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
@@ -0,0 +1,262 @@
1
+ <purpose>
2
+ Clarify WHAT a phase delivers through a Socratic interview loop with quantitative ambiguity scoring.
3
+ Produces a SPEC.md with falsifiable requirements that discuss-phase treats as locked decisions.
4
+
5
+ This workflow handles "what" and "why" — discuss-phase handles "how".
6
+ </purpose>
7
+
8
+ <ambiguity_model>
9
+ Score each dimension 0.0 (completely unclear) to 1.0 (crystal clear):
10
+
11
+ | Dimension | Weight | Minimum | What it measures |
12
+ |-------------------|--------|---------|---------------------------------------------------|
13
+ | Goal Clarity | 35% | 0.75 | Is the outcome specific and measurable? |
14
+ | Boundary Clarity | 25% | 0.70 | What's in scope vs out of scope? |
15
+ | Constraint Clarity| 20% | 0.65 | Performance, compatibility, data requirements? |
16
+ | Acceptance Criteria| 20% | 0.70 | How do we know it's done? |
17
+
18
+ **Ambiguity score** = 1.0 − (0.35×goal + 0.25×boundary + 0.20×constraint + 0.20×acceptance)
19
+
20
+ **Gate:** ambiguity ≤ 0.20 AND all dimensions ≥ their minimums → ready to write SPEC.md.
21
+
22
+ A score of 0.20 means 80% weighted clarity — enough precision that the planner won't silently make wrong assumptions.
23
+ </ambiguity_model>
24
+
25
+ <interview_perspectives>
26
+ Rotate through these perspectives — each naturally surfaces different blindspots:
27
+
28
+ **Researcher (rounds 1–2):** Ground the discussion in current reality.
29
+ - "What exists in the codebase today related to this phase?"
30
+ - "What's the delta between today and the target state?"
31
+ - "What triggers this work — what's broken or missing?"
32
+
33
+ **Simplifier (round 2):** Surface minimum viable scope.
34
+ - "What's the simplest version that solves the core problem?"
35
+ - "If you had to cut 50%, what's the irreducible core?"
36
+ - "What would make this phase a success even without the nice-to-haves?"
37
+
38
+ **Boundary Keeper (round 3):** Lock the perimeter.
39
+ - "What explicitly will NOT be done in this phase?"
40
+ - "What adjacent problems is it tempting to solve but shouldn't?"
41
+ - "What does 'done' look like — what's the final deliverable?"
42
+
43
+ **Failure Analyst (round 4):** Find the edge cases that invalidate requirements.
44
+ - "What's the worst thing that could go wrong if we get the requirements wrong?"
45
+ - "What does a broken version of this look like?"
46
+ - "What would cause a verifier to reject the output?"
47
+
48
+ **Seed Closer (rounds 5–6):** Lock remaining undecided territory.
49
+ - "We have [dimension] at [score] — what would make it completely clear?"
50
+ - "The remaining ambiguity is in [area] — can we make a decision now?"
51
+ - "Is there anything you'd regret not specifying before planning starts?"
52
+ </interview_perspectives>
53
+
54
+ <process>
55
+
56
+ ## Step 1: Initialize
57
+
58
+ ```bash
59
+ .agent/skills/gsd/bin/gsd-tools.cjs" init phase-op "${PHASE}")
60
+ if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
61
+ ```
62
+
63
+ Parse JSON for: `phase_found`, `phase_dir`, `phase_number`, `phase_name`, `phase_slug`, `padded_phase`, `state_path`, `requirements_path`, `roadmap_path`, `planning_path`, `response_language`, `commit_docs`.
64
+
65
+ **If `response_language` is set:** All user-facing text in this workflow MUST be in `{response_language}`. Technical terms, code, and file paths stay in English.
66
+
67
+ **If `phase_found` is false:**
68
+ ```
69
+ Phase [X] not found in roadmap.
70
+ Use /gsd-progress to see available phases.
71
+ ```
72
+ Exit.
73
+
74
+ **Check for existing SPEC.md:**
75
+ ```bash
76
+ ls ${phase_dir}/*-SPEC.md 2>/dev/null | grep -v AI-SPEC | head -1 || true
77
+ ```
78
+
79
+ If SPEC.md already exists:
80
+
81
+ **If `--auto`:** Auto-select "Update it". Log: `[auto] SPEC.md exists — updating.`
82
+
83
+ **Otherwise:** Use AskUserQuestion:
84
+ - header: "Spec"
85
+ - question: "Phase [X] already has a SPEC.md. What do you want to do?"
86
+ - options:
87
+ - "Update it" — Revise and re-score
88
+ - "View it" — Show current spec
89
+ - "Skip" — Exit (use existing spec as-is)
90
+
91
+ If "View": Display SPEC.md, then offer Update/Skip.
92
+ If "Skip": Exit with message: "Existing SPEC.md unchanged. Run /gsd-discuss-phase [X] to continue."
93
+ If "Update": Load existing SPEC.md, continue to Step 3.
94
+
95
+ ## Step 2: Scout Codebase
96
+
97
+ **Read these files before any questions:**
98
+ - `{requirements_path}` — Project requirements
99
+ - `{state_path}` — Decisions already made, current phase, blockers
100
+ - ROADMAP.md phase entry — Phase description, goals, canonical refs
101
+
102
+ **Grep the codebase** for code/files relevant to this phase goal. Look for:
103
+ - Existing implementations of similar functionality
104
+ - Integration points where new code will connect
105
+ - Test coverage gaps relevant to the phase
106
+ - Prior phase artifacts (SUMMARY.md, VERIFICATION.md) that inform current state
107
+
108
+ **Synthesize current state** — the grounded baseline for the interview:
109
+ - What exists today related to this phase
110
+ - The gap between current state and the phase goal
111
+ - The primary deliverable: what file/behavior/capability does NOT exist yet?
112
+
113
+ Confirm your current state synthesis internally. Do not present it to the user yet — you'll use it to ask precise, grounded questions.
114
+
115
+ ## Step 3: First Ambiguity Assessment
116
+
117
+ Before questioning begins, score the phase's current ambiguity based only on what ROADMAP.md and REQUIREMENTS.md say:
118
+
119
+ ```
120
+ Goal Clarity: [score 0.0–1.0]
121
+ Boundary Clarity: [score 0.0–1.0]
122
+ Constraint Clarity: [score 0.0–1.0]
123
+ Acceptance Criteria:[score 0.0–1.0]
124
+
125
+ Ambiguity: [score] ([calculate])
126
+ ```
127
+
128
+ **If `--auto` and initial ambiguity already ≤ 0.20 with all minimums met:** Skip interview — derive SPEC.md directly from roadmap + requirements. Log: `[auto] Phase requirements are already sufficiently clear — generating SPEC.md from existing context.` Jump to Step 6.
129
+
130
+ **Otherwise:** Continue to Step 4.
131
+
132
+ ## Step 4: Socratic Interview Loop
133
+
134
+ **Max 6 rounds.** Each round: 2–3 questions max. End round after user responds.
135
+
136
+ **Round selection by perspective:**
137
+ - Round 1: Researcher
138
+ - Round 2: Researcher + Simplifier
139
+ - Round 3: Boundary Keeper
140
+ - Round 4: Failure Analyst
141
+ - Rounds 5–6: Seed Closer (focus on lowest-scoring dimensions)
142
+
143
+ **After each round:**
144
+ 1. Update all 4 dimension scores from the user's answers
145
+ 2. Calculate new ambiguity score
146
+ 3. Display the updated scoring:
147
+
148
+ ```
149
+ After round [N]:
150
+ Goal Clarity: [score] (min 0.75) [✓ or ↑ needed]
151
+ Boundary Clarity: [score] (min 0.70) [✓ or ↑ needed]
152
+ Constraint Clarity: [score] (min 0.65) [✓ or ↑ needed]
153
+ Acceptance Criteria:[score] (min 0.70) [✓ or ↑ needed]
154
+ Ambiguity: [score] (gate: ≤ 0.20)
155
+ ```
156
+
157
+ **Gate check after each round:**
158
+
159
+ If gate passes (ambiguity ≤ 0.20 AND all minimums met):
160
+
161
+ **If `--auto`:** Jump to Step 6.
162
+
163
+ **Otherwise:** AskUserQuestion:
164
+ - header: "Spec Gate Passed"
165
+ - question: "Ambiguity is [score] — requirements are clear enough to write SPEC.md. Proceed?"
166
+ - options:
167
+ - "Yes — write SPEC.md" → Jump to Step 6
168
+ - "One more round" → Continue interview
169
+ - "Done talking — write it" → Jump to Step 6
170
+
171
+ **If max rounds reached (6) and gate not passed:**
172
+
173
+ **If `--auto`:** Write SPEC.md anyway — flag unresolved dimensions. Log: `[auto] Max rounds reached. Writing SPEC.md with [N] dimensions below minimum. Planner will need to treat these as assumptions.`
174
+
175
+ **Otherwise:** AskUserQuestion:
176
+ - header: "Max Rounds"
177
+ - question: "After 6 rounds, ambiguity is [score]. [List dimensions still below minimum.] What would you like to do?"
178
+ - options:
179
+ - "Write SPEC.md anyway — flag gaps" → Write SPEC.md, mark unresolved dimensions in Ambiguity Report
180
+ - "Keep talking" → Continue (no round limit from here)
181
+ - "Abandon" → Exit without writing
182
+
183
+ **If `--auto` mode throughout:** Replace all AskUserQuestion calls above with Antigravity's recommended choice. Log decisions inline. Apply the same logic as `--auto` in discuss-phase.
184
+
185
+ **Text mode (`workflow.text_mode: true` or `--text` flag):** Use plain-text numbered lists instead of AskUserQuestion TUI menus.
186
+
187
+ ## Step 5: (covered inline — ambiguity scoring is per-round)
188
+
189
+ ## Step 6: Generate SPEC.md
190
+
191
+ Use the SPEC.md template from @assets/templates/spec.md.
192
+
193
+ **Requirements for every requirement entry:**
194
+ - One specific, testable statement
195
+ - Current state (what exists now)
196
+ - Target state (what it should become)
197
+ - Acceptance criterion (how to verify it was met)
198
+
199
+ **Vague requirements are rejected:**
200
+ - ✗ "The system should be fast"
201
+ - ✗ "Improve user experience"
202
+ - ✓ "API endpoint responds in < 200ms at p95 under 100 concurrent requests"
203
+ - ✓ "CLI command exits with code 1 and prints to stderr on invalid input"
204
+
205
+ **Count requirements.** The display in discuss-phase reads: "Found SPEC.md — {N} requirements locked."
206
+
207
+ **Boundaries must be explicit lists:**
208
+ - "In scope" — what this phase produces
209
+ - "Out of scope" — what it explicitly does NOT do (with brief reasoning)
210
+
211
+ **Acceptance criteria must be pass/fail checkboxes** — no "should feel good" or "looks reasonable."
212
+
213
+ **If any dimensions are below minimum**, mark them in the Ambiguity Report with: `⚠ Below minimum — planner must treat as assumption`.
214
+
215
+ Write to: `{phase_dir}/{padded_phase}-SPEC.md`
216
+
217
+ ## Step 7: Commit
218
+
219
+ ```bash
220
+ git add "${phase_dir}/${padded_phase}-SPEC.md"
221
+ git commit -m "spec(phase-${phase_number}): add SPEC.md for ${phase_name} — ${requirement_count} requirements (#2213)"
222
+ ```
223
+
224
+ If `commit_docs` is false: Skip commit. Note that SPEC.md was written but not committed.
225
+
226
+ ## Step 8: Wrap Up
227
+
228
+ Display:
229
+
230
+ ```
231
+ SPEC.md written — {N} requirements locked.
232
+
233
+ Phase {X}: {name}
234
+ Ambiguity: {final_score} (gate: ≤ 0.20)
235
+
236
+ Next: /gsd-discuss-phase {X}
237
+ discuss-phase will detect SPEC.md and focus on implementation decisions only.
238
+ ```
239
+
240
+ </process>
241
+
242
+ <critical_rules>
243
+ - Every requirement MUST have current state, target state, and acceptance criterion
244
+ - Boundaries section is MANDATORY — cannot be empty
245
+ - "In scope" and "Out of scope" must be explicit lists, not narrative prose
246
+ - Acceptance criteria must be pass/fail — no subjective criteria
247
+ - SPEC.md is NEVER written if the user selects "Abandon"
248
+ - Do NOT ask about HOW to implement — that is discuss-phase territory
249
+ - Scout the codebase BEFORE the first question — grounded questions only
250
+ - Max 2–3 questions per round — do not frontload all questions at once
251
+ </critical_rules>
252
+
253
+ <success_criteria>
254
+ - Codebase scouted and current state understood before questioning
255
+ - All 4 dimensions scored after every round
256
+ - Gate passed OR user explicitly chose to write despite gaps
257
+ - SPEC.md contains only falsifiable requirements
258
+ - Boundaries are explicit (in scope / out of scope with reasoning)
259
+ - Acceptance criteria are pass/fail checkboxes
260
+ - SPEC.md committed atomically (when commit_docs is true)
261
+ - User directed to /gsd-discuss-phase as next step
262
+ </success_criteria>
@@ -0,0 +1,273 @@
1
+ <purpose>
2
+ Curate spike experiment findings and package them into a persistent project skill for future
3
+ build conversations. Reads from `.planning/spikes/`, writes skill to `./.antigravity/skills/spike-findings-[project]/`
4
+ (project-local) and summary to `.planning/spikes/WRAP-UP-SUMMARY.md`.
5
+ Companion to `/gsd-spike`.
6
+ </purpose>
7
+
8
+ <required_reading>
9
+ Read all files referenced by the invoking prompt's execution_context before starting.
10
+ </required_reading>
11
+
12
+ <process>
13
+
14
+ <step name="banner">
15
+ ```
16
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
17
+ GSD ► SPIKE WRAP-UP
18
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
19
+ ```
20
+ </step>
21
+
22
+ <step name="gather">
23
+ ## Gather Spike Inventory
24
+
25
+ 1. Read `.planning/spikes/MANIFEST.md` for the overall idea context
26
+ 2. Glob `.planning/spikes/*/README.md` and parse YAML frontmatter from each
27
+ 3. Check if `./.antigravity/skills/spike-findings-*/SKILL.md` exists for this project
28
+ - If yes: read its `processed_spikes` list from the metadata section and filter those out
29
+ - If no: all spikes are candidates
30
+
31
+ If no unprocessed spikes exist:
32
+ ```
33
+ No unprocessed spikes found in `.planning/spikes/`.
34
+ Run `/gsd-spike` first to create experiments.
35
+ ```
36
+ Exit.
37
+
38
+ Check `commit_docs` config:
39
+ ```bash
40
+ COMMIT_DOCS=$(gsd-sdk query config-get commit_docs 2>/dev/null || echo "true")
41
+ ```
42
+ </step>
43
+
44
+ <step name="curate">
45
+ ## Curate Spikes One-at-a-Time
46
+
47
+ Present each unprocessed spike in ascending order. For each spike, show:
48
+
49
+ - **Spike number and name**
50
+ - **Validates:** the Given/When/Then from frontmatter
51
+ - **Verdict:** VALIDATED / INVALIDATED / PARTIAL
52
+ - **Tags:** from frontmatter
53
+ - **Key findings:** summarize the Results section from the README
54
+ - **Grey areas:** anything uncertain or partially proven
55
+
56
+ Then ask the user:
57
+
58
+ ╔══════════════════════════════════════════════════════════════╗
59
+ ║ CHECKPOINT: Decision Required ║
60
+ ╚══════════════════════════════════════════════════════════════╝
61
+
62
+ Spike {NNN}: {name} — {verdict}
63
+
64
+ {key findings summary}
65
+
66
+ ──────────────────────────────────────────────────────────────
67
+ → Include / Exclude / Partial / Help me UAT this
68
+ ──────────────────────────────────────────────────────────────
69
+
70
+ **If "Help me UAT this":**
71
+ 1. Read the spike's README "How to Run" and "What to Expect" sections
72
+ 2. Present step-by-step instructions
73
+ 3. Ask: "Does this match what you expected?"
74
+ 4. After UAT, return to the include/exclude/partial decision
75
+
76
+ **If "Partial":**
77
+ Ask what specifically to include or exclude. Record their notes alongside the spike.
78
+ </step>
79
+
80
+ <step name="group">
81
+ ## Auto-Group by Feature Area
82
+
83
+ After all spikes are curated:
84
+
85
+ 1. Read all included spikes' tags, names, `related` fields, and content
86
+ 2. Propose feature-area groupings, e.g.:
87
+ - "**WebSocket Streaming** — spikes 001, 004, 007"
88
+ - "**Foo API Integration** — spikes 002, 003"
89
+ - "**PDF Parsing** — spike 005"
90
+ 3. Present the grouping for approval — user may merge, split, rename, or rearrange
91
+
92
+ Each group becomes one reference file in the generated skill.
93
+ </step>
94
+
95
+ <step name="skill_name">
96
+ ## Determine Output Skill Name
97
+
98
+ Derive the skill name from the project directory:
99
+
100
+ 1. Get the project root directory name (e.g., `solana-tracker`)
101
+ 2. The skill will be created at `./.antigravity/skills/spike-findings-[project-dir-name]/`
102
+
103
+ If a skill already exists at that path (append mode), update in place.
104
+ </step>
105
+
106
+ <step name="copy_sources">
107
+ ## Copy Source Files
108
+
109
+ For each included spike:
110
+
111
+ 1. Identify the core source files — the actual scripts, main files, and config that make the spike work. Exclude:
112
+ - `node_modules/`, `__pycache__/`, `.venv/`, build artifacts
113
+ - Lock files (`package-lock.json`, `yarn.lock`, etc.)
114
+ - `.git/`, `.DS_Store`
115
+ 2. Copy the README.md and core source files into `sources/NNN-spike-name/` inside the generated skill directory
116
+ </step>
117
+
118
+ <step name="synthesize">
119
+ ## Synthesize Reference Files
120
+
121
+ For each feature-area group, write a reference file at `references/[feature-area-name].md`:
122
+
123
+ ```markdown
124
+ # [Feature Area Name]
125
+
126
+ ## Validated Patterns
127
+ [For each validated finding: describe the approach that works, include key code snippets extracted from the spike source, explain why it works]
128
+
129
+ ## Landmines
130
+ [Things that look right but aren't. Gotchas. Anti-patterns discovered during spiking.]
131
+
132
+ ## Constraints
133
+ [Hard facts: rate limits, library limitations, version requirements, incompatibilities]
134
+
135
+ ## Origin
136
+ Synthesized from spikes: NNN, NNN, NNN
137
+ Source files available in: sources/NNN-spike-name/, sources/NNN-spike-name/
138
+ ```
139
+ </step>
140
+
141
+ <step name="write_skill">
142
+ ## Write SKILL.md
143
+
144
+ Create (or update) the generated skill's SKILL.md:
145
+
146
+ ```markdown
147
+ ---
148
+ name: spike-findings-[project-dir-name]
149
+ description: Validated patterns, constraints, and implementation knowledge from spike experiments. Auto-loaded during implementation work on [project-dir-name].
150
+ ---
151
+
152
+ <context>
153
+ ## Project: [project-dir-name]
154
+
155
+ [One paragraph from MANIFEST.md describing the overall idea]
156
+
157
+ Spike sessions wrapped: [date(s)]
158
+ </context>
159
+
160
+ <findings_index>
161
+ ## Feature Areas
162
+
163
+ | Area | Reference | Key Finding |
164
+ |------|-----------|-------------|
165
+ | [Name] | references/[name].md | [One-line summary] |
166
+
167
+ ## Source Files
168
+
169
+ Original spike source files are preserved in `sources/` for complete reference.
170
+ </findings_index>
171
+
172
+ <metadata>
173
+ ## Processed Spikes
174
+
175
+ [List of spike numbers wrapped up]
176
+
177
+ - 001-spike-name
178
+ - 002-spike-name
179
+ </metadata>
180
+ ```
181
+ </step>
182
+
183
+ <step name="write_summary">
184
+ ## Write Planning Summary
185
+
186
+ Write `.planning/spikes/WRAP-UP-SUMMARY.md` for project history:
187
+
188
+ ```markdown
189
+ # Spike Wrap-Up Summary
190
+
191
+ **Date:** [date]
192
+ **Spikes processed:** [count]
193
+ **Feature areas:** [list]
194
+ **Skill output:** `./.antigravity/skills/spike-findings-[project]/`
195
+
196
+ ## Included Spikes
197
+ | # | Name | Verdict | Feature Area |
198
+ |---|------|---------|--------------|
199
+
200
+ ## Excluded Spikes
201
+ | # | Name | Reason |
202
+ |---|------|--------|
203
+
204
+ ## Key Findings
205
+ [consolidated findings summary]
206
+ ```
207
+ </step>
208
+
209
+ <step name="update_antigravity_md">
210
+ ## Update Project ANTIGRAVITY.md
211
+
212
+ Add an auto-load routing line to the project's ANTIGRAVITY.md (create the file if it doesn't exist):
213
+
214
+ ```
215
+ - **Spike findings for [project]** (implementation patterns, constraints, gotchas) → `Skill("spike-findings-[project-dir-name]")`
216
+ ```
217
+
218
+ If this routing line already exists (append mode), leave it as-is.
219
+ </step>
220
+
221
+ <step name="commit">
222
+ Commit all artifacts (if `COMMIT_DOCS` is true):
223
+
224
+ ```bash
225
+ gsd-sdk query commit "docs(spike-wrap-up): package [N] spike findings into project skill" .planning/spikes/WRAP-UP-SUMMARY.md
226
+ ```
227
+ </step>
228
+
229
+ <step name="report">
230
+ ```
231
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
232
+ GSD ► SPIKE WRAP-UP COMPLETE ✓
233
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
234
+
235
+ **Curated:** {N} spikes ({included} included, {excluded} excluded)
236
+ **Feature areas:** {list}
237
+ **Skill:** `./.antigravity/skills/spike-findings-[project]/`
238
+ **Summary:** `.planning/spikes/WRAP-UP-SUMMARY.md`
239
+ **ANTIGRAVITY.md:** routing line added
240
+
241
+ The spike-findings skill will auto-load in future build conversations.
242
+ ```
243
+
244
+ ───────────────────────────────────────────────────────────────
245
+
246
+ ## ▶ Next Up
247
+
248
+ **Start building** — plan the real implementation
249
+
250
+ `/gsd-plan-phase`
251
+
252
+ ───────────────────────────────────────────────────────────────
253
+
254
+ **Also available:**
255
+ - `/gsd-add-phase` — add a phase based on spike findings
256
+ - `/gsd-spike` — spike additional ideas
257
+ - `/gsd-explore` — continue exploring
258
+
259
+ ───────────────────────────────────────────────────────────────
260
+ </step>
261
+
262
+ </process>
263
+
264
+ <success_criteria>
265
+ - [ ] Every unprocessed spike presented for individual curation
266
+ - [ ] Feature-area grouping proposed and approved
267
+ - [ ] Spike-findings skill exists at `./.antigravity/skills/` with SKILL.md, references/, sources/
268
+ - [ ] Core source files from included spikes copied into sources/
269
+ - [ ] Reference files contain validated patterns, code snippets, landmines, constraints
270
+ - [ ] `.planning/spikes/WRAP-UP-SUMMARY.md` written for project history
271
+ - [ ] Project ANTIGRAVITY.md has auto-load routing line
272
+ - [ ] Summary presented with next-step routing
273
+ </success_criteria>