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,153 +1,220 @@
1
- <purpose>
2
- Detect current project state and automatically advance to the next logical GSD workflow step.
3
- Reads project state to determine: discuss → plan → execute → verify → complete progression.
4
- </purpose>
5
-
6
- <required_reading>
7
- Read all files referenced by the invoking prompt's execution_context before starting.
8
- </required_reading>
9
-
10
- <process>
11
-
12
- <step name="detect_state">
13
- Read project state to determine current position:
14
-
15
- ```bash
16
- # Get state snapshot
17
- .agent/skills/gsd/bin/gsd-tools.cjs" state json 2>/dev/null || echo "{}"
18
- ```
19
-
20
- Also read:
21
- - `.planning/STATE.md` — current phase, progress, plan counts
22
- - `.planning/ROADMAP.md` — milestone structure and phase list
23
-
24
- Extract:
25
- - `current_phase` — which phase is active
26
- - `plan_of` / `plans_total` — plan execution progress
27
- - `progress` — overall percentage
28
- - `status` — active, paused, etc.
29
-
30
- If no `.planning/` directory exists:
31
- ```
32
- No GSD project detected. Run `/gsd-new-project` to get started.
33
- ```
34
- Exit.
35
- </step>
36
-
37
- <step name="safety_gates">
38
- Run hard-stop checks before routing. Exit on first hit unless `--force` was passed.
39
-
40
- If `--force` flag was passed, skip all gates and the consecutive guard.
41
- Print a one-line warning: `⚠ --force: skipping safety gates`
42
- Then proceed directly to `determine_next_action`.
43
-
44
- **Gate 1: Unresolved checkpoint**
45
- Check if `.planning/.continue-here.md` exists:
46
- ```bash
47
- [ -f .planning/.continue-here.md ]
48
- ```
49
- If found:
50
- ```
51
- ⛔ Hard stop: Unresolved checkpoint
52
-
53
- `.planning/.continue-here.md` exists — a previous session left
54
- unfinished work that needs manual review before advancing.
55
-
56
- Read the file, resolve the issue, then delete it to continue.
57
- Use `--force` to bypass this check.
58
- ```
59
- Exit (do not route).
60
-
61
- **Gate 2: Error state**
62
- Check if STATE.md contains `status: error` or `status: failed`:
63
- If found:
64
- ```
65
- ⛔ Hard stop: Project in error state
66
-
67
- STATE.md shows status: {status}. Resolve the error before advancing.
68
- Run `/gsd-health` to diagnose, or manually fix STATE.md.
69
- Use `--force` to bypass this check.
70
- ```
71
- Exit.
72
-
73
- **Gate 3: Unchecked verification**
74
- Check if the current phase has a VERIFICATION.md with any `FAIL` items that don't have overrides:
75
- If found:
76
- ```
77
- ⛔ Hard stop: Unchecked verification failures
78
-
79
- VERIFICATION.md for phase {N} has {count} unresolved FAIL items.
80
- Address the failures or add overrides before advancing to the next phase.
81
- Use `--force` to bypass this check.
82
- ```
83
- Exit.
84
-
85
- **Consecutive-call guard:**
86
- After passing all gates, check a counter file `.planning/.next-call-count`:
87
- - If file exists and count >= 6: prompt "You've called /gsd-next {N} times consecutively. Continue? [y/N]"
88
- - If user says no, exit
89
- - Increment the counter
90
- - The counter file is deleted by any non-`/gsd-next` command (convention other workflows don't need to implement this, the note here is sufficient)
91
- </step>
92
-
93
- <step name="determine_next_action">
94
- Apply routing rules based on state:
95
-
96
- **Route 1: No phases exist yet → discuss**
97
- If ROADMAP has phases but no phase directories exist on disk:
98
- → Next action: `/gsd-discuss-phase <first-phase>`
99
-
100
- **Route 2: Phase exists but has no CONTEXT.md or RESEARCH.md → discuss**
101
- If the current phase directory exists but has neither CONTEXT.md nor RESEARCH.md:
102
- → Next action: `/gsd-discuss-phase <current-phase>`
103
-
104
- **Route 3: Phase has context but no plans plan**
105
- If the current phase has CONTEXT.md (or RESEARCH.md) but no PLAN.md files:
106
- → Next action: `/gsd-plan-phase <current-phase>`
107
-
108
- **Route 4: Phase has plans but incomplete summaries → execute**
109
- If plans exist but not all have matching summaries:
110
- Next action: `/gsd-execute-phase <current-phase>`
111
-
112
- **Route 5: All plans have summaries → verify and complete**
113
- If all plans in the current phase have summaries:
114
- → Next action: `/gsd-verify-work`
115
-
116
- **Route 6: Phase complete, next phase exists → advance**
117
- If the current phase is complete and the next phase exists in ROADMAP:
118
- Next action: `/gsd-discuss-phase <next-phase>`
119
-
120
- **Route 7: All phases complete complete milestone**
121
- If all phases are complete:
122
- Next action: `/gsd-complete-milestone`
123
-
124
- **Route 8: Paused resume**
125
- If STATE.md shows paused_at:
126
- Next action: `/gsd-resume-work`
127
- </step>
128
-
129
- <step name="show_and_execute">
130
- Display the determination:
131
-
132
- ```
133
- ## GSD Next
134
-
135
- **Current:** Phase [N] — [name] | [progress]%
136
- **Status:** [status description]
137
-
138
- **Next step:** `/gsd-[command] [args]`
139
- [One-line explanation of why this is the next step]
140
- ```
141
-
142
- Then immediately invoke the determined command via SlashCommand.
143
- Do not ask for confirmation — the whole point of `/gsd-next` is zero-friction advancement.
144
- </step>
145
-
146
- </process>
147
-
148
- <success_criteria>
149
- - [ ] Project state correctly detected
150
- - [ ] Next action correctly determined from routing rules
151
- - [ ] Command invoked immediately without user confirmation
152
- - [ ] Clear status shown before invoking
153
- </success_criteria>
1
+ <purpose>
2
+ Detect current project state and automatically advance to the next logical GSD workflow step.
3
+ Reads project state to determine: discuss → plan → execute → verify → complete progression.
4
+ </purpose>
5
+
6
+ <required_reading>
7
+ Read all files referenced by the invoking prompt's execution_context before starting.
8
+ </required_reading>
9
+
10
+ <process>
11
+
12
+ <step name="detect_state">
13
+ Read project state to determine current position:
14
+
15
+ ```bash
16
+ # Get state snapshot
17
+ gsd-sdk query state.json 2>/dev/null || echo "{}"
18
+ ```
19
+
20
+ Also read:
21
+ - `.planning/STATE.md` — current phase, progress, plan counts
22
+ - `.planning/ROADMAP.md` — milestone structure and phase list
23
+
24
+ Extract:
25
+ - `current_phase` — which phase is active
26
+ - `plan_of` / `plans_total` — plan execution progress
27
+ - `progress` — overall percentage
28
+ - `status` — active, paused, etc.
29
+
30
+ If no `.planning/` directory exists:
31
+ ```
32
+ No GSD project detected. Run `/gsd-new-project` to get started.
33
+ ```
34
+ Exit.
35
+ </step>
36
+
37
+ <step name="safety_gates">
38
+ Run hard-stop checks before routing. Exit on first hit unless `--force` was passed.
39
+
40
+ If `--force` flag was passed, skip all gates and the consecutive guard.
41
+ Print a one-line warning: `⚠ --force: skipping safety gates`
42
+ Then proceed directly to `determine_next_action`.
43
+
44
+ **Gate 1: Unresolved checkpoint**
45
+ Check if `.planning/.continue-here.md` exists:
46
+ ```bash
47
+ [ -f .planning/.continue-here.md ]
48
+ ```
49
+ If found:
50
+ ```
51
+ ⛔ Hard stop: Unresolved checkpoint
52
+
53
+ `.planning/.continue-here.md` exists — a previous session left
54
+ unfinished work that needs manual review before advancing.
55
+
56
+ Read the file, resolve the issue, then delete it to continue.
57
+ Use `--force` to bypass this check.
58
+ ```
59
+ Exit (do not route).
60
+
61
+ **Gate 2: Error state**
62
+ Check if STATE.md contains `status: error` or `status: failed`:
63
+ If found:
64
+ ```
65
+ ⛔ Hard stop: Project in error state
66
+
67
+ STATE.md shows status: {status}. Resolve the error before advancing.
68
+ Run `/gsd-health` to diagnose, or manually fix STATE.md.
69
+ Use `--force` to bypass this check.
70
+ ```
71
+ Exit.
72
+
73
+ **Gate 3: Unchecked verification**
74
+ Check if the current phase has a VERIFICATION.md with any `FAIL` items that don't have overrides:
75
+ If found:
76
+ ```
77
+ ⛔ Hard stop: Unchecked verification failures
78
+
79
+ VERIFICATION.md for phase {N} has {count} unresolved FAIL items.
80
+ Address the failures or add overrides before advancing to the next phase.
81
+ Use `--force` to bypass this check.
82
+ ```
83
+ Exit.
84
+
85
+ **Prior-phase completeness scan:**
86
+ After passing all three hard-stop gates, scan all phases that precede the current phase in ROADMAP.md order for incomplete work. For each prior phase number `N`, use `gsd-sdk query find-phase <N>` JSON (plans, summaries, incomplete_plans, etc.) to inspect that phase.
87
+
88
+ Detect three categories of incomplete work:
89
+ 1. **Plans without summaries** — a PLAN.md exists in a prior phase directory but no matching SUMMARY.md exists (execution started but not completed).
90
+ 2. **Verification failures not overridden** a prior phase has a VERIFICATION.md with `FAIL` items that have no override annotation.
91
+ 3. **CONTEXT.md without plans** — a prior phase directory has a CONTEXT.md but no PLAN.md files (discussion happened, planning never ran).
92
+
93
+ If no incomplete prior work is found, continue to `determine_next_action` silently with no interruption.
94
+
95
+ If incomplete prior work is found, show a structured completeness report:
96
+ ```
97
+ Prior phase has incomplete work
98
+
99
+ Phase {N} — "{name}" has unresolved items:
100
+ Plan {N}-{M} ({slug}): executed but no SUMMARY.md
101
+ [... additional items ...]
102
+
103
+ Advancing before resolving these may cause:
104
+ Verification gaps future phase verification won't have visibility into what prior phases shipped
105
+ Context loss plans that ran without summaries leave no record for future agents
106
+
107
+ Options:
108
+ [C] Continue and defer these items to backlog
109
+ [S] Stop and resolve manually (recommended)
110
+ [F] Force advance without recording deferral
111
+
112
+ Choice [S]:
113
+ ```
114
+
115
+ **If the user chooses "Stop" (S or Enter/default):** Exit without routing.
116
+
117
+ **If the user chooses "Continue and defer" (C):**
118
+ 1. For each incomplete item, create a backlog entry in `ROADMAP.md` under `## Backlog` using the existing `999.x` numbering scheme:
119
+ ```markdown
120
+ ### Phase 999.{N}: Follow-up Phase {src} incomplete plans (BACKLOG)
121
+
122
+ **Goal:** Resolve plans that ran without producing summaries during Phase {src} execution
123
+ **Source phase:** {src}
124
+ **Deferred at:** {date} during /gsd-next advancement to Phase {dest}
125
+ **Plans:**
126
+ - [ ] {N}-{M}: {slug} (ran, no SUMMARY.md)
127
+ ```
128
+ 2. Commit the deferral record:
129
+ ```bash
130
+ gsd-sdk query commit "docs: defer incomplete Phase {src} items to backlog"
131
+ ```
132
+ 3. Continue routing to `determine_next_action` immediately — no second prompt.
133
+
134
+ **If the user chooses "Force" (F):** Continue to `determine_next_action` without recording deferral.
135
+ </step>
136
+
137
+ <step name="spike_sketch_notice">
138
+ Check for pending spike/sketch work and surface a notice (does not change routing):
139
+
140
+ ```bash
141
+ # Check for pending spikes (verdict: PENDING in any README)
142
+ PENDING_SPIKES=$(grep -rl 'verdict: PENDING' .planning/spikes/*/README.md 2>/dev/null | wc -l | tr -d ' ')
143
+
144
+ # Check for pending sketches (winner: null in any README)
145
+ PENDING_SKETCHES=$(grep -rl 'winner: null' .planning/sketches/*/README.md 2>/dev/null | wc -l | tr -d ' ')
146
+ ```
147
+
148
+ If either count is > 0, display before routing:
149
+ ```
150
+ Pending exploratory work:
151
+ {PENDING_SPIKES} spike(s) with unresolved verdicts in .planning/spikes/
152
+ {PENDING_SKETCHES} sketch(es) without a winning variant in .planning/sketches/
153
+
154
+ Resume with `/gsd-spike` or `/gsd-sketch`, or continue with phase work below.
155
+ ```
156
+
157
+ Only show lines for non-zero counts. If both are 0, skip this notice entirely.
158
+ </step>
159
+
160
+ <step name="determine_next_action">
161
+ Apply routing rules based on state:
162
+
163
+ **Route 1: No phases exist yet → discuss**
164
+ If ROADMAP has phases but no phase directories exist on disk:
165
+ → Next action: `/gsd-discuss-phase <first-phase>`
166
+
167
+ **Route 2: Phase exists but has no CONTEXT.md or RESEARCH.md → discuss**
168
+ If the current phase directory exists but has neither CONTEXT.md nor RESEARCH.md:
169
+ → Next action: `/gsd-discuss-phase <current-phase>`
170
+
171
+ **Route 3: Phase has context but no plans → plan**
172
+ If the current phase has CONTEXT.md (or RESEARCH.md) but no PLAN.md files:
173
+ → Next action: `/gsd-plan-phase <current-phase>`
174
+
175
+ **Route 4: Phase has plans but incomplete summaries → execute**
176
+ If plans exist but not all have matching summaries:
177
+ → Next action: `/gsd-execute-phase <current-phase>`
178
+
179
+ **Route 5: All plans have summaries → verify and complete**
180
+ If all plans in the current phase have summaries:
181
+ → Next action: `/gsd-verify-work`
182
+
183
+ **Route 6: Phase complete, next phase exists → advance**
184
+ If the current phase is complete and the next phase exists in ROADMAP:
185
+ → Next action: `/gsd-discuss-phase <next-phase>`
186
+
187
+ **Route 7: All phases complete → complete milestone**
188
+ If all phases are complete:
189
+ → Next action: `/gsd-complete-milestone`
190
+
191
+ **Route 8: Paused → resume**
192
+ If STATE.md shows paused_at:
193
+ → Next action: `/gsd-resume-work`
194
+ </step>
195
+
196
+ <step name="show_and_execute">
197
+ Display the determination:
198
+
199
+ ```
200
+ ## GSD Next
201
+
202
+ **Current:** Phase [N] — [name] | [progress]%
203
+ **Status:** [status description]
204
+
205
+ ▶ **Next step:** `/gsd-[command] [args]`
206
+ [One-line explanation of why this is the next step]
207
+ ```
208
+
209
+ Then immediately invoke the determined command via SlashCommand.
210
+ Do not ask for confirmation — the whole point of `/gsd-next` is zero-friction advancement.
211
+ </step>
212
+
213
+ </process>
214
+
215
+ <success_criteria>
216
+ - [ ] Project state correctly detected
217
+ - [ ] Next action correctly determined from routing rules
218
+ - [ ] Command invoked immediately without user confirmation
219
+ - [ ] Clear status shown before invoking
220
+ </success_criteria>
@@ -1,5 +1,7 @@
1
1
  <purpose>
2
2
  Zero-friction idea capture. One Write call, one confirmation line. No questions, no prompts.
3
+
4
+ **Text mode (`workflow.text_mode: true` in config or `--text` flag):** Set `TEXT_MODE=true` if `--text` is present in `$ARGUMENTS` OR `text_mode` from init JSON is `true`. When TEXT_MODE is active, replace every `AskUserQuestion` call with a plain-text numbered list and ask the user to type their choice number. This is required for non-Antigravity runtimes (OpenAI Codex, Gemini CLI, etc.) where `AskUserQuestion` is not available.
3
5
  Runs inline — no Task, no AskUserQuestion, no Bash.
4
6
  </purpose>
5
7
 
@@ -18,7 +18,10 @@ Determine what kind of work is being paused and set the handoff destination acco
18
18
  phase=$(( ls -lt .planning/phases/*/PLAN.md 2>/dev/null || true ) | head -1 | grep -oP 'phases/\K[^/]+' || true)
19
19
 
20
20
  # Check for active spike
21
- spike=$(( ls -lt .planning/spikes/*/SPIKE.md .planning/spikes/*/DESIGN.md 2>/dev/null || true ) | head -1 | grep -oP 'spikes/\K[^/]+' || true)
21
+ spike=$(( ls -lt .planning/spikes/*/SPIKE.md .planning/spikes/*/DESIGN.md .planning/spikes/*/README.md 2>/dev/null || true ) | head -1 | grep -oP 'spikes/\K[^/]+' || true)
22
+
23
+ # Check for active sketch
24
+ sketch=$(( ls -lt .planning/sketches/*/README.md .planning/sketches/*/index.html 2>/dev/null || true ) | head -1 | grep -oP 'sketches/\K[^/]+' || true)
22
25
 
23
26
  # Check for active deliberation
24
27
  deliberation=$(ls .planning/deliberations/*.md 2>/dev/null | head -1 || true)
@@ -26,8 +29,9 @@ deliberation=$(ls .planning/deliberations/*.md 2>/dev/null | head -1 || true)
26
29
 
27
30
  - **Phase work**: active phase directory → handoff to `.planning/phases/XX-name/.continue-here.md`
28
31
  - **Spike work**: active spike directory or spike-related files (no active phase) → handoff to `.planning/spikes/SPIKE-NNN/.continue-here.md` (create directory if needed)
29
- - **Deliberation work**: active deliberation file (no phase/spike) → handoff to `.planning/deliberations/.continue-here.md`
30
- - **Research work**: research notes exist but no phase/spike/deliberation → handoff to `.planning/.continue-here.md`
32
+ - **Sketch work**: active sketch directory (no active phase/spike) → handoff to `.planning/sketches/.continue-here.md`
33
+ - **Deliberation work**: active deliberation file (no phase/spike/sketch) → handoff to `.planning/deliberations/.continue-here.md`
34
+ - **Research work**: research notes exist but no phase/spike/sketch/deliberation → handoff to `.planning/.continue-here.md`
31
35
  - **Default**: no detectable context → handoff to `.planning/.continue-here.md`, note the ambiguity in `<current_state>`
32
36
 
33
37
  If phase is detected, proceed with phase handoff path. Otherwise use the first matching non-phase path above.
@@ -62,7 +66,7 @@ Report any summaries with placeholder content as incomplete items.
62
66
  **Write structured handoff to `.planning/HANDOFF.json`:**
63
67
 
64
68
  ```bash
65
- .agent/skills/gsd/bin/gsd-tools.cjs" current-timestamp full --raw)
69
+ timestamp=$(gsd-sdk query current-timestamp full --raw)
66
70
  ```
67
71
 
68
72
  ```json
@@ -106,7 +110,7 @@ Report any summaries with placeholder content as incomplete items.
106
110
 
107
111
  ```markdown
108
112
  ---
109
- context: [phase|spike|deliberation|research|default]
113
+ context: [phase|spike|sketch|deliberation|research|default]
110
114
  phase: XX-name
111
115
  task: 3
112
116
  total_tasks: 7
@@ -197,13 +201,13 @@ Be specific enough for a fresh Antigravity to understand immediately.
197
201
 
198
202
  Use `current-timestamp` for last_updated field. You can use init todos (which provides timestamps) or call directly:
199
203
  ```bash
200
- .agent/skills/gsd/bin/gsd-tools.cjs" current-timestamp full --raw)
204
+ timestamp=$(gsd-sdk query current-timestamp full --raw)
201
205
  ```
202
206
  </step>
203
207
 
204
208
  <step name="commit">
205
209
  ```bash
206
- .agent/skills/gsd/bin/gsd-tools.cjs" commit "wip: [context-name] paused at [X]/[Y]" --files [handoff-path] .planning/HANDOFF.json
210
+ gsd-sdk query commit "wip: [context-name] paused at [X]/[Y]" [handoff-path] .planning/HANDOFF.json
207
211
  ```
208
212
  </step>
209
213