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,441 @@
1
+ <purpose>
2
+ Execute a phase prompt (PLAN.md) and create the outcome summary (SUMMARY.md).
3
+ </purpose>
4
+
5
+ <required_reading>
6
+ Read STATE.md before any operation to load project context.
7
+ Read config.json for planning behavior settings.
8
+
9
+ @~/.claude/get-shit-done/references/git-integration.md
10
+ </required_reading>
11
+
12
+ <process>
13
+
14
+ <step name="init_context" priority="first">
15
+ Load execution context (uses `init execute-phase` for full context, including file contents):
16
+
17
+ ```bash
18
+ INIT=$(node ~/.claude/get-shit-done/bin/gsd-tools.cjs init execute-phase "${PHASE}" --include state,config)
19
+ ```
20
+
21
+ Extract from init JSON: `executor_model`, `commit_docs`, `phase_dir`, `phase_number`, `plans`, `summaries`, `incomplete_plans`.
22
+
23
+ **File contents (from --include):** `state_content`, `config_content`. Access with:
24
+ ```bash
25
+ STATE_CONTENT=$(echo "$INIT" | jq -r '.state_content // empty')
26
+ CONFIG_CONTENT=$(echo "$INIT" | jq -r '.config_content // empty')
27
+ ```
28
+
29
+ If `.planning/` missing: error.
30
+ </step>
31
+
32
+ <step name="identify_plan">
33
+ ```bash
34
+ # Use plans/summaries from INIT JSON, or list files
35
+ ls .planning/phases/XX-name/*-PLAN.md 2>/dev/null | sort
36
+ ls .planning/phases/XX-name/*-SUMMARY.md 2>/dev/null | sort
37
+ ```
38
+
39
+ Find first PLAN without matching SUMMARY. Decimal phases supported (`01.1-hotfix/`):
40
+
41
+ ```bash
42
+ PHASE=$(echo "$PLAN_PATH" | grep -oE '[0-9]+(\.[0-9]+)?-[0-9]+')
43
+ # config_content already loaded via --include config in init_context
44
+ ```
45
+
46
+ <if mode="yolo">
47
+ Auto-approve: `⚡ Execute {phase}-{plan}-PLAN.md [Plan X of Y for Phase Z]` → parse_segments.
48
+ </if>
49
+
50
+ <if mode="interactive" OR="custom with gates.execute_next_plan true">
51
+ Present plan identification, wait for confirmation.
52
+ </if>
53
+ </step>
54
+
55
+ <step name="record_start_time">
56
+ ```bash
57
+ PLAN_START_TIME=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
58
+ PLAN_START_EPOCH=$(date +%s)
59
+ ```
60
+ </step>
61
+
62
+ <step name="parse_segments">
63
+ ```bash
64
+ grep -n "type=\"checkpoint" .planning/phases/XX-name/{phase}-{plan}-PLAN.md
65
+ ```
66
+
67
+ **Routing by checkpoint type:**
68
+
69
+ | Checkpoints | Pattern | Execution |
70
+ |-------------|---------|-----------|
71
+ | None | A (autonomous) | Single subagent: full plan + SUMMARY + commit |
72
+ | Verify-only | B (segmented) | Segments between checkpoints. After none/human-verify → SUBAGENT. After decision/human-action → MAIN |
73
+ | Decision | C (main) | Execute entirely in main context |
74
+
75
+ **Pattern A:** init_agent_tracking → spawn Task(subagent_type="gsd-executor", model=executor_model) with prompt: execute plan at [path], autonomous, all tasks + SUMMARY + commit, follow deviation/auth rules, report: plan name, tasks, SUMMARY path, commit hash → track agent_id → wait → update tracking → report.
76
+
77
+ **Pattern B:** Execute segment-by-segment. Autonomous segments: spawn subagent for assigned tasks only (no SUMMARY/commit). Checkpoints: main context. After all segments: aggregate, create SUMMARY, commit. See segment_execution.
78
+
79
+ **Pattern C:** Execute in main using standard flow (step name="execute").
80
+
81
+ Fresh context per subagent preserves peak quality. Main context stays lean.
82
+ </step>
83
+
84
+ <step name="init_agent_tracking">
85
+ ```bash
86
+ if [ ! -f .planning/agent-history.json ]; then
87
+ echo '{"version":"1.0","max_entries":50,"entries":[]}' > .planning/agent-history.json
88
+ fi
89
+ rm -f .planning/current-agent-id.txt
90
+ if [ -f .planning/current-agent-id.txt ]; then
91
+ INTERRUPTED_ID=$(cat .planning/current-agent-id.txt)
92
+ echo "Found interrupted agent: $INTERRUPTED_ID"
93
+ fi
94
+ ```
95
+
96
+ If interrupted: ask user to resume (Task `resume` parameter) or start fresh.
97
+
98
+ **Tracking protocol:** On spawn: write agent_id to `current-agent-id.txt`, append to agent-history.json: `{"agent_id":"[id]","task_description":"[desc]","phase":"[phase]","plan":"[plan]","segment":[num|null],"timestamp":"[ISO]","status":"spawned","completion_timestamp":null}`. On completion: status → "completed", set completion_timestamp, delete current-agent-id.txt. Prune: if entries > max_entries, remove oldest "completed" (never "spawned").
99
+
100
+ Run for Pattern A/B before spawning. Pattern C: skip.
101
+ </step>
102
+
103
+ <step name="segment_execution">
104
+ Pattern B only (verify-only checkpoints). Skip for A/C.
105
+
106
+ 1. Parse segment map: checkpoint locations and types
107
+ 2. Per segment:
108
+ - Subagent route: spawn gsd-executor for assigned tasks only. Prompt: task range, plan path, read full plan for context, execute assigned tasks, track deviations, NO SUMMARY/commit. Track via agent protocol.
109
+ - Main route: execute tasks using standard flow (step name="execute")
110
+ 3. After ALL segments: aggregate files/deviations/decisions → create SUMMARY.md → commit → self-check:
111
+ - Verify key-files.created exist on disk with `[ -f ]`
112
+ - Check `git log --oneline --all --grep="{phase}-{plan}"` returns ≥1 commit
113
+ - Append `## Self-Check: PASSED` or `## Self-Check: FAILED` to SUMMARY
114
+
115
+ **Known Claude Code bug (classifyHandoffIfNeeded):** If any segment agent reports "failed" with `classifyHandoffIfNeeded is not defined`, this is a Claude Code runtime bug — not a real failure. Run spot-checks; if they pass, treat as successful.
116
+
117
+
118
+
119
+
120
+ </step>
121
+
122
+ <step name="load_prompt">
123
+ ```bash
124
+ cat .planning/phases/XX-name/{phase}-{plan}-PLAN.md
125
+ ```
126
+ This IS the execution instructions. Follow exactly. If plan references CONTEXT.md: honor user's vision throughout.
127
+ </step>
128
+
129
+ <step name="previous_phase_check">
130
+ ```bash
131
+ node ~/.claude/get-shit-done/bin/gsd-tools.cjs phases list --type summaries --raw
132
+ # Extract the second-to-last summary from the JSON result
133
+ ```
134
+ If previous SUMMARY has unresolved "Issues Encountered" or "Next Phase Readiness" blockers: AskUserQuestion(header="Previous Issues", options: "Proceed anyway" | "Address first" | "Review previous").
135
+ </step>
136
+
137
+ <step name="execute">
138
+ Deviations are normal — handle via rules below.
139
+
140
+ 1. Read @context files from prompt
141
+ 2. Per task:
142
+ - `type="auto"`: if `tdd="true"` → TDD execution. Implement with deviation rules + auth gates. Verify done criteria. Commit (see task_commit). Track hash for Summary.
143
+ - `type="checkpoint:*"`: STOP → checkpoint_protocol → wait for user → continue only after confirmation.
144
+ 3. Run `<verification>` checks
145
+ 4. Confirm `<success_criteria>` met
146
+ 5. Document deviations in Summary
147
+ </step>
148
+
149
+ <authentication_gates>
150
+
151
+ ## Authentication Gates
152
+
153
+ Auth errors during execution are NOT failures — they're expected interaction points.
154
+
155
+ **Indicators:** "Not authenticated", "Unauthorized", 401/403, "Please run {tool} login", "Set {ENV_VAR}"
156
+
157
+ **Protocol:**
158
+ 1. Recognize auth gate (not a bug)
159
+ 2. STOP task execution
160
+ 3. Create dynamic checkpoint:human-action with exact auth steps
161
+ 4. Wait for user to authenticate
162
+ 5. Verify credentials work
163
+ 6. Retry original task
164
+ 7. Continue normally
165
+
166
+ **Example:** `vercel --yes` → "Not authenticated" → checkpoint asking user to `vercel login` → verify with `vercel whoami` → retry deploy → continue
167
+
168
+ **In Summary:** Document as normal flow under "## Authentication Gates", not as deviations.
169
+
170
+ </authentication_gates>
171
+
172
+ <deviation_rules>
173
+
174
+ ## Deviation Rules
175
+
176
+ You WILL discover unplanned work. Apply automatically, track all for Summary.
177
+
178
+ | Rule | Trigger | Action | Permission |
179
+ |------|---------|--------|------------|
180
+ | **1: Bug** | Broken behavior, errors, wrong queries, type errors, security vulns, race conditions, leaks | Fix → test → verify → track `[Rule 1 - Bug]` | Auto |
181
+ | **2: Missing Critical** | Missing essentials: error handling, validation, auth, CSRF/CORS, rate limiting, indexes, logging | Add → test → verify → track `[Rule 2 - Missing Critical]` | Auto |
182
+ | **3: Blocking** | Prevents completion: missing deps, wrong types, broken imports, missing env/config/files, circular deps | Fix blocker → verify proceeds → track `[Rule 3 - Blocking]` | Auto |
183
+ | **4: Architectural** | Structural change: new DB table, schema change, new service, switching libs, breaking API, new infra | STOP → present decision (below) → track `[Rule 4 - Architectural]` | Ask user |
184
+
185
+ **Rule 4 format:**
186
+ ```
187
+ ⚠️ Architectural Decision Needed
188
+
189
+ Current task: [task name]
190
+ Discovery: [what prompted this]
191
+ Proposed change: [modification]
192
+ Why needed: [rationale]
193
+ Impact: [what this affects]
194
+ Alternatives: [other approaches]
195
+
196
+ Proceed with proposed change? (yes / different approach / defer)
197
+ ```
198
+
199
+ **Priority:** Rule 4 (STOP) > Rules 1-3 (auto) > unsure → Rule 4
200
+ **Edge cases:** missing validation → R2 | null crash → R1 | new table → R4 | new column → R1/2
201
+ **Heuristic:** Affects correctness/security/completion? → R1-3. Maybe? → R4.
202
+
203
+ </deviation_rules>
204
+
205
+ <deviation_documentation>
206
+
207
+ ## Documenting Deviations
208
+
209
+ Summary MUST include deviations section. None? → `## Deviations from Plan\n\nNone - plan executed exactly as written.`
210
+
211
+ Per deviation: **[Rule N - Category] Title** — Found during: Task X | Issue | Fix | Files modified | Verification | Commit hash
212
+
213
+ End with: **Total deviations:** N auto-fixed (breakdown). **Impact:** assessment.
214
+
215
+ </deviation_documentation>
216
+
217
+ <tdd_plan_execution>
218
+ ## TDD Execution
219
+
220
+ For `type: tdd` plans — RED-GREEN-REFACTOR:
221
+
222
+ 1. **Infrastructure** (first TDD plan only): detect project, install framework, config, verify empty suite
223
+ 2. **RED:** Read `<behavior>` → failing test(s) → run (MUST fail) → commit: `test({phase}-{plan}): add failing test for [feature]`
224
+ 3. **GREEN:** Read `<implementation>` → minimal code → run (MUST pass) → commit: `feat({phase}-{plan}): implement [feature]`
225
+ 4. **REFACTOR:** Clean up → tests MUST pass → commit: `refactor({phase}-{plan}): clean up [feature]`
226
+
227
+ Errors: RED doesn't fail → investigate test/existing feature. GREEN doesn't pass → debug, iterate. REFACTOR breaks → undo.
228
+
229
+ See `~/.claude/get-shit-done/references/tdd.md` for structure.
230
+ </tdd_plan_execution>
231
+
232
+ <task_commit>
233
+ ## Task Commit Protocol
234
+
235
+ After each task (verification passed, done criteria met), commit immediately.
236
+
237
+ **1. Check:** `git status --short`
238
+
239
+ **2. Stage individually** (NEVER `git add .` or `git add -A`):
240
+ ```bash
241
+ git add src/api/auth.ts
242
+ git add src/types/user.ts
243
+ ```
244
+
245
+ **3. Commit type:**
246
+
247
+ | Type | When | Example |
248
+ |------|------|---------|
249
+ | `feat` | New functionality | feat(08-02): create user registration endpoint |
250
+ | `fix` | Bug fix | fix(08-02): correct email validation regex |
251
+ | `test` | Test-only (TDD RED) | test(08-02): add failing test for password hashing |
252
+ | `refactor` | No behavior change (TDD REFACTOR) | refactor(08-02): extract validation to helper |
253
+ | `perf` | Performance | perf(08-02): add database index |
254
+ | `docs` | Documentation | docs(08-02): add API docs |
255
+ | `style` | Formatting | style(08-02): format auth module |
256
+ | `chore` | Config/deps | chore(08-02): add bcrypt dependency |
257
+
258
+ **4. Format:** `{type}({phase}-{plan}): {description}` with bullet points for key changes.
259
+
260
+ **5. Record hash:**
261
+ ```bash
262
+ TASK_COMMIT=$(git rev-parse --short HEAD)
263
+ TASK_COMMITS+=("Task ${TASK_NUM}: ${TASK_COMMIT}")
264
+ ```
265
+
266
+ </task_commit>
267
+
268
+ <step name="checkpoint_protocol">
269
+ On `type="checkpoint:*"`: automate everything possible first. Checkpoints are for verification/decisions only.
270
+
271
+ Display: `CHECKPOINT: [Type]` box → Progress {X}/{Y} → Task name → type-specific content → `YOUR ACTION: [signal]`
272
+
273
+ | Type | Content | Resume signal |
274
+ |------|---------|---------------|
275
+ | human-verify (90%) | What was built + verification steps (commands/URLs) | "approved" or describe issues |
276
+ | decision (9%) | Decision needed + context + options with pros/cons | "Select: option-id" |
277
+ | human-action (1%) | What was automated + ONE manual step + verification plan | "done" |
278
+
279
+ After response: verify if specified. Pass → continue. Fail → inform, wait. WAIT for user — do NOT hallucinate completion.
280
+
281
+ See ~/.claude/get-shit-done/references/checkpoints.md for details.
282
+ </step>
283
+
284
+ <step name="checkpoint_return_for_orchestrator">
285
+ When spawned via Task and hitting checkpoint: return structured state (cannot interact with user directly).
286
+
287
+ **Required return:** 1) Completed Tasks table (hashes + files) 2) Current Task (what's blocking) 3) Checkpoint Details (user-facing content) 4) Awaiting (what's needed from user)
288
+
289
+ Orchestrator parses → presents to user → spawns fresh continuation with your completed tasks state. You will NOT be resumed. In main context: use checkpoint_protocol above.
290
+ </step>
291
+
292
+ <step name="verification_failure_gate">
293
+ If verification fails: STOP. Present: "Verification failed for Task [X]: [name]. Expected: [criteria]. Actual: [result]." Options: Retry | Skip (mark incomplete) | Stop (investigate). If skipped → SUMMARY "Issues Encountered".
294
+ </step>
295
+
296
+ <step name="record_completion_time">
297
+ ```bash
298
+ PLAN_END_TIME=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
299
+ PLAN_END_EPOCH=$(date +%s)
300
+
301
+ DURATION_SEC=$(( PLAN_END_EPOCH - PLAN_START_EPOCH ))
302
+ DURATION_MIN=$(( DURATION_SEC / 60 ))
303
+
304
+ if [[ $DURATION_MIN -ge 60 ]]; then
305
+ HRS=$(( DURATION_MIN / 60 ))
306
+ MIN=$(( DURATION_MIN % 60 ))
307
+ DURATION="${HRS}h ${MIN}m"
308
+ else
309
+ DURATION="${DURATION_MIN} min"
310
+ fi
311
+ ```
312
+ </step>
313
+
314
+ <step name="generate_user_setup">
315
+ ```bash
316
+ grep -A 50 "^user_setup:" .planning/phases/XX-name/{phase}-{plan}-PLAN.md | head -50
317
+ ```
318
+
319
+ If user_setup exists: create `{phase}-USER-SETUP.md` using template `~/.claude/get-shit-done/templates/user-setup.md`. Per service: env vars table, account setup checklist, dashboard config, local dev notes, verification commands. Status "Incomplete". Set `USER_SETUP_CREATED=true`. If empty/missing: skip.
320
+ </step>
321
+
322
+ <step name="create_summary">
323
+ Create `{phase}-{plan}-SUMMARY.md` at `.planning/phases/XX-name/`. Use `~/.claude/get-shit-done/templates/summary.md`.
324
+
325
+ **Frontmatter:** phase, plan, subsystem, tags | requires/provides/affects | tech-stack.added/patterns | key-files.created/modified | key-decisions | duration ($DURATION), completed ($PLAN_END_TIME date).
326
+
327
+ Title: `# Phase [X] Plan [Y]: [Name] Summary`
328
+
329
+ One-liner SUBSTANTIVE: "JWT auth with refresh rotation using jose library" not "Authentication implemented"
330
+
331
+ Include: duration, start/end times, task count, file count.
332
+
333
+ Next: more plans → "Ready for {next-plan}" | last → "Phase complete, ready for transition".
334
+ </step>
335
+
336
+ <step name="update_current_position">
337
+ Update STATE.md using gsd-tools:
338
+
339
+ ```bash
340
+ # Advance plan counter (handles last-plan edge case)
341
+ node ~/.claude/get-shit-done/bin/gsd-tools.cjs state advance-plan
342
+
343
+ # Recalculate progress bar from disk state
344
+ node ~/.claude/get-shit-done/bin/gsd-tools.cjs state update-progress
345
+
346
+ # Record execution metrics
347
+ node ~/.claude/get-shit-done/bin/gsd-tools.cjs state record-metric \
348
+ --phase "${PHASE}" --plan "${PLAN}" --duration "${DURATION}" \
349
+ --tasks "${TASK_COUNT}" --files "${FILE_COUNT}"
350
+ ```
351
+ </step>
352
+
353
+ <step name="extract_decisions_and_issues">
354
+ From SUMMARY: Extract decisions and add to STATE.md:
355
+
356
+ ```bash
357
+ # Add each decision from SUMMARY key-decisions
358
+ node ~/.claude/get-shit-done/bin/gsd-tools.cjs state add-decision \
359
+ --phase "${PHASE}" --summary "${DECISION_TEXT}" --rationale "${RATIONALE}"
360
+
361
+ # Add blockers if any found
362
+ node ~/.claude/get-shit-done/bin/gsd-tools.cjs state add-blocker "Blocker description"
363
+ ```
364
+ </step>
365
+
366
+ <step name="update_session_continuity">
367
+ Update session info using gsd-tools:
368
+
369
+ ```bash
370
+ node ~/.claude/get-shit-done/bin/gsd-tools.cjs state record-session \
371
+ --stopped-at "Completed ${PHASE}-${PLAN}-PLAN.md" \
372
+ --resume-file "None"
373
+ ```
374
+
375
+ Keep STATE.md under 150 lines.
376
+ </step>
377
+
378
+ <step name="issues_review_gate">
379
+ If SUMMARY "Issues Encountered" ≠ "None": yolo → log and continue. Interactive → present issues, wait for acknowledgment.
380
+ </step>
381
+
382
+ <step name="update_roadmap">
383
+ ```bash
384
+ node ~/.claude/get-shit-done/bin/gsd-tools.cjs roadmap update-plan-progress "${PHASE}"
385
+ ```
386
+ Counts PLAN vs SUMMARY files on disk. Updates progress table row with correct count and status (`In Progress` or `Complete` with date).
387
+ </step>
388
+
389
+ <step name="git_commit_metadata">
390
+ Task code already committed per-task. Commit plan metadata:
391
+
392
+ ```bash
393
+ node ~/.claude/get-shit-done/bin/gsd-tools.cjs commit "docs({phase}-{plan}): complete [plan-name] plan" --files .planning/phases/XX-name/{phase}-{plan}-SUMMARY.md .planning/STATE.md .planning/ROADMAP.md
394
+ ```
395
+ </step>
396
+
397
+ <step name="update_codebase_map">
398
+ If .planning/codebase/ doesn't exist: skip.
399
+
400
+ ```bash
401
+ FIRST_TASK=$(git log --oneline --grep="feat({phase}-{plan}):" --grep="fix({phase}-{plan}):" --grep="test({phase}-{plan}):" --reverse | head -1 | cut -d' ' -f1)
402
+ git diff --name-only ${FIRST_TASK}^..HEAD 2>/dev/null
403
+ ```
404
+
405
+ Update only structural changes: new src/ dir → STRUCTURE.md | deps → STACK.md | file pattern → CONVENTIONS.md | API client → INTEGRATIONS.md | config → STACK.md | renamed → update paths. Skip code-only/bugfix/content changes.
406
+
407
+ ```bash
408
+ node ~/.claude/get-shit-done/bin/gsd-tools.cjs commit "" --files .planning/codebase/*.md --amend
409
+ ```
410
+ </step>
411
+
412
+ <step name="offer_next">
413
+ If `USER_SETUP_CREATED=true`: display `⚠️ USER SETUP REQUIRED` with path + env/config tasks at TOP.
414
+
415
+ ```bash
416
+ ls -1 .planning/phases/[current-phase-dir]/*-PLAN.md 2>/dev/null | wc -l
417
+ ls -1 .planning/phases/[current-phase-dir]/*-SUMMARY.md 2>/dev/null | wc -l
418
+ ```
419
+
420
+ | Condition | Route | Action |
421
+ |-----------|-------|--------|
422
+ | summaries < plans | **A: More plans** | Find next PLAN without SUMMARY. Yolo: auto-continue. Interactive: show next plan, suggest `/gsd:execute-phase {phase}` + `/gsd:verify-work`. STOP here. |
423
+ | summaries = plans, current < highest phase | **B: Phase done** | Show completion, suggest `/gsd:plan-phase {Z+1}` + `/gsd:verify-work {Z}` + `/gsd:discuss-phase {Z+1}` |
424
+ | summaries = plans, current = highest phase | **C: Milestone done** | Show banner, suggest `/gsd:complete-milestone` + `/gsd:verify-work` + `/gsd:add-phase` |
425
+
426
+ All routes: `/clear` first for fresh context.
427
+ </step>
428
+
429
+ </process>
430
+
431
+ <success_criteria>
432
+
433
+ - All tasks from PLAN.md completed
434
+ - All verifications pass
435
+ - USER-SETUP.md generated if user_setup in frontmatter
436
+ - SUMMARY.md created with substantive content
437
+ - STATE.md updated (position, decisions, issues, session)
438
+ - ROADMAP.md updated
439
+ - If codebase map exists: map updated with execution changes (or skipped if no significant changes)
440
+ - If USER-SETUP.md created: prominently surfaced in completion output
441
+ </success_criteria>
@@ -0,0 +1,156 @@
1
+ <purpose>
2
+ Validate `.planning/` directory integrity and report actionable issues. Checks for missing files, invalid configurations, inconsistent state, and orphaned plans. Optionally repairs auto-fixable issues.
3
+ </purpose>
4
+
5
+ <required_reading>
6
+ Read all files referenced by the invoking prompt's execution_context before starting.
7
+ </required_reading>
8
+
9
+ <process>
10
+
11
+ <step name="parse_args">
12
+ **Parse arguments:**
13
+
14
+ Check if `--repair` flag is present in the command arguments.
15
+
16
+ ```
17
+ REPAIR_FLAG=""
18
+ if arguments contain "--repair"; then
19
+ REPAIR_FLAG="--repair"
20
+ fi
21
+ ```
22
+ </step>
23
+
24
+ <step name="run_health_check">
25
+ **Run health validation:**
26
+
27
+ ```bash
28
+ node ~/.claude/get-shit-done/bin/gsd-tools.cjs validate health $REPAIR_FLAG
29
+ ```
30
+
31
+ Parse JSON output:
32
+ - `status`: "healthy" | "degraded" | "broken"
33
+ - `errors[]`: Critical issues (code, message, fix, repairable)
34
+ - `warnings[]`: Non-critical issues
35
+ - `info[]`: Informational notes
36
+ - `repairable_count`: Number of auto-fixable issues
37
+ - `repairs_performed[]`: Actions taken if --repair was used
38
+ </step>
39
+
40
+ <step name="format_output">
41
+ **Format and display results:**
42
+
43
+ ```
44
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
45
+ GSD Health Check
46
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
47
+
48
+ Status: HEALTHY | DEGRADED | BROKEN
49
+ Errors: N | Warnings: N | Info: N
50
+ ```
51
+
52
+ **If repairs were performed:**
53
+ ```
54
+ ## Repairs Performed
55
+
56
+ - ✓ config.json: Created with defaults
57
+ - ✓ STATE.md: Regenerated from roadmap
58
+ ```
59
+
60
+ **If errors exist:**
61
+ ```
62
+ ## Errors
63
+
64
+ - [E001] config.json: JSON parse error at line 5
65
+ Fix: Run /gsd:health --repair to reset to defaults
66
+
67
+ - [E002] PROJECT.md not found
68
+ Fix: Run /gsd:new-project to create
69
+ ```
70
+
71
+ **If warnings exist:**
72
+ ```
73
+ ## Warnings
74
+
75
+ - [W001] STATE.md references phase 5, but only phases 1-3 exist
76
+ Fix: Run /gsd:health --repair to regenerate
77
+
78
+ - [W005] Phase directory "1-setup" doesn't follow NN-name format
79
+ Fix: Rename to match pattern (e.g., 01-setup)
80
+ ```
81
+
82
+ **If info exists:**
83
+ ```
84
+ ## Info
85
+
86
+ - [I001] 02-implementation/02-01-PLAN.md has no SUMMARY.md
87
+ Note: May be in progress
88
+ ```
89
+
90
+ **Footer (if repairable issues exist and --repair was NOT used):**
91
+ ```
92
+ ---
93
+ N issues can be auto-repaired. Run: /gsd:health --repair
94
+ ```
95
+ </step>
96
+
97
+ <step name="offer_repair">
98
+ **If repairable issues exist and --repair was NOT used:**
99
+
100
+ Ask user if they want to run repairs:
101
+
102
+ ```
103
+ Would you like to run /gsd:health --repair to fix N issues automatically?
104
+ ```
105
+
106
+ If yes, re-run with --repair flag and display results.
107
+ </step>
108
+
109
+ <step name="verify_repairs">
110
+ **If repairs were performed:**
111
+
112
+ Re-run health check without --repair to confirm issues are resolved:
113
+
114
+ ```bash
115
+ node ~/.claude/get-shit-done/bin/gsd-tools.cjs validate health
116
+ ```
117
+
118
+ Report final status.
119
+ </step>
120
+
121
+ </process>
122
+
123
+ <error_codes>
124
+
125
+ | Code | Severity | Description | Repairable |
126
+ |------|----------|-------------|------------|
127
+ | E001 | error | .planning/ directory not found | No |
128
+ | E002 | error | PROJECT.md not found | No |
129
+ | E003 | error | ROADMAP.md not found | No |
130
+ | E004 | error | STATE.md not found | Yes |
131
+ | E005 | error | config.json parse error | Yes |
132
+ | W001 | warning | PROJECT.md missing required section | No |
133
+ | W002 | warning | STATE.md references invalid phase | Yes |
134
+ | W003 | warning | config.json not found | Yes |
135
+ | W004 | warning | config.json invalid field value | No |
136
+ | W005 | warning | Phase directory naming mismatch | No |
137
+ | W006 | warning | Phase in ROADMAP but no directory | No |
138
+ | W007 | warning | Phase on disk but not in ROADMAP | No |
139
+ | I001 | info | Plan without SUMMARY (may be in progress) | No |
140
+
141
+ </error_codes>
142
+
143
+ <repair_actions>
144
+
145
+ | Action | Effect | Risk |
146
+ |--------|--------|------|
147
+ | createConfig | Create config.json with defaults | None |
148
+ | resetConfig | Delete + recreate config.json | Loses custom settings |
149
+ | regenerateState | Create STATE.md from ROADMAP structure | Loses session history |
150
+
151
+ **Not repairable (too risky):**
152
+ - PROJECT.md, ROADMAP.md content
153
+ - Phase directory renaming
154
+ - Orphaned plan cleanup
155
+
156
+ </repair_actions>