@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,297 @@
1
+ <purpose>
2
+ Verify milestone achieved its definition of done by aggregating phase verifications, checking cross-phase integration, and assessing requirements coverage. Reads existing VERIFICATION.md files (phases already verified during execute-phase), aggregates tech debt and deferred gaps, then spawns integration checker for cross-phase wiring.
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
+ ## 0. Initialize Milestone Context
12
+
13
+ ```bash
14
+ INIT=$(node ./.claude/get-shit-done/bin/gsd-tools.cjs init milestone-op)
15
+ ```
16
+
17
+ Extract from init JSON: `milestone_version`, `milestone_name`, `phase_count`, `completed_phases`, `commit_docs`.
18
+
19
+ Resolve integration checker model:
20
+ ```bash
21
+ CHECKER_MODEL=$(node ./.claude/get-shit-done/bin/gsd-tools.cjs resolve-model gsd-integration-checker --raw)
22
+ ```
23
+
24
+ ## 1. Determine Milestone Scope
25
+
26
+ ```bash
27
+ # Get phases in milestone (sorted numerically, handles decimals)
28
+ node ./.claude/get-shit-done/bin/gsd-tools.cjs phases list
29
+ ```
30
+
31
+ - Parse version from arguments or detect current from ROADMAP.md
32
+ - Identify all phase directories in scope
33
+ - Extract milestone definition of done from ROADMAP.md
34
+ - Extract requirements mapped to this milestone from REQUIREMENTS.md
35
+
36
+ ## 2. Read All Phase Verifications
37
+
38
+ For each phase directory, read the VERIFICATION.md:
39
+
40
+ ```bash
41
+ # For each phase, use find-phase to resolve the directory (handles archived phases)
42
+ PHASE_INFO=$(node ./.claude/get-shit-done/bin/gsd-tools.cjs find-phase 01 --raw)
43
+ # Extract directory from JSON, then read VERIFICATION.md from that directory
44
+ # Repeat for each phase number from ROADMAP.md
45
+ ```
46
+
47
+ From each VERIFICATION.md, extract:
48
+ - **Status:** passed | gaps_found
49
+ - **Critical gaps:** (if any — these are blockers)
50
+ - **Non-critical gaps:** tech debt, deferred items, warnings
51
+ - **Anti-patterns found:** TODOs, stubs, placeholders
52
+ - **Requirements coverage:** which requirements satisfied/blocked
53
+
54
+ If a phase is missing VERIFICATION.md, flag it as "unverified phase" — this is a blocker.
55
+
56
+ ## 3. Spawn Integration Checker
57
+
58
+ With phase context collected:
59
+
60
+ Extract `MILESTONE_REQ_IDS` from REQUIREMENTS.md traceability table — all REQ-IDs assigned to phases in this milestone.
61
+
62
+ ```
63
+ Task(
64
+ prompt="Check cross-phase integration and E2E flows.
65
+
66
+ Phases: {phase_dirs}
67
+ Phase exports: {from SUMMARYs}
68
+ API routes: {routes created}
69
+
70
+ Milestone Requirements:
71
+ {MILESTONE_REQ_IDS — list each REQ-ID with description and assigned phase}
72
+
73
+ MUST map each integration finding to affected requirement IDs where applicable.
74
+
75
+ Verify cross-phase wiring and E2E user flows.",
76
+ subagent_type="gsd-integration-checker",
77
+ model="{integration_checker_model}"
78
+ )
79
+ ```
80
+
81
+ ## 4. Collect Results
82
+
83
+ Combine:
84
+ - Phase-level gaps and tech debt (from step 2)
85
+ - Integration checker's report (wiring gaps, broken flows)
86
+
87
+ ## 5. Check Requirements Coverage (3-Source Cross-Reference)
88
+
89
+ MUST cross-reference three independent sources for each requirement:
90
+
91
+ ### 5a. Parse REQUIREMENTS.md Traceability Table
92
+
93
+ Extract all REQ-IDs mapped to milestone phases from the traceability table:
94
+ - Requirement ID, description, assigned phase, current status, checked-off state (`[x]` vs `[ ]`)
95
+
96
+ ### 5b. Parse Phase VERIFICATION.md Requirements Tables
97
+
98
+ For each phase's VERIFICATION.md, extract the expanded requirements table:
99
+ - Requirement | Source Plan | Description | Status | Evidence
100
+ - Map each entry back to its REQ-ID
101
+
102
+ ### 5c. Extract SUMMARY.md Frontmatter Cross-Check
103
+
104
+ For each phase's SUMMARY.md, extract `requirements-completed` from YAML frontmatter:
105
+ ```bash
106
+ for summary in .planning/phases/*-*/*-SUMMARY.md; do
107
+ node ./.claude/get-shit-done/bin/gsd-tools.cjs summary-extract "$summary" --fields requirements_completed | jq -r '.requirements_completed'
108
+ done
109
+ ```
110
+
111
+ ### 5d. Status Determination Matrix
112
+
113
+ For each REQ-ID, determine status using all three sources:
114
+
115
+ | VERIFICATION.md Status | SUMMARY Frontmatter | REQUIREMENTS.md | → Final Status |
116
+ |------------------------|---------------------|-----------------|----------------|
117
+ | passed | listed | `[x]` | **satisfied** |
118
+ | passed | listed | `[ ]` | **satisfied** (update checkbox) |
119
+ | passed | missing | any | **partial** (verify manually) |
120
+ | gaps_found | any | any | **unsatisfied** |
121
+ | missing | listed | any | **partial** (verification gap) |
122
+ | missing | missing | any | **unsatisfied** |
123
+
124
+ ### 5e. FAIL Gate and Orphan Detection
125
+
126
+ **REQUIRED:** Any `unsatisfied` requirement MUST force `gaps_found` status on the milestone audit.
127
+
128
+ **Orphan detection:** Requirements present in REQUIREMENTS.md traceability table but absent from ALL phase VERIFICATION.md files MUST be flagged as orphaned. Orphaned requirements are treated as `unsatisfied` — they were assigned but never verified by any phase.
129
+
130
+ ## 6. Aggregate into v{version}-MILESTONE-AUDIT.md
131
+
132
+ Create `.planning/v{version}-v{version}-MILESTONE-AUDIT.md` with:
133
+
134
+ ```yaml
135
+ ---
136
+ milestone: {version}
137
+ audited: {timestamp}
138
+ status: passed | gaps_found | tech_debt
139
+ scores:
140
+ requirements: N/M
141
+ phases: N/M
142
+ integration: N/M
143
+ flows: N/M
144
+ gaps: # Critical blockers
145
+ requirements:
146
+ - id: "{REQ-ID}"
147
+ status: "unsatisfied | partial | orphaned"
148
+ phase: "{assigned phase}"
149
+ claimed_by_plans: ["{plan files that reference this requirement}"]
150
+ completed_by_plans: ["{plan files whose SUMMARY marks it complete}"]
151
+ verification_status: "passed | gaps_found | missing | orphaned"
152
+ evidence: "{specific evidence or lack thereof}"
153
+ integration: [...]
154
+ flows: [...]
155
+ tech_debt: # Non-critical, deferred
156
+ - phase: 01-auth
157
+ items:
158
+ - "TODO: add rate limiting"
159
+ - "Warning: no password strength validation"
160
+ - phase: 03-dashboard
161
+ items:
162
+ - "Deferred: mobile responsive layout"
163
+ ---
164
+ ```
165
+
166
+ Plus full markdown report with tables for requirements, phases, integration, tech debt.
167
+
168
+ **Status values:**
169
+ - `passed` — all requirements met, no critical gaps, minimal tech debt
170
+ - `gaps_found` — critical blockers exist
171
+ - `tech_debt` — no blockers but accumulated deferred items need review
172
+
173
+ ## 7. Present Results
174
+
175
+ Route by status (see `<offer_next>`).
176
+
177
+ </process>
178
+
179
+ <offer_next>
180
+ Output this markdown directly (not as a code block). Route based on status:
181
+
182
+ ---
183
+
184
+ **If passed:**
185
+
186
+ ## ✓ Milestone {version} — Audit Passed
187
+
188
+ **Score:** {N}/{M} requirements satisfied
189
+ **Report:** .planning/v{version}-MILESTONE-AUDIT.md
190
+
191
+ All requirements covered. Cross-phase integration verified. E2E flows complete.
192
+
193
+ ───────────────────────────────────────────────────────────────
194
+
195
+ ## ▶ Next Up
196
+
197
+ **Complete milestone** — archive and tag
198
+
199
+ /gsd:complete-milestone {version}
200
+
201
+ <sub>/clear first → fresh context window</sub>
202
+
203
+ ───────────────────────────────────────────────────────────────
204
+
205
+ ---
206
+
207
+ **If gaps_found:**
208
+
209
+ ## ⚠ Milestone {version} — Gaps Found
210
+
211
+ **Score:** {N}/{M} requirements satisfied
212
+ **Report:** .planning/v{version}-MILESTONE-AUDIT.md
213
+
214
+ ### Unsatisfied Requirements
215
+
216
+ {For each unsatisfied requirement:}
217
+ - **{REQ-ID}: {description}** (Phase {X})
218
+ - {reason}
219
+
220
+ ### Cross-Phase Issues
221
+
222
+ {For each integration gap:}
223
+ - **{from} → {to}:** {issue}
224
+
225
+ ### Broken Flows
226
+
227
+ {For each flow gap:}
228
+ - **{flow name}:** breaks at {step}
229
+
230
+ ───────────────────────────────────────────────────────────────
231
+
232
+ ## ▶ Next Up
233
+
234
+ **Plan gap closure** — create phases to complete milestone
235
+
236
+ /gsd:plan-milestone-gaps
237
+
238
+ <sub>/clear first → fresh context window</sub>
239
+
240
+ ───────────────────────────────────────────────────────────────
241
+
242
+ **Also available:**
243
+ - cat .planning/v{version}-MILESTONE-AUDIT.md — see full report
244
+ - /gsd:complete-milestone {version} — proceed anyway (accept tech debt)
245
+
246
+ ───────────────────────────────────────────────────────────────
247
+
248
+ ---
249
+
250
+ **If tech_debt (no blockers but accumulated debt):**
251
+
252
+ ## ⚡ Milestone {version} — Tech Debt Review
253
+
254
+ **Score:** {N}/{M} requirements satisfied
255
+ **Report:** .planning/v{version}-MILESTONE-AUDIT.md
256
+
257
+ All requirements met. No critical blockers. Accumulated tech debt needs review.
258
+
259
+ ### Tech Debt by Phase
260
+
261
+ {For each phase with debt:}
262
+ **Phase {X}: {name}**
263
+ - {item 1}
264
+ - {item 2}
265
+
266
+ ### Total: {N} items across {M} phases
267
+
268
+ ───────────────────────────────────────────────────────────────
269
+
270
+ ## ▶ Options
271
+
272
+ **A. Complete milestone** — accept debt, track in backlog
273
+
274
+ /gsd:complete-milestone {version}
275
+
276
+ **B. Plan cleanup phase** — address debt before completing
277
+
278
+ /gsd:plan-milestone-gaps
279
+
280
+ <sub>/clear first → fresh context window</sub>
281
+
282
+ ───────────────────────────────────────────────────────────────
283
+ </offer_next>
284
+
285
+ <success_criteria>
286
+ - [ ] Milestone scope identified
287
+ - [ ] All phase VERIFICATION.md files read
288
+ - [ ] SUMMARY.md `requirements-completed` frontmatter extracted for each phase
289
+ - [ ] REQUIREMENTS.md traceability table parsed for all milestone REQ-IDs
290
+ - [ ] 3-source cross-reference completed (VERIFICATION + SUMMARY + traceability)
291
+ - [ ] Orphaned requirements detected (in traceability but absent from all VERIFICATIONs)
292
+ - [ ] Tech debt and deferred gaps aggregated
293
+ - [ ] Integration checker spawned with milestone requirement IDs
294
+ - [ ] v{version}-MILESTONE-AUDIT.md created with structured requirement gap objects
295
+ - [ ] FAIL gate enforced — any unsatisfied requirement forces gaps_found status
296
+ - [ ] Results presented with actionable next steps
297
+ </success_criteria>
@@ -0,0 +1,176 @@
1
+ <purpose>
2
+ List all pending todos, allow selection, load full context for the selected todo, and route to appropriate action.
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="init_context">
12
+ Load todo context:
13
+
14
+ ```bash
15
+ INIT=$(node ./.claude/get-shit-done/bin/gsd-tools.cjs init todos)
16
+ ```
17
+
18
+ Extract from init JSON: `todo_count`, `todos`, `pending_dir`.
19
+
20
+ If `todo_count` is 0:
21
+ ```
22
+ No pending todos.
23
+
24
+ Todos are captured during work sessions with /gsd:add-todo.
25
+
26
+ ---
27
+
28
+ Would you like to:
29
+
30
+ 1. Continue with current phase (/gsd:progress)
31
+ 2. Add a todo now (/gsd:add-todo)
32
+ ```
33
+
34
+ Exit.
35
+ </step>
36
+
37
+ <step name="parse_filter">
38
+ Check for area filter in arguments:
39
+ - `/gsd:check-todos` → show all
40
+ - `/gsd:check-todos api` → filter to area:api only
41
+ </step>
42
+
43
+ <step name="list_todos">
44
+ Use the `todos` array from init context (already filtered by area if specified).
45
+
46
+ Parse and display as numbered list:
47
+
48
+ ```
49
+ Pending Todos:
50
+
51
+ 1. Add auth token refresh (api, 2d ago)
52
+ 2. Fix modal z-index issue (ui, 1d ago)
53
+ 3. Refactor database connection pool (database, 5h ago)
54
+
55
+ ---
56
+
57
+ Reply with a number to view details, or:
58
+ - `/gsd:check-todos [area]` to filter by area
59
+ - `q` to exit
60
+ ```
61
+
62
+ Format age as relative time from created timestamp.
63
+ </step>
64
+
65
+ <step name="handle_selection">
66
+ Wait for user to reply with a number.
67
+
68
+ If valid: load selected todo, proceed.
69
+ If invalid: "Invalid selection. Reply with a number (1-[N]) or `q` to exit."
70
+ </step>
71
+
72
+ <step name="load_context">
73
+ Read the todo file completely. Display:
74
+
75
+ ```
76
+ ## [title]
77
+
78
+ **Area:** [area]
79
+ **Created:** [date] ([relative time] ago)
80
+ **Files:** [list or "None"]
81
+
82
+ ### Problem
83
+ [problem section content]
84
+
85
+ ### Solution
86
+ [solution section content]
87
+ ```
88
+
89
+ If `files` field has entries, read and briefly summarize each.
90
+ </step>
91
+
92
+ <step name="check_roadmap">
93
+ Check for roadmap (can use init progress or directly check file existence):
94
+
95
+ If `.planning/ROADMAP.md` exists:
96
+ 1. Check if todo's area matches an upcoming phase
97
+ 2. Check if todo's files overlap with a phase's scope
98
+ 3. Note any match for action options
99
+ </step>
100
+
101
+ <step name="offer_actions">
102
+ **If todo maps to a roadmap phase:**
103
+
104
+ Use AskUserQuestion:
105
+ - header: "Action"
106
+ - question: "This todo relates to Phase [N]: [name]. What would you like to do?"
107
+ - options:
108
+ - "Work on it now" — move to done, start working
109
+ - "Add to phase plan" — include when planning Phase [N]
110
+ - "Brainstorm approach" — think through before deciding
111
+ - "Put it back" — return to list
112
+
113
+ **If no roadmap match:**
114
+
115
+ Use AskUserQuestion:
116
+ - header: "Action"
117
+ - question: "What would you like to do with this todo?"
118
+ - options:
119
+ - "Work on it now" — move to done, start working
120
+ - "Create a phase" — /gsd:add-phase with this scope
121
+ - "Brainstorm approach" — think through before deciding
122
+ - "Put it back" — return to list
123
+ </step>
124
+
125
+ <step name="execute_action">
126
+ **Work on it now:**
127
+ ```bash
128
+ mv ".planning/todos/pending/[filename]" ".planning/todos/done/"
129
+ ```
130
+ Update STATE.md todo count. Present problem/solution context. Begin work or ask how to proceed.
131
+
132
+ **Add to phase plan:**
133
+ Note todo reference in phase planning notes. Keep in pending. Return to list or exit.
134
+
135
+ **Create a phase:**
136
+ Display: `/gsd:add-phase [description from todo]`
137
+ Keep in pending. User runs command in fresh context.
138
+
139
+ **Brainstorm approach:**
140
+ Keep in pending. Start discussion about problem and approaches.
141
+
142
+ **Put it back:**
143
+ Return to list_todos step.
144
+ </step>
145
+
146
+ <step name="update_state">
147
+ After any action that changes todo count:
148
+
149
+ Re-run `init todos` to get updated count, then update STATE.md "### Pending Todos" section if exists.
150
+ </step>
151
+
152
+ <step name="git_commit">
153
+ If todo was moved to done/, commit the change:
154
+
155
+ ```bash
156
+ git rm --cached .planning/todos/pending/[filename] 2>/dev/null || true
157
+ node ./.claude/get-shit-done/bin/gsd-tools.cjs commit "docs: start work on todo - [title]" --files .planning/todos/done/[filename] .planning/STATE.md
158
+ ```
159
+
160
+ Tool respects `commit_docs` config and gitignore automatically.
161
+
162
+ Confirm: "Committed: docs: start work on todo - [title]"
163
+ </step>
164
+
165
+ </process>
166
+
167
+ <success_criteria>
168
+ - [ ] All pending todos listed with title, area, age
169
+ - [ ] Area filter applied if specified
170
+ - [ ] Selected todo's full context loaded
171
+ - [ ] Roadmap context checked for phase match
172
+ - [ ] Appropriate actions offered
173
+ - [ ] Selected action executed
174
+ - [ ] STATE.md updated if todo count changed
175
+ - [ ] Changes committed to git (if todo moved to done/)
176
+ </success_criteria>
@@ -0,0 +1,152 @@
1
+ <purpose>
2
+
3
+ Archive accumulated phase directories from completed milestones into `.planning/milestones/v{X.Y}-phases/`. Identifies which phases belong to each completed milestone, shows a dry-run summary, and moves directories on confirmation.
4
+
5
+ </purpose>
6
+
7
+ <required_reading>
8
+
9
+ 1. `.planning/MILESTONES.md`
10
+ 2. `.planning/milestones/` directory listing
11
+ 3. `.planning/phases/` directory listing
12
+
13
+ </required_reading>
14
+
15
+ <process>
16
+
17
+ <step name="identify_completed_milestones">
18
+
19
+ Read `.planning/MILESTONES.md` to identify completed milestones and their versions.
20
+
21
+ ```bash
22
+ cat .planning/MILESTONES.md
23
+ ```
24
+
25
+ Extract each milestone version (e.g., v1.0, v1.1, v2.0).
26
+
27
+ Check which milestone archive dirs already exist:
28
+
29
+ ```bash
30
+ ls -d .planning/milestones/v*-phases 2>/dev/null
31
+ ```
32
+
33
+ Filter to milestones that do NOT already have a `-phases` archive directory.
34
+
35
+ If all milestones already have phase archives:
36
+
37
+ ```
38
+ All completed milestones already have phase directories archived. Nothing to clean up.
39
+ ```
40
+
41
+ Stop here.
42
+
43
+ </step>
44
+
45
+ <step name="determine_phase_membership">
46
+
47
+ For each completed milestone without a `-phases` archive, read the archived ROADMAP snapshot to determine which phases belong to it:
48
+
49
+ ```bash
50
+ cat .planning/milestones/v{X.Y}-ROADMAP.md
51
+ ```
52
+
53
+ Extract phase numbers and names from the archived roadmap (e.g., Phase 1: Foundation, Phase 2: Auth).
54
+
55
+ Check which of those phase directories still exist in `.planning/phases/`:
56
+
57
+ ```bash
58
+ ls -d .planning/phases/*/ 2>/dev/null
59
+ ```
60
+
61
+ Match phase directories to milestone membership. Only include directories that still exist in `.planning/phases/`.
62
+
63
+ </step>
64
+
65
+ <step name="show_dry_run">
66
+
67
+ Present a dry-run summary for each milestone:
68
+
69
+ ```
70
+ ## Cleanup Summary
71
+
72
+ ### v{X.Y} — {Milestone Name}
73
+ These phase directories will be archived:
74
+ - 01-foundation/
75
+ - 02-auth/
76
+ - 03-core-features/
77
+
78
+ Destination: .planning/milestones/v{X.Y}-phases/
79
+
80
+ ### v{X.Z} — {Milestone Name}
81
+ These phase directories will be archived:
82
+ - 04-security/
83
+ - 05-hardening/
84
+
85
+ Destination: .planning/milestones/v{X.Z}-phases/
86
+ ```
87
+
88
+ If no phase directories remain to archive (all already moved or deleted):
89
+
90
+ ```
91
+ No phase directories found to archive. Phases may have been removed or archived previously.
92
+ ```
93
+
94
+ Stop here.
95
+
96
+ AskUserQuestion: "Proceed with archiving?" with options: "Yes — archive listed phases" | "Cancel"
97
+
98
+ If "Cancel": Stop.
99
+
100
+ </step>
101
+
102
+ <step name="archive_phases">
103
+
104
+ For each milestone, move phase directories:
105
+
106
+ ```bash
107
+ mkdir -p .planning/milestones/v{X.Y}-phases
108
+ ```
109
+
110
+ For each phase directory belonging to this milestone:
111
+
112
+ ```bash
113
+ mv .planning/phases/{dir} .planning/milestones/v{X.Y}-phases/
114
+ ```
115
+
116
+ Repeat for all milestones in the cleanup set.
117
+
118
+ </step>
119
+
120
+ <step name="commit">
121
+
122
+ Commit the changes:
123
+
124
+ ```bash
125
+ node ./.claude/get-shit-done/bin/gsd-tools.cjs commit "chore: archive phase directories from completed milestones" --files .planning/milestones/ .planning/phases/
126
+ ```
127
+
128
+ </step>
129
+
130
+ <step name="report">
131
+
132
+ ```
133
+ Archived:
134
+ {For each milestone}
135
+ - v{X.Y}: {N} phase directories → .planning/milestones/v{X.Y}-phases/
136
+
137
+ .planning/phases/ cleaned up.
138
+ ```
139
+
140
+ </step>
141
+
142
+ </process>
143
+
144
+ <success_criteria>
145
+
146
+ - [ ] All completed milestones without existing phase archives identified
147
+ - [ ] Phase membership determined from archived ROADMAP snapshots
148
+ - [ ] Dry-run summary shown and user confirmed
149
+ - [ ] Phase directories moved to `.planning/milestones/v{X.Y}-phases/`
150
+ - [ ] Changes committed
151
+
152
+ </success_criteria>