create-threejs-game 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/README.md +97 -0
  2. package/bin/cli.js +370 -0
  3. package/package.json +29 -0
  4. package/template/.claude/skills/threejs-animation/SKILL.md +552 -0
  5. package/template/.claude/skills/threejs-fundamentals/SKILL.md +488 -0
  6. package/template/.claude/skills/threejs-geometry/SKILL.md +548 -0
  7. package/template/.claude/skills/threejs-interaction/SKILL.md +660 -0
  8. package/template/.claude/skills/threejs-lighting/SKILL.md +481 -0
  9. package/template/.claude/skills/threejs-loaders/SKILL.md +623 -0
  10. package/template/.claude/skills/threejs-materials/SKILL.md +520 -0
  11. package/template/.claude/skills/threejs-postprocessing/SKILL.md +602 -0
  12. package/template/.claude/skills/threejs-shaders/SKILL.md +642 -0
  13. package/template/.claude/skills/threejs-textures/SKILL.md +628 -0
  14. package/template/.codex/skills/threejs-animation/SKILL.md +552 -0
  15. package/template/.codex/skills/threejs-fundamentals/SKILL.md +488 -0
  16. package/template/.codex/skills/threejs-geometry/SKILL.md +548 -0
  17. package/template/.codex/skills/threejs-interaction/SKILL.md +660 -0
  18. package/template/.codex/skills/threejs-lighting/SKILL.md +481 -0
  19. package/template/.codex/skills/threejs-loaders/SKILL.md +623 -0
  20. package/template/.codex/skills/threejs-materials/SKILL.md +520 -0
  21. package/template/.codex/skills/threejs-postprocessing/SKILL.md +602 -0
  22. package/template/.codex/skills/threejs-shaders/SKILL.md +642 -0
  23. package/template/.codex/skills/threejs-textures/SKILL.md +628 -0
  24. package/template/README.md +352 -0
  25. package/template/docs/.gitkeep +0 -0
  26. package/template/plans/.gitkeep +0 -0
  27. package/template/prompts/01-mockup-generation.md +44 -0
  28. package/template/prompts/02-prd-generation.md +119 -0
  29. package/template/prompts/03-tdd-generation.md +127 -0
  30. package/template/prompts/04-execution-plan.md +89 -0
  31. package/template/prompts/05-implementation.md +61 -0
  32. package/template/public/assets/.gitkeep +0 -0
  33. package/template/scripts/config.example.json +12 -0
  34. package/template/scripts/generate-assets-json.js +149 -0
  35. package/template/scripts/generate-mockup.js +197 -0
  36. package/template/scripts/generate-plan.js +295 -0
  37. package/template/scripts/generate-prd.js +297 -0
  38. package/template/scripts/generate-tdd.js +283 -0
  39. package/template/scripts/pipeline.js +229 -0
@@ -0,0 +1,352 @@
1
+ # Three.js Game Vibe Coding Template
2
+
3
+ A structured methodology for rapidly prototyping 3D games in Three.js using AI-assisted development.
4
+
5
+ ## Quick Start (Automated Pipeline)
6
+
7
+ ```bash
8
+ # 1. Copy template and rename to your game
9
+ cp -r template/ my_game/
10
+ cd my_game/
11
+
12
+ # 2. Add your assets to public/assets/{game_name}/
13
+
14
+ # 3. Configure API keys and game details
15
+ cp scripts/config.example.json scripts/config.json
16
+ # Edit config.json with your keys and game description
17
+
18
+ # 4. Run the full pipeline
19
+ node scripts/pipeline.js
20
+
21
+ # 5. Implement with Claude Code using the generated plan
22
+ ```
23
+
24
+ ---
25
+
26
+ ## Prerequisites Checklist
27
+
28
+ | Requirement | Status | Notes |
29
+ |-------------|--------|-------|
30
+ | `.claude/skills/` with Three.js skills | ✅ Included | 10 skill files for Claude |
31
+ | `.codex/skills/` with Three.js skills | ✅ Included | 10 skill files for Codex |
32
+ | Google AI Studio API key | ❌ **YOU PROVIDE** | For mockup generation |
33
+ | Anthropic API key | ❌ **YOU PROVIDE** | For PRD/TDD/Plan generation |
34
+ | Game description | ❌ **YOU PROVIDE** | 1-3 sentence description |
35
+ | Asset pack (GLTF preferred) | ❌ **YOU PROVIDE** | Find on itch.io, Kenney, etc. |
36
+
37
+ ---
38
+
39
+ ## API Setup
40
+
41
+ ### Google AI Studio (for mockup generation)
42
+ 1. Go to [Google AI Studio](https://aistudio.google.com/)
43
+ 2. Get an API key
44
+ 3. Add to `scripts/config.json` under `google_ai_studio.api_key`
45
+
46
+ ### Anthropic (for document generation)
47
+ 1. Go to [Anthropic Console](https://console.anthropic.com/)
48
+ 2. Get an API key
49
+ 3. Add to `scripts/config.json` under `anthropic.api_key`
50
+
51
+ ---
52
+
53
+ ## Automated Scripts
54
+
55
+ | Script | Purpose | Command |
56
+ |--------|---------|---------|
57
+ | `pipeline.js` | Run full pipeline | `node scripts/pipeline.js` |
58
+ | `generate-assets-json.js` | Index assets | `node scripts/generate-assets-json.js {name}` |
59
+ | `generate-mockup.js` | Create concept art | `node scripts/generate-mockup.js` |
60
+ | `generate-prd.js` | Create PRD | `node scripts/generate-prd.js` |
61
+ | `generate-tdd.js` | Create TDD | `node scripts/generate-tdd.js` |
62
+ | `generate-plan.js` | Create execution plan | `node scripts/generate-plan.js` |
63
+
64
+ ### Pipeline Options
65
+ ```bash
66
+ # Run full pipeline
67
+ node scripts/pipeline.js
68
+
69
+ # Skip mockup generation (use existing concept.jpg)
70
+ node scripts/pipeline.js --skip-mockup
71
+
72
+ # Skip to specific step
73
+ node scripts/pipeline.js --skip-to=prd
74
+
75
+ # Use specific plan name
76
+ node scripts/pipeline.js --plan-name=my-plan
77
+ ```
78
+
79
+ ---
80
+
81
+ ## Workflow Steps
82
+
83
+ ### Legend
84
+ - 🤖 **Automated** - Can be done with scripts/tools
85
+ - 🖐️ **Manual** - Requires human action
86
+ - 🤝 **AI-Assisted** - LLM generates, human reviews
87
+
88
+ ---
89
+
90
+ ## Phase 1: Asset Setup
91
+
92
+ ### Step 1: Find Asset Pack 🖐️ MANUAL
93
+ **What:** Find a complete 3D asset pack online (GLTF/GLB format preferred)
94
+
95
+ **Good sources:**
96
+ - [itch.io](https://itch.io/game-assets/tag-3d) - Many free/paid packs
97
+ - [Kenney.nl](https://kenney.nl/assets) - Free CC0 assets
98
+ - [Sketchfab](https://sketchfab.com/) - Search for downloadable models
99
+ - [OpenGameArt](https://opengameart.org/) - Free game assets
100
+ - [Quaternius](https://quaternius.com/) - Free low-poly packs
101
+
102
+ **Tips:**
103
+ - Look for "complete" packs with multiple related assets
104
+ - GLTF format loads directly in Three.js without conversion
105
+ - Check license allows game development use
106
+
107
+ ---
108
+
109
+ ### Step 2: Organize Assets 🖐️ MANUAL
110
+ **What:** Place assets in the correct folder structure
111
+
112
+ **Steps:**
113
+ 1. Create folder: `public/assets/{your_game_name}/`
114
+ 2. Copy asset pack contents there
115
+ 3. Ensure GLTF files are in a `glTF/` subfolder (if applicable)
116
+
117
+ **Expected structure:**
118
+ ```
119
+ public/
120
+ └── assets/
121
+ └── {your_game_name}/
122
+ ├── glTF/ # 3D models
123
+ │ ├── Model1.gltf
124
+ │ └── Model2.gltf
125
+ ├── PNG/ # Textures/sprites (optional)
126
+ │ └── texture.png
127
+ └── Preview.jpg # Asset preview image
128
+ ```
129
+
130
+ ---
131
+
132
+ ### Step 3: Create assets.json 🤖 AUTOMATED
133
+ **What:** Generate an index file listing all available assets
134
+
135
+ **Run the script:**
136
+ ```bash
137
+ node scripts/generate-assets-json.js {your_game_name}
138
+ ```
139
+
140
+ **Or manually create** `public/assets/{your_game_name}/assets.json` with this structure:
141
+ ```json
142
+ {
143
+ "metadata": {
144
+ "generatedAt": "2026-01-30T00:00:00Z",
145
+ "root": "public/assets/{your_game_name}",
146
+ "totalAssets": 50,
147
+ "glTFAssetCount": 25
148
+ },
149
+ "assets": [
150
+ {
151
+ "name": "Building1.gltf",
152
+ "path": "public/assets/{game}/glTF/Building1.gltf",
153
+ "relativePath": "glTF/Building1.gltf",
154
+ "category": "glTF",
155
+ "extension": ".gltf",
156
+ "focusGlTF": true
157
+ }
158
+ ]
159
+ }
160
+ ```
161
+
162
+ ---
163
+
164
+ ### Step 4: Asset Preview Image 🖐️ MANUAL (if missing)
165
+ **What:** Ensure there's a `Preview.jpg` showing all available assets
166
+
167
+ **If the asset pack includes one:** Just rename it to `Preview.jpg` and place in the assets folder
168
+
169
+ **If missing, create one:**
170
+ 1. Open the asset pack in Blender or a GLTF viewer
171
+ 2. Arrange multiple assets in view
172
+ 3. Take a screenshot/render
173
+ 4. Save as `public/assets/{your_game_name}/Preview.jpg`
174
+
175
+ ---
176
+
177
+ ## Phase 2: Concept Generation
178
+
179
+ ### Step 5: Generate Mockup 🤝 AI-ASSISTED
180
+ **What:** Use an image-generation AI to create a visual concept of your game
181
+
182
+ **Tool:** Nano Banana Pro (or similar: Midjourney, DALL-E, Stable Diffusion)
183
+
184
+ **Attach:**
185
+ - `Preview.jpg` (asset preview)
186
+ - `assets.json` (asset index)
187
+
188
+ **Prompt template:** (see `prompts/01-mockup-generation.md`)
189
+ ```
190
+ Given the following preview of assets that I have and the following
191
+ assets.json index, create a mock-up of a:
192
+
193
+ [YOUR GAME DESCRIPTION]
194
+
195
+ The mockup should show:
196
+ - How the game would look during gameplay
197
+ - UI elements and their placement
198
+ - The overall visual style and mood
199
+ - Camera perspective (top-down, isometric, third-person, etc.)
200
+ ```
201
+
202
+ **Output:** Save generated image to `public/{your_game_name}/concept.jpg`
203
+
204
+ ---
205
+
206
+ ## Phase 3: Design Documents
207
+
208
+ ### Step 6: Create PRD (Product Requirements Document) 🤝 AI-ASSISTED
209
+ **What:** Generate a comprehensive game design document
210
+
211
+ **Tool:** Claude/Codex with Three.js skills enabled
212
+
213
+ **Attach:**
214
+ - `concept.jpg`
215
+ - `Preview.jpg`
216
+ - `assets.json`
217
+
218
+ **Prompt template:** (see `prompts/02-prd-generation.md`)
219
+
220
+ **Output:** Save to `docs/prd.md`
221
+
222
+ ---
223
+
224
+ ### Step 7: Create TDD (Technical Design Document) 🤝 AI-ASSISTED
225
+ **What:** Generate technical architecture and implementation details
226
+
227
+ **Tool:** Claude/Codex with Three.js skills enabled (NEW CHAT)
228
+
229
+ **Attach:**
230
+ - `docs/prd.md`
231
+ - `assets.json`
232
+ - `concept.jpg`
233
+ - `Preview.jpg`
234
+
235
+ **Prompt template:** (see `prompts/03-tdd-generation.md`)
236
+
237
+ **Output:** Save to `docs/tdd.md`
238
+
239
+ ---
240
+
241
+ ## Phase 4: Implementation
242
+
243
+ ### Step 8: Create Execution Plan 🤝 AI-ASSISTED
244
+ **What:** Generate a step-by-step implementation plan
245
+
246
+ **Tool:** Claude/Codex with Three.js skills enabled (NEW CHAT)
247
+
248
+ **Attach:**
249
+ - `docs/prd.md`
250
+ - `docs/tdd.md`
251
+ - `assets.json`
252
+
253
+ **Prompt template:** (see `prompts/04-execution-plan.md`)
254
+
255
+ **Output:** Save to `plans/{plan-name}.md`
256
+
257
+ ---
258
+
259
+ ### Step 9: Implement the Game 🤝 AI-ASSISTED
260
+ **What:** Let the AI implement the game based on the plan
261
+
262
+ **Tool:** Claude Code / Cursor with Three.js skills enabled
263
+
264
+ **Prompt:**
265
+ ```
266
+ Please proceed with implementing the game based on the plan in
267
+ plans/{plan-name}.md
268
+
269
+ Use the Three.js skills for reference.
270
+ ```
271
+
272
+ **Output:** Game code in `public/index.html` (or as specified in TDD)
273
+
274
+ ---
275
+
276
+ ## Automation Summary
277
+
278
+ | Step | Task | Automation Level | Tool/Script |
279
+ |------|------|------------------|-------------|
280
+ | 1 | Find assets | 🖐️ Manual | Human search online |
281
+ | 2 | Organize assets | 🖐️ Manual | Copy to `public/assets/{name}/` |
282
+ | 3 | Generate assets.json | 🤖 **Automated** | `node scripts/generate-assets-json.js` |
283
+ | 4 | Asset preview | 🖐️ Manual | Usually included in pack |
284
+ | 5 | Generate mockup | 🤖 **Automated** | `node scripts/generate-mockup.js` (Google AI) |
285
+ | 6 | Create PRD | 🤖 **Automated** | `node scripts/generate-prd.js` (Claude API) |
286
+ | 7 | Create TDD | 🤖 **Automated** | `node scripts/generate-tdd.js` (Claude API) |
287
+ | 8 | Create plan | 🤖 **Automated** | `node scripts/generate-plan.js` (Claude API) |
288
+ | 9 | Implement | 🤝 AI-Assisted | Claude Code with plan |
289
+
290
+ **Or run everything at once:** `node scripts/pipeline.js`
291
+
292
+ ---
293
+
294
+ ## File Structure After Completion
295
+
296
+ ```
297
+ {your_game}/
298
+ ├── .claude/
299
+ │ └── skills/
300
+ │ └── threejs-*/SKILL.md (10 skills)
301
+ ├── .codex/
302
+ │ └── skills/
303
+ │ └── threejs-*/SKILL.md (10 skills)
304
+ ├── docs/
305
+ │ ├── prd.md
306
+ │ └── tdd.md
307
+ ├── plans/
308
+ │ └── {plan-name}.md
309
+ ├── public/
310
+ │ ├── assets/
311
+ │ │ └── {game_name}/
312
+ │ │ ├── glTF/
313
+ │ │ ├── assets.json
314
+ │ │ └── Preview.jpg
315
+ │ ├── {game_name}/
316
+ │ │ └── concept.jpg
317
+ │ └── index.html
318
+ ├── scripts/
319
+ │ └── generate-assets-json.js
320
+ ├── prompts/
321
+ │ ├── 01-mockup-generation.md
322
+ │ ├── 02-prd-generation.md
323
+ │ ├── 03-tdd-generation.md
324
+ │ └── 04-execution-plan.md
325
+ └── README.md
326
+ ```
327
+
328
+ ---
329
+
330
+ ## Tips for Success
331
+
332
+ 1. **Clear game description**: The more specific your 1-3 sentence description, the better the outputs
333
+ 2. **Review AI outputs**: Always review and adjust PRD/TDD before moving to implementation
334
+ 3. **Iterate**: If the mockup doesn't match your vision, regenerate with adjusted prompts
335
+ 4. **Start simple**: Begin with a minimal viable game, then add features
336
+ 5. **Use the skills**: The Three.js skills provide patterns and code the AI can reference
337
+
338
+ ---
339
+
340
+ ## Example Game Descriptions
341
+
342
+ **RTS Game:**
343
+ > "A 3D real-time strategy game set in a medieval fantasy world where players gather resources, build bases, train armies, and destroy the enemy's town center to win."
344
+
345
+ **Tower Defense:**
346
+ > "A 3D tower defense game where players place defensive structures along a path to stop waves of enemies from reaching their castle."
347
+
348
+ **Puzzle Game:**
349
+ > "A 3D puzzle game where players rotate and connect pipes to guide water from a source to various destinations."
350
+
351
+ **Racing Game:**
352
+ > "An arcade-style 3D kart racing game with power-ups, drifting mechanics, and multiple tracks through a fantasy kingdom."
File without changes
File without changes
@@ -0,0 +1,44 @@
1
+ # Mockup Generation Prompt
2
+
3
+ ## Tool
4
+ Image generation AI (Nano Banana Pro, Midjourney, DALL-E, etc.)
5
+
6
+ ## Files to Attach
7
+ - `public/assets/{game_name}/Preview.jpg`
8
+ - `public/assets/{game_name}/assets.json`
9
+
10
+ ## Prompt Template
11
+
12
+ ```
13
+ Given the following preview of assets that I have and the following
14
+ assets.json index, create a mock-up of a:
15
+
16
+ [INSERT YOUR GAME DESCRIPTION HERE]
17
+
18
+ Example descriptions:
19
+ - "A 3D real-time strategy game set in a medieval fantasy world"
20
+ - "A 3D tower defense game with fantasy creatures"
21
+ - "A 3D puzzle platformer in a magical forest"
22
+
23
+ The mockup should show:
24
+ - How the game would look during active gameplay
25
+ - UI elements appropriate for the game type (health bars, resources, minimap, etc.)
26
+ - The overall visual style matching the asset pack's aesthetic
27
+ - An appropriate camera perspective for the game type
28
+ - Multiple game elements arranged naturally (buildings, units, terrain, etc.)
29
+
30
+ Style notes:
31
+ - Match the art style of the provided assets
32
+ - Show a gameplay scenario, not a title screen
33
+ - Include enough elements to demonstrate the game's core loop
34
+ ```
35
+
36
+ ## Output
37
+ Save the generated image to: `public/{game_name}/concept.jpg`
38
+
39
+ ## Tips
40
+ - If the first result doesn't match your vision, try:
41
+ - Adding more specific details about camera angle
42
+ - Specifying UI element locations
43
+ - Describing a specific gameplay moment
44
+ - Generate 2-3 variations and pick the best one
@@ -0,0 +1,119 @@
1
+ # PRD (Product Requirements Document) Generation Prompt
2
+
3
+ ## Tool
4
+ LLM with Three.js skills enabled (Claude Code, Cursor, etc.)
5
+
6
+ ## Files to Attach
7
+ - `public/{game_name}/concept.jpg` - The mockup
8
+ - `public/assets/{game_name}/Preview.jpg` - Asset preview
9
+ - `public/assets/{game_name}/assets.json` - Asset index
10
+
11
+ ## Prompt Template
12
+
13
+ ```
14
+ [INSERT YOUR GAME DESCRIPTION HERE]
15
+
16
+ I have concept mockups that reflect how the game looks.
17
+ I have also added a preview of the assets that are available.
18
+
19
+ Create a comprehensive Game Design Document (PRD) with the following sections:
20
+
21
+ ## 1. Summary
22
+ - Brief description of the game
23
+ - Target platform (browser-based)
24
+ - Key assumptions and constraints for V1
25
+ - Match length / session time
26
+
27
+ ## 2. Technical Requirements
28
+ - Three.js version (r160 recommended)
29
+ - Delivery format (single HTML file preferred)
30
+ - Unit system (world units = meters)
31
+ - Required loaders (GLTFLoader)
32
+ - Valid materials and lights
33
+
34
+ ## 3. Canvas & Viewport
35
+ - Internal resolution
36
+ - Aspect ratio handling (letterboxing if fixed)
37
+ - Background style
38
+
39
+ ## 4. Visual Style & Art Direction
40
+ - Overall look description
41
+ - Color palette with hex codes and purposes
42
+ - Mood/atmosphere
43
+ - Camera style and defaults (pitch, yaw, zoom range)
44
+ - Lighting mood
45
+
46
+ ## 5. Player Specifications
47
+ - Faction/player identity if applicable
48
+ - Unit types (appearance, size, role, stats)
49
+ - Starting setup (resources, units, position)
50
+ - Movement constraints
51
+
52
+ ## 6. Physics & Movement
53
+ - Movement model (kinematic, physics-based)
54
+ - Gravity, speeds, collision approach
55
+ - Unit movement values table
56
+
57
+ ## 7. Obstacles/Enemies
58
+ - Enemy types and behaviors
59
+ - Neutral obstacles using available assets
60
+ - Spawn timing and difficulty scaling
61
+
62
+ ## 8. World & Environment
63
+ - Map layout and dimensions
64
+ - Resource/pickup nodes and their values
65
+ - Buildings/structures using available GLTF assets
66
+ - Fallback primitives if assets fail to load
67
+
68
+ ## 9. Collision & Scoring
69
+ - Collision shapes and approach
70
+ - Win/lose conditions
71
+ - Score system and point values
72
+ - High score storage (localStorage key)
73
+
74
+ ## 10. Controls
75
+ - Complete input mapping table
76
+ - Desktop and touch/mobile controls
77
+ - Keyboard shortcuts
78
+
79
+ ## 11. Game States
80
+ - Menu state (buttons, background)
81
+ - Playing state (active systems, UI shown)
82
+ - Paused state (trigger, display, frozen elements)
83
+ - Game Over state (display, stats, retry flow)
84
+
85
+ ## 12. Game Feel & Juice (REQUIRED)
86
+ - Input response feedback (selection, commands)
87
+ - Animation timing table
88
+ - Screen effects (shake, flash, zoom, time dilation)
89
+ - Death sequences
90
+ - Milestone celebrations
91
+ - Idle life animations
92
+
93
+ ## 13. UX Requirements
94
+ - Controls visibility
95
+ - Onboarding flow
96
+ - Readability considerations
97
+ - Forgiving mechanics
98
+
99
+ ## 14. Out of Scope (V1)
100
+ - Features explicitly NOT included
101
+
102
+ ## 15. Success Criteria
103
+ - Checklist of requirements the game must meet
104
+
105
+ Reference the attached assets.json for available models. Use specific asset
106
+ names (e.g., "TownCenter_FirstAge_Level1.gltf") when specifying which assets
107
+ to use for game elements.
108
+ ```
109
+
110
+ ## Output
111
+ Save to: `docs/prd.md`
112
+
113
+ ## Review Checklist
114
+ After generation, verify:
115
+ - [ ] All major game mechanics are defined
116
+ - [ ] Asset references match available assets in assets.json
117
+ - [ ] Controls are complete for both desktop and mobile
118
+ - [ ] Win/lose conditions are clear
119
+ - [ ] Success criteria are testable
@@ -0,0 +1,127 @@
1
+ # TDD (Technical Design Document) Generation Prompt
2
+
3
+ ## Tool
4
+ LLM with Three.js skills enabled (Claude Code, Cursor, etc.)
5
+
6
+ **IMPORTANT:** Start a NEW CHAT with clear context
7
+
8
+ ## Files to Attach
9
+ - `docs/prd.md` - The PRD you generated
10
+ - `public/assets/{game_name}/assets.json` - Asset index
11
+ - `public/{game_name}/concept.jpg` - Visual reference
12
+ - `public/assets/{game_name}/Preview.jpg` - Asset preview
13
+
14
+ ## Prompt Template
15
+
16
+ ```
17
+ Based on the PRD in docs/prd.md, create a Technical Design Document (TDD)
18
+ that will ensure we can implement this game with minimal problems and
19
+ maximum speed.
20
+
21
+ Use the Three.js skills for patterns and best practices.
22
+ Reference the assets.json for the list of available assets.
23
+ Use the concept image as a visual reference for the game.
24
+
25
+ The TDD should include:
26
+
27
+ ## 1. Overview
28
+ - Technical stack summary table
29
+ - Reference materials list
30
+
31
+ ## 2. Architecture Overview
32
+ - High-level module structure diagram (ASCII art)
33
+ - Game state flow diagram
34
+
35
+ ## 3. Core Engine Systems
36
+ - Renderer setup with code example
37
+ - Scene setup
38
+ - Camera system with full implementation code
39
+ - Lighting system with configuration
40
+ - Asset loading system with:
41
+ - LoadingManager setup
42
+ - GLTF loading with error handling
43
+ - Fallback primitive generation
44
+ - Asset manifest (list of core assets to load)
45
+
46
+ ## 4. Entity Component System (ECS)
47
+ - Core Entity class structure
48
+ - All component definitions with code:
49
+ - TransformComponent
50
+ - HealthComponent
51
+ - MovementComponent
52
+ - CombatComponent
53
+ - CollisionComponent
54
+ - SelectableComponent
55
+ - (Game-specific components)
56
+ - Entity Factory with creation methods
57
+ - Unit and building stats tables
58
+
59
+ ## 5. Game Systems
60
+ Each system should include full implementation code:
61
+ - Entity Manager (add, remove, query by type/faction)
62
+ - Selection System (click, box select, animations)
63
+ - Command System (move, attack, gather commands)
64
+ - Movement System (pathfinding, separation, turn rate)
65
+ - Combat System (melee, ranged, projectiles, damage)
66
+ - Economy/Resource System (if applicable)
67
+ - AI System (state machine, behaviors)
68
+
69
+ ## 6. Visual Effects System
70
+ - Effects Manager implementation
71
+ - Screen shake
72
+ - Time dilation
73
+ - Floating text
74
+ - Particle effects
75
+ - Death sequences
76
+
77
+ ## 7. UI System
78
+ - Complete HTML structure
79
+ - Full CSS styles
80
+ - HUD elements
81
+ - Menu screens
82
+ - Build palette (if applicable)
83
+ - Mobile touch controls
84
+
85
+ ## 8. Main Game Loop
86
+ - Game State Manager
87
+ - Full Game class implementation
88
+ - Update loop
89
+ - Win/lose checking
90
+ - HUD updates
91
+
92
+ ## 9. Implementation Phases
93
+ - Ordered list of implementation steps
94
+ - Dependencies between phases
95
+ - Priority markers (Critical, Important, Polish)
96
+
97
+ ## 10. Performance Considerations
98
+ - Rendering optimizations
99
+ - Game logic optimizations
100
+ - Memory management
101
+
102
+ ## 11. Testing Checklist
103
+ - All success criteria from PRD as checkboxes
104
+
105
+ ## 12. Appendix
106
+ - Color palette reference table
107
+ - Animation timing reference table
108
+ - Unit stats reference table
109
+ - Building stats reference table
110
+
111
+ All code examples should be:
112
+ - Complete and runnable (not pseudocode)
113
+ - Using Three.js r160 APIs
114
+ - Following the patterns from the Three.js skills
115
+ - Well-commented for clarity
116
+ ```
117
+
118
+ ## Output
119
+ Save to: `docs/tdd.md`
120
+
121
+ ## Review Checklist
122
+ After generation, verify:
123
+ - [ ] All systems from PRD are covered
124
+ - [ ] Code examples are complete (not truncated)
125
+ - [ ] Asset paths match the actual asset structure
126
+ - [ ] Implementation phases are logical
127
+ - [ ] No missing dependencies between systems