gsd-code-first 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 (238) hide show
  1. package/LICENSE +21 -0
  2. package/README.ja-JP.md +834 -0
  3. package/README.ko-KR.md +823 -0
  4. package/README.md +937 -0
  5. package/README.pt-BR.md +452 -0
  6. package/README.zh-CN.md +800 -0
  7. package/agents/gsd-advisor-researcher.md +104 -0
  8. package/agents/gsd-annotator.md +148 -0
  9. package/agents/gsd-arc-executor.md +537 -0
  10. package/agents/gsd-arc-planner.md +374 -0
  11. package/agents/gsd-assumptions-analyzer.md +105 -0
  12. package/agents/gsd-code-planner.md +155 -0
  13. package/agents/gsd-codebase-mapper.md +770 -0
  14. package/agents/gsd-debugger.md +1373 -0
  15. package/agents/gsd-executor.md +509 -0
  16. package/agents/gsd-integration-checker.md +443 -0
  17. package/agents/gsd-nyquist-auditor.md +176 -0
  18. package/agents/gsd-phase-researcher.md +698 -0
  19. package/agents/gsd-plan-checker.md +773 -0
  20. package/agents/gsd-planner.md +1354 -0
  21. package/agents/gsd-project-researcher.md +654 -0
  22. package/agents/gsd-prototyper.md +161 -0
  23. package/agents/gsd-research-synthesizer.md +247 -0
  24. package/agents/gsd-roadmapper.md +679 -0
  25. package/agents/gsd-ui-auditor.md +439 -0
  26. package/agents/gsd-ui-checker.md +300 -0
  27. package/agents/gsd-ui-researcher.md +357 -0
  28. package/agents/gsd-user-profiler.md +171 -0
  29. package/agents/gsd-verifier.md +700 -0
  30. package/bin/install.js +5009 -0
  31. package/commands/gsd/add-backlog.md +76 -0
  32. package/commands/gsd/add-phase.md +43 -0
  33. package/commands/gsd/add-tests.md +41 -0
  34. package/commands/gsd/add-todo.md +47 -0
  35. package/commands/gsd/annotate.md +54 -0
  36. package/commands/gsd/audit-milestone.md +36 -0
  37. package/commands/gsd/audit-uat.md +24 -0
  38. package/commands/gsd/autonomous.md +41 -0
  39. package/commands/gsd/check-todos.md +45 -0
  40. package/commands/gsd/cleanup.md +18 -0
  41. package/commands/gsd/complete-milestone.md +136 -0
  42. package/commands/gsd/debug.md +173 -0
  43. package/commands/gsd/deep-plan.md +52 -0
  44. package/commands/gsd/discuss-phase.md +64 -0
  45. package/commands/gsd/do.md +30 -0
  46. package/commands/gsd/execute-phase.md +59 -0
  47. package/commands/gsd/extract-plan.md +35 -0
  48. package/commands/gsd/fast.md +30 -0
  49. package/commands/gsd/forensics.md +56 -0
  50. package/commands/gsd/health.md +22 -0
  51. package/commands/gsd/help.md +22 -0
  52. package/commands/gsd/insert-phase.md +32 -0
  53. package/commands/gsd/iterate.md +124 -0
  54. package/commands/gsd/join-discord.md +18 -0
  55. package/commands/gsd/list-phase-assumptions.md +46 -0
  56. package/commands/gsd/list-workspaces.md +19 -0
  57. package/commands/gsd/manager.md +39 -0
  58. package/commands/gsd/map-codebase.md +71 -0
  59. package/commands/gsd/milestone-summary.md +51 -0
  60. package/commands/gsd/new-milestone.md +44 -0
  61. package/commands/gsd/new-project.md +42 -0
  62. package/commands/gsd/new-workspace.md +44 -0
  63. package/commands/gsd/next.md +24 -0
  64. package/commands/gsd/note.md +34 -0
  65. package/commands/gsd/pause-work.md +38 -0
  66. package/commands/gsd/plan-milestone-gaps.md +34 -0
  67. package/commands/gsd/plan-phase.md +47 -0
  68. package/commands/gsd/plant-seed.md +28 -0
  69. package/commands/gsd/pr-branch.md +25 -0
  70. package/commands/gsd/profile-user.md +46 -0
  71. package/commands/gsd/progress.md +24 -0
  72. package/commands/gsd/prototype.md +56 -0
  73. package/commands/gsd/quick.md +47 -0
  74. package/commands/gsd/reapply-patches.md +123 -0
  75. package/commands/gsd/remove-phase.md +31 -0
  76. package/commands/gsd/remove-workspace.md +26 -0
  77. package/commands/gsd/research-phase.md +195 -0
  78. package/commands/gsd/resume-work.md +40 -0
  79. package/commands/gsd/review-backlog.md +61 -0
  80. package/commands/gsd/review.md +37 -0
  81. package/commands/gsd/session-report.md +19 -0
  82. package/commands/gsd/set-mode.md +41 -0
  83. package/commands/gsd/set-profile.md +12 -0
  84. package/commands/gsd/settings.md +36 -0
  85. package/commands/gsd/ship.md +23 -0
  86. package/commands/gsd/stats.md +18 -0
  87. package/commands/gsd/thread.md +127 -0
  88. package/commands/gsd/ui-phase.md +34 -0
  89. package/commands/gsd/ui-review.md +32 -0
  90. package/commands/gsd/update.md +37 -0
  91. package/commands/gsd/validate-phase.md +35 -0
  92. package/commands/gsd/verify-work.md +38 -0
  93. package/commands/gsd/workstreams.md +63 -0
  94. package/get-shit-done/bin/gsd-tools.cjs +946 -0
  95. package/get-shit-done/bin/lib/arc-scanner.cjs +341 -0
  96. package/get-shit-done/bin/lib/commands.cjs +959 -0
  97. package/get-shit-done/bin/lib/config.cjs +466 -0
  98. package/get-shit-done/bin/lib/core.cjs +1230 -0
  99. package/get-shit-done/bin/lib/frontmatter.cjs +336 -0
  100. package/get-shit-done/bin/lib/init.cjs +1442 -0
  101. package/get-shit-done/bin/lib/milestone.cjs +252 -0
  102. package/get-shit-done/bin/lib/model-profiles.cjs +68 -0
  103. package/get-shit-done/bin/lib/phase.cjs +888 -0
  104. package/get-shit-done/bin/lib/profile-output.cjs +952 -0
  105. package/get-shit-done/bin/lib/profile-pipeline.cjs +539 -0
  106. package/get-shit-done/bin/lib/roadmap.cjs +329 -0
  107. package/get-shit-done/bin/lib/security.cjs +382 -0
  108. package/get-shit-done/bin/lib/state.cjs +1031 -0
  109. package/get-shit-done/bin/lib/template.cjs +222 -0
  110. package/get-shit-done/bin/lib/uat.cjs +282 -0
  111. package/get-shit-done/bin/lib/verify.cjs +888 -0
  112. package/get-shit-done/bin/lib/workstream.cjs +491 -0
  113. package/get-shit-done/commands/gsd/workstreams.md +63 -0
  114. package/get-shit-done/references/arc-standard.md +315 -0
  115. package/get-shit-done/references/checkpoints.md +778 -0
  116. package/get-shit-done/references/continuation-format.md +249 -0
  117. package/get-shit-done/references/decimal-phase-calculation.md +64 -0
  118. package/get-shit-done/references/git-integration.md +295 -0
  119. package/get-shit-done/references/git-planning-commit.md +38 -0
  120. package/get-shit-done/references/model-profile-resolution.md +36 -0
  121. package/get-shit-done/references/model-profiles.md +139 -0
  122. package/get-shit-done/references/phase-argument-parsing.md +61 -0
  123. package/get-shit-done/references/planning-config.md +202 -0
  124. package/get-shit-done/references/questioning.md +162 -0
  125. package/get-shit-done/references/tdd.md +263 -0
  126. package/get-shit-done/references/ui-brand.md +160 -0
  127. package/get-shit-done/references/user-profiling.md +681 -0
  128. package/get-shit-done/references/verification-patterns.md +612 -0
  129. package/get-shit-done/references/workstream-flag.md +58 -0
  130. package/get-shit-done/templates/DEBUG.md +164 -0
  131. package/get-shit-done/templates/UAT.md +265 -0
  132. package/get-shit-done/templates/UI-SPEC.md +100 -0
  133. package/get-shit-done/templates/VALIDATION.md +76 -0
  134. package/get-shit-done/templates/claude-md.md +122 -0
  135. package/get-shit-done/templates/codebase/architecture.md +255 -0
  136. package/get-shit-done/templates/codebase/concerns.md +310 -0
  137. package/get-shit-done/templates/codebase/conventions.md +307 -0
  138. package/get-shit-done/templates/codebase/integrations.md +280 -0
  139. package/get-shit-done/templates/codebase/stack.md +186 -0
  140. package/get-shit-done/templates/codebase/structure.md +285 -0
  141. package/get-shit-done/templates/codebase/testing.md +480 -0
  142. package/get-shit-done/templates/config.json +44 -0
  143. package/get-shit-done/templates/context.md +352 -0
  144. package/get-shit-done/templates/continue-here.md +78 -0
  145. package/get-shit-done/templates/copilot-instructions.md +7 -0
  146. package/get-shit-done/templates/debug-subagent-prompt.md +91 -0
  147. package/get-shit-done/templates/dev-preferences.md +21 -0
  148. package/get-shit-done/templates/discovery.md +146 -0
  149. package/get-shit-done/templates/discussion-log.md +63 -0
  150. package/get-shit-done/templates/milestone-archive.md +123 -0
  151. package/get-shit-done/templates/milestone.md +115 -0
  152. package/get-shit-done/templates/phase-prompt.md +610 -0
  153. package/get-shit-done/templates/planner-subagent-prompt.md +117 -0
  154. package/get-shit-done/templates/project.md +186 -0
  155. package/get-shit-done/templates/requirements.md +231 -0
  156. package/get-shit-done/templates/research-project/ARCHITECTURE.md +204 -0
  157. package/get-shit-done/templates/research-project/FEATURES.md +147 -0
  158. package/get-shit-done/templates/research-project/PITFALLS.md +200 -0
  159. package/get-shit-done/templates/research-project/STACK.md +120 -0
  160. package/get-shit-done/templates/research-project/SUMMARY.md +170 -0
  161. package/get-shit-done/templates/research.md +552 -0
  162. package/get-shit-done/templates/retrospective.md +54 -0
  163. package/get-shit-done/templates/roadmap.md +202 -0
  164. package/get-shit-done/templates/state.md +176 -0
  165. package/get-shit-done/templates/summary-complex.md +59 -0
  166. package/get-shit-done/templates/summary-minimal.md +41 -0
  167. package/get-shit-done/templates/summary-standard.md +48 -0
  168. package/get-shit-done/templates/summary.md +248 -0
  169. package/get-shit-done/templates/user-profile.md +146 -0
  170. package/get-shit-done/templates/user-setup.md +311 -0
  171. package/get-shit-done/templates/verification-report.md +322 -0
  172. package/get-shit-done/workflows/add-phase.md +112 -0
  173. package/get-shit-done/workflows/add-tests.md +351 -0
  174. package/get-shit-done/workflows/add-todo.md +158 -0
  175. package/get-shit-done/workflows/audit-milestone.md +340 -0
  176. package/get-shit-done/workflows/audit-uat.md +109 -0
  177. package/get-shit-done/workflows/autonomous.md +891 -0
  178. package/get-shit-done/workflows/check-todos.md +177 -0
  179. package/get-shit-done/workflows/cleanup.md +152 -0
  180. package/get-shit-done/workflows/complete-milestone.md +767 -0
  181. package/get-shit-done/workflows/diagnose-issues.md +231 -0
  182. package/get-shit-done/workflows/discovery-phase.md +289 -0
  183. package/get-shit-done/workflows/discuss-phase-assumptions.md +653 -0
  184. package/get-shit-done/workflows/discuss-phase.md +1049 -0
  185. package/get-shit-done/workflows/do.md +104 -0
  186. package/get-shit-done/workflows/execute-phase.md +846 -0
  187. package/get-shit-done/workflows/execute-plan.md +514 -0
  188. package/get-shit-done/workflows/fast.md +105 -0
  189. package/get-shit-done/workflows/forensics.md +265 -0
  190. package/get-shit-done/workflows/health.md +181 -0
  191. package/get-shit-done/workflows/help.md +634 -0
  192. package/get-shit-done/workflows/insert-phase.md +130 -0
  193. package/get-shit-done/workflows/list-phase-assumptions.md +178 -0
  194. package/get-shit-done/workflows/list-workspaces.md +56 -0
  195. package/get-shit-done/workflows/manager.md +362 -0
  196. package/get-shit-done/workflows/map-codebase.md +377 -0
  197. package/get-shit-done/workflows/milestone-summary.md +223 -0
  198. package/get-shit-done/workflows/new-milestone.md +486 -0
  199. package/get-shit-done/workflows/new-project.md +1250 -0
  200. package/get-shit-done/workflows/new-workspace.md +237 -0
  201. package/get-shit-done/workflows/next.md +97 -0
  202. package/get-shit-done/workflows/node-repair.md +92 -0
  203. package/get-shit-done/workflows/note.md +156 -0
  204. package/get-shit-done/workflows/pause-work.md +176 -0
  205. package/get-shit-done/workflows/plan-milestone-gaps.md +273 -0
  206. package/get-shit-done/workflows/plan-phase.md +859 -0
  207. package/get-shit-done/workflows/plant-seed.md +169 -0
  208. package/get-shit-done/workflows/pr-branch.md +129 -0
  209. package/get-shit-done/workflows/profile-user.md +450 -0
  210. package/get-shit-done/workflows/progress.md +507 -0
  211. package/get-shit-done/workflows/quick.md +757 -0
  212. package/get-shit-done/workflows/remove-phase.md +155 -0
  213. package/get-shit-done/workflows/remove-workspace.md +90 -0
  214. package/get-shit-done/workflows/research-phase.md +82 -0
  215. package/get-shit-done/workflows/resume-project.md +326 -0
  216. package/get-shit-done/workflows/review.md +228 -0
  217. package/get-shit-done/workflows/session-report.md +146 -0
  218. package/get-shit-done/workflows/settings.md +283 -0
  219. package/get-shit-done/workflows/ship.md +228 -0
  220. package/get-shit-done/workflows/stats.md +60 -0
  221. package/get-shit-done/workflows/transition.md +671 -0
  222. package/get-shit-done/workflows/ui-phase.md +302 -0
  223. package/get-shit-done/workflows/ui-review.md +165 -0
  224. package/get-shit-done/workflows/update.md +323 -0
  225. package/get-shit-done/workflows/validate-phase.md +174 -0
  226. package/get-shit-done/workflows/verify-phase.md +254 -0
  227. package/get-shit-done/workflows/verify-work.md +637 -0
  228. package/hooks/dist/gsd-check-update.js +114 -0
  229. package/hooks/dist/gsd-context-monitor.js +156 -0
  230. package/hooks/dist/gsd-prompt-guard.js +96 -0
  231. package/hooks/dist/gsd-statusline.js +119 -0
  232. package/hooks/dist/gsd-workflow-guard.js +94 -0
  233. package/package.json +52 -0
  234. package/scripts/base64-scan.sh +262 -0
  235. package/scripts/build-hooks.js +82 -0
  236. package/scripts/prompt-injection-scan.sh +198 -0
  237. package/scripts/run-tests.cjs +29 -0
  238. package/scripts/secret-scan.sh +227 -0
@@ -0,0 +1,859 @@
1
+ <purpose>
2
+ Create executable phase prompts (PLAN.md files) for a roadmap phase with integrated research and verification. Default flow: Research (if needed) -> Plan -> Verify -> Done. Orchestrates gsd-phase-researcher, gsd-planner, and gsd-plan-checker agents with a revision loop (max 3 iterations).
3
+ </purpose>
4
+
5
+ <required_reading>
6
+ Read all files referenced by the invoking prompt's execution_context before starting.
7
+
8
+ @~/.claude/get-shit-done/references/ui-brand.md
9
+ </required_reading>
10
+
11
+ <available_agent_types>
12
+ Valid GSD subagent types (use exact names — do not fall back to 'general-purpose'):
13
+ - gsd-phase-researcher — Researches technical approaches for a phase
14
+ - gsd-planner — Creates detailed plans from phase scope
15
+ - gsd-plan-checker — Reviews plan quality before execution
16
+ </available_agent_types>
17
+
18
+ <process>
19
+
20
+ ## 1. Initialize
21
+
22
+ Load all context in one call (paths only to minimize orchestrator context):
23
+
24
+ ```bash
25
+ INIT=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" init plan-phase "$PHASE")
26
+ if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
27
+ AGENT_SKILLS_RESEARCHER=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" agent-skills gsd-researcher 2>/dev/null)
28
+ AGENT_SKILLS_PLANNER=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" agent-skills gsd-planner 2>/dev/null)
29
+ AGENT_SKILLS_CHECKER=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" agent-skills gsd-checker 2>/dev/null)
30
+ ```
31
+
32
+ Parse JSON for: `researcher_model`, `planner_model`, `checker_model`, `research_enabled`, `plan_checker_enabled`, `nyquist_validation_enabled`, `commit_docs`, `text_mode`, `phase_found`, `phase_dir`, `phase_number`, `phase_name`, `phase_slug`, `padded_phase`, `has_research`, `has_context`, `has_reviews`, `has_plans`, `plan_count`, `planning_exists`, `roadmap_exists`, `phase_req_ids`.
33
+
34
+ **File paths (for <files_to_read> blocks):** `state_path`, `roadmap_path`, `requirements_path`, `context_path`, `research_path`, `verification_path`, `uat_path`, `reviews_path`. These are null if files don't exist.
35
+
36
+ **If `planning_exists` is false:** Error — run `/gsd:new-project` first.
37
+
38
+ ## 2. Parse and Normalize Arguments
39
+
40
+ Extract from $ARGUMENTS: phase number (integer or decimal like `2.1`), flags (`--research`, `--skip-research`, `--gaps`, `--skip-verify`, `--prd <filepath>`, `--reviews`, `--text`).
41
+
42
+ Set `TEXT_MODE=true` if `--text` is present in $ARGUMENTS OR `text_mode` from init JSON is `true`. When `TEXT_MODE` is active, replace every `AskUserQuestion` call with a plain-text numbered list and ask the user to type their choice number. This is required for Claude Code remote sessions (`/rc` mode) where TUI menus don't work through the Claude App.
43
+
44
+ Extract `--prd <filepath>` from $ARGUMENTS. If present, set PRD_FILE to the filepath.
45
+
46
+ **If no phase number:** Detect next unplanned phase from roadmap.
47
+
48
+ **If `phase_found` is false:** Validate phase exists in ROADMAP.md. If valid, create the directory using `phase_slug` and `padded_phase` from init:
49
+ ```bash
50
+ mkdir -p ".planning/phases/${padded_phase}-${phase_slug}"
51
+ ```
52
+
53
+ **Existing artifacts from init:** `has_research`, `has_plans`, `plan_count`.
54
+
55
+ ## 2.5. Validate `--reviews` Prerequisite
56
+
57
+ **Skip if:** No `--reviews` flag.
58
+
59
+ **If `--reviews` AND `--gaps`:** Error — cannot combine `--reviews` with `--gaps`. These are conflicting modes.
60
+
61
+ **If `--reviews` AND `has_reviews` is false (no REVIEWS.md in phase dir):**
62
+
63
+ Error:
64
+ ```
65
+ No REVIEWS.md found for Phase {N}. Run reviews first:
66
+
67
+ /gsd:review --phase {N}
68
+
69
+ Then re-run /gsd:plan-phase {N} --reviews
70
+ ```
71
+ Exit workflow.
72
+
73
+ ## 3. Validate Phase
74
+
75
+ ```bash
76
+ PHASE_INFO=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" roadmap get-phase "${PHASE}")
77
+ ```
78
+
79
+ **If `found` is false:** Error with available phases. **If `found` is true:** Extract `phase_number`, `phase_name`, `goal` from JSON.
80
+
81
+ ## 3.5. Handle PRD Express Path
82
+
83
+ **Skip if:** No `--prd` flag in arguments.
84
+
85
+ **If `--prd <filepath>` provided:**
86
+
87
+ 1. Read the PRD file:
88
+ ```bash
89
+ PRD_CONTENT=$(cat "$PRD_FILE" 2>/dev/null)
90
+ if [ -z "$PRD_CONTENT" ]; then
91
+ echo "Error: PRD file not found: $PRD_FILE"
92
+ exit 1
93
+ fi
94
+ ```
95
+
96
+ 2. Display banner:
97
+ ```
98
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
99
+ GSD ► PRD EXPRESS PATH
100
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
101
+
102
+ Using PRD: {PRD_FILE}
103
+ Generating CONTEXT.md from requirements...
104
+ ```
105
+
106
+ 3. Parse the PRD content and generate CONTEXT.md. The orchestrator should:
107
+ - Extract all requirements, user stories, acceptance criteria, and constraints from the PRD
108
+ - Map each to a locked decision (everything in the PRD is treated as a locked decision)
109
+ - Identify any areas the PRD doesn't cover and mark as "Claude's Discretion"
110
+ - **Extract canonical refs** from ROADMAP.md for this phase, plus any specs/ADRs referenced in the PRD — expand to full file paths (MANDATORY)
111
+ - Create CONTEXT.md in the phase directory
112
+
113
+ 4. Write CONTEXT.md:
114
+ ```markdown
115
+ # Phase [X]: [Name] - Context
116
+
117
+ **Gathered:** [date]
118
+ **Status:** Ready for planning
119
+ **Source:** PRD Express Path ({PRD_FILE})
120
+
121
+ <domain>
122
+ ## Phase Boundary
123
+
124
+ [Extracted from PRD — what this phase delivers]
125
+
126
+ </domain>
127
+
128
+ <decisions>
129
+ ## Implementation Decisions
130
+
131
+ {For each requirement/story/criterion in the PRD:}
132
+ ### [Category derived from content]
133
+ - [Requirement as locked decision]
134
+
135
+ ### Claude's Discretion
136
+ [Areas not covered by PRD — implementation details, technical choices]
137
+
138
+ </decisions>
139
+
140
+ <canonical_refs>
141
+ ## Canonical References
142
+
143
+ **Downstream agents MUST read these before planning or implementing.**
144
+
145
+ [MANDATORY. Extract from ROADMAP.md and any docs referenced in the PRD.
146
+ Use full relative paths. Group by topic area.]
147
+
148
+ ### [Topic area]
149
+ - `path/to/spec-or-adr.md` — [What it decides/defines]
150
+
151
+ [If no external specs: "No external specs — requirements fully captured in decisions above"]
152
+
153
+ </canonical_refs>
154
+
155
+ <specifics>
156
+ ## Specific Ideas
157
+
158
+ [Any specific references, examples, or concrete requirements from PRD]
159
+
160
+ </specifics>
161
+
162
+ <deferred>
163
+ ## Deferred Ideas
164
+
165
+ [Items in PRD explicitly marked as future/v2/out-of-scope]
166
+ [If none: "None — PRD covers phase scope"]
167
+
168
+ </deferred>
169
+
170
+ ---
171
+
172
+ *Phase: XX-name*
173
+ *Context gathered: [date] via PRD Express Path*
174
+ ```
175
+
176
+ 5. Commit:
177
+ ```bash
178
+ node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" commit "docs(${padded_phase}): generate context from PRD" --files "${phase_dir}/${padded_phase}-CONTEXT.md"
179
+ ```
180
+
181
+ 6. Set `context_content` to the generated CONTEXT.md content and continue to step 5 (Handle Research).
182
+
183
+ **Effect:** This completely bypasses step 4 (Load CONTEXT.md) since we just created it. The rest of the workflow (research, planning, verification) proceeds normally with the PRD-derived context.
184
+
185
+ ## 4. Load CONTEXT.md
186
+
187
+ **Skip if:** PRD express path was used (CONTEXT.md already created in step 3.5).
188
+
189
+ Check `context_path` from init JSON.
190
+
191
+ If `context_path` is not null, display: `Using phase context from: ${context_path}`
192
+
193
+ **If `context_path` is null (no CONTEXT.md exists):**
194
+
195
+ Read discuss mode for context gate label:
196
+ ```bash
197
+ DISCUSS_MODE=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" config-get workflow.discuss_mode 2>/dev/null || echo "discuss")
198
+ ```
199
+
200
+ If `TEXT_MODE` is true, present as a plain-text numbered list:
201
+ ```
202
+ No CONTEXT.md found for Phase {X}. Plans will use research and requirements only — your design preferences won't be included.
203
+
204
+ 1. Continue without context — Plan using research + requirements only
205
+ [If DISCUSS_MODE is "assumptions":]
206
+ 2. Gather context (assumptions mode) — Analyze codebase and surface assumptions before planning
207
+ [If DISCUSS_MODE is "discuss" or unset:]
208
+ 2. Run discuss-phase first — Capture design decisions before planning
209
+
210
+ Enter number:
211
+ ```
212
+
213
+ Otherwise use AskUserQuestion:
214
+ - header: "No context"
215
+ - question: "No CONTEXT.md found for Phase {X}. Plans will use research and requirements only — your design preferences won't be included. Continue or capture context first?"
216
+ - options:
217
+ - "Continue without context" — Plan using research + requirements only
218
+ If `DISCUSS_MODE` is `"assumptions"`:
219
+ - "Gather context (assumptions mode)" — Analyze codebase and surface assumptions before planning
220
+ If `DISCUSS_MODE` is `"discuss"` (or unset):
221
+ - "Run discuss-phase first" — Capture design decisions before planning
222
+
223
+ If "Continue without context": Proceed to step 5.
224
+ If "Run discuss-phase first":
225
+ **IMPORTANT:** Do NOT invoke discuss-phase as a nested Skill/Task call — AskUserQuestion
226
+ does not work correctly in nested subcontexts (#1009). Instead, display the command
227
+ and exit so the user runs it as a top-level command:
228
+ ```
229
+ Run this command first, then re-run /gsd:plan-phase {X} ${GSD_WS}:
230
+
231
+ /gsd:discuss-phase {X} ${GSD_WS}
232
+ ```
233
+ **Exit the plan-phase workflow. Do not continue.**
234
+
235
+ ## 5. Handle Research
236
+
237
+ **Skip if:** `--gaps` flag or `--skip-research` flag or `--reviews` flag.
238
+
239
+ **If `has_research` is true (from init) AND no `--research` flag:** Use existing, skip to step 6.
240
+
241
+ **If RESEARCH.md missing OR `--research` flag:**
242
+
243
+ **If no explicit flag (`--research` or `--skip-research`) and not `--auto`:**
244
+ Ask the user whether to research, with a contextual recommendation based on the phase:
245
+
246
+ If `TEXT_MODE` is true, present as a plain-text numbered list:
247
+ ```
248
+ Research before planning Phase {X}: {phase_name}?
249
+
250
+ 1. Research first (Recommended) — Investigate domain, patterns, and dependencies before planning. Best for new features, unfamiliar integrations, or architectural changes.
251
+ 2. Skip research — Plan directly from context and requirements. Best for bug fixes, simple refactors, or well-understood tasks.
252
+
253
+ Enter number:
254
+ ```
255
+
256
+ Otherwise use AskUserQuestion:
257
+ ```
258
+ AskUserQuestion([
259
+ {
260
+ question: "Research before planning Phase {X}: {phase_name}?",
261
+ header: "Research",
262
+ multiSelect: false,
263
+ options: [
264
+ { label: "Research first (Recommended)", description: "Investigate domain, patterns, and dependencies before planning. Best for new features, unfamiliar integrations, or architectural changes." },
265
+ { label: "Skip research", description: "Plan directly from context and requirements. Best for bug fixes, simple refactors, or well-understood tasks." }
266
+ ]
267
+ }
268
+ ])
269
+ ```
270
+
271
+ If user selects "Skip research": skip to step 6.
272
+
273
+ **If `--auto` and `research_enabled` is false:** Skip research silently (preserves automated behavior).
274
+
275
+ Display banner:
276
+ ```
277
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
278
+ GSD ► RESEARCHING PHASE {X}
279
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
280
+
281
+ ◆ Spawning researcher...
282
+ ```
283
+
284
+ ### Spawn gsd-phase-researcher
285
+
286
+ ```bash
287
+ PHASE_DESC=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" roadmap get-phase "${PHASE}" --pick section)
288
+ ```
289
+
290
+ Research prompt:
291
+
292
+ ```markdown
293
+ <objective>
294
+ Research how to implement Phase {phase_number}: {phase_name}
295
+ Answer: "What do I need to know to PLAN this phase well?"
296
+ </objective>
297
+
298
+ <files_to_read>
299
+ - {context_path} (USER DECISIONS from /gsd:discuss-phase)
300
+ - {requirements_path} (Project requirements)
301
+ - {state_path} (Project decisions and history)
302
+ </files_to_read>
303
+
304
+ ${AGENT_SKILLS_RESEARCHER}
305
+
306
+ <additional_context>
307
+ **Phase description:** {phase_description}
308
+ **Phase requirement IDs (MUST address):** {phase_req_ids}
309
+
310
+ **Project instructions:** Read ./CLAUDE.md if exists — follow project-specific guidelines
311
+ **Project skills:** Check .claude/skills/ or .agents/skills/ directory (if either exists) — read SKILL.md files, research should account for project skill patterns
312
+ </additional_context>
313
+
314
+ <output>
315
+ Write to: {phase_dir}/{phase_num}-RESEARCH.md
316
+ </output>
317
+ ```
318
+
319
+ ```
320
+ Task(
321
+ prompt=research_prompt,
322
+ subagent_type="gsd-phase-researcher",
323
+ model="{researcher_model}",
324
+ description="Research Phase {phase}"
325
+ )
326
+ ```
327
+
328
+ ### Handle Researcher Return
329
+
330
+ - **`## RESEARCH COMPLETE`:** Display confirmation, continue to step 6
331
+ - **`## RESEARCH BLOCKED`:** Display blocker, offer: 1) Provide context, 2) Skip research, 3) Abort
332
+
333
+ ## 5.5. Create Validation Strategy
334
+
335
+ Skip if `nyquist_validation_enabled` is false OR `research_enabled` is false.
336
+
337
+ If `research_enabled` is false and `nyquist_validation_enabled` is true: warn "Nyquist validation enabled but research disabled — VALIDATION.md cannot be created without RESEARCH.md. Plans will lack validation requirements (Dimension 8)." Continue to step 6.
338
+
339
+ **But Nyquist is not applicable for this run** when all of the following are true:
340
+ - `research_enabled` is false
341
+ - `has_research` is false
342
+ - no `--research` flag was provided
343
+
344
+ In that case: **skip validation-strategy creation entirely**. Do **not** expect `RESEARCH.md` or `VALIDATION.md` for this run, and continue to Step 6.
345
+
346
+ ```bash
347
+ grep -l "## Validation Architecture" "${PHASE_DIR}"/*-RESEARCH.md 2>/dev/null || true
348
+ ```
349
+
350
+ **If found:**
351
+ 1. Read template: `~/.claude/get-shit-done/templates/VALIDATION.md`
352
+ 2. Write to `${PHASE_DIR}/${PADDED_PHASE}-VALIDATION.md` (use Write tool)
353
+ 3. Fill frontmatter: `{N}` → phase number, `{phase-slug}` → slug, `{date}` → current date
354
+ 4. Verify:
355
+ ```bash
356
+ test -f "${PHASE_DIR}/${PADDED_PHASE}-VALIDATION.md" && echo "VALIDATION_CREATED=true" || echo "VALIDATION_CREATED=false"
357
+ ```
358
+ 5. If `VALIDATION_CREATED=false`: STOP — do not proceed to Step 6
359
+ 6. If `commit_docs`: `commit "docs(phase-${PHASE}): add validation strategy"`
360
+
361
+ **If not found:** Warn and continue — plans may fail Dimension 8.
362
+
363
+ ## 5.6. UI Design Contract Gate
364
+
365
+ > Skip if `workflow.ui_phase` is explicitly `false` AND `workflow.ui_safety_gate` is explicitly `false` in `.planning/config.json`. If keys are absent, treat as enabled.
366
+
367
+ ```bash
368
+ UI_PHASE_CFG=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" config-get workflow.ui_phase 2>/dev/null || echo "true")
369
+ UI_GATE_CFG=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" config-get workflow.ui_safety_gate 2>/dev/null || echo "true")
370
+ ```
371
+
372
+ **If both are `false`:** Skip to step 6.
373
+
374
+ Check if phase has frontend indicators:
375
+
376
+ ```bash
377
+ PHASE_SECTION=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" roadmap get-phase "${PHASE}" 2>/dev/null)
378
+ echo "$PHASE_SECTION" | grep -iE "UI|interface|frontend|component|layout|page|screen|view|form|dashboard|widget" > /dev/null 2>&1
379
+ HAS_UI=$?
380
+ ```
381
+
382
+ **If `HAS_UI` is 0 (frontend indicators found):**
383
+
384
+ Check for existing UI-SPEC:
385
+ ```bash
386
+ UI_SPEC_FILE=$(ls "${PHASE_DIR}"/*-UI-SPEC.md 2>/dev/null | head -1)
387
+ ```
388
+
389
+ **If UI-SPEC.md found:** Set `UI_SPEC_PATH=$UI_SPEC_FILE`. Display: `Using UI design contract: ${UI_SPEC_PATH}`
390
+
391
+ **If UI-SPEC.md missing AND `UI_GATE_CFG` is `true`:**
392
+
393
+ If `TEXT_MODE` is true, present as a plain-text numbered list:
394
+ ```
395
+ Phase {N} has frontend indicators but no UI-SPEC.md. Generate a design contract before planning?
396
+
397
+ 1. Generate UI-SPEC first — Run /gsd:ui-phase {N} then re-run /gsd:plan-phase {N}
398
+ 2. Continue without UI-SPEC
399
+ 3. Not a frontend phase
400
+
401
+ Enter number:
402
+ ```
403
+
404
+ Otherwise use AskUserQuestion:
405
+ - header: "UI Design Contract"
406
+ - question: "Phase {N} has frontend indicators but no UI-SPEC.md. Generate a design contract before planning?"
407
+ - options:
408
+ - "Generate UI-SPEC first" → Display: "Run `/gsd:ui-phase {N} ${GSD_WS}` then re-run `/gsd:plan-phase {N} ${GSD_WS}`". Exit workflow.
409
+ - "Continue without UI-SPEC" → Continue to step 6.
410
+ - "Not a frontend phase" → Continue to step 6.
411
+
412
+ **If `HAS_UI` is 1 (no frontend indicators):** Skip silently to step 6.
413
+
414
+ ## 6. Check Existing Plans
415
+
416
+ ```bash
417
+ ls "${PHASE_DIR}"/*-PLAN.md 2>/dev/null || true
418
+ ```
419
+
420
+ **If exists AND `--reviews` flag:** Skip prompt — go straight to replanning (the purpose of `--reviews` is to replan with review feedback).
421
+
422
+ **If exists AND no `--reviews` flag:** Offer: 1) Add more plans, 2) View existing, 3) Replan from scratch.
423
+
424
+ ## 7. Use Context Paths from INIT
425
+
426
+ Extract from INIT JSON:
427
+
428
+ ```bash
429
+ _gsd_field() { node -e "const o=JSON.parse(process.argv[1]); const v=o[process.argv[2]]; process.stdout.write(v==null?'':String(v))" "$1" "$2"; }
430
+ STATE_PATH=$(_gsd_field "$INIT" state_path)
431
+ ROADMAP_PATH=$(_gsd_field "$INIT" roadmap_path)
432
+ REQUIREMENTS_PATH=$(_gsd_field "$INIT" requirements_path)
433
+ RESEARCH_PATH=$(_gsd_field "$INIT" research_path)
434
+ VERIFICATION_PATH=$(_gsd_field "$INIT" verification_path)
435
+ UAT_PATH=$(_gsd_field "$INIT" uat_path)
436
+ CONTEXT_PATH=$(_gsd_field "$INIT" context_path)
437
+ REVIEWS_PATH=$(_gsd_field "$INIT" reviews_path)
438
+ ```
439
+
440
+ ## 7.5. Verify Nyquist Artifacts
441
+
442
+ Skip if `nyquist_validation_enabled` is false OR `research_enabled` is false.
443
+
444
+ Also skip if all of the following are true:
445
+ - `research_enabled` is false
446
+ - `has_research` is false
447
+ - no `--research` flag was provided
448
+
449
+ In that no-research path, Nyquist artifacts are **not required** for this run.
450
+
451
+ ```bash
452
+ VALIDATION_EXISTS=$(ls "${PHASE_DIR}"/*-VALIDATION.md 2>/dev/null | head -1)
453
+ ```
454
+
455
+ If missing and Nyquist is still enabled/applicable — ask user:
456
+ 1. Re-run: `/gsd:plan-phase {PHASE} --research ${GSD_WS}`
457
+ 2. Disable Nyquist with the exact command:
458
+ `node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" config-set workflow.nyquist_validation false`
459
+ 3. Continue anyway (plans fail Dimension 8)
460
+
461
+ Proceed to Step 8 only if user selects 2 or 3.
462
+
463
+ ## 8. Spawn gsd-planner Agent
464
+
465
+ Display banner:
466
+ ```
467
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
468
+ GSD ► PLANNING PHASE {X}
469
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
470
+
471
+ ◆ Spawning planner...
472
+ ```
473
+
474
+ Planner prompt:
475
+
476
+ ```markdown
477
+ <planning_context>
478
+ **Phase:** {phase_number}
479
+ **Mode:** {standard | gap_closure | reviews}
480
+
481
+ <files_to_read>
482
+ - {state_path} (Project State)
483
+ - {roadmap_path} (Roadmap)
484
+ - {requirements_path} (Requirements)
485
+ - {context_path} (USER DECISIONS from /gsd:discuss-phase)
486
+ - {research_path} (Technical Research)
487
+ - {verification_path} (Verification Gaps - if --gaps)
488
+ - {uat_path} (UAT Gaps - if --gaps)
489
+ - {reviews_path} (Cross-AI Review Feedback - if --reviews)
490
+ - {UI_SPEC_PATH} (UI Design Contract — visual/interaction specs, if exists)
491
+ </files_to_read>
492
+
493
+ ${AGENT_SKILLS_PLANNER}
494
+
495
+ **Phase requirement IDs (every ID MUST appear in a plan's `requirements` field):** {phase_req_ids}
496
+
497
+ **Project instructions:** Read ./CLAUDE.md if exists — follow project-specific guidelines
498
+ **Project skills:** Check .claude/skills/ or .agents/skills/ directory (if either exists) — read SKILL.md files, plans should account for project skill rules
499
+ </planning_context>
500
+
501
+ <downstream_consumer>
502
+ Output consumed by /gsd:execute-phase. Plans need:
503
+ - Frontmatter (wave, depends_on, files_modified, autonomous)
504
+ - Tasks in XML format with read_first and acceptance_criteria fields (MANDATORY on every task)
505
+ - Verification criteria
506
+ - must_haves for goal-backward verification
507
+ </downstream_consumer>
508
+
509
+ <deep_work_rules>
510
+ ## Anti-Shallow Execution Rules (MANDATORY)
511
+
512
+ Every task MUST include these fields — they are NOT optional:
513
+
514
+ 1. **`<read_first>`** — Files the executor MUST read before touching anything. Always include:
515
+ - The file being modified (so executor sees current state, not assumptions)
516
+ - Any "source of truth" file referenced in CONTEXT.md (reference implementations, existing patterns, config files, schemas)
517
+ - Any file whose patterns, signatures, types, or conventions must be replicated or respected
518
+
519
+ 2. **`<acceptance_criteria>`** — Verifiable conditions that prove the task was done correctly. Rules:
520
+ - Every criterion must be checkable with grep, file read, test command, or CLI output
521
+ - NEVER use subjective language ("looks correct", "properly configured", "consistent with")
522
+ - ALWAYS include exact strings, patterns, values, or command outputs that must be present
523
+ - Examples:
524
+ - Code: `auth.py contains def verify_token(` / `test_auth.py exits 0`
525
+ - Config: `.env.example contains DATABASE_URL=` / `Dockerfile contains HEALTHCHECK`
526
+ - Docs: `README.md contains '## Installation'` / `API.md lists all endpoints`
527
+ - Infra: `deploy.yml has rollback step` / `docker-compose.yml has healthcheck for db`
528
+
529
+ 3. **`<action>`** — Must include CONCRETE values, not references. Rules:
530
+ - NEVER say "align X with Y", "match X to Y", "update to be consistent" without specifying the exact target state
531
+ - ALWAYS include the actual values: config keys, function signatures, SQL statements, class names, import paths, env vars, etc.
532
+ - If CONTEXT.md has a comparison table or expected values, copy them into the action verbatim
533
+ - The executor should be able to complete the task from the action text alone, without needing to read CONTEXT.md or reference files (read_first is for verification, not discovery)
534
+
535
+ **Why this matters:** Executor agents work from the plan text. Vague instructions like "update the config to match production" produce shallow one-line changes. Concrete instructions like "add DATABASE_URL=postgresql://... , set POOL_SIZE=20, add REDIS_URL=redis://..." produce complete work. The cost of verbose plans is far less than the cost of re-doing shallow execution.
536
+ </deep_work_rules>
537
+
538
+ <quality_gate>
539
+ - [ ] PLAN.md files created in phase directory
540
+ - [ ] Each plan has valid frontmatter
541
+ - [ ] Tasks are specific and actionable
542
+ - [ ] Every task has `<read_first>` with at least the file being modified
543
+ - [ ] Every task has `<acceptance_criteria>` with grep-verifiable conditions
544
+ - [ ] Every `<action>` contains concrete values (no "align X with Y" without specifying what)
545
+ - [ ] Dependencies correctly identified
546
+ - [ ] Waves assigned for parallel execution
547
+ - [ ] must_haves derived from phase goal
548
+ </quality_gate>
549
+ ```
550
+
551
+ ```
552
+ Task(
553
+ prompt=filled_prompt,
554
+ subagent_type="gsd-planner",
555
+ model="{planner_model}",
556
+ description="Plan Phase {phase}"
557
+ )
558
+ ```
559
+
560
+ ## 9. Handle Planner Return
561
+
562
+ - **`## PLANNING COMPLETE`:** Display plan count. If `--skip-verify` or `plan_checker_enabled` is false (from init): skip to step 13. Otherwise: step 10.
563
+ - **`## CHECKPOINT REACHED`:** Present to user, get response, spawn continuation (step 12)
564
+ - **`## PLANNING INCONCLUSIVE`:** Show attempts, offer: Add context / Retry / Manual
565
+
566
+ ## 10. Spawn gsd-plan-checker Agent
567
+
568
+ Display banner:
569
+ ```
570
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
571
+ GSD ► VERIFYING PLANS
572
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
573
+
574
+ ◆ Spawning plan checker...
575
+ ```
576
+
577
+ Checker prompt:
578
+
579
+ ```markdown
580
+ <verification_context>
581
+ **Phase:** {phase_number}
582
+ **Phase Goal:** {goal from ROADMAP}
583
+
584
+ <files_to_read>
585
+ - {PHASE_DIR}/*-PLAN.md (Plans to verify)
586
+ - {roadmap_path} (Roadmap)
587
+ - {requirements_path} (Requirements)
588
+ - {context_path} (USER DECISIONS from /gsd:discuss-phase)
589
+ - {research_path} (Technical Research — includes Validation Architecture)
590
+ </files_to_read>
591
+
592
+ ${AGENT_SKILLS_CHECKER}
593
+
594
+ **Phase requirement IDs (MUST ALL be covered):** {phase_req_ids}
595
+
596
+ **Project instructions:** Read ./CLAUDE.md if exists — verify plans honor project guidelines
597
+ **Project skills:** Check .claude/skills/ or .agents/skills/ directory (if either exists) — verify plans account for project skill rules
598
+ </verification_context>
599
+
600
+ <expected_output>
601
+ - ## VERIFICATION PASSED — all checks pass
602
+ - ## ISSUES FOUND — structured issue list
603
+ </expected_output>
604
+ ```
605
+
606
+ ```
607
+ Task(
608
+ prompt=checker_prompt,
609
+ subagent_type="gsd-plan-checker",
610
+ model="{checker_model}",
611
+ description="Verify Phase {phase} plans"
612
+ )
613
+ ```
614
+
615
+ ## 11. Handle Checker Return
616
+
617
+ - **`## VERIFICATION PASSED`:** Display confirmation, proceed to step 13.
618
+ - **`## ISSUES FOUND`:** Display issues, check iteration count, proceed to step 12.
619
+
620
+ ## 12. Revision Loop (Max 3 Iterations)
621
+
622
+ Track `iteration_count` (starts at 1 after initial plan + check).
623
+
624
+ **If iteration_count < 3:**
625
+
626
+ Display: `Sending back to planner for revision... (iteration {N}/3)`
627
+
628
+ Revision prompt:
629
+
630
+ ```markdown
631
+ <revision_context>
632
+ **Phase:** {phase_number}
633
+ **Mode:** revision
634
+
635
+ <files_to_read>
636
+ - {PHASE_DIR}/*-PLAN.md (Existing plans)
637
+ - {context_path} (USER DECISIONS from /gsd:discuss-phase)
638
+ </files_to_read>
639
+
640
+ ${AGENT_SKILLS_PLANNER}
641
+
642
+ **Checker issues:** {structured_issues_from_checker}
643
+ </revision_context>
644
+
645
+ <instructions>
646
+ Make targeted updates to address checker issues.
647
+ Do NOT replan from scratch unless issues are fundamental.
648
+ Return what changed.
649
+ </instructions>
650
+ ```
651
+
652
+ ```
653
+ Task(
654
+ prompt=revision_prompt,
655
+ subagent_type="gsd-planner",
656
+ model="{planner_model}",
657
+ description="Revise Phase {phase} plans"
658
+ )
659
+ ```
660
+
661
+ After planner returns -> spawn checker again (step 10), increment iteration_count.
662
+
663
+ **If iteration_count >= 3:**
664
+
665
+ Display: `Max iterations reached. {N} issues remain:` + issue list
666
+
667
+ Offer: 1) Force proceed, 2) Provide guidance and retry, 3) Abandon
668
+
669
+ ## 13. Requirements Coverage Gate
670
+
671
+ After plans pass the checker (or checker is skipped), verify that all phase requirements are covered by at least one plan.
672
+
673
+ **Skip if:** `phase_req_ids` is null or TBD (no requirements mapped to this phase).
674
+
675
+ **Step 1: Extract requirement IDs claimed by plans**
676
+ ```bash
677
+ # Collect all requirement IDs from plan frontmatter
678
+ PLAN_REQS=$(grep -h "requirements_addressed\|requirements:" ${PHASE_DIR}/*-PLAN.md 2>/dev/null | tr -d '[]' | tr ',' '\n' | sed 's/^[[:space:]]*//' | sort -u)
679
+ ```
680
+
681
+ **Step 2: Compare against phase requirements from ROADMAP**
682
+
683
+ For each REQ-ID in `phase_req_ids`:
684
+ - If REQ-ID appears in `PLAN_REQS` → covered ✓
685
+ - If REQ-ID does NOT appear in any plan → uncovered ✗
686
+
687
+ **Step 3: Check CONTEXT.md features against plan objectives**
688
+
689
+ Read CONTEXT.md `<decisions>` section. Extract feature/capability names. Check each against plan `<objective>` blocks. Features not mentioned in any plan objective → potentially dropped.
690
+
691
+ **Step 4: Report**
692
+
693
+ If all requirements covered and no dropped features:
694
+ ```
695
+ ✓ Requirements coverage: {N}/{N} REQ-IDs covered by plans
696
+ ```
697
+ → Proceed to step 14.
698
+
699
+ If gaps found:
700
+ ```
701
+ ## ⚠ Requirements Coverage Gap
702
+
703
+ {M} of {N} phase requirements are not assigned to any plan:
704
+
705
+ | REQ-ID | Description | Plans |
706
+ |--------|-------------|-------|
707
+ | {id} | {from REQUIREMENTS.md} | None |
708
+
709
+ {K} CONTEXT.md features not found in plan objectives:
710
+ - {feature_name} — described in CONTEXT.md but no plan covers it
711
+
712
+ Options:
713
+ 1. Re-plan to include missing requirements (recommended)
714
+ 2. Move uncovered requirements to next phase
715
+ 3. Proceed anyway — accept coverage gaps
716
+ ```
717
+
718
+ If `TEXT_MODE` is true, present as a plain-text numbered list (options already shown in the block above). Otherwise use AskUserQuestion to present the options.
719
+
720
+ ## 14. Present Final Status
721
+
722
+ Route to `<offer_next>` OR `auto_advance` depending on flags/config.
723
+
724
+ ## 15. Auto-Advance Check
725
+
726
+ Check for auto-advance trigger:
727
+
728
+ 1. Parse `--auto` flag from $ARGUMENTS
729
+ 2. **Sync chain flag with intent** — if user invoked manually (no `--auto`), clear the ephemeral chain flag from any previous interrupted `--auto` chain. This does NOT touch `workflow.auto_advance` (the user's persistent settings preference):
730
+ ```bash
731
+ if [[ ! "$ARGUMENTS" =~ --auto ]]; then
732
+ node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" config-set workflow._auto_chain_active false 2>/dev/null
733
+ fi
734
+ ```
735
+ 3. Read both the chain flag and user preference:
736
+ ```bash
737
+ AUTO_CHAIN=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" config-get workflow._auto_chain_active 2>/dev/null || echo "false")
738
+ AUTO_CFG=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" config-get workflow.auto_advance 2>/dev/null || echo "false")
739
+ ```
740
+
741
+ **If `--auto` flag present OR `AUTO_CHAIN` is true OR `AUTO_CFG` is true:**
742
+
743
+ Display banner:
744
+ ```
745
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
746
+ GSD ► AUTO-ADVANCING TO EXECUTE
747
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
748
+
749
+ Plans ready. Launching execute-phase...
750
+ ```
751
+
752
+ Launch execute-phase using the Skill tool to avoid nested Task sessions (which cause runtime freezes due to deep agent nesting):
753
+ ```
754
+ Skill(skill="gsd:execute-phase", args="${PHASE} --auto --no-transition ${GSD_WS}")
755
+ ```
756
+
757
+ The `--no-transition` flag tells execute-phase to return status after verification instead of chaining further. This keeps the auto-advance chain flat — each phase runs at the same nesting level rather than spawning deeper Task agents.
758
+
759
+ **Handle execute-phase return:**
760
+ - **PHASE COMPLETE** → Display final summary:
761
+ ```
762
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
763
+ GSD ► PHASE ${PHASE} COMPLETE ✓
764
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
765
+
766
+ Auto-advance pipeline finished.
767
+
768
+ Next: /gsd:discuss-phase ${NEXT_PHASE} --auto ${GSD_WS}
769
+ ```
770
+ - **GAPS FOUND / VERIFICATION FAILED** → Display result, stop chain:
771
+ ```
772
+ Auto-advance stopped: Execution needs review.
773
+
774
+ Review the output above and continue manually:
775
+ /gsd:execute-phase ${PHASE} ${GSD_WS}
776
+ ```
777
+
778
+ **If neither `--auto` nor config enabled:**
779
+ Route to `<offer_next>` (existing behavior).
780
+
781
+ </process>
782
+
783
+ <offer_next>
784
+ Output this markdown directly (not as a code block):
785
+
786
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
787
+ GSD ► PHASE {X} PLANNED ✓
788
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
789
+
790
+ **Phase {X}: {Name}** — {N} plan(s) in {M} wave(s)
791
+
792
+ | Wave | Plans | What it builds |
793
+ |------|-------|----------------|
794
+ | 1 | 01, 02 | [objectives] |
795
+ | 2 | 03 | [objective] |
796
+
797
+ Research: {Completed | Used existing | Skipped}
798
+ Verification: {Passed | Passed with override | Skipped}
799
+
800
+ ───────────────────────────────────────────────────────────────
801
+
802
+ ## ▶ Next Up
803
+
804
+ **Execute Phase {X}** — run all {N} plans
805
+
806
+ /gsd:execute-phase {X} ${GSD_WS}
807
+
808
+ <sub>/clear first → fresh context window</sub>
809
+
810
+ ───────────────────────────────────────────────────────────────
811
+
812
+ **Also available:**
813
+ - cat .planning/phases/{phase-dir}/*-PLAN.md — review plans
814
+ - /gsd:plan-phase {X} --research — re-research first
815
+ - /gsd:review --phase {X} --all — peer review plans with external AIs
816
+ - /gsd:plan-phase {X} --reviews — replan incorporating review feedback
817
+
818
+ ───────────────────────────────────────────────────────────────
819
+ </offer_next>
820
+
821
+ <windows_troubleshooting>
822
+ **Windows users:** If plan-phase freezes during agent spawning (common on Windows due to
823
+ stdio deadlocks with MCP servers — see Claude Code issue anthropics/claude-code#28126):
824
+
825
+ 1. **Force-kill:** Close the terminal (Ctrl+C may not work)
826
+ 2. **Clean up orphaned processes:**
827
+ ```powershell
828
+ # Kill orphaned node processes from stale MCP servers
829
+ Get-Process node -ErrorAction SilentlyContinue | Where-Object {$_.StartTime -lt (Get-Date).AddHours(-1)} | Stop-Process -Force
830
+ ```
831
+ 3. **Clean up stale task directories:**
832
+ ```powershell
833
+ # Remove stale subagent task dirs (Claude Code never cleans these on crash)
834
+ Remove-Item -Recurse -Force "$env:USERPROFILE\.claude\tasks\*" -ErrorAction SilentlyContinue
835
+ ```
836
+ 4. **Reduce MCP server count:** Temporarily disable non-essential MCP servers in settings.json
837
+ 5. **Retry:** Restart Claude Code and run `/gsd:plan-phase` again
838
+
839
+ If freezes persist, try `--skip-research` to reduce the agent chain from 3 to 2 agents:
840
+ ```
841
+ /gsd:plan-phase N --skip-research
842
+ ```
843
+ </windows_troubleshooting>
844
+
845
+ <success_criteria>
846
+ - [ ] .planning/ directory validated
847
+ - [ ] Phase validated against roadmap
848
+ - [ ] Phase directory created if needed
849
+ - [ ] CONTEXT.md loaded early (step 4) and passed to ALL agents
850
+ - [ ] Research completed (unless --skip-research or --gaps or exists)
851
+ - [ ] gsd-phase-researcher spawned with CONTEXT.md
852
+ - [ ] Existing plans checked
853
+ - [ ] gsd-planner spawned with CONTEXT.md + RESEARCH.md
854
+ - [ ] Plans created (PLANNING COMPLETE or CHECKPOINT handled)
855
+ - [ ] gsd-plan-checker spawned with CONTEXT.md
856
+ - [ ] Verification passed OR user override OR max iterations with user decision
857
+ - [ ] User sees status between agent spawns
858
+ - [ ] User knows next steps
859
+ </success_criteria>