@m3hti/commit-genie 3.2.0 → 3.3.1

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/.claude/agents/gsd-codebase-mapper.md +764 -0
  2. package/.claude/agents/gsd-debugger.md +1246 -0
  3. package/.claude/agents/gsd-executor.md +469 -0
  4. package/.claude/agents/gsd-integration-checker.md +443 -0
  5. package/.claude/agents/gsd-phase-researcher.md +546 -0
  6. package/.claude/agents/gsd-plan-checker.md +690 -0
  7. package/.claude/agents/gsd-planner.md +1275 -0
  8. package/.claude/agents/gsd-project-researcher.md +621 -0
  9. package/.claude/agents/gsd-research-synthesizer.md +239 -0
  10. package/.claude/agents/gsd-roadmapper.md +642 -0
  11. package/.claude/agents/gsd-verifier.md +573 -0
  12. package/.claude/commands/gsd/add-phase.md +43 -0
  13. package/.claude/commands/gsd/add-tests.md +41 -0
  14. package/.claude/commands/gsd/add-todo.md +47 -0
  15. package/.claude/commands/gsd/audit-milestone.md +36 -0
  16. package/.claude/commands/gsd/check-todos.md +45 -0
  17. package/.claude/commands/gsd/cleanup.md +18 -0
  18. package/.claude/commands/gsd/complete-milestone.md +136 -0
  19. package/.claude/commands/gsd/debug.md +167 -0
  20. package/.claude/commands/gsd/discuss-phase.md +83 -0
  21. package/.claude/commands/gsd/execute-phase.md +41 -0
  22. package/.claude/commands/gsd/health.md +22 -0
  23. package/.claude/commands/gsd/help.md +22 -0
  24. package/.claude/commands/gsd/insert-phase.md +32 -0
  25. package/.claude/commands/gsd/join-discord.md +18 -0
  26. package/.claude/commands/gsd/list-phase-assumptions.md +46 -0
  27. package/.claude/commands/gsd/map-codebase.md +71 -0
  28. package/.claude/commands/gsd/new-milestone.md +44 -0
  29. package/.claude/commands/gsd/new-project.md +42 -0
  30. package/.claude/commands/gsd/new-project.md.bak +1041 -0
  31. package/.claude/commands/gsd/pause-work.md +38 -0
  32. package/.claude/commands/gsd/plan-milestone-gaps.md +34 -0
  33. package/.claude/commands/gsd/plan-phase.md +45 -0
  34. package/.claude/commands/gsd/progress.md +24 -0
  35. package/.claude/commands/gsd/quick.md +41 -0
  36. package/.claude/commands/gsd/reapply-patches.md +110 -0
  37. package/.claude/commands/gsd/remove-phase.md +31 -0
  38. package/.claude/commands/gsd/research-phase.md +189 -0
  39. package/.claude/commands/gsd/resume-work.md +40 -0
  40. package/.claude/commands/gsd/set-profile.md +34 -0
  41. package/.claude/commands/gsd/settings.md +36 -0
  42. package/.claude/commands/gsd/update.md +37 -0
  43. package/.claude/commands/gsd/verify-work.md +38 -0
  44. package/.claude/get-shit-done/VERSION +1 -0
  45. package/.claude/get-shit-done/bin/gsd-tools.cjs +588 -0
  46. package/.claude/get-shit-done/bin/lib/commands.cjs +553 -0
  47. package/.claude/get-shit-done/bin/lib/config.cjs +162 -0
  48. package/.claude/get-shit-done/bin/lib/core.cjs +411 -0
  49. package/.claude/get-shit-done/bin/lib/frontmatter.cjs +299 -0
  50. package/.claude/get-shit-done/bin/lib/init.cjs +710 -0
  51. package/.claude/get-shit-done/bin/lib/milestone.cjs +216 -0
  52. package/.claude/get-shit-done/bin/lib/phase.cjs +871 -0
  53. package/.claude/get-shit-done/bin/lib/roadmap.cjs +298 -0
  54. package/.claude/get-shit-done/bin/lib/state.cjs +679 -0
  55. package/.claude/get-shit-done/bin/lib/template.cjs +222 -0
  56. package/.claude/get-shit-done/bin/lib/verify.cjs +773 -0
  57. package/.claude/get-shit-done/references/checkpoints.md +776 -0
  58. package/.claude/get-shit-done/references/continuation-format.md +249 -0
  59. package/.claude/get-shit-done/references/decimal-phase-calculation.md +65 -0
  60. package/.claude/get-shit-done/references/git-integration.md +248 -0
  61. package/.claude/get-shit-done/references/git-planning-commit.md +38 -0
  62. package/.claude/get-shit-done/references/model-profile-resolution.md +34 -0
  63. package/.claude/get-shit-done/references/model-profiles.md +92 -0
  64. package/.claude/get-shit-done/references/phase-argument-parsing.md +61 -0
  65. package/.claude/get-shit-done/references/planning-config.md +196 -0
  66. package/.claude/get-shit-done/references/questioning.md +145 -0
  67. package/.claude/get-shit-done/references/tdd.md +263 -0
  68. package/.claude/get-shit-done/references/ui-brand.md +160 -0
  69. package/.claude/get-shit-done/references/verification-patterns.md +612 -0
  70. package/.claude/get-shit-done/templates/DEBUG.md +164 -0
  71. package/.claude/get-shit-done/templates/UAT.md +247 -0
  72. package/.claude/get-shit-done/templates/VALIDATION.md +76 -0
  73. package/.claude/get-shit-done/templates/codebase/architecture.md +255 -0
  74. package/.claude/get-shit-done/templates/codebase/concerns.md +310 -0
  75. package/.claude/get-shit-done/templates/codebase/conventions.md +307 -0
  76. package/.claude/get-shit-done/templates/codebase/integrations.md +280 -0
  77. package/.claude/get-shit-done/templates/codebase/stack.md +186 -0
  78. package/.claude/get-shit-done/templates/codebase/structure.md +285 -0
  79. package/.claude/get-shit-done/templates/codebase/testing.md +480 -0
  80. package/.claude/get-shit-done/templates/config.json +37 -0
  81. package/.claude/get-shit-done/templates/context.md +283 -0
  82. package/.claude/get-shit-done/templates/continue-here.md +78 -0
  83. package/.claude/get-shit-done/templates/debug-subagent-prompt.md +91 -0
  84. package/.claude/get-shit-done/templates/discovery.md +146 -0
  85. package/.claude/get-shit-done/templates/milestone-archive.md +123 -0
  86. package/.claude/get-shit-done/templates/milestone.md +115 -0
  87. package/.claude/get-shit-done/templates/phase-prompt.md +569 -0
  88. package/.claude/get-shit-done/templates/planner-subagent-prompt.md +117 -0
  89. package/.claude/get-shit-done/templates/project.md +184 -0
  90. package/.claude/get-shit-done/templates/requirements.md +231 -0
  91. package/.claude/get-shit-done/templates/research-project/ARCHITECTURE.md +204 -0
  92. package/.claude/get-shit-done/templates/research-project/FEATURES.md +147 -0
  93. package/.claude/get-shit-done/templates/research-project/PITFALLS.md +200 -0
  94. package/.claude/get-shit-done/templates/research-project/STACK.md +120 -0
  95. package/.claude/get-shit-done/templates/research-project/SUMMARY.md +170 -0
  96. package/.claude/get-shit-done/templates/research.md +552 -0
  97. package/.claude/get-shit-done/templates/retrospective.md +54 -0
  98. package/.claude/get-shit-done/templates/roadmap.md +202 -0
  99. package/.claude/get-shit-done/templates/state.md +176 -0
  100. package/.claude/get-shit-done/templates/summary-complex.md +59 -0
  101. package/.claude/get-shit-done/templates/summary-minimal.md +41 -0
  102. package/.claude/get-shit-done/templates/summary-standard.md +48 -0
  103. package/.claude/get-shit-done/templates/summary.md +248 -0
  104. package/.claude/get-shit-done/templates/user-setup.md +311 -0
  105. package/.claude/get-shit-done/templates/verification-report.md +322 -0
  106. package/.claude/get-shit-done/workflows/add-phase.md +111 -0
  107. package/.claude/get-shit-done/workflows/add-tests.md +350 -0
  108. package/.claude/get-shit-done/workflows/add-todo.md +157 -0
  109. package/.claude/get-shit-done/workflows/audit-milestone.md +297 -0
  110. package/.claude/get-shit-done/workflows/check-todos.md +176 -0
  111. package/.claude/get-shit-done/workflows/cleanup.md +152 -0
  112. package/.claude/get-shit-done/workflows/complete-milestone.md +763 -0
  113. package/.claude/get-shit-done/workflows/diagnose-issues.md +219 -0
  114. package/.claude/get-shit-done/workflows/discovery-phase.md +289 -0
  115. package/.claude/get-shit-done/workflows/discuss-phase.md +542 -0
  116. package/.claude/get-shit-done/workflows/execute-phase.md +449 -0
  117. package/.claude/get-shit-done/workflows/execute-plan.md +448 -0
  118. package/.claude/get-shit-done/workflows/health.md +156 -0
  119. package/.claude/get-shit-done/workflows/help.md +489 -0
  120. package/.claude/get-shit-done/workflows/insert-phase.md +129 -0
  121. package/.claude/get-shit-done/workflows/list-phase-assumptions.md +178 -0
  122. package/.claude/get-shit-done/workflows/map-codebase.md +315 -0
  123. package/.claude/get-shit-done/workflows/new-milestone.md +382 -0
  124. package/.claude/get-shit-done/workflows/new-project.md +1116 -0
  125. package/.claude/get-shit-done/workflows/pause-work.md +122 -0
  126. package/.claude/get-shit-done/workflows/plan-milestone-gaps.md +274 -0
  127. package/.claude/get-shit-done/workflows/plan-phase.md +569 -0
  128. package/.claude/get-shit-done/workflows/progress.md +381 -0
  129. package/.claude/get-shit-done/workflows/quick.md +453 -0
  130. package/.claude/get-shit-done/workflows/remove-phase.md +154 -0
  131. package/.claude/get-shit-done/workflows/research-phase.md +73 -0
  132. package/.claude/get-shit-done/workflows/resume-project.md +306 -0
  133. package/.claude/get-shit-done/workflows/set-profile.md +80 -0
  134. package/.claude/get-shit-done/workflows/settings.md +213 -0
  135. package/.claude/get-shit-done/workflows/transition.md +544 -0
  136. package/.claude/get-shit-done/workflows/update.md +219 -0
  137. package/.claude/get-shit-done/workflows/verify-phase.md +242 -0
  138. package/.claude/get-shit-done/workflows/verify-work.md +569 -0
  139. package/.claude/gsd-file-manifest.json +144 -0
  140. package/.claude/hooks/gsd-check-update.js +62 -0
  141. package/.claude/hooks/gsd-context-monitor.js +122 -0
  142. package/.claude/hooks/gsd-statusline.js +108 -0
  143. package/.claude/package.json +1 -0
  144. package/.claude/settings.json +49 -0
  145. package/dist/commands/generate.d.ts.map +1 -1
  146. package/dist/commands/generate.js +18 -8
  147. package/dist/commands/generate.js.map +1 -1
  148. package/dist/services/analyzerService.d.ts.map +1 -1
  149. package/dist/services/analyzerService.js +10 -0
  150. package/dist/services/analyzerService.js.map +1 -1
  151. package/dist/services/descriptionGenerator.d.ts.map +1 -1
  152. package/dist/services/descriptionGenerator.js +56 -14
  153. package/dist/services/descriptionGenerator.js.map +1 -1
  154. package/dist/services/fileContentAnalyzer.js +136 -17
  155. package/dist/services/fileContentAnalyzer.js.map +1 -1
  156. package/dist/services/fileContentAnalyzer.test.js +64 -0
  157. package/dist/services/fileContentAnalyzer.test.js.map +1 -1
  158. package/dist/services/semanticAnalyzer.js +20 -0
  159. package/dist/services/semanticAnalyzer.js.map +1 -1
  160. package/package.json +1 -1
@@ -0,0 +1,449 @@
1
+ <purpose>
2
+ Execute all plans in a phase using wave-based parallel execution. Orchestrator stays lean — delegates plan execution to subagents.
3
+ </purpose>
4
+
5
+ <core_principle>
6
+ Orchestrator coordinates, not executes. Each subagent loads the full execute-plan context. Orchestrator: discover plans → analyze deps → group waves → spawn agents → handle checkpoints → collect results.
7
+ </core_principle>
8
+
9
+ <required_reading>
10
+ Read STATE.md before any operation to load project context.
11
+ </required_reading>
12
+
13
+ <process>
14
+
15
+ <step name="initialize" priority="first">
16
+ Load all context in one call:
17
+
18
+ ```bash
19
+ INIT=$(node ./.claude/get-shit-done/bin/gsd-tools.cjs init execute-phase "${PHASE_ARG}")
20
+ ```
21
+
22
+ Parse JSON for: `executor_model`, `verifier_model`, `commit_docs`, `parallelization`, `branching_strategy`, `branch_name`, `phase_found`, `phase_dir`, `phase_number`, `phase_name`, `phase_slug`, `plans`, `incomplete_plans`, `plan_count`, `incomplete_count`, `state_exists`, `roadmap_exists`, `phase_req_ids`.
23
+
24
+ **If `phase_found` is false:** Error — phase directory not found.
25
+ **If `plan_count` is 0:** Error — no plans found in phase.
26
+ **If `state_exists` is false but `.planning/` exists:** Offer reconstruct or continue.
27
+
28
+ When `parallelization` is false, plans within a wave execute sequentially.
29
+ </step>
30
+
31
+ <step name="handle_branching">
32
+ Check `branching_strategy` from init:
33
+
34
+ **"none":** Skip, continue on current branch.
35
+
36
+ **"phase" or "milestone":** Use pre-computed `branch_name` from init:
37
+ ```bash
38
+ git checkout -b "$BRANCH_NAME" 2>/dev/null || git checkout "$BRANCH_NAME"
39
+ ```
40
+
41
+ All subsequent commits go to this branch. User handles merging.
42
+ </step>
43
+
44
+ <step name="validate_phase">
45
+ From init JSON: `phase_dir`, `plan_count`, `incomplete_count`.
46
+
47
+ Report: "Found {plan_count} plans in {phase_dir} ({incomplete_count} incomplete)"
48
+ </step>
49
+
50
+ <step name="discover_and_group_plans">
51
+ Load plan inventory with wave grouping in one call:
52
+
53
+ ```bash
54
+ PLAN_INDEX=$(node ./.claude/get-shit-done/bin/gsd-tools.cjs phase-plan-index "${PHASE_NUMBER}")
55
+ ```
56
+
57
+ Parse JSON for: `phase`, `plans[]` (each with `id`, `wave`, `autonomous`, `objective`, `files_modified`, `task_count`, `has_summary`), `waves` (map of wave number → plan IDs), `incomplete`, `has_checkpoints`.
58
+
59
+ **Filtering:** Skip plans where `has_summary: true`. If `--gaps-only`: also skip non-gap_closure plans. If all filtered: "No matching incomplete plans" → exit.
60
+
61
+ Report:
62
+ ```
63
+ ## Execution Plan
64
+
65
+ **Phase {X}: {Name}** — {total_plans} plans across {wave_count} waves
66
+
67
+ | Wave | Plans | What it builds |
68
+ |------|-------|----------------|
69
+ | 1 | 01-01, 01-02 | {from plan objectives, 3-8 words} |
70
+ | 2 | 01-03 | ... |
71
+ ```
72
+ </step>
73
+
74
+ <step name="execute_waves">
75
+ Execute each wave in sequence. Within a wave: parallel if `PARALLELIZATION=true`, sequential if `false`.
76
+
77
+ **For each wave:**
78
+
79
+ 1. **Describe what's being built (BEFORE spawning):**
80
+
81
+ Read each plan's `<objective>`. Extract what's being built and why.
82
+
83
+ ```
84
+ ---
85
+ ## Wave {N}
86
+
87
+ **{Plan ID}: {Plan Name}**
88
+ {2-3 sentences: what this builds, technical approach, why it matters}
89
+
90
+ Spawning {count} agent(s)...
91
+ ---
92
+ ```
93
+
94
+ - Bad: "Executing terrain generation plan"
95
+ - Good: "Procedural terrain generator using Perlin noise — creates height maps, biome zones, and collision meshes. Required before vehicle physics can interact with ground."
96
+
97
+ 2. **Spawn executor agents:**
98
+
99
+ Pass paths only — executors read files themselves with their fresh 200k context.
100
+ This keeps orchestrator context lean (~10-15%).
101
+
102
+ ```
103
+ Task(
104
+ subagent_type="gsd-executor",
105
+ model="{executor_model}",
106
+ prompt="
107
+ <objective>
108
+ Execute plan {plan_number} of phase {phase_number}-{phase_name}.
109
+ Commit each task atomically. Create SUMMARY.md. Update STATE.md and ROADMAP.md.
110
+ </objective>
111
+
112
+ <execution_context>
113
+ @./.claude/get-shit-done/workflows/execute-plan.md
114
+ @./.claude/get-shit-done/templates/summary.md
115
+ @./.claude/get-shit-done/references/checkpoints.md
116
+ @./.claude/get-shit-done/references/tdd.md
117
+ </execution_context>
118
+
119
+ <files_to_read>
120
+ Read these files at execution start using the Read tool:
121
+ - {phase_dir}/{plan_file} (Plan)
122
+ - .planning/STATE.md (State)
123
+ - .planning/config.json (Config, if exists)
124
+ - ./CLAUDE.md (Project instructions, if exists — follow project-specific guidelines and coding conventions)
125
+ - .agents/skills/ (Project skills, if exists — list skills, read SKILL.md for each, follow relevant rules during implementation)
126
+ </files_to_read>
127
+
128
+ <success_criteria>
129
+ - [ ] All tasks executed
130
+ - [ ] Each task committed individually
131
+ - [ ] SUMMARY.md created in plan directory
132
+ - [ ] STATE.md updated with position and decisions
133
+ - [ ] ROADMAP.md updated with plan progress (via `roadmap update-plan-progress`)
134
+ </success_criteria>
135
+ "
136
+ )
137
+ ```
138
+
139
+ 3. **Wait for all agents in wave to complete.**
140
+
141
+ 4. **Report completion — spot-check claims first:**
142
+
143
+ For each SUMMARY.md:
144
+ - Verify first 2 files from `key-files.created` exist on disk
145
+ - Check `git log --oneline --all --grep="{phase}-{plan}"` returns ≥1 commit
146
+ - Check for `## Self-Check: FAILED` marker
147
+
148
+ If ANY spot-check fails: report which plan failed, route to failure handler — ask "Retry plan?" or "Continue with remaining waves?"
149
+
150
+ If pass:
151
+ ```
152
+ ---
153
+ ## Wave {N} Complete
154
+
155
+ **{Plan ID}: {Plan Name}**
156
+ {What was built — from SUMMARY.md}
157
+ {Notable deviations, if any}
158
+
159
+ {If more waves: what this enables for next wave}
160
+ ---
161
+ ```
162
+
163
+ - Bad: "Wave 2 complete. Proceeding to Wave 3."
164
+ - Good: "Terrain system complete — 3 biome types, height-based texturing, physics collision meshes. Vehicle physics (Wave 3) can now reference ground surfaces."
165
+
166
+ 5. **Handle failures:**
167
+
168
+ **Known Claude Code bug (classifyHandoffIfNeeded):** If an agent reports "failed" with error containing `classifyHandoffIfNeeded is not defined`, this is a Claude Code runtime bug — not a GSD or agent issue. The error fires in the completion handler AFTER all tool calls finish. In this case: run the same spot-checks as step 4 (SUMMARY.md exists, git commits present, no Self-Check: FAILED). If spot-checks PASS → treat as **successful**. If spot-checks FAIL → treat as real failure below.
169
+
170
+ For real failures: report which plan failed → ask "Continue?" or "Stop?" → if continue, dependent plans may also fail. If stop, partial completion report.
171
+
172
+ 6. **Execute checkpoint plans between waves** — see `<checkpoint_handling>`.
173
+
174
+ 7. **Proceed to next wave.**
175
+ </step>
176
+
177
+ <step name="checkpoint_handling">
178
+ Plans with `autonomous: false` require user interaction.
179
+
180
+ **Auto-mode checkpoint handling:**
181
+
182
+ Read auto-advance config:
183
+ ```bash
184
+ AUTO_CFG=$(node ./.claude/get-shit-done/bin/gsd-tools.cjs config-get workflow.auto_advance 2>/dev/null || echo "false")
185
+ ```
186
+
187
+ When executor returns a checkpoint AND `AUTO_CFG` is `"true"`:
188
+ - **human-verify** → Auto-spawn continuation agent with `{user_response}` = `"approved"`. Log `⚡ Auto-approved checkpoint`.
189
+ - **decision** → Auto-spawn continuation agent with `{user_response}` = first option from checkpoint details. Log `⚡ Auto-selected: [option]`.
190
+ - **human-action** → Present to user (existing behavior below). Auth gates cannot be automated.
191
+
192
+ **Standard flow (not auto-mode, or human-action type):**
193
+
194
+ 1. Spawn agent for checkpoint plan
195
+ 2. Agent runs until checkpoint task or auth gate → returns structured state
196
+ 3. Agent return includes: completed tasks table, current task + blocker, checkpoint type/details, what's awaited
197
+ 4. **Present to user:**
198
+ ```
199
+ ## Checkpoint: [Type]
200
+
201
+ **Plan:** 03-03 Dashboard Layout
202
+ **Progress:** 2/3 tasks complete
203
+
204
+ [Checkpoint Details from agent return]
205
+ [Awaiting section from agent return]
206
+ ```
207
+ 5. User responds: "approved"/"done" | issue description | decision selection
208
+ 6. **Spawn continuation agent (NOT resume)** using continuation-prompt.md template:
209
+ - `{completed_tasks_table}`: From checkpoint return
210
+ - `{resume_task_number}` + `{resume_task_name}`: Current task
211
+ - `{user_response}`: What user provided
212
+ - `{resume_instructions}`: Based on checkpoint type
213
+ 7. Continuation agent verifies previous commits, continues from resume point
214
+ 8. Repeat until plan completes or user stops
215
+
216
+ **Why fresh agent, not resume:** Resume relies on internal serialization that breaks with parallel tool calls. Fresh agents with explicit state are more reliable.
217
+
218
+ **Checkpoints in parallel waves:** Agent pauses and returns while other parallel agents may complete. Present checkpoint, spawn continuation, wait for all before next wave.
219
+ </step>
220
+
221
+ <step name="aggregate_results">
222
+ After all waves:
223
+
224
+ ```markdown
225
+ ## Phase {X}: {Name} Execution Complete
226
+
227
+ **Waves:** {N} | **Plans:** {M}/{total} complete
228
+
229
+ | Wave | Plans | Status |
230
+ |------|-------|--------|
231
+ | 1 | plan-01, plan-02 | ✓ Complete |
232
+ | CP | plan-03 | ✓ Verified |
233
+ | 2 | plan-04 | ✓ Complete |
234
+
235
+ ### Plan Details
236
+ 1. **03-01**: [one-liner from SUMMARY.md]
237
+ 2. **03-02**: [one-liner from SUMMARY.md]
238
+
239
+ ### Issues Encountered
240
+ [Aggregate from SUMMARYs, or "None"]
241
+ ```
242
+ </step>
243
+
244
+ <step name="close_parent_artifacts">
245
+ **For decimal/polish phases only (X.Y pattern):** Close the feedback loop by resolving parent UAT and debug artifacts.
246
+
247
+ **Skip if** phase number has no decimal (e.g., `3`, `04`) — only applies to gap-closure phases like `4.1`, `03.1`.
248
+
249
+ **1. Detect decimal phase and derive parent:**
250
+ ```bash
251
+ # Check if phase_number contains a decimal
252
+ if [[ "$PHASE_NUMBER" == *.* ]]; then
253
+ PARENT_PHASE="${PHASE_NUMBER%%.*}"
254
+ fi
255
+ ```
256
+
257
+ **2. Find parent UAT file:**
258
+ ```bash
259
+ PARENT_INFO=$(node ./.claude/get-shit-done/bin/gsd-tools.cjs find-phase "${PARENT_PHASE}" --raw)
260
+ # Extract directory from PARENT_INFO JSON, then find UAT file in that directory
261
+ ```
262
+
263
+ **If no parent UAT found:** Skip this step (gap-closure may have been triggered by VERIFICATION.md instead).
264
+
265
+ **3. Update UAT gap statuses:**
266
+
267
+ Read the parent UAT file's `## Gaps` section. For each gap entry with `status: failed`:
268
+ - Update to `status: resolved`
269
+
270
+ **4. Update UAT frontmatter:**
271
+
272
+ If all gaps now have `status: resolved`:
273
+ - Update frontmatter `status: diagnosed` → `status: resolved`
274
+ - Update frontmatter `updated:` timestamp
275
+
276
+ **5. Resolve referenced debug sessions:**
277
+
278
+ For each gap that has a `debug_session:` field:
279
+ - Read the debug session file
280
+ - Update frontmatter `status:` → `resolved`
281
+ - Update frontmatter `updated:` timestamp
282
+ - Move to resolved directory:
283
+ ```bash
284
+ mkdir -p .planning/debug/resolved
285
+ mv .planning/debug/{slug}.md .planning/debug/resolved/
286
+ ```
287
+
288
+ **6. Commit updated artifacts:**
289
+ ```bash
290
+ node ./.claude/get-shit-done/bin/gsd-tools.cjs commit "docs(phase-${PARENT_PHASE}): resolve UAT gaps and debug sessions after ${PHASE_NUMBER} gap closure" --files .planning/phases/*${PARENT_PHASE}*/*-UAT.md .planning/debug/resolved/*.md
291
+ ```
292
+ </step>
293
+
294
+ <step name="verify_phase_goal">
295
+ Verify phase achieved its GOAL, not just completed tasks.
296
+
297
+ ```
298
+ Task(
299
+ prompt="Verify phase {phase_number} goal achievement.
300
+ Phase directory: {phase_dir}
301
+ Phase goal: {goal from ROADMAP.md}
302
+ Phase requirement IDs: {phase_req_ids}
303
+ Check must_haves against actual codebase.
304
+ Cross-reference requirement IDs from PLAN frontmatter against REQUIREMENTS.md — every ID MUST be accounted for.
305
+ Create VERIFICATION.md.",
306
+ subagent_type="gsd-verifier",
307
+ model="{verifier_model}"
308
+ )
309
+ ```
310
+
311
+ Read status:
312
+ ```bash
313
+ grep "^status:" "$PHASE_DIR"/*-VERIFICATION.md | cut -d: -f2 | tr -d ' '
314
+ ```
315
+
316
+ | Status | Action |
317
+ |--------|--------|
318
+ | `passed` | → update_roadmap |
319
+ | `human_needed` | Present items for human testing, get approval or feedback |
320
+ | `gaps_found` | Present gap summary, offer `/gsd:plan-phase {phase} --gaps` |
321
+
322
+ **If human_needed:**
323
+ ```
324
+ ## ✓ Phase {X}: {Name} — Human Verification Required
325
+
326
+ All automated checks passed. {N} items need human testing:
327
+
328
+ {From VERIFICATION.md human_verification section}
329
+
330
+ "approved" → continue | Report issues → gap closure
331
+ ```
332
+
333
+ **If gaps_found:**
334
+ ```
335
+ ## ⚠ Phase {X}: {Name} — Gaps Found
336
+
337
+ **Score:** {N}/{M} must-haves verified
338
+ **Report:** {phase_dir}/{phase_num}-VERIFICATION.md
339
+
340
+ ### What's Missing
341
+ {Gap summaries from VERIFICATION.md}
342
+
343
+ ---
344
+ ## ▶ Next Up
345
+
346
+ `/gsd:plan-phase {X} --gaps`
347
+
348
+ <sub>`/clear` first → fresh context window</sub>
349
+
350
+ Also: `cat {phase_dir}/{phase_num}-VERIFICATION.md` — full report
351
+ Also: `/gsd:verify-work {X}` — manual testing first
352
+ ```
353
+
354
+ Gap closure cycle: `/gsd:plan-phase {X} --gaps` reads VERIFICATION.md → creates gap plans with `gap_closure: true` → user runs `/gsd:execute-phase {X} --gaps-only` → verifier re-runs.
355
+ </step>
356
+
357
+ <step name="update_roadmap">
358
+ **Mark phase complete and update all tracking files:**
359
+
360
+ ```bash
361
+ COMPLETION=$(node ./.claude/get-shit-done/bin/gsd-tools.cjs phase complete "${PHASE_NUMBER}")
362
+ ```
363
+
364
+ The CLI handles:
365
+ - Marking phase checkbox `[x]` with completion date
366
+ - Updating Progress table (Status → Complete, date)
367
+ - Updating plan count to final
368
+ - Advancing STATE.md to next phase
369
+ - Updating REQUIREMENTS.md traceability
370
+
371
+ Extract from result: `next_phase`, `next_phase_name`, `is_last_phase`.
372
+
373
+ ```bash
374
+ node ./.claude/get-shit-done/bin/gsd-tools.cjs commit "docs(phase-{X}): complete phase execution" --files .planning/ROADMAP.md .planning/STATE.md .planning/REQUIREMENTS.md {phase_dir}/*-VERIFICATION.md
375
+ ```
376
+ </step>
377
+
378
+ <step name="offer_next">
379
+
380
+ **Exception:** If `gaps_found`, the `verify_phase_goal` step already presents the gap-closure path (`/gsd:plan-phase {X} --gaps`). No additional routing needed — skip auto-advance.
381
+
382
+ **No-transition check (spawned by auto-advance chain):**
383
+
384
+ Parse `--no-transition` flag from $ARGUMENTS.
385
+
386
+ **If `--no-transition` flag present:**
387
+
388
+ Execute-phase was spawned by plan-phase's auto-advance. Do NOT run transition.md.
389
+ After verification passes and roadmap is updated, return completion status to parent:
390
+
391
+ ```
392
+ ## PHASE COMPLETE
393
+
394
+ Phase: ${PHASE_NUMBER} - ${PHASE_NAME}
395
+ Plans: ${completed_count}/${total_count}
396
+ Verification: {Passed | Gaps Found}
397
+
398
+ [Include aggregate_results output]
399
+ ```
400
+
401
+ STOP. Do not proceed to auto-advance or transition.
402
+
403
+ **If `--no-transition` flag is NOT present:**
404
+
405
+ **Auto-advance detection:**
406
+
407
+ 1. Parse `--auto` flag from $ARGUMENTS
408
+ 2. Read `workflow.auto_advance` from config:
409
+ ```bash
410
+ AUTO_CFG=$(node ./.claude/get-shit-done/bin/gsd-tools.cjs config-get workflow.auto_advance 2>/dev/null || echo "false")
411
+ ```
412
+
413
+ **If `--auto` flag present OR `AUTO_CFG` is true (AND verification passed with no gaps):**
414
+
415
+ ```
416
+ ╔══════════════════════════════════════════╗
417
+ ║ AUTO-ADVANCING → TRANSITION ║
418
+ ║ Phase {X} verified, continuing chain ║
419
+ ╚══════════════════════════════════════════╝
420
+ ```
421
+
422
+ Execute the transition workflow inline (do NOT use Task — orchestrator context is ~10-15%, transition needs phase completion data already in context):
423
+
424
+ Read and follow `./.claude/get-shit-done/workflows/transition.md`, passing through the `--auto` flag so it propagates to the next phase invocation.
425
+
426
+ **If neither `--auto` nor `AUTO_CFG` is true:**
427
+
428
+ The workflow ends. The user runs `/gsd:progress` or invokes the transition workflow manually.
429
+ </step>
430
+
431
+ </process>
432
+
433
+ <context_efficiency>
434
+ Orchestrator: ~10-15% context. Subagents: fresh 200k each. No polling (Task blocks). No context bleed.
435
+ </context_efficiency>
436
+
437
+ <failure_handling>
438
+ - **classifyHandoffIfNeeded false failure:** Agent reports "failed" but error is `classifyHandoffIfNeeded is not defined` → Claude Code bug, not GSD. Spot-check (SUMMARY exists, commits present) → if pass, treat as success
439
+ - **Agent fails mid-plan:** Missing SUMMARY.md → report, ask user how to proceed
440
+ - **Dependency chain breaks:** Wave 1 fails → Wave 2 dependents likely fail → user chooses attempt or skip
441
+ - **All agents in wave fail:** Systemic issue → stop, report for investigation
442
+ - **Checkpoint unresolvable:** "Skip this plan?" or "Abort phase execution?" → record partial progress in STATE.md
443
+ </failure_handling>
444
+
445
+ <resumption>
446
+ Re-run `/gsd:execute-phase {phase}` → discover_plans finds completed SUMMARYs → skips them → resumes from first incomplete plan → continues wave execution.
447
+
448
+ STATE.md tracks: last completed plan, current wave, pending checkpoints.
449
+ </resumption>