.claude/skills/architect-game/SKILL.md
Maps a Game Design Document to a technical architecture using existing UPM packages and new modules. Use after clone-game produces a GDD.
npx skillsauth add punkfuncgames/tetris-clone architect-gameInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
docs/plans/{game-name}-gdd.mdcode-style, patterns, project-overview, testing.mcp.json must exist with correct paths (set up by clone-game Step 0b). If MCP is not connected, STOP and tell the user to restart Claude Code.Before any architecture work, verify the MCP bridge is running:
.mcp.json exists with valid pathsexecute_editor_method (e.g., Application.unityVersion) to confirm the Unity editor is reachableread_package_registry(filter: "all") to get the full catalog of available packages with their descriptions, events, and useWhen hintswallet-module, stats-module, ui-module, etc.)For each system identified in the GDD:
useWhen field to match GDD systems to existing packagesProduce a mapping table:
| GDD System | Package / Module | Status | Notes | |-----------|-----------------|--------|-------| | Scoring | com.punkfuncgames.stats | Install | Map score to a stat | | Currency | com.punkfuncgames.wallet | Install | Define currency definitions | | Spawning | NEW: GameTemplate.Spawner | Create | Wave-based entity spawner |
After the mapping is complete, install the packages identified as needed:
install_package(packageId) — this handles dependency resolution automaticallyExample:
install_package("wallet") # Tier 3 — auto-installs math dependency (already base)
install_package("stats") # Tier 3
install_package("pool") # Tier 2
install_package("audio") # Tier 3
The tool will:
manifest.jsonProjectLifetimeScopeAfter all packages are installed, run analyze_composition() to verify:
Review the gaps and dead ends:
PlaySfxRequest, CameraShakeRequest) are expected — game code publishes theseAfter resolving:
git add -A
git commit -m "build: install packages for {game-name} ({list packages})"
Define the scene structure following the bootstrap pattern:
BOOTSTRAP (ProjectLifetimeScope)
→ MAINMENU (MainMenuLifetimeScope)
→ GAMEPLAY (GameplayLifetimeScope)
→ [additional scenes if needed]
For each scene, list:
For each NEW module, define its internal layout:
Assets/Scripts/PunkFuncGames/GameTemplate/Runtime/{Module}/
Config/ — ScriptableObject config + Data struct
Model/ — Domain models, containers, state
Event/ — MessagePipe event structs
Service/ — IService interface + implementation
View/ — MonoBehaviour views + ViewModels
Installer/ — Static Install method
For each component, specify:
List every prefab needed:
| Prefab | Type | Pool? | Components | |--------|------|-------|------------| | Player | Entity | No | PlayerView, Rigidbody, Collider | | Enemy_Basic | Entity | Yes (pool: 20) | EnemyView, Rigidbody, Collider | | ScorePopup | UI | Yes (pool: 10) | FloatingTextView |
Define the installer registration for each scope:
// ProjectLifetimeScope — shared services
GameCoreInstaller.Install(builder, options, gameConfig);
// GameplayLifetimeScope — gameplay-specific
SpawnerInstaller.Install(builder, options, spawnerConfig);
PlayerInstaller.Install(builder, options, playerConfig);
For each new module, list the test classes needed:
| Module | Test Class | Type | Key Test Cases | |--------|-----------|------|---------------| | Spawner | SpawnerServiceTests | EditMode | Wave timing, spawn counts, difficulty scaling | | Player | PlayerServiceTests | EditMode | Movement, health, damage, death | | Player | PlayerViewTests | PlayMode | Input handling, animation triggers |
Write to:
docs/plans/{game-name}-architecture.md
Use this structure:
# {Game Name} — Architecture Document
## Package Mapping
(table from Step 2)
## Installed Packages
(list from Step 2b with versions)
## Event Wiring Analysis
(summary from Step 2c — connected, gaps resolved, expected dead ends)
## Scene Graph
(diagram from Step 3)
## New Modules
### {Module Name}
- Config: {ConfigName} + {DataStruct}
- Models: (list)
- Service: I{Name}Service / {Name}Service
- Events: (list of event structs)
- Views: (list)
- Dependencies: (list)
## Prefab Plan
(table from Step 5)
## Installer Plan
(code from Step 6)
## Test Plan
(table from Step 7)
## Implementation Order
Ordered list of modules to implement (dependency-first):
1. Data/Configs (no dependencies)
2. Core services (depend on configs only)
3. Game-specific services (depend on core)
4. Views (depend on services)
5. Installers (wire everything)
6. Scenes (final assembly)
## Open Questions
Any design decisions that need user input before implementation.
git add docs/plans/{game-name}-architecture.md
git commit -m "docs: add {game-name} architecture document"
The architecture document path, the count of reused vs new modules, the event wiring analysis summary, and any open questions that need resolution before implementation.
development
WalletModule reference — currency management with BigDouble support, reactive properties, caps, lifetime stats, and persistence. Use when working with currencies, wallets, or financial systems.
development
UnlockConditionModule reference — composable unlock conditions using ScriptableObjects with AND/OR/NOT logic, stat/currency/upgrade/prestige/gamestate/boolean checks, reactive service layer with progress tracking. Use when implementing unlock systems, gating, or progression requirements.
development
UndoModule reference — command pattern with undo/redo stacks, command merging, and reactive state. Use when implementing undo/redo, undoable actions, or command patterns.
tools
Unity UI Toolkit reference — UXML documents, USS styling, MVVM pattern (ViewModel + Presenter), custom VisualElements, responsive layout, animations, performance guidelines, and complete Figma-to-UI-Toolkit property mapping. Use when building or modifying UI with UI Toolkit, creating UXML/USS files, writing ViewModels or Presenters, designing screens/panels/components, or converting Figma designs to UI Toolkit.