gsd-codex-cli 1.20.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 (160) hide show
  1. package/.codex/prompts/gsd-add-phase.md +44 -0
  2. package/.codex/prompts/gsd-add-todo.md +43 -0
  3. package/.codex/prompts/gsd-audit-milestone.md +43 -0
  4. package/.codex/prompts/gsd-check-todos.md +43 -0
  5. package/.codex/prompts/gsd-complete-milestone.md +43 -0
  6. package/.codex/prompts/gsd-debug.md +46 -0
  7. package/.codex/prompts/gsd-discuss-phase.md +43 -0
  8. package/.codex/prompts/gsd-execute-phase.md +43 -0
  9. package/.codex/prompts/gsd-help.md +43 -0
  10. package/.codex/prompts/gsd-insert-phase.md +43 -0
  11. package/.codex/prompts/gsd-list-phase-assumptions.md +43 -0
  12. package/.codex/prompts/gsd-map-codebase.md +43 -0
  13. package/.codex/prompts/gsd-new-milestone.md +43 -0
  14. package/.codex/prompts/gsd-new-project.md +43 -0
  15. package/.codex/prompts/gsd-pause-work.md +43 -0
  16. package/.codex/prompts/gsd-plan-milestone-gaps.md +43 -0
  17. package/.codex/prompts/gsd-plan-phase.md +43 -0
  18. package/.codex/prompts/gsd-progress.md +43 -0
  19. package/.codex/prompts/gsd-quick.md +43 -0
  20. package/.codex/prompts/gsd-remove-phase.md +43 -0
  21. package/.codex/prompts/gsd-research-phase.md +43 -0
  22. package/.codex/prompts/gsd-resume-work.md +43 -0
  23. package/.codex/prompts/gsd-set-profile.md +43 -0
  24. package/.codex/prompts/gsd-settings.md +43 -0
  25. package/.codex/prompts/gsd-update.md +43 -0
  26. package/.codex/prompts/gsd-verify-work.md +43 -0
  27. package/.codex/skills/get-shit-done-codex/SKILL.md +65 -0
  28. package/.codex/skills/get-shit-done-codex/references/compat.md +32 -0
  29. package/.codex/skills/get-shit-done-codex/references/windows.md +23 -0
  30. package/CHANGELOG.md +1434 -0
  31. package/LICENSE +21 -0
  32. package/README.md +690 -0
  33. package/agents/gsd-codebase-mapper.md +761 -0
  34. package/agents/gsd-debugger.md +1198 -0
  35. package/agents/gsd-executor.md +419 -0
  36. package/agents/gsd-integration-checker.md +423 -0
  37. package/agents/gsd-phase-researcher.md +469 -0
  38. package/agents/gsd-plan-checker.md +622 -0
  39. package/agents/gsd-planner.md +1159 -0
  40. package/agents/gsd-project-researcher.md +618 -0
  41. package/agents/gsd-research-synthesizer.md +236 -0
  42. package/agents/gsd-roadmapper.md +639 -0
  43. package/agents/gsd-verifier.md +541 -0
  44. package/bin/install-codex.js +100 -0
  45. package/bin/install.js +1806 -0
  46. package/commands/gsd/add-phase.md +39 -0
  47. package/commands/gsd/add-todo.md +42 -0
  48. package/commands/gsd/audit-milestone.md +42 -0
  49. package/commands/gsd/check-todos.md +41 -0
  50. package/commands/gsd/cleanup.md +18 -0
  51. package/commands/gsd/complete-milestone.md +136 -0
  52. package/commands/gsd/debug.md +162 -0
  53. package/commands/gsd/discuss-phase.md +87 -0
  54. package/commands/gsd/execute-phase.md +42 -0
  55. package/commands/gsd/health.md +22 -0
  56. package/commands/gsd/help.md +22 -0
  57. package/commands/gsd/insert-phase.md +33 -0
  58. package/commands/gsd/join-discord.md +18 -0
  59. package/commands/gsd/list-phase-assumptions.md +50 -0
  60. package/commands/gsd/map-codebase.md +71 -0
  61. package/commands/gsd/new-milestone.md +51 -0
  62. package/commands/gsd/new-project.md +42 -0
  63. package/commands/gsd/pause-work.md +35 -0
  64. package/commands/gsd/plan-milestone-gaps.md +40 -0
  65. package/commands/gsd/plan-phase.md +44 -0
  66. package/commands/gsd/progress.md +24 -0
  67. package/commands/gsd/quick.md +40 -0
  68. package/commands/gsd/reapply-patches.md +110 -0
  69. package/commands/gsd/remove-phase.md +32 -0
  70. package/commands/gsd/research-phase.md +187 -0
  71. package/commands/gsd/resume-work.md +40 -0
  72. package/commands/gsd/set-profile.md +34 -0
  73. package/commands/gsd/settings.md +36 -0
  74. package/commands/gsd/update.md +37 -0
  75. package/commands/gsd/verify-work.md +39 -0
  76. package/get-shit-done/bin/gsd-tools.cjs +5243 -0
  77. package/get-shit-done/bin/gsd-tools.test.cjs +2273 -0
  78. package/get-shit-done/references/checkpoints.md +775 -0
  79. package/get-shit-done/references/continuation-format.md +249 -0
  80. package/get-shit-done/references/decimal-phase-calculation.md +65 -0
  81. package/get-shit-done/references/git-integration.md +248 -0
  82. package/get-shit-done/references/git-planning-commit.md +38 -0
  83. package/get-shit-done/references/model-profile-resolution.md +34 -0
  84. package/get-shit-done/references/model-profiles.md +92 -0
  85. package/get-shit-done/references/phase-argument-parsing.md +61 -0
  86. package/get-shit-done/references/planning-config.md +196 -0
  87. package/get-shit-done/references/questioning.md +145 -0
  88. package/get-shit-done/references/tdd.md +263 -0
  89. package/get-shit-done/references/ui-brand.md +160 -0
  90. package/get-shit-done/references/verification-patterns.md +612 -0
  91. package/get-shit-done/templates/DEBUG.md +159 -0
  92. package/get-shit-done/templates/UAT.md +247 -0
  93. package/get-shit-done/templates/codebase/architecture.md +255 -0
  94. package/get-shit-done/templates/codebase/concerns.md +310 -0
  95. package/get-shit-done/templates/codebase/conventions.md +307 -0
  96. package/get-shit-done/templates/codebase/integrations.md +280 -0
  97. package/get-shit-done/templates/codebase/stack.md +186 -0
  98. package/get-shit-done/templates/codebase/structure.md +285 -0
  99. package/get-shit-done/templates/codebase/testing.md +480 -0
  100. package/get-shit-done/templates/config.json +36 -0
  101. package/get-shit-done/templates/context.md +283 -0
  102. package/get-shit-done/templates/continue-here.md +78 -0
  103. package/get-shit-done/templates/debug-subagent-prompt.md +91 -0
  104. package/get-shit-done/templates/discovery.md +146 -0
  105. package/get-shit-done/templates/milestone-archive.md +123 -0
  106. package/get-shit-done/templates/milestone.md +115 -0
  107. package/get-shit-done/templates/phase-prompt.md +567 -0
  108. package/get-shit-done/templates/planner-subagent-prompt.md +117 -0
  109. package/get-shit-done/templates/project.md +184 -0
  110. package/get-shit-done/templates/requirements.md +231 -0
  111. package/get-shit-done/templates/research-project/ARCHITECTURE.md +204 -0
  112. package/get-shit-done/templates/research-project/FEATURES.md +147 -0
  113. package/get-shit-done/templates/research-project/PITFALLS.md +200 -0
  114. package/get-shit-done/templates/research-project/STACK.md +120 -0
  115. package/get-shit-done/templates/research-project/SUMMARY.md +170 -0
  116. package/get-shit-done/templates/research.md +552 -0
  117. package/get-shit-done/templates/roadmap.md +202 -0
  118. package/get-shit-done/templates/state.md +176 -0
  119. package/get-shit-done/templates/summary-complex.md +59 -0
  120. package/get-shit-done/templates/summary-minimal.md +41 -0
  121. package/get-shit-done/templates/summary-standard.md +48 -0
  122. package/get-shit-done/templates/summary.md +246 -0
  123. package/get-shit-done/templates/user-setup.md +311 -0
  124. package/get-shit-done/templates/verification-report.md +322 -0
  125. package/get-shit-done/workflows/add-phase.md +111 -0
  126. package/get-shit-done/workflows/add-todo.md +157 -0
  127. package/get-shit-done/workflows/audit-milestone.md +242 -0
  128. package/get-shit-done/workflows/check-todos.md +176 -0
  129. package/get-shit-done/workflows/cleanup.md +152 -0
  130. package/get-shit-done/workflows/complete-milestone.md +674 -0
  131. package/get-shit-done/workflows/diagnose-issues.md +219 -0
  132. package/get-shit-done/workflows/discovery-phase.md +289 -0
  133. package/get-shit-done/workflows/discuss-phase.md +485 -0
  134. package/get-shit-done/workflows/execute-phase.md +408 -0
  135. package/get-shit-done/workflows/execute-plan.md +441 -0
  136. package/get-shit-done/workflows/health.md +156 -0
  137. package/get-shit-done/workflows/help.md +486 -0
  138. package/get-shit-done/workflows/insert-phase.md +129 -0
  139. package/get-shit-done/workflows/list-phase-assumptions.md +178 -0
  140. package/get-shit-done/workflows/map-codebase.md +327 -0
  141. package/get-shit-done/workflows/new-milestone.md +373 -0
  142. package/get-shit-done/workflows/new-project.md +1113 -0
  143. package/get-shit-done/workflows/pause-work.md +122 -0
  144. package/get-shit-done/workflows/plan-milestone-gaps.md +256 -0
  145. package/get-shit-done/workflows/plan-phase.md +448 -0
  146. package/get-shit-done/workflows/progress.md +393 -0
  147. package/get-shit-done/workflows/quick.md +444 -0
  148. package/get-shit-done/workflows/remove-phase.md +154 -0
  149. package/get-shit-done/workflows/research-phase.md +74 -0
  150. package/get-shit-done/workflows/resume-project.md +306 -0
  151. package/get-shit-done/workflows/set-profile.md +80 -0
  152. package/get-shit-done/workflows/settings.md +200 -0
  153. package/get-shit-done/workflows/transition.md +539 -0
  154. package/get-shit-done/workflows/update.md +214 -0
  155. package/get-shit-done/workflows/verify-phase.md +242 -0
  156. package/get-shit-done/workflows/verify-work.md +570 -0
  157. package/hooks/dist/gsd-check-update.js +62 -0
  158. package/hooks/dist/gsd-statusline.js +91 -0
  159. package/package.json +54 -0
  160. package/scripts/build-hooks.js +42 -0
@@ -0,0 +1,170 @@
1
+ # Research Summary Template
2
+
3
+ Template for `.planning/research/SUMMARY.md` — executive summary of project research with roadmap implications.
4
+
5
+ <template>
6
+
7
+ ```markdown
8
+ # Project Research Summary
9
+
10
+ **Project:** [name from PROJECT.md]
11
+ **Domain:** [inferred domain type]
12
+ **Researched:** [date]
13
+ **Confidence:** [HIGH/MEDIUM/LOW]
14
+
15
+ ## Executive Summary
16
+
17
+ [2-3 paragraph overview of research findings]
18
+
19
+ - What type of product this is and how experts build it
20
+ - The recommended approach based on research
21
+ - Key risks and how to mitigate them
22
+
23
+ ## Key Findings
24
+
25
+ ### Recommended Stack
26
+
27
+ [Summary from STACK.md — 1-2 paragraphs]
28
+
29
+ **Core technologies:**
30
+ - [Technology]: [purpose] — [why recommended]
31
+ - [Technology]: [purpose] — [why recommended]
32
+ - [Technology]: [purpose] — [why recommended]
33
+
34
+ ### Expected Features
35
+
36
+ [Summary from FEATURES.md]
37
+
38
+ **Must have (table stakes):**
39
+ - [Feature] — users expect this
40
+ - [Feature] — users expect this
41
+
42
+ **Should have (competitive):**
43
+ - [Feature] — differentiator
44
+ - [Feature] — differentiator
45
+
46
+ **Defer (v2+):**
47
+ - [Feature] — not essential for launch
48
+
49
+ ### Architecture Approach
50
+
51
+ [Summary from ARCHITECTURE.md — 1 paragraph]
52
+
53
+ **Major components:**
54
+ 1. [Component] — [responsibility]
55
+ 2. [Component] — [responsibility]
56
+ 3. [Component] — [responsibility]
57
+
58
+ ### Critical Pitfalls
59
+
60
+ [Top 3-5 from PITFALLS.md]
61
+
62
+ 1. **[Pitfall]** — [how to avoid]
63
+ 2. **[Pitfall]** — [how to avoid]
64
+ 3. **[Pitfall]** — [how to avoid]
65
+
66
+ ## Implications for Roadmap
67
+
68
+ Based on research, suggested phase structure:
69
+
70
+ ### Phase 1: [Name]
71
+ **Rationale:** [why this comes first based on research]
72
+ **Delivers:** [what this phase produces]
73
+ **Addresses:** [features from FEATURES.md]
74
+ **Avoids:** [pitfall from PITFALLS.md]
75
+
76
+ ### Phase 2: [Name]
77
+ **Rationale:** [why this order]
78
+ **Delivers:** [what this phase produces]
79
+ **Uses:** [stack elements from STACK.md]
80
+ **Implements:** [architecture component]
81
+
82
+ ### Phase 3: [Name]
83
+ **Rationale:** [why this order]
84
+ **Delivers:** [what this phase produces]
85
+
86
+ [Continue for suggested phases...]
87
+
88
+ ### Phase Ordering Rationale
89
+
90
+ - [Why this order based on dependencies discovered]
91
+ - [Why this grouping based on architecture patterns]
92
+ - [How this avoids pitfalls from research]
93
+
94
+ ### Research Flags
95
+
96
+ Phases likely needing deeper research during planning:
97
+ - **Phase [X]:** [reason — e.g., "complex integration, needs API research"]
98
+ - **Phase [Y]:** [reason — e.g., "niche domain, sparse documentation"]
99
+
100
+ Phases with standard patterns (skip research-phase):
101
+ - **Phase [X]:** [reason — e.g., "well-documented, established patterns"]
102
+
103
+ ## Confidence Assessment
104
+
105
+ | Area | Confidence | Notes |
106
+ |------|------------|-------|
107
+ | Stack | [HIGH/MEDIUM/LOW] | [reason] |
108
+ | Features | [HIGH/MEDIUM/LOW] | [reason] |
109
+ | Architecture | [HIGH/MEDIUM/LOW] | [reason] |
110
+ | Pitfalls | [HIGH/MEDIUM/LOW] | [reason] |
111
+
112
+ **Overall confidence:** [HIGH/MEDIUM/LOW]
113
+
114
+ ### Gaps to Address
115
+
116
+ [Any areas where research was inconclusive or needs validation during implementation]
117
+
118
+ - [Gap]: [how to handle during planning/execution]
119
+ - [Gap]: [how to handle during planning/execution]
120
+
121
+ ## Sources
122
+
123
+ ### Primary (HIGH confidence)
124
+ - [Context7 library ID] — [topics]
125
+ - [Official docs URL] — [what was checked]
126
+
127
+ ### Secondary (MEDIUM confidence)
128
+ - [Source] — [finding]
129
+
130
+ ### Tertiary (LOW confidence)
131
+ - [Source] — [finding, needs validation]
132
+
133
+ ---
134
+ *Research completed: [date]*
135
+ *Ready for roadmap: yes*
136
+ ```
137
+
138
+ </template>
139
+
140
+ <guidelines>
141
+
142
+ **Executive Summary:**
143
+ - Write for someone who will only read this section
144
+ - Include the key recommendation and main risk
145
+ - 2-3 paragraphs maximum
146
+
147
+ **Key Findings:**
148
+ - Summarize, don't duplicate full documents
149
+ - Link to detailed docs (STACK.md, FEATURES.md, etc.)
150
+ - Focus on what matters for roadmap decisions
151
+
152
+ **Implications for Roadmap:**
153
+ - This is the most important section
154
+ - Directly informs roadmap creation
155
+ - Be explicit about phase suggestions and rationale
156
+ - Include research flags for each suggested phase
157
+
158
+ **Confidence Assessment:**
159
+ - Be honest about uncertainty
160
+ - Note gaps that need resolution during planning
161
+ - HIGH = verified with official sources
162
+ - MEDIUM = community consensus, multiple sources agree
163
+ - LOW = single source or inference
164
+
165
+ **Integration with roadmap creation:**
166
+ - This file is loaded as context during roadmap creation
167
+ - Phase suggestions here become starting point for roadmap
168
+ - Research flags inform phase planning
169
+
170
+ </guidelines>
@@ -0,0 +1,552 @@
1
+ # Research Template
2
+
3
+ Template for `.planning/phases/XX-name/{phase_num}-RESEARCH.md` - comprehensive ecosystem research before planning.
4
+
5
+ **Purpose:** Document what Claude needs to know to implement a phase well - not just "which library" but "how do experts build this."
6
+
7
+ ---
8
+
9
+ ## File Template
10
+
11
+ ```markdown
12
+ # Phase [X]: [Name] - Research
13
+
14
+ **Researched:** [date]
15
+ **Domain:** [primary technology/problem domain]
16
+ **Confidence:** [HIGH/MEDIUM/LOW]
17
+
18
+ <user_constraints>
19
+ ## User Constraints (from CONTEXT.md)
20
+
21
+ **CRITICAL:** If CONTEXT.md exists from /gsd:discuss-phase, copy locked decisions here verbatim. These MUST be honored by the planner.
22
+
23
+ ### Locked Decisions
24
+ [Copy from CONTEXT.md `## Decisions` section - these are NON-NEGOTIABLE]
25
+ - [Decision 1]
26
+ - [Decision 2]
27
+
28
+ ### Claude's Discretion
29
+ [Copy from CONTEXT.md - areas where researcher/planner can choose]
30
+ - [Area 1]
31
+ - [Area 2]
32
+
33
+ ### Deferred Ideas (OUT OF SCOPE)
34
+ [Copy from CONTEXT.md - do NOT research or plan these]
35
+ - [Deferred 1]
36
+ - [Deferred 2]
37
+
38
+ **If no CONTEXT.md exists:** Write "No user constraints - all decisions at Claude's discretion"
39
+ </user_constraints>
40
+
41
+ <research_summary>
42
+ ## Summary
43
+
44
+ [2-3 paragraph executive summary]
45
+ - What was researched
46
+ - What the standard approach is
47
+ - Key recommendations
48
+
49
+ **Primary recommendation:** [one-liner actionable guidance]
50
+ </research_summary>
51
+
52
+ <standard_stack>
53
+ ## Standard Stack
54
+
55
+ The established libraries/tools for this domain:
56
+
57
+ ### Core
58
+ | Library | Version | Purpose | Why Standard |
59
+ |---------|---------|---------|--------------|
60
+ | [name] | [ver] | [what it does] | [why experts use it] |
61
+ | [name] | [ver] | [what it does] | [why experts use it] |
62
+
63
+ ### Supporting
64
+ | Library | Version | Purpose | When to Use |
65
+ |---------|---------|---------|-------------|
66
+ | [name] | [ver] | [what it does] | [use case] |
67
+ | [name] | [ver] | [what it does] | [use case] |
68
+
69
+ ### Alternatives Considered
70
+ | Instead of | Could Use | Tradeoff |
71
+ |------------|-----------|----------|
72
+ | [standard] | [alternative] | [when alternative makes sense] |
73
+
74
+ **Installation:**
75
+ ```bash
76
+ npm install [packages]
77
+ # or
78
+ yarn add [packages]
79
+ ```
80
+ </standard_stack>
81
+
82
+ <architecture_patterns>
83
+ ## Architecture Patterns
84
+
85
+ ### Recommended Project Structure
86
+ ```
87
+ src/
88
+ ├── [folder]/ # [purpose]
89
+ ├── [folder]/ # [purpose]
90
+ └── [folder]/ # [purpose]
91
+ ```
92
+
93
+ ### Pattern 1: [Pattern Name]
94
+ **What:** [description]
95
+ **When to use:** [conditions]
96
+ **Example:**
97
+ ```typescript
98
+ // [code example from Context7/official docs]
99
+ ```
100
+
101
+ ### Pattern 2: [Pattern Name]
102
+ **What:** [description]
103
+ **When to use:** [conditions]
104
+ **Example:**
105
+ ```typescript
106
+ // [code example]
107
+ ```
108
+
109
+ ### Anti-Patterns to Avoid
110
+ - **[Anti-pattern]:** [why it's bad, what to do instead]
111
+ - **[Anti-pattern]:** [why it's bad, what to do instead]
112
+ </architecture_patterns>
113
+
114
+ <dont_hand_roll>
115
+ ## Don't Hand-Roll
116
+
117
+ Problems that look simple but have existing solutions:
118
+
119
+ | Problem | Don't Build | Use Instead | Why |
120
+ |---------|-------------|-------------|-----|
121
+ | [problem] | [what you'd build] | [library] | [edge cases, complexity] |
122
+ | [problem] | [what you'd build] | [library] | [edge cases, complexity] |
123
+ | [problem] | [what you'd build] | [library] | [edge cases, complexity] |
124
+
125
+ **Key insight:** [why custom solutions are worse in this domain]
126
+ </dont_hand_roll>
127
+
128
+ <common_pitfalls>
129
+ ## Common Pitfalls
130
+
131
+ ### Pitfall 1: [Name]
132
+ **What goes wrong:** [description]
133
+ **Why it happens:** [root cause]
134
+ **How to avoid:** [prevention strategy]
135
+ **Warning signs:** [how to detect early]
136
+
137
+ ### Pitfall 2: [Name]
138
+ **What goes wrong:** [description]
139
+ **Why it happens:** [root cause]
140
+ **How to avoid:** [prevention strategy]
141
+ **Warning signs:** [how to detect early]
142
+
143
+ ### Pitfall 3: [Name]
144
+ **What goes wrong:** [description]
145
+ **Why it happens:** [root cause]
146
+ **How to avoid:** [prevention strategy]
147
+ **Warning signs:** [how to detect early]
148
+ </common_pitfalls>
149
+
150
+ <code_examples>
151
+ ## Code Examples
152
+
153
+ Verified patterns from official sources:
154
+
155
+ ### [Common Operation 1]
156
+ ```typescript
157
+ // Source: [Context7/official docs URL]
158
+ [code]
159
+ ```
160
+
161
+ ### [Common Operation 2]
162
+ ```typescript
163
+ // Source: [Context7/official docs URL]
164
+ [code]
165
+ ```
166
+
167
+ ### [Common Operation 3]
168
+ ```typescript
169
+ // Source: [Context7/official docs URL]
170
+ [code]
171
+ ```
172
+ </code_examples>
173
+
174
+ <sota_updates>
175
+ ## State of the Art (2024-2025)
176
+
177
+ What's changed recently:
178
+
179
+ | Old Approach | Current Approach | When Changed | Impact |
180
+ |--------------|------------------|--------------|--------|
181
+ | [old] | [new] | [date/version] | [what it means for implementation] |
182
+
183
+ **New tools/patterns to consider:**
184
+ - [Tool/Pattern]: [what it enables, when to use]
185
+ - [Tool/Pattern]: [what it enables, when to use]
186
+
187
+ **Deprecated/outdated:**
188
+ - [Thing]: [why it's outdated, what replaced it]
189
+ </sota_updates>
190
+
191
+ <open_questions>
192
+ ## Open Questions
193
+
194
+ Things that couldn't be fully resolved:
195
+
196
+ 1. **[Question]**
197
+ - What we know: [partial info]
198
+ - What's unclear: [the gap]
199
+ - Recommendation: [how to handle during planning/execution]
200
+
201
+ 2. **[Question]**
202
+ - What we know: [partial info]
203
+ - What's unclear: [the gap]
204
+ - Recommendation: [how to handle]
205
+ </open_questions>
206
+
207
+ <sources>
208
+ ## Sources
209
+
210
+ ### Primary (HIGH confidence)
211
+ - [Context7 library ID] - [topics fetched]
212
+ - [Official docs URL] - [what was checked]
213
+
214
+ ### Secondary (MEDIUM confidence)
215
+ - [WebSearch verified with official source] - [finding + verification]
216
+
217
+ ### Tertiary (LOW confidence - needs validation)
218
+ - [WebSearch only] - [finding, marked for validation during implementation]
219
+ </sources>
220
+
221
+ <metadata>
222
+ ## Metadata
223
+
224
+ **Research scope:**
225
+ - Core technology: [what]
226
+ - Ecosystem: [libraries explored]
227
+ - Patterns: [patterns researched]
228
+ - Pitfalls: [areas checked]
229
+
230
+ **Confidence breakdown:**
231
+ - Standard stack: [HIGH/MEDIUM/LOW] - [reason]
232
+ - Architecture: [HIGH/MEDIUM/LOW] - [reason]
233
+ - Pitfalls: [HIGH/MEDIUM/LOW] - [reason]
234
+ - Code examples: [HIGH/MEDIUM/LOW] - [reason]
235
+
236
+ **Research date:** [date]
237
+ **Valid until:** [estimate - 30 days for stable tech, 7 days for fast-moving]
238
+ </metadata>
239
+
240
+ ---
241
+
242
+ *Phase: XX-name*
243
+ *Research completed: [date]*
244
+ *Ready for planning: [yes/no]*
245
+ ```
246
+
247
+ ---
248
+
249
+ ## Good Example
250
+
251
+ ```markdown
252
+ # Phase 3: 3D City Driving - Research
253
+
254
+ **Researched:** 2025-01-20
255
+ **Domain:** Three.js 3D web game with driving mechanics
256
+ **Confidence:** HIGH
257
+
258
+ <research_summary>
259
+ ## Summary
260
+
261
+ Researched the Three.js ecosystem for building a 3D city driving game. The standard approach uses Three.js with React Three Fiber for component architecture, Rapier for physics, and drei for common helpers.
262
+
263
+ Key finding: Don't hand-roll physics or collision detection. Rapier (via @react-three/rapier) handles vehicle physics, terrain collision, and city object interactions efficiently. Custom physics code leads to bugs and performance issues.
264
+
265
+ **Primary recommendation:** Use R3F + Rapier + drei stack. Start with vehicle controller from drei, add Rapier vehicle physics, build city with instanced meshes for performance.
266
+ </research_summary>
267
+
268
+ <standard_stack>
269
+ ## Standard Stack
270
+
271
+ ### Core
272
+ | Library | Version | Purpose | Why Standard |
273
+ |---------|---------|---------|--------------|
274
+ | three | 0.160.0 | 3D rendering | The standard for web 3D |
275
+ | @react-three/fiber | 8.15.0 | React renderer for Three.js | Declarative 3D, better DX |
276
+ | @react-three/drei | 9.92.0 | Helpers and abstractions | Solves common problems |
277
+ | @react-three/rapier | 1.2.1 | Physics engine bindings | Best physics for R3F |
278
+
279
+ ### Supporting
280
+ | Library | Version | Purpose | When to Use |
281
+ |---------|---------|---------|-------------|
282
+ | @react-three/postprocessing | 2.16.0 | Visual effects | Bloom, DOF, motion blur |
283
+ | leva | 0.9.35 | Debug UI | Tweaking parameters |
284
+ | zustand | 4.4.7 | State management | Game state, UI state |
285
+ | use-sound | 4.0.1 | Audio | Engine sounds, ambient |
286
+
287
+ ### Alternatives Considered
288
+ | Instead of | Could Use | Tradeoff |
289
+ |------------|-----------|----------|
290
+ | Rapier | Cannon.js | Cannon simpler but less performant for vehicles |
291
+ | R3F | Vanilla Three | Vanilla if no React, but R3F DX is much better |
292
+ | drei | Custom helpers | drei is battle-tested, don't reinvent |
293
+
294
+ **Installation:**
295
+ ```bash
296
+ npm install three @react-three/fiber @react-three/drei @react-three/rapier zustand
297
+ ```
298
+ </standard_stack>
299
+
300
+ <architecture_patterns>
301
+ ## Architecture Patterns
302
+
303
+ ### Recommended Project Structure
304
+ ```
305
+ src/
306
+ ├── components/
307
+ │ ├── Vehicle/ # Player car with physics
308
+ │ ├── City/ # City generation and buildings
309
+ │ ├── Road/ # Road network
310
+ │ └── Environment/ # Sky, lighting, fog
311
+ ├── hooks/
312
+ │ ├── useVehicleControls.ts
313
+ │ └── useGameState.ts
314
+ ├── stores/
315
+ │ └── gameStore.ts # Zustand state
316
+ └── utils/
317
+ └── cityGenerator.ts # Procedural generation helpers
318
+ ```
319
+
320
+ ### Pattern 1: Vehicle with Rapier Physics
321
+ **What:** Use RigidBody with vehicle-specific settings, not custom physics
322
+ **When to use:** Any ground vehicle
323
+ **Example:**
324
+ ```typescript
325
+ // Source: @react-three/rapier docs
326
+ import { RigidBody, useRapier } from '@react-three/rapier'
327
+
328
+ function Vehicle() {
329
+ const rigidBody = useRef()
330
+
331
+ return (
332
+ <RigidBody
333
+ ref={rigidBody}
334
+ type="dynamic"
335
+ colliders="hull"
336
+ mass={1500}
337
+ linearDamping={0.5}
338
+ angularDamping={0.5}
339
+ >
340
+ <mesh>
341
+ <boxGeometry args={[2, 1, 4]} />
342
+ <meshStandardMaterial />
343
+ </mesh>
344
+ </RigidBody>
345
+ )
346
+ }
347
+ ```
348
+
349
+ ### Pattern 2: Instanced Meshes for City
350
+ **What:** Use InstancedMesh for repeated objects (buildings, trees, props)
351
+ **When to use:** >100 similar objects
352
+ **Example:**
353
+ ```typescript
354
+ // Source: drei docs
355
+ import { Instances, Instance } from '@react-three/drei'
356
+
357
+ function Buildings({ positions }) {
358
+ return (
359
+ <Instances limit={1000}>
360
+ <boxGeometry />
361
+ <meshStandardMaterial />
362
+ {positions.map((pos, i) => (
363
+ <Instance key={i} position={pos} scale={[1, Math.random() * 5 + 1, 1]} />
364
+ ))}
365
+ </Instances>
366
+ )
367
+ }
368
+ ```
369
+
370
+ ### Anti-Patterns to Avoid
371
+ - **Creating meshes in render loop:** Create once, update transforms only
372
+ - **Not using InstancedMesh:** Individual meshes for buildings kills performance
373
+ - **Custom physics math:** Rapier handles it better, every time
374
+ </architecture_patterns>
375
+
376
+ <dont_hand_roll>
377
+ ## Don't Hand-Roll
378
+
379
+ | Problem | Don't Build | Use Instead | Why |
380
+ |---------|-------------|-------------|-----|
381
+ | Vehicle physics | Custom velocity/acceleration | Rapier RigidBody | Wheel friction, suspension, collisions are complex |
382
+ | Collision detection | Raycasting everything | Rapier colliders | Performance, edge cases, tunneling |
383
+ | Camera follow | Manual lerp | drei CameraControls or custom with useFrame | Smooth interpolation, bounds |
384
+ | City generation | Pure random placement | Grid-based with noise for variation | Random looks wrong, grid is predictable |
385
+ | LOD | Manual distance checks | drei <Detailed> | Handles transitions, hysteresis |
386
+
387
+ **Key insight:** 3D game development has 40+ years of solved problems. Rapier implements proper physics simulation. drei implements proper 3D helpers. Fighting these leads to bugs that look like "game feel" issues but are actually physics edge cases.
388
+ </dont_hand_roll>
389
+
390
+ <common_pitfalls>
391
+ ## Common Pitfalls
392
+
393
+ ### Pitfall 1: Physics Tunneling
394
+ **What goes wrong:** Fast objects pass through walls
395
+ **Why it happens:** Default physics step too large for velocity
396
+ **How to avoid:** Use CCD (Continuous Collision Detection) in Rapier
397
+ **Warning signs:** Objects randomly appearing outside buildings
398
+
399
+ ### Pitfall 2: Performance Death by Draw Calls
400
+ **What goes wrong:** Game stutters with many buildings
401
+ **Why it happens:** Each mesh = 1 draw call, hundreds of buildings = hundreds of calls
402
+ **How to avoid:** InstancedMesh for similar objects, merge static geometry
403
+ **Warning signs:** GPU bound, low FPS despite simple scene
404
+
405
+ ### Pitfall 3: Vehicle "Floaty" Feel
406
+ **What goes wrong:** Car doesn't feel grounded
407
+ **Why it happens:** Missing proper wheel/suspension simulation
408
+ **How to avoid:** Use Rapier vehicle controller or tune mass/damping carefully
409
+ **Warning signs:** Car bounces oddly, doesn't grip corners
410
+ </common_pitfalls>
411
+
412
+ <code_examples>
413
+ ## Code Examples
414
+
415
+ ### Basic R3F + Rapier Setup
416
+ ```typescript
417
+ // Source: @react-three/rapier getting started
418
+ import { Canvas } from '@react-three/fiber'
419
+ import { Physics } from '@react-three/rapier'
420
+
421
+ function Game() {
422
+ return (
423
+ <Canvas>
424
+ <Physics gravity={[0, -9.81, 0]}>
425
+ <Vehicle />
426
+ <City />
427
+ <Ground />
428
+ </Physics>
429
+ </Canvas>
430
+ )
431
+ }
432
+ ```
433
+
434
+ ### Vehicle Controls Hook
435
+ ```typescript
436
+ // Source: Community pattern, verified with drei docs
437
+ import { useFrame } from '@react-three/fiber'
438
+ import { useKeyboardControls } from '@react-three/drei'
439
+
440
+ function useVehicleControls(rigidBodyRef) {
441
+ const [, getKeys] = useKeyboardControls()
442
+
443
+ useFrame(() => {
444
+ const { forward, back, left, right } = getKeys()
445
+ const body = rigidBodyRef.current
446
+ if (!body) return
447
+
448
+ const impulse = { x: 0, y: 0, z: 0 }
449
+ if (forward) impulse.z -= 10
450
+ if (back) impulse.z += 5
451
+
452
+ body.applyImpulse(impulse, true)
453
+
454
+ if (left) body.applyTorqueImpulse({ x: 0, y: 2, z: 0 }, true)
455
+ if (right) body.applyTorqueImpulse({ x: 0, y: -2, z: 0 }, true)
456
+ })
457
+ }
458
+ ```
459
+ </code_examples>
460
+
461
+ <sota_updates>
462
+ ## State of the Art (2024-2025)
463
+
464
+ | Old Approach | Current Approach | When Changed | Impact |
465
+ |--------------|------------------|--------------|--------|
466
+ | cannon-es | Rapier | 2023 | Rapier is faster, better maintained |
467
+ | vanilla Three.js | React Three Fiber | 2020+ | R3F is now standard for React apps |
468
+ | Manual InstancedMesh | drei <Instances> | 2022 | Simpler API, handles updates |
469
+
470
+ **New tools/patterns to consider:**
471
+ - **WebGPU:** Coming but not production-ready for games yet (2025)
472
+ - **drei Gltf helpers:** <useGLTF.preload> for loading screens
473
+
474
+ **Deprecated/outdated:**
475
+ - **cannon.js (original):** Use cannon-es fork or better, Rapier
476
+ - **Manual raycasting for physics:** Just use Rapier colliders
477
+ </sota_updates>
478
+
479
+ <sources>
480
+ ## Sources
481
+
482
+ ### Primary (HIGH confidence)
483
+ - /pmndrs/react-three-fiber - getting started, hooks, performance
484
+ - /pmndrs/drei - instances, controls, helpers
485
+ - /dimforge/rapier-js - physics setup, vehicle physics
486
+
487
+ ### Secondary (MEDIUM confidence)
488
+ - Three.js discourse "city driving game" threads - verified patterns against docs
489
+ - R3F examples repository - verified code works
490
+
491
+ ### Tertiary (LOW confidence - needs validation)
492
+ - None - all findings verified
493
+ </sources>
494
+
495
+ <metadata>
496
+ ## Metadata
497
+
498
+ **Research scope:**
499
+ - Core technology: Three.js + React Three Fiber
500
+ - Ecosystem: Rapier, drei, zustand
501
+ - Patterns: Vehicle physics, instancing, city generation
502
+ - Pitfalls: Performance, physics, feel
503
+
504
+ **Confidence breakdown:**
505
+ - Standard stack: HIGH - verified with Context7, widely used
506
+ - Architecture: HIGH - from official examples
507
+ - Pitfalls: HIGH - documented in discourse, verified in docs
508
+ - Code examples: HIGH - from Context7/official sources
509
+
510
+ **Research date:** 2025-01-20
511
+ **Valid until:** 2025-02-20 (30 days - R3F ecosystem stable)
512
+ </metadata>
513
+
514
+ ---
515
+
516
+ *Phase: 03-city-driving*
517
+ *Research completed: 2025-01-20*
518
+ *Ready for planning: yes*
519
+ ```
520
+
521
+ ---
522
+
523
+ ## Guidelines
524
+
525
+ **When to create:**
526
+ - Before planning phases in niche/complex domains
527
+ - When Claude's training data is likely stale or sparse
528
+ - When "how do experts do this" matters more than "which library"
529
+
530
+ **Structure:**
531
+ - Use XML tags for section markers (matches GSD templates)
532
+ - Seven core sections: summary, standard_stack, architecture_patterns, dont_hand_roll, common_pitfalls, code_examples, sources
533
+ - All sections required (drives comprehensive research)
534
+
535
+ **Content quality:**
536
+ - Standard stack: Specific versions, not just names
537
+ - Architecture: Include actual code examples from authoritative sources
538
+ - Don't hand-roll: Be explicit about what problems to NOT solve yourself
539
+ - Pitfalls: Include warning signs, not just "don't do this"
540
+ - Sources: Mark confidence levels honestly
541
+
542
+ **Integration with planning:**
543
+ - RESEARCH.md loaded as @context reference in PLAN.md
544
+ - Standard stack informs library choices
545
+ - Don't hand-roll prevents custom solutions
546
+ - Pitfalls inform verification criteria
547
+ - Code examples can be referenced in task actions
548
+
549
+ **After creation:**
550
+ - File lives in phase directory: `.planning/phases/XX-name/{phase_num}-RESEARCH.md`
551
+ - Referenced during planning workflow
552
+ - plan-phase loads it automatically when present