gsd-antigravity-kit 2.0.1 → 2.1.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 (251) hide show
  1. package/.agent/skills/gsd/SKILL.md +26 -4
  2. package/.agent/skills/gsd/VERSION +1 -1
  3. package/.agent/skills/gsd/assets/templates/AI-SPEC.md +246 -0
  4. package/.agent/skills/gsd/assets/templates/DEBUG.md +7 -2
  5. package/.agent/skills/gsd/assets/templates/config.json +56 -48
  6. package/.agent/skills/gsd/assets/templates/research.md +40 -0
  7. package/.agent/skills/gsd/assets/templates/spec.md +307 -0
  8. package/.agent/skills/gsd/assets/templates/state.md +8 -0
  9. package/.agent/skills/gsd/bin/gsd-tools.cjs +212 -11
  10. package/.agent/skills/gsd/bin/help-manifest.json +8 -2
  11. package/.agent/skills/gsd/bin/hooks/gsd-check-update-worker.js +108 -0
  12. package/.agent/skills/gsd/bin/hooks/gsd-check-update.js +14 -89
  13. package/.agent/skills/gsd/bin/hooks/gsd-context-monitor.js +34 -5
  14. package/.agent/skills/gsd/bin/hooks/gsd-phase-boundary.sh +1 -0
  15. package/.agent/skills/gsd/bin/hooks/gsd-prompt-guard.js +1 -1
  16. package/.agent/skills/gsd/bin/hooks/gsd-read-guard.js +6 -1
  17. package/.agent/skills/gsd/bin/hooks/gsd-session-state.sh +1 -0
  18. package/.agent/skills/gsd/bin/hooks/gsd-statusline.js +150 -16
  19. package/.agent/skills/gsd/bin/hooks/gsd-validate-commit.sh +1 -0
  20. package/.agent/skills/gsd/bin/hooks/gsd-workflow-guard.js +1 -1
  21. package/.agent/skills/gsd/bin/lib/audit.cjs +757 -0
  22. package/.agent/skills/gsd/bin/lib/commands.cjs +17 -7
  23. package/.agent/skills/gsd/bin/lib/config.cjs +66 -20
  24. package/.agent/skills/gsd/bin/lib/core.cjs +212 -12
  25. package/.agent/skills/gsd/bin/lib/frontmatter.cjs +6 -8
  26. package/.agent/skills/gsd/bin/lib/graphify.cjs +494 -0
  27. package/.agent/skills/gsd/bin/lib/gsd2-import.cjs +511 -0
  28. package/.agent/skills/gsd/bin/lib/init.cjs +371 -18
  29. package/.agent/skills/gsd/bin/lib/intel.cjs +9 -30
  30. package/.agent/skills/gsd/bin/lib/milestone.cjs +18 -17
  31. package/.agent/skills/gsd/bin/lib/model-profiles.cjs +1 -0
  32. package/.agent/skills/gsd/bin/lib/phase.cjs +225 -98
  33. package/.agent/skills/gsd/bin/lib/profile-output.cjs +17 -5
  34. package/.agent/skills/gsd/bin/lib/roadmap.cjs +12 -5
  35. package/.agent/skills/gsd/bin/lib/state.cjs +394 -129
  36. package/.agent/skills/gsd/bin/lib/template.cjs +8 -4
  37. package/.agent/skills/gsd/bin/lib/uat.cjs +2 -1
  38. package/.agent/skills/gsd/bin/lib/verify.cjs +111 -42
  39. package/.agent/skills/gsd/migration_report.md +2 -2
  40. package/.agent/skills/gsd/references/agents/gsd-advisor-researcher.md +23 -0
  41. package/.agent/skills/gsd/references/agents/gsd-ai-researcher.md +133 -0
  42. package/.agent/skills/gsd/references/agents/gsd-code-fixer.md +11 -10
  43. package/.agent/skills/gsd/references/agents/gsd-code-reviewer.md +2 -2
  44. package/.agent/skills/gsd/references/agents/gsd-codebase-mapper.md +13 -2
  45. package/.agent/skills/gsd/references/agents/gsd-debug-session-manager.md +314 -0
  46. package/.agent/skills/gsd/references/agents/gsd-debugger.md +147 -76
  47. package/.agent/skills/gsd/references/agents/gsd-doc-verifier.md +1 -1
  48. package/.agent/skills/gsd/references/agents/gsd-doc-writer.md +615 -602
  49. package/.agent/skills/gsd/references/agents/gsd-domain-researcher.md +153 -0
  50. package/.agent/skills/gsd/references/agents/gsd-eval-auditor.md +175 -0
  51. package/.agent/skills/gsd/references/agents/gsd-eval-planner.md +154 -0
  52. package/.agent/skills/gsd/references/agents/gsd-executor.md +108 -38
  53. package/.agent/skills/gsd/references/agents/gsd-framework-selector.md +160 -0
  54. package/.agent/skills/gsd/references/agents/gsd-integration-checker.md +454 -443
  55. package/.agent/skills/gsd/references/agents/gsd-intel-updater.md +40 -20
  56. package/.agent/skills/gsd/references/agents/gsd-nyquist-auditor.md +187 -176
  57. package/.agent/skills/gsd/references/agents/gsd-pattern-mapper.md +335 -0
  58. package/.agent/skills/gsd/references/agents/gsd-phase-researcher.md +112 -13
  59. package/.agent/skills/gsd/references/agents/gsd-plan-checker.md +104 -10
  60. package/.agent/skills/gsd/references/agents/gsd-planner.md +125 -167
  61. package/.agent/skills/gsd/references/agents/gsd-project-researcher.md +25 -2
  62. package/.agent/skills/gsd/references/agents/gsd-research-synthesizer.md +3 -3
  63. package/.agent/skills/gsd/references/agents/gsd-roadmapper.md +12 -1
  64. package/.agent/skills/gsd/references/agents/gsd-security-auditor.md +139 -128
  65. package/.agent/skills/gsd/references/agents/gsd-ui-auditor.md +3 -3
  66. package/.agent/skills/gsd/references/agents/gsd-ui-checker.md +11 -2
  67. package/.agent/skills/gsd/references/agents/gsd-ui-researcher.md +27 -4
  68. package/.agent/skills/gsd/references/agents/gsd-verifier.md +13 -19
  69. package/.agent/skills/gsd/references/commands/atomic/add-todo.md +2 -2
  70. package/.agent/skills/gsd/references/commands/atomic/check-todos.md +2 -2
  71. package/.agent/skills/gsd/references/commands/atomic/cleanup.md +2 -2
  72. package/.agent/skills/gsd/references/commands/atomic/do.md +2 -2
  73. package/.agent/skills/gsd/references/commands/atomic/help.md +2 -2
  74. package/.agent/skills/gsd/references/commands/atomic/join-discord.md +2 -2
  75. package/.agent/skills/gsd/references/commands/atomic/note.md +2 -2
  76. package/.agent/skills/gsd/references/commands/atomic/session-report.md +2 -2
  77. package/.agent/skills/gsd/references/commands/atomic/ship.md +2 -2
  78. package/.agent/skills/gsd/references/commands/atomic/stats.md +2 -2
  79. package/.agent/skills/gsd/references/commands/atomic/thread.md +141 -41
  80. package/.agent/skills/gsd/references/commands/atomic/undo.md +2 -2
  81. package/.agent/skills/gsd/references/commands/milestone/add-backlog.md +15 -12
  82. package/.agent/skills/gsd/references/commands/milestone/audit-milestone.md +2 -2
  83. package/.agent/skills/gsd/references/commands/milestone/complete-milestone.md +2 -2
  84. package/.agent/skills/gsd/references/commands/milestone/milestone-summary.md +2 -2
  85. package/.agent/skills/gsd/references/commands/milestone/new-milestone.md +2 -2
  86. package/.agent/skills/gsd/references/commands/milestone/plan-milestone-gaps.md +2 -2
  87. package/.agent/skills/gsd/references/commands/milestone/plant-seed.md +2 -2
  88. package/.agent/skills/gsd/references/commands/milestone/review-backlog.md +4 -4
  89. package/.agent/skills/gsd/references/commands/misc/ai-integration-phase.md +38 -0
  90. package/.agent/skills/gsd/references/commands/misc/audit-fix.md +2 -2
  91. package/.agent/skills/gsd/references/commands/misc/audit-uat.md +2 -2
  92. package/.agent/skills/gsd/references/commands/misc/eval-review.md +34 -0
  93. package/.agent/skills/gsd/references/commands/misc/extract_learnings.md +24 -0
  94. package/.agent/skills/gsd/references/commands/misc/from-gsd2.md +49 -0
  95. package/.agent/skills/gsd/references/commands/misc/graphify.md +203 -0
  96. package/.agent/skills/gsd/references/commands/misc/inbox.md +40 -0
  97. package/.agent/skills/gsd/references/commands/misc/next.md +5 -3
  98. package/.agent/skills/gsd/references/commands/misc/progress.md +4 -3
  99. package/.agent/skills/gsd/references/commands/misc/sketch-wrap-up.md +33 -0
  100. package/.agent/skills/gsd/references/commands/misc/sketch.md +47 -0
  101. package/.agent/skills/gsd/references/commands/misc/spec-phase.md +64 -0
  102. package/.agent/skills/gsd/references/commands/misc/spike-wrap-up.md +33 -0
  103. package/.agent/skills/gsd/references/commands/misc/spike.md +43 -0
  104. package/.agent/skills/gsd/references/commands/misc/verify-work.md +2 -2
  105. package/.agent/skills/gsd/references/commands/phase/add-phase.md +2 -2
  106. package/.agent/skills/gsd/references/commands/phase/add-tests.md +2 -2
  107. package/.agent/skills/gsd/references/commands/phase/discuss-phase.md +5 -5
  108. package/.agent/skills/gsd/references/commands/phase/execute-phase.md +4 -4
  109. package/.agent/skills/gsd/references/commands/phase/insert-phase.md +2 -2
  110. package/.agent/skills/gsd/references/commands/phase/list-phase-assumptions.md +2 -2
  111. package/.agent/skills/gsd/references/commands/phase/plan-phase.md +3 -3
  112. package/.agent/skills/gsd/references/commands/phase/remove-phase.md +2 -2
  113. package/.agent/skills/gsd/references/commands/phase/research-phase.md +5 -5
  114. package/.agent/skills/gsd/references/commands/phase/secure-phase.md +2 -2
  115. package/.agent/skills/gsd/references/commands/phase/ui-phase.md +2 -2
  116. package/.agent/skills/gsd/references/commands/phase/ui-review.md +2 -2
  117. package/.agent/skills/gsd/references/commands/phase/validate-phase.md +2 -2
  118. package/.agent/skills/gsd/references/commands/phase/workstreams.md +9 -9
  119. package/.agent/skills/gsd/references/commands/project/analyze-dependencies.md +2 -2
  120. package/.agent/skills/gsd/references/commands/project/explore.md +2 -2
  121. package/.agent/skills/gsd/references/commands/project/import.md +2 -2
  122. package/.agent/skills/gsd/references/commands/project/intel.md +10 -10
  123. package/.agent/skills/gsd/references/commands/project/list-workspaces.md +2 -2
  124. package/.agent/skills/gsd/references/commands/project/map-codebase.md +2 -2
  125. package/.agent/skills/gsd/references/commands/project/new-project.md +2 -2
  126. package/.agent/skills/gsd/references/commands/project/new-workspace.md +2 -2
  127. package/.agent/skills/gsd/references/commands/project/remove-workspace.md +2 -2
  128. package/.agent/skills/gsd/references/commands/project/scan.md +2 -2
  129. package/.agent/skills/gsd/references/commands/system/autonomous.md +4 -3
  130. package/.agent/skills/gsd/references/commands/system/code-review-fix.md +3 -3
  131. package/.agent/skills/gsd/references/commands/system/code-review.md +3 -3
  132. package/.agent/skills/gsd/references/commands/system/debug.md +177 -100
  133. package/.agent/skills/gsd/references/commands/system/docs-update.md +2 -2
  134. package/.agent/skills/gsd/references/commands/system/fast.md +2 -2
  135. package/.agent/skills/gsd/references/commands/system/forensics.md +2 -2
  136. package/.agent/skills/gsd/references/commands/system/gsd-tools.md +153 -6
  137. package/.agent/skills/gsd/references/commands/system/health.md +2 -2
  138. package/.agent/skills/gsd/references/commands/system/manager.md +3 -3
  139. package/.agent/skills/gsd/references/commands/system/pause-work.md +2 -2
  140. package/.agent/skills/gsd/references/commands/system/pr-branch.md +2 -2
  141. package/.agent/skills/gsd/references/commands/system/profile-user.md +2 -2
  142. package/.agent/skills/gsd/references/commands/system/quick.md +127 -3
  143. package/.agent/skills/gsd/references/commands/system/reapply-patches.md +45 -6
  144. package/.agent/skills/gsd/references/commands/system/resume-work.md +2 -2
  145. package/.agent/skills/gsd/references/commands/system/review.md +6 -4
  146. package/.agent/skills/gsd/references/commands/system/set-profile.md +3 -3
  147. package/.agent/skills/gsd/references/commands/system/settings.md +2 -2
  148. package/.agent/skills/gsd/references/commands/system/update.md +2 -2
  149. package/.agent/skills/gsd/references/docs/ai-evals.md +156 -0
  150. package/.agent/skills/gsd/references/docs/ai-frameworks.md +186 -0
  151. package/.agent/skills/gsd/references/docs/artifact-types.md +18 -0
  152. package/.agent/skills/gsd/references/docs/autonomous-smart-discuss.md +277 -0
  153. package/.agent/skills/gsd/references/docs/checkpoints.md +30 -0
  154. package/.agent/skills/gsd/references/docs/common-bug-patterns.md +49 -49
  155. package/.agent/skills/gsd/references/docs/continuation-format.md +11 -7
  156. package/.agent/skills/gsd/references/docs/debugger-philosophy.md +76 -0
  157. package/.agent/skills/gsd/references/docs/decimal-phase-calculation.md +64 -64
  158. package/.agent/skills/gsd/references/docs/executor-examples.md +110 -0
  159. package/.agent/skills/gsd/references/docs/git-integration.md +4 -4
  160. package/.agent/skills/gsd/references/docs/git-planning-commit.md +40 -38
  161. package/.agent/skills/gsd/references/docs/ios-scaffold.md +123 -0
  162. package/.agent/skills/gsd/references/docs/mandatory-initial-read.md +2 -0
  163. package/.agent/skills/gsd/references/docs/phase-argument-parsing.md +61 -61
  164. package/.agent/skills/gsd/references/docs/planner-antipatterns.md +89 -0
  165. package/.agent/skills/gsd/references/docs/planner-revision.md +87 -87
  166. package/.agent/skills/gsd/references/docs/planner-source-audit.md +73 -0
  167. package/.agent/skills/gsd/references/docs/planning-config.md +33 -8
  168. package/.agent/skills/gsd/references/docs/project-skills-discovery.md +19 -0
  169. package/.agent/skills/gsd/references/docs/sketch-interactivity.md +41 -0
  170. package/.agent/skills/gsd/references/docs/sketch-theme-system.md +94 -0
  171. package/.agent/skills/gsd/references/docs/sketch-tooling.md +45 -0
  172. package/.agent/skills/gsd/references/docs/sketch-variant-patterns.md +81 -0
  173. package/.agent/skills/gsd/references/docs/tdd.md +67 -0
  174. package/.agent/skills/gsd/references/docs/universal-anti-patterns.md +5 -0
  175. package/.agent/skills/gsd/references/docs/workstream-flag.md +11 -11
  176. package/.agent/skills/gsd/references/mapping.md +1 -1
  177. package/.agent/skills/gsd/references/workflows/add-phase.md +112 -112
  178. package/.agent/skills/gsd/references/workflows/add-tests.md +6 -3
  179. package/.agent/skills/gsd/references/workflows/add-todo.md +5 -3
  180. package/.agent/skills/gsd/references/workflows/ai-integration-phase.md +284 -0
  181. package/.agent/skills/gsd/references/workflows/audit-fix.md +157 -157
  182. package/.agent/skills/gsd/references/workflows/audit-milestone.md +340 -340
  183. package/.agent/skills/gsd/references/workflows/audit-uat.md +109 -109
  184. package/.agent/skills/gsd/references/workflows/autonomous.md +20 -288
  185. package/.agent/skills/gsd/references/workflows/check-todos.md +4 -2
  186. package/.agent/skills/gsd/references/workflows/cleanup.md +3 -1
  187. package/.agent/skills/gsd/references/workflows/code-review-fix.md +497 -497
  188. package/.agent/skills/gsd/references/workflows/code-review.md +515 -515
  189. package/.agent/skills/gsd/references/workflows/complete-milestone.md +97 -24
  190. package/.agent/skills/gsd/references/workflows/diagnose-issues.md +238 -238
  191. package/.agent/skills/gsd/references/workflows/discovery-phase.md +2 -0
  192. package/.agent/skills/gsd/references/workflows/discuss-phase-assumptions.md +11 -11
  193. package/.agent/skills/gsd/references/workflows/discuss-phase.md +143 -19
  194. package/.agent/skills/gsd/references/workflows/do.md +8 -2
  195. package/.agent/skills/gsd/references/workflows/docs-update.md +5 -3
  196. package/.agent/skills/gsd/references/workflows/eval-review.md +155 -0
  197. package/.agent/skills/gsd/references/workflows/execute-phase.md +338 -54
  198. package/.agent/skills/gsd/references/workflows/execute-plan.md +80 -104
  199. package/.agent/skills/gsd/references/workflows/explore.md +3 -1
  200. package/.agent/skills/gsd/references/workflows/extract_learnings.md +232 -0
  201. package/.agent/skills/gsd/references/workflows/forensics.md +3 -3
  202. package/.agent/skills/gsd/references/workflows/health.md +2 -2
  203. package/.agent/skills/gsd/references/workflows/help.md +59 -1
  204. package/.agent/skills/gsd/references/workflows/import.md +3 -1
  205. package/.agent/skills/gsd/references/workflows/inbox.md +387 -384
  206. package/.agent/skills/gsd/references/workflows/insert-phase.md +130 -130
  207. package/.agent/skills/gsd/references/workflows/list-workspaces.md +56 -56
  208. package/.agent/skills/gsd/references/workflows/manager.md +5 -3
  209. package/.agent/skills/gsd/references/workflows/map-codebase.md +19 -5
  210. package/.agent/skills/gsd/references/workflows/milestone-summary.md +6 -6
  211. package/.agent/skills/gsd/references/workflows/new-milestone.md +63 -9
  212. package/.agent/skills/gsd/references/workflows/new-project.md +126 -22
  213. package/.agent/skills/gsd/references/workflows/new-workspace.md +6 -4
  214. package/.agent/skills/gsd/references/workflows/next.md +220 -153
  215. package/.agent/skills/gsd/references/workflows/note.md +2 -0
  216. package/.agent/skills/gsd/references/workflows/pause-work.md +11 -7
  217. package/.agent/skills/gsd/references/workflows/plan-milestone-gaps.md +273 -273
  218. package/.agent/skills/gsd/references/workflows/plan-phase.md +281 -62
  219. package/.agent/skills/gsd/references/workflows/plant-seed.md +4 -1
  220. package/.agent/skills/gsd/references/workflows/pr-branch.md +41 -13
  221. package/.agent/skills/gsd/references/workflows/profile-user.md +15 -13
  222. package/.agent/skills/gsd/references/workflows/progress.md +133 -21
  223. package/.agent/skills/gsd/references/workflows/quick.md +67 -27
  224. package/.agent/skills/gsd/references/workflows/remove-phase.md +155 -155
  225. package/.agent/skills/gsd/references/workflows/remove-workspace.md +4 -2
  226. package/.agent/skills/gsd/references/workflows/research-phase.md +3 -3
  227. package/.agent/skills/gsd/references/workflows/resume-project.md +3 -3
  228. package/.agent/skills/gsd/references/workflows/review.md +71 -8
  229. package/.agent/skills/gsd/references/workflows/scan.md +102 -102
  230. package/.agent/skills/gsd/references/workflows/secure-phase.md +7 -5
  231. package/.agent/skills/gsd/references/workflows/settings.md +24 -7
  232. package/.agent/skills/gsd/references/workflows/ship.md +71 -6
  233. package/.agent/skills/gsd/references/workflows/sketch-wrap-up.md +283 -0
  234. package/.agent/skills/gsd/references/workflows/sketch.md +263 -0
  235. package/.agent/skills/gsd/references/workflows/spec-phase.md +262 -0
  236. package/.agent/skills/gsd/references/workflows/spike-wrap-up.md +273 -0
  237. package/.agent/skills/gsd/references/workflows/spike.md +270 -0
  238. package/.agent/skills/gsd/references/workflows/stats.md +60 -60
  239. package/.agent/skills/gsd/references/workflows/transition.md +671 -671
  240. package/.agent/skills/gsd/references/workflows/ui-phase.md +33 -12
  241. package/.agent/skills/gsd/references/workflows/ui-review.md +6 -4
  242. package/.agent/skills/gsd/references/workflows/undo.md +3 -1
  243. package/.agent/skills/gsd/references/workflows/update.md +113 -2
  244. package/.agent/skills/gsd/references/workflows/validate-phase.md +7 -5
  245. package/.agent/skills/gsd/references/workflows/verify-phase.md +93 -10
  246. package/.agent/skills/gsd/references/workflows/verify-work.md +50 -10
  247. package/.agent/skills/gsd-converter/references/mapping.md +1 -1
  248. package/.agent/skills/gsd-converter/scripts/convert.py +36 -17
  249. package/.agent/skills/gsd-converter/scripts/regression_test.py +68 -33
  250. package/README.md +3 -2
  251. package/package.json +1 -1
@@ -1,273 +1,273 @@
1
- <purpose>
2
- Create all phases necessary to close gaps identified by `/gsd-audit-milestone`. Reads MILESTONE-AUDIT.md, groups gaps into logical phases, creates phase entries in ROADMAP.md, and offers to plan each phase. One command creates all fix phases — no manual `/gsd-add-phase` per gap.
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
- ## 1. Load Audit Results
12
-
13
- ```bash
14
- # Find the most recent audit file
15
- (ls -t .planning/v*-MILESTONE-AUDIT.md 2>/dev/null || true) | head -1
16
- ```
17
-
18
- Parse YAML frontmatter to extract structured gaps:
19
- - `gaps.requirements` — unsatisfied requirements
20
- - `gaps.integration` — missing cross-phase connections
21
- - `gaps.flows` — broken E2E flows
22
-
23
- If no audit file exists or has no gaps, error:
24
- ```
25
- No audit gaps found. Run `/gsd-audit-milestone` first.
26
- ```
27
-
28
- ## 2. Prioritize Gaps
29
-
30
- Group gaps by priority from REQUIREMENTS.md:
31
-
32
- | Priority | Action |
33
- |----------|--------|
34
- | `must` | Create phase, blocks milestone |
35
- | `should` | Create phase, recommended |
36
- | `nice` | Ask user: include or defer? |
37
-
38
- For integration/flow gaps, infer priority from affected requirements.
39
-
40
- ## 3. Group Gaps into Phases
41
-
42
- Cluster related gaps into logical phases:
43
-
44
- **Grouping rules:**
45
- - Same affected phase → combine into one fix phase
46
- - Same subsystem (auth, API, UI) → combine
47
- - Dependency order (fix stubs before wiring)
48
- - Keep phases focused: 2-4 tasks each
49
-
50
- **Example grouping:**
51
- ```
52
- Gap: DASH-01 unsatisfied (Dashboard doesn't fetch)
53
- Gap: Integration Phase 1→3 (Auth not passed to API calls)
54
- Gap: Flow "View dashboard" broken at data fetch
55
-
56
- → Phase 6: "Wire Dashboard to API"
57
- - Add fetch to Dashboard.tsx
58
- - Include auth header in fetch
59
- - Handle response, update state
60
- - Render user data
61
- ```
62
-
63
- ## 4. Determine Phase Numbers
64
-
65
- Find highest existing phase:
66
- ```bash
67
- # Get sorted phase list, extract last one
68
- .agent/skills/gsd/bin/gsd-tools.cjs" phases list --pick directories[-1])
69
- ```
70
-
71
- New phases continue from there:
72
- - If Phase 5 is highest, gaps become Phase 6, 7, 8...
73
-
74
- ## 5. Present Gap Closure Plan
75
-
76
- ```markdown
77
- ## Gap Closure Plan
78
-
79
- **Milestone:** {version}
80
- **Gaps to close:** {N} requirements, {M} integration, {K} flows
81
-
82
- ### Proposed Phases
83
-
84
- **Phase {N}: {Name}**
85
- Closes:
86
- - {REQ-ID}: {description}
87
- - Integration: {from} → {to}
88
- Tasks: {count}
89
-
90
- **Phase {N+1}: {Name}**
91
- Closes:
92
- - {REQ-ID}: {description}
93
- - Flow: {flow name}
94
- Tasks: {count}
95
-
96
- {If nice-to-have gaps exist:}
97
-
98
- ### Deferred (nice-to-have)
99
-
100
- These gaps are optional. Include them?
101
- - {gap description}
102
- - {gap description}
103
-
104
- ---
105
-
106
- Create these {X} phases? (yes / adjust / defer all optional)
107
- ```
108
-
109
- Wait for user confirmation.
110
-
111
- ## 6. Update ROADMAP.md
112
-
113
- Add new phases to current milestone:
114
-
115
- ```markdown
116
- ### Phase {N}: {Name}
117
- **Goal:** {derived from gaps being closed}
118
- **Requirements:** {REQ-IDs being satisfied}
119
- **Gap Closure:** Closes gaps from audit
120
-
121
- ### Phase {N+1}: {Name}
122
- ...
123
- ```
124
-
125
- ## 7. Update REQUIREMENTS.md Traceability Table (REQUIRED)
126
-
127
- For each REQ-ID assigned to a gap closure phase:
128
- - Update the Phase column to reflect the new gap closure phase
129
- - Reset Status to `Pending`
130
-
131
- Reset checked-off requirements the audit found unsatisfied:
132
- - Change `[x]` → `[ ]` for any requirement marked unsatisfied in the audit
133
- - Update coverage count at top of REQUIREMENTS.md
134
-
135
- ```bash
136
- # Verify traceability table reflects gap closure assignments
137
- grep -c "Pending" .planning/REQUIREMENTS.md
138
- ```
139
-
140
- ## 8. Create Phase Directories
141
-
142
- ```bash
143
- mkdir -p ".planning/phases/{NN}-{name}"
144
- ```
145
-
146
- ## 9. Commit Roadmap and Requirements Update
147
-
148
- ```bash
149
- .agent/skills/gsd/bin/gsd-tools.cjs" commit "docs(roadmap): add gap closure phases {N}-{M}" --files .planning/ROADMAP.md .planning/REQUIREMENTS.md
150
- ```
151
-
152
- ## 10. Offer Next Steps
153
-
154
- ```markdown
155
- ## ✓ Gap Closure Phases Created
156
-
157
- **Phases added:** {N} - {M}
158
- **Gaps addressed:** {count} requirements, {count} integration, {count} flows
159
-
160
- ---
161
-
162
- ## ▶ Next Up
163
-
164
- **Plan first gap closure phase**
165
-
166
- `/clear` then:
167
-
168
- `/gsd-plan-phase {N}`
169
-
170
- ---
171
-
172
- **Also available:**
173
- - `/gsd-execute-phase {N}` — if plans already exist
174
- - `cat .planning/ROADMAP.md` — see updated roadmap
175
-
176
- ---
177
-
178
- **After all gap phases complete:**
179
-
180
- `/gsd-audit-milestone` — re-audit to verify gaps closed
181
- `/gsd-complete-milestone {version}` — archive when audit passes
182
- ```
183
-
184
- </process>
185
-
186
- <gap_to_phase_mapping>
187
-
188
- ## How Gaps Become Tasks
189
-
190
- **Requirement gap → Tasks:**
191
- ```yaml
192
- gap:
193
- id: DASH-01
194
- description: "User sees their data"
195
- reason: "Dashboard exists but doesn't fetch from API"
196
- missing:
197
- - "useEffect with fetch to /api/user/data"
198
- - "State for user data"
199
- - "Render user data in JSX"
200
-
201
- becomes:
202
-
203
- phase: "Wire Dashboard Data"
204
- tasks:
205
- - name: "Add data fetching"
206
- files: [src/components/Dashboard.tsx]
207
- action: "Add useEffect that fetches /api/user/data on mount"
208
-
209
- - name: "Add state management"
210
- files: [src/components/Dashboard.tsx]
211
- action: "Add useState for userData, loading, error states"
212
-
213
- - name: "Render user data"
214
- files: [src/components/Dashboard.tsx]
215
- action: "Replace placeholder with userData.map rendering"
216
- ```
217
-
218
- **Integration gap → Tasks:**
219
- ```yaml
220
- gap:
221
- from_phase: 1
222
- to_phase: 3
223
- connection: "Auth token → API calls"
224
- reason: "Dashboard API calls don't include auth header"
225
- missing:
226
- - "Auth header in fetch calls"
227
- - "Token refresh on 401"
228
-
229
- becomes:
230
-
231
- phase: "Add Auth to Dashboard API Calls"
232
- tasks:
233
- - name: "Add auth header to fetches"
234
- files: [src/components/Dashboard.tsx, src/lib/api.ts]
235
- action: "Include Authorization header with token in all API calls"
236
-
237
- - name: "Handle 401 responses"
238
- files: [src/lib/api.ts]
239
- action: "Add interceptor to refresh token or redirect to login on 401"
240
- ```
241
-
242
- **Flow gap → Tasks:**
243
- ```yaml
244
- gap:
245
- name: "User views dashboard after login"
246
- broken_at: "Dashboard data load"
247
- reason: "No fetch call"
248
- missing:
249
- - "Fetch user data on mount"
250
- - "Display loading state"
251
- - "Render user data"
252
-
253
- becomes:
254
-
255
- # Usually same phase as requirement/integration gap
256
- # Flow gaps often overlap with other gap types
257
- ```
258
-
259
- </gap_to_phase_mapping>
260
-
261
- <success_criteria>
262
- - [ ] MILESTONE-AUDIT.md loaded and gaps parsed
263
- - [ ] Gaps prioritized (must/should/nice)
264
- - [ ] Gaps grouped into logical phases
265
- - [ ] User confirmed phase plan
266
- - [ ] ROADMAP.md updated with new phases
267
- - [ ] REQUIREMENTS.md traceability table updated with gap closure phase assignments
268
- - [ ] Unsatisfied requirement checkboxes reset (`[x]` → `[ ]`)
269
- - [ ] Coverage count updated in REQUIREMENTS.md
270
- - [ ] Phase directories created
271
- - [ ] Changes committed (includes REQUIREMENTS.md)
272
- - [ ] User knows to run `/gsd-plan-phase` next
273
- </success_criteria>
1
+ <purpose>
2
+ Create all phases necessary to close gaps identified by `/gsd-audit-milestone`. Reads MILESTONE-AUDIT.md, groups gaps into logical phases, creates phase entries in ROADMAP.md, and offers to plan each phase. One command creates all fix phases — no manual `/gsd-add-phase` per gap.
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
+ ## 1. Load Audit Results
12
+
13
+ ```bash
14
+ # Find the most recent audit file
15
+ (ls -t .planning/v*-MILESTONE-AUDIT.md 2>/dev/null || true) | head -1
16
+ ```
17
+
18
+ Parse YAML frontmatter to extract structured gaps:
19
+ - `gaps.requirements` — unsatisfied requirements
20
+ - `gaps.integration` — missing cross-phase connections
21
+ - `gaps.flows` — broken E2E flows
22
+
23
+ If no audit file exists or has no gaps, error:
24
+ ```
25
+ No audit gaps found. Run `/gsd-audit-milestone` first.
26
+ ```
27
+
28
+ ## 2. Prioritize Gaps
29
+
30
+ Group gaps by priority from REQUIREMENTS.md:
31
+
32
+ | Priority | Action |
33
+ |----------|--------|
34
+ | `must` | Create phase, blocks milestone |
35
+ | `should` | Create phase, recommended |
36
+ | `nice` | Ask user: include or defer? |
37
+
38
+ For integration/flow gaps, infer priority from affected requirements.
39
+
40
+ ## 3. Group Gaps into Phases
41
+
42
+ Cluster related gaps into logical phases:
43
+
44
+ **Grouping rules:**
45
+ - Same affected phase → combine into one fix phase
46
+ - Same subsystem (auth, API, UI) → combine
47
+ - Dependency order (fix stubs before wiring)
48
+ - Keep phases focused: 2-4 tasks each
49
+
50
+ **Example grouping:**
51
+ ```
52
+ Gap: DASH-01 unsatisfied (Dashboard doesn't fetch)
53
+ Gap: Integration Phase 1→3 (Auth not passed to API calls)
54
+ Gap: Flow "View dashboard" broken at data fetch
55
+
56
+ → Phase 6: "Wire Dashboard to API"
57
+ - Add fetch to Dashboard.tsx
58
+ - Include auth header in fetch
59
+ - Handle response, update state
60
+ - Render user data
61
+ ```
62
+
63
+ ## 4. Determine Phase Numbers
64
+
65
+ Find highest existing phase:
66
+ ```bash
67
+ # Get sorted phase list, extract last one
68
+ HIGHEST=$(gsd-sdk query phases.list --pick directories[-1])
69
+ ```
70
+
71
+ New phases continue from there:
72
+ - If Phase 5 is highest, gaps become Phase 6, 7, 8...
73
+
74
+ ## 5. Present Gap Closure Plan
75
+
76
+ ```markdown
77
+ ## Gap Closure Plan
78
+
79
+ **Milestone:** {version}
80
+ **Gaps to close:** {N} requirements, {M} integration, {K} flows
81
+
82
+ ### Proposed Phases
83
+
84
+ **Phase {N}: {Name}**
85
+ Closes:
86
+ - {REQ-ID}: {description}
87
+ - Integration: {from} → {to}
88
+ Tasks: {count}
89
+
90
+ **Phase {N+1}: {Name}**
91
+ Closes:
92
+ - {REQ-ID}: {description}
93
+ - Flow: {flow name}
94
+ Tasks: {count}
95
+
96
+ {If nice-to-have gaps exist:}
97
+
98
+ ### Deferred (nice-to-have)
99
+
100
+ These gaps are optional. Include them?
101
+ - {gap description}
102
+ - {gap description}
103
+
104
+ ---
105
+
106
+ Create these {X} phases? (yes / adjust / defer all optional)
107
+ ```
108
+
109
+ Wait for user confirmation.
110
+
111
+ ## 6. Update ROADMAP.md
112
+
113
+ Add new phases to current milestone:
114
+
115
+ ```markdown
116
+ ### Phase {N}: {Name}
117
+ **Goal:** {derived from gaps being closed}
118
+ **Requirements:** {REQ-IDs being satisfied}
119
+ **Gap Closure:** Closes gaps from audit
120
+
121
+ ### Phase {N+1}: {Name}
122
+ ...
123
+ ```
124
+
125
+ ## 7. Update REQUIREMENTS.md Traceability Table (REQUIRED)
126
+
127
+ For each REQ-ID assigned to a gap closure phase:
128
+ - Update the Phase column to reflect the new gap closure phase
129
+ - Reset Status to `Pending`
130
+
131
+ Reset checked-off requirements the audit found unsatisfied:
132
+ - Change `[x]` → `[ ]` for any requirement marked unsatisfied in the audit
133
+ - Update coverage count at top of REQUIREMENTS.md
134
+
135
+ ```bash
136
+ # Verify traceability table reflects gap closure assignments
137
+ grep -c "Pending" .planning/REQUIREMENTS.md
138
+ ```
139
+
140
+ ## 8. Create Phase Directories
141
+
142
+ ```bash
143
+ mkdir -p ".planning/phases/{NN}-{name}"
144
+ ```
145
+
146
+ ## 9. Commit Roadmap and Requirements Update
147
+
148
+ ```bash
149
+ gsd-sdk query commit "docs(roadmap): add gap closure phases {N}-{M}" .planning/ROADMAP.md .planning/REQUIREMENTS.md
150
+ ```
151
+
152
+ ## 10. Offer Next Steps
153
+
154
+ ```markdown
155
+ ## ✓ Gap Closure Phases Created
156
+
157
+ **Phases added:** {N} - {M}
158
+ **Gaps addressed:** {count} requirements, {count} integration, {count} flows
159
+
160
+ ---
161
+
162
+ ## ▶ Next Up — [${PROJECT_CODE}] ${PROJECT_TITLE}
163
+
164
+ **Plan first gap closure phase**
165
+
166
+ `/clear` then:
167
+
168
+ `/gsd-plan-phase {N}`
169
+
170
+ ---
171
+
172
+ **Also available:**
173
+ - `/gsd-execute-phase {N}` — if plans already exist
174
+ - `cat .planning/ROADMAP.md` — see updated roadmap
175
+
176
+ ---
177
+
178
+ **After all gap phases complete:**
179
+
180
+ `/gsd-audit-milestone` — re-audit to verify gaps closed
181
+ `/gsd-complete-milestone {version}` — archive when audit passes
182
+ ```
183
+
184
+ </process>
185
+
186
+ <gap_to_phase_mapping>
187
+
188
+ ## How Gaps Become Tasks
189
+
190
+ **Requirement gap → Tasks:**
191
+ ```yaml
192
+ gap:
193
+ id: DASH-01
194
+ description: "User sees their data"
195
+ reason: "Dashboard exists but doesn't fetch from API"
196
+ missing:
197
+ - "useEffect with fetch to /api/user/data"
198
+ - "State for user data"
199
+ - "Render user data in JSX"
200
+
201
+ becomes:
202
+
203
+ phase: "Wire Dashboard Data"
204
+ tasks:
205
+ - name: "Add data fetching"
206
+ files: [src/components/Dashboard.tsx]
207
+ action: "Add useEffect that fetches /api/user/data on mount"
208
+
209
+ - name: "Add state management"
210
+ files: [src/components/Dashboard.tsx]
211
+ action: "Add useState for userData, loading, error states"
212
+
213
+ - name: "Render user data"
214
+ files: [src/components/Dashboard.tsx]
215
+ action: "Replace placeholder with userData.map rendering"
216
+ ```
217
+
218
+ **Integration gap → Tasks:**
219
+ ```yaml
220
+ gap:
221
+ from_phase: 1
222
+ to_phase: 3
223
+ connection: "Auth token → API calls"
224
+ reason: "Dashboard API calls don't include auth header"
225
+ missing:
226
+ - "Auth header in fetch calls"
227
+ - "Token refresh on 401"
228
+
229
+ becomes:
230
+
231
+ phase: "Add Auth to Dashboard API Calls"
232
+ tasks:
233
+ - name: "Add auth header to fetches"
234
+ files: [src/components/Dashboard.tsx, src/lib/api.ts]
235
+ action: "Include Authorization header with token in all API calls"
236
+
237
+ - name: "Handle 401 responses"
238
+ files: [src/lib/api.ts]
239
+ action: "Add interceptor to refresh token or redirect to login on 401"
240
+ ```
241
+
242
+ **Flow gap → Tasks:**
243
+ ```yaml
244
+ gap:
245
+ name: "User views dashboard after login"
246
+ broken_at: "Dashboard data load"
247
+ reason: "No fetch call"
248
+ missing:
249
+ - "Fetch user data on mount"
250
+ - "Display loading state"
251
+ - "Render user data"
252
+
253
+ becomes:
254
+
255
+ # Usually same phase as requirement/integration gap
256
+ # Flow gaps often overlap with other gap types
257
+ ```
258
+
259
+ </gap_to_phase_mapping>
260
+
261
+ <success_criteria>
262
+ - [ ] MILESTONE-AUDIT.md loaded and gaps parsed
263
+ - [ ] Gaps prioritized (must/should/nice)
264
+ - [ ] Gaps grouped into logical phases
265
+ - [ ] User confirmed phase plan
266
+ - [ ] ROADMAP.md updated with new phases
267
+ - [ ] REQUIREMENTS.md traceability table updated with gap closure phase assignments
268
+ - [ ] Unsatisfied requirement checkboxes reset (`[x]` → `[ ]`)
269
+ - [ ] Coverage count updated in REQUIREMENTS.md
270
+ - [ ] Phase directories created
271
+ - [ ] Changes committed (includes REQUIREMENTS.md)
272
+ - [ ] User knows to run `/gsd-plan-phase` next
273
+ </success_criteria>