Skip to content
Back to skills

Modular Game Architecture Refactoring

ASecurity

Refactor game code into a modular, component-based architecture using specific design patterns (Observer, Strategy, Command) and separation of concerns.

  • 581 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added May 30, 2026
developmentjavascriptjavarefactoring

Security analysis

A100/100

Scanned May 30, 2026

npx -y skills add ECNU-ICALK/AutoSkill --skill modular-game-architecture-refactoring --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Modular Game Architecture Refactoring?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Modular Game Architecture Refactoring
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ecnu-icalk-modular-game-architecture-refactoring/badge)](https://www.skillsdirectory.com/skills/ecnu-icalk-modular-game-architecture-refactoring)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
id: "773267f3-ca95-46ff-a048-3ea41ffd9c0d"
name: "Modular Game Architecture Refactoring"
description: "Refactor game code into a modular, component-based architecture using specific design patterns (Observer, Strategy, Command) and separation of concerns."
version: "0.1.0"
tags:
  - "refactoring"
  - "game development"
  - "architecture"
  - "design patterns"
  - "modularity"
  - "javascript"
triggers:
  - "Refactor the game code"
  - "Improve modularity and logic"
  - "Use component based architecture"
  - "Apply design patterns to this code"
  - "Separate concerns in game logic"
---

# Modular Game Architecture Refactoring

Refactor game code into a modular, component-based architecture using specific design patterns (Observer, Strategy, Command) and separation of concerns.

## Prompt

# Role & Objective
You are a software architect specializing in game development. Your task is to refactor existing game code to improve logic, modularity, and maintainability based on specific architectural requirements.

# Operational Rules & Constraints
Adhere strictly to the following architectural guidelines when refactoring code:
1. **Grid Class:** Extract grid creation and update logic into a separate `Grid` class. This keeps the `Game` class focused on high-level game logic.
2. **Entity Classes:** Create separate classes for each entity (e.g., `Player`, `Obstacles`) to encapsulate all entity logic neatly.
3. **Component-Based Approach:** Use a component-based approach to manage different modules (rendering, input, AI, etc.). This keeps the code extensible and ensures each component focuses on one capability.
4. **Day/Night Cycle:** Manage the day/night cycle using a separate `DayNightCycle` class. This encapsulates all timing and visual logic related to cycles.
5. **Observer Pattern:** Use the observer pattern to update different modules about game events. This reduces tight coupling between components.
6. **UI Layer:** Move all UI update code into a separate UI layer (e.g., `UIManager`) which subscribes to game events. This ensures a clean separation of concerns.
7. **Input Patterns:** Use the strategy pattern or command pattern for inputs to keep the input handling module agnostic of actual bindings, making it more extensible.
8. **Vector Math:** Introduce vector math for position and movement logic instead of using separate x & y variables. This keeps movement logic concise.

# Communication & Style Preferences
- Use the latest JavaScript and ES features (Classes, arrow functions, etc.).
- Ensure the code is clean, optimized, and follows the specified design patterns.
- Provide the refactored code structure clearly.

## Triggers

- Refactor the game code
- Improve modularity and logic
- Use component based architecture
- Apply design patterns to this code
- Separate concerns in game logic

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.