@opengsd/gsd-core 1.18.0 → 1.19.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 (257) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +2 -1
  3. package/.opencode/plugins/gsd-core.js +2 -3
  4. package/agents/gsd-code-fixer.compact.md +2 -2
  5. package/agents/gsd-code-fixer.md +4 -3
  6. package/agents/gsd-verifier.md +1 -1
  7. package/bin/install.js +422 -103
  8. package/gsd-core/bin/gsd-tools.cjs +106 -7
  9. package/gsd-core/bin/lib/agent-install-check.cjs +29 -3
  10. package/gsd-core/bin/lib/args-terminator.cjs +114 -0
  11. package/gsd-core/bin/lib/broken-windows.cjs +59 -1
  12. package/gsd-core/bin/lib/capability-lock.cjs +13 -2
  13. package/gsd-core/bin/lib/capability-registry.cjs +156 -74
  14. package/gsd-core/bin/lib/capability-state.cjs +14 -8
  15. package/gsd-core/bin/lib/capability-validator.cjs +17 -0
  16. package/gsd-core/bin/lib/config-loader.cjs +10 -0
  17. package/gsd-core/bin/lib/config.cjs +256 -58
  18. package/gsd-core/bin/lib/core-utils.cjs +34 -0
  19. package/gsd-core/bin/lib/decision-coverage-support.cjs +74 -0
  20. package/gsd-core/bin/lib/gate-context-drift.cjs +8 -3
  21. package/gsd-core/bin/lib/gate-decision-coverage-plan.cjs +6 -1
  22. package/gsd-core/bin/lib/gate-decision-coverage-verify.cjs +6 -1
  23. package/gsd-core/bin/lib/gate-evaluation-scope.cjs +134 -13
  24. package/gsd-core/bin/lib/gate-tdd-review-checkpoint.cjs +63 -22
  25. package/gsd-core/bin/lib/gate-ui-safety.cjs +23 -5
  26. package/gsd-core/bin/lib/git-info-exclude.cjs +57 -0
  27. package/gsd-core/bin/lib/health-diagnostic-rules/phase-structure.cjs +18 -3
  28. package/gsd-core/bin/lib/health-diagnostic-types.cjs +4 -0
  29. package/gsd-core/bin/lib/health-diagnostic.cjs +52 -1
  30. package/gsd-core/bin/lib/host-integration.cjs +13 -6
  31. package/gsd-core/bin/lib/init.cjs +65 -1
  32. package/gsd-core/bin/lib/install-engine.cjs +246 -32
  33. package/gsd-core/bin/lib/install-profiles.cjs +9 -4
  34. package/gsd-core/bin/lib/installer-migration-report.cjs +2 -0
  35. package/gsd-core/bin/lib/markdown-line-diff.cjs +147 -0
  36. package/gsd-core/bin/lib/markdown-sectionizer.cjs +113 -0
  37. package/gsd-core/bin/lib/milestone-lock.cjs +8 -1
  38. package/gsd-core/bin/lib/milestone-release-map.cjs +244 -0
  39. package/gsd-core/bin/lib/milestone-release-tags.cjs +440 -0
  40. package/gsd-core/bin/lib/milestone.cjs +43 -1
  41. package/gsd-core/bin/lib/model-catalog.cjs +8 -0
  42. package/gsd-core/bin/lib/normalize-test-command.cjs +67 -0
  43. package/gsd-core/bin/lib/phase-id.cjs +21 -4
  44. package/gsd-core/bin/lib/phase-lifecycle.cjs +37 -4
  45. package/gsd-core/bin/lib/phase.cjs +115 -26
  46. package/gsd-core/bin/lib/planning-snapshot.cjs +3 -1
  47. package/gsd-core/bin/lib/planning-workspace.cjs +18 -0
  48. package/gsd-core/bin/lib/pristine-baseline.cjs +11 -3
  49. package/gsd-core/bin/lib/read-only-git-env.cjs +58 -0
  50. package/gsd-core/bin/lib/review-lane-descriptor.cjs +35 -2
  51. package/gsd-core/bin/lib/review-lane-runner.cjs +33 -4
  52. package/gsd-core/bin/lib/roadmap-parser.cjs +12 -0
  53. package/gsd-core/bin/lib/roadmap-upgrade.cjs +39 -2
  54. package/gsd-core/bin/lib/roadmap.cjs +33 -25
  55. package/gsd-core/bin/lib/runtime-artifact-conversion.cjs +381 -14
  56. package/gsd-core/bin/lib/runtime-artifact-layout.cjs +8 -4
  57. package/gsd-core/bin/lib/runtime-hooks-surface.cjs +60 -16
  58. package/gsd-core/bin/lib/shell-command-projection.cjs +121 -16
  59. package/gsd-core/bin/lib/smart-entry.cjs +13 -0
  60. package/gsd-core/bin/lib/state-contract.cjs +29 -9
  61. package/gsd-core/bin/lib/state-document.cjs +12 -4
  62. package/gsd-core/bin/lib/state-transition.cjs +119 -24
  63. package/gsd-core/bin/lib/state.cjs +50 -28
  64. package/gsd-core/bin/lib/surface.cjs +9 -0
  65. package/gsd-core/bin/lib/task-command-router.cjs +5 -25
  66. package/gsd-core/bin/lib/task-content-resolution.cjs +46 -1
  67. package/gsd-core/bin/lib/verification.cjs +96 -9
  68. package/gsd-core/bin/lib/verify.cjs +2 -0
  69. package/gsd-core/bin/lib/worktree-safety.cjs +22 -1
  70. package/gsd-core/bin/shared/config-defaults.manifest.json +1 -0
  71. package/gsd-core/bin/shared/config-schema.manifest.json +1 -0
  72. package/gsd-core/references/git-integration.md +11 -0
  73. package/gsd-core/references/loop-hook-dispatch.md +13 -6
  74. package/gsd-core/references/planning-config.md +2 -0
  75. package/gsd-core/references/tdd.md +2 -2
  76. package/gsd-core/templates/DEBUG.md +16 -0
  77. package/gsd-core/templates/config.json +2 -1
  78. package/gsd-core/templates/verification-report.md +1 -1
  79. package/gsd-core/workflows/audit-fix.md +2 -1
  80. package/gsd-core/workflows/code-review/steps/structural-pre-pass.md +10 -1
  81. package/gsd-core/workflows/code-review.md +61 -7
  82. package/gsd-core/workflows/complete-milestone/steps/project-md-evolution-review.md +145 -0
  83. package/gsd-core/workflows/complete-milestone/steps/release-map.md +80 -0
  84. package/gsd-core/workflows/complete-milestone.md +37 -150
  85. package/gsd-core/workflows/diagnose-issues.md +29 -5
  86. package/gsd-core/workflows/discuss-phase/modes/power.md +1 -1
  87. package/gsd-core/workflows/discuss-phase-assumptions.md +33 -2
  88. package/gsd-core/workflows/discuss-phase-power.md +19 -2
  89. package/gsd-core/workflows/discuss-phase.md +6 -10
  90. package/gsd-core/workflows/execute-phase/steps/per-plan-worktree-gate.md +13 -7
  91. package/gsd-core/workflows/execute-phase/steps/post-merge-gate.md +7 -2
  92. package/gsd-core/workflows/execute-phase/steps/regression-gate-run.md +2 -1
  93. package/gsd-core/workflows/execute-phase/steps/verify-phase-goal.md +2 -2
  94. package/gsd-core/workflows/execute-phase/steps/wave-post-gate-hooks.md +11 -2
  95. package/gsd-core/workflows/execute-phase.md +9 -5
  96. package/gsd-core/workflows/health.md +2 -1
  97. package/gsd-core/workflows/import.md +1 -1
  98. package/gsd-core/workflows/plan-phase/steps/chunked-planning-mode.md +2 -2
  99. package/gsd-core/workflows/plan-phase.md +13 -13
  100. package/gsd-core/workflows/quick/steps/plan-checker-loop.md +1 -1
  101. package/gsd-core/workflows/quick/steps/worktree-pre-dispatch-commit.md +8 -1
  102. package/gsd-core/workflows/quick-batch/steps/plan-checker-loop.md +2 -1
  103. package/gsd-core/workflows/quick.md +1 -1
  104. package/gsd-core/workflows/review.md +16 -13
  105. package/gsd-core/workflows/section-manifest.json +5 -0
  106. package/gsd-core/workflows/settings.md +1 -0
  107. package/gsd-core/workflows/ship.md +3 -4
  108. package/gsd-core/workflows/spec-phase.md +3 -6
  109. package/gsd-core/workflows/verify-work.md +4 -3
  110. package/hooks/dist/gsd-agent-isolation-guard.js +11 -1
  111. package/hooks/dist/gsd-cursor-subagent-start.js +6 -2
  112. package/hooks/dist/gsd-path-export.js +95 -0
  113. package/hooks/dist/gsd-secret-read-guard.js +172 -39
  114. package/hooks/dist/gsd-statusline.js +35 -2
  115. package/hooks/dist/gsd-windsurf-pre-write.js +28 -1
  116. package/hooks/dist/gsd-workflow-guard.js +1 -1
  117. package/hooks/dist/gsd-worktree-path-guard.js +28 -1
  118. package/hooks/dist/lib/isolation-sentinel.js +44 -0
  119. package/hooks/dist/managed-hooks-registry.cjs +1 -0
  120. package/hooks/gsd-agent-isolation-guard.js +11 -1
  121. package/hooks/gsd-cursor-subagent-start.js +6 -2
  122. package/hooks/gsd-path-export.js +95 -0
  123. package/hooks/gsd-secret-read-guard.js +172 -39
  124. package/hooks/gsd-statusline.js +35 -2
  125. package/hooks/gsd-windsurf-pre-write.js +28 -1
  126. package/hooks/gsd-workflow-guard.js +1 -1
  127. package/hooks/gsd-worktree-path-guard.js +28 -1
  128. package/hooks/hooks.json +1 -0
  129. package/hooks/lib/isolation-sentinel.js +44 -0
  130. package/hooks/managed-hooks-registry.cjs +1 -0
  131. package/package.json +13 -6
  132. package/pi/gsd.cjs +1047 -10
  133. package/pi/package-agents/gsd-advisor-researcher.md +113 -0
  134. package/pi/package-agents/gsd-ai-researcher.md +111 -0
  135. package/pi/package-agents/gsd-assumptions-analyzer.md +110 -0
  136. package/pi/package-agents/gsd-code-fixer.md +769 -0
  137. package/pi/package-agents/gsd-code-reviewer.md +402 -0
  138. package/pi/package-agents/gsd-codebase-mapper.md +850 -0
  139. package/pi/package-agents/gsd-debug-session-manager.md +416 -0
  140. package/pi/package-agents/gsd-debugger.md +1274 -0
  141. package/pi/package-agents/gsd-doc-classifier.md +269 -0
  142. package/pi/package-agents/gsd-doc-synthesizer.md +259 -0
  143. package/pi/package-agents/gsd-doc-verifier.md +212 -0
  144. package/pi/package-agents/gsd-doc-writer.md +626 -0
  145. package/pi/package-agents/gsd-dom-verifier.md +164 -0
  146. package/pi/package-agents/gsd-domain-researcher.md +144 -0
  147. package/pi/package-agents/gsd-eval-auditor.md +185 -0
  148. package/pi/package-agents/gsd-eval-planner.md +149 -0
  149. package/pi/package-agents/gsd-executor.md +894 -0
  150. package/pi/package-agents/gsd-framework-selector.md +159 -0
  151. package/pi/package-agents/gsd-integration-checker.md +476 -0
  152. package/pi/package-agents/gsd-intel-updater.md +338 -0
  153. package/pi/package-agents/gsd-mempalace-curator.md +49 -0
  154. package/pi/package-agents/gsd-nyquist-auditor.md +200 -0
  155. package/pi/package-agents/gsd-pattern-mapper.md +340 -0
  156. package/pi/package-agents/gsd-phase-researcher.md +897 -0
  157. package/pi/package-agents/gsd-plan-checker.md +1077 -0
  158. package/pi/package-agents/gsd-planner.md +1003 -0
  159. package/pi/package-agents/gsd-project-researcher.md +611 -0
  160. package/pi/package-agents/gsd-research-synthesizer.md +259 -0
  161. package/pi/package-agents/gsd-roadmapper.md +779 -0
  162. package/pi/package-agents/gsd-security-auditor.md +171 -0
  163. package/pi/package-agents/gsd-ui-auditor.md +581 -0
  164. package/pi/package-agents/gsd-ui-checker.md +417 -0
  165. package/pi/package-agents/gsd-ui-researcher.md +469 -0
  166. package/pi/package-agents/gsd-user-profiler.md +174 -0
  167. package/pi/package-agents/gsd-verifier.md +963 -0
  168. package/pi/package-agents/manifest.json +39 -0
  169. package/pi/package-skills/gsd-add-tests/SKILL.md +39 -0
  170. package/pi/package-skills/gsd-ai-integration-phase/SKILL.md +36 -0
  171. package/pi/package-skills/gsd-audit-fix/SKILL.md +34 -0
  172. package/pi/package-skills/gsd-audit-milestone/SKILL.md +40 -0
  173. package/pi/package-skills/gsd-audit-uat/SKILL.md +26 -0
  174. package/pi/package-skills/gsd-autonomous/SKILL.md +52 -0
  175. package/pi/package-skills/gsd-capture/SKILL.md +68 -0
  176. package/pi/package-skills/gsd-cleanup/SKILL.md +25 -0
  177. package/pi/package-skills/gsd-code-review/SKILL.md +71 -0
  178. package/pi/package-skills/gsd-complete-milestone/SKILL.md +147 -0
  179. package/pi/package-skills/gsd-config/SKILL.md +60 -0
  180. package/pi/package-skills/gsd-debug/SKILL.md +64 -0
  181. package/pi/package-skills/gsd-discuss-phase/SKILL.md +74 -0
  182. package/pi/package-skills/gsd-docs-update/SKILL.md +50 -0
  183. package/pi/package-skills/gsd-eval-review/SKILL.md +35 -0
  184. package/pi/package-skills/gsd-execute-phase/SKILL.md +62 -0
  185. package/pi/package-skills/gsd-explore/SKILL.md +26 -0
  186. package/pi/package-skills/gsd-extract-learnings/SKILL.md +25 -0
  187. package/pi/package-skills/gsd-fast/SKILL.md +33 -0
  188. package/pi/package-skills/gsd-forensics/SKILL.md +59 -0
  189. package/pi/package-skills/gsd-graphify/SKILL.md +210 -0
  190. package/pi/package-skills/gsd-health/SKILL.md +36 -0
  191. package/pi/package-skills/gsd-help/SKILL.md +37 -0
  192. package/pi/package-skills/gsd-import/SKILL.md +46 -0
  193. package/pi/package-skills/gsd-inbox/SKILL.md +42 -0
  194. package/pi/package-skills/gsd-ingest-docs/SKILL.md +43 -0
  195. package/pi/package-skills/gsd-manager/SKILL.md +46 -0
  196. package/pi/package-skills/gsd-map-codebase/SKILL.md +85 -0
  197. package/pi/package-skills/gsd-mempalace-capture/SKILL.md +111 -0
  198. package/pi/package-skills/gsd-mempalace-recall/SKILL.md +111 -0
  199. package/pi/package-skills/gsd-milestone-summary/SKILL.md +54 -0
  200. package/pi/package-skills/gsd-mvp-phase/SKILL.md +45 -0
  201. package/pi/package-skills/gsd-new-milestone/SKILL.md +49 -0
  202. package/pi/package-skills/gsd-new-project/SKILL.md +49 -0
  203. package/pi/package-skills/gsd-next/SKILL.md +34 -0
  204. package/pi/package-skills/gsd-ns-context/SKILL.md +31 -0
  205. package/pi/package-skills/gsd-ns-ideate/SKILL.md +30 -0
  206. package/pi/package-skills/gsd-ns-manage/SKILL.md +42 -0
  207. package/pi/package-skills/gsd-ns-project/SKILL.md +34 -0
  208. package/pi/package-skills/gsd-ns-review/SKILL.md +35 -0
  209. package/pi/package-skills/gsd-ns-workflow/SKILL.md +44 -0
  210. package/pi/package-skills/gsd-onboard/SKILL.md +46 -0
  211. package/pi/package-skills/gsd-pause-work/SKILL.md +48 -0
  212. package/pi/package-skills/gsd-phase/SKILL.md +61 -0
  213. package/pi/package-skills/gsd-plan-phase/SKILL.md +62 -0
  214. package/pi/package-skills/gsd-plan-review-convergence/SKILL.md +63 -0
  215. package/pi/package-skills/gsd-pr-branch/SKILL.md +31 -0
  216. package/pi/package-skills/gsd-profile-user/SKILL.md +48 -0
  217. package/pi/package-skills/gsd-progress/SKILL.md +51 -0
  218. package/pi/package-skills/gsd-quick/SKILL.md +179 -0
  219. package/pi/package-skills/gsd-quick-batch/SKILL.md +114 -0
  220. package/pi/package-skills/gsd-resume-work/SKILL.md +31 -0
  221. package/pi/package-skills/gsd-review/SKILL.md +50 -0
  222. package/pi/package-skills/gsd-review-backlog/SKILL.md +65 -0
  223. package/pi/package-skills/gsd-secure-phase/SKILL.md +37 -0
  224. package/pi/package-skills/gsd-settings/SKILL.md +30 -0
  225. package/pi/package-skills/gsd-ship/SKILL.md +27 -0
  226. package/pi/package-skills/gsd-sketch/SKILL.md +56 -0
  227. package/pi/package-skills/gsd-spec-phase/SKILL.md +63 -0
  228. package/pi/package-skills/gsd-spike/SKILL.md +53 -0
  229. package/pi/package-skills/gsd-stats/SKILL.md +22 -0
  230. package/pi/package-skills/gsd-surface/SKILL.md +177 -0
  231. package/pi/package-skills/gsd-thread/SKILL.md +29 -0
  232. package/pi/package-skills/gsd-ui-phase/SKILL.md +35 -0
  233. package/pi/package-skills/gsd-ui-review/SKILL.md +35 -0
  234. package/pi/package-skills/gsd-ultraplan-phase/SKILL.md +38 -0
  235. package/pi/package-skills/gsd-undo/SKILL.md +38 -0
  236. package/pi/package-skills/gsd-update/SKILL.md +51 -0
  237. package/pi/package-skills/gsd-validate-phase/SKILL.md +37 -0
  238. package/pi/package-skills/gsd-verify-work/SKILL.md +41 -0
  239. package/pi/package-skills/gsd-workspace/SKILL.md +57 -0
  240. package/pi/package-skills/gsd-workstreams/SKILL.md +73 -0
  241. package/scripts/build-hooks.js +4 -0
  242. package/scripts/command-contract-helpers.cjs +1 -1
  243. package/scripts/docs-guard-registry.cjs +20 -7
  244. package/scripts/gen-health-docs.cjs +13 -1
  245. package/scripts/gen-pi-package-skills.cjs +217 -0
  246. package/scripts/lib/macos-conformance-tier.generated.cjs +11 -1
  247. package/scripts/lib/platform-conformance-tier.generated.cjs +26 -1
  248. package/scripts/lint-docs-guard-registration.exempt-baseline.cjs +3 -3
  249. package/scripts/lint-retired-runtime-name.cjs +5 -0
  250. package/scripts/npm-audit-baseline.cjs +41 -7
  251. package/scripts/reviewed-or-maintainer-policy.cjs +181 -0
  252. package/scripts/select-docs-guards.cjs +1 -1
  253. package/scripts/self-test-report-policy.cjs +350 -0
  254. package/vscode/package.json +1 -1
  255. package/scripts/diagnose-validate-commit-in-tier.cjs +0 -270
  256. package/scripts/diagnose-validate-commit-phases.cjs +0 -348
  257. package/scripts/xtrace-phase-timing.cjs +0 -205
@@ -0,0 +1,145 @@
1
+ <step name="evolve_project_full_review">
2
+
3
+ Full PROJECT.md evolution review at milestone completion.
4
+
5
+ Read all phase summaries:
6
+
7
+ ```bash
8
+ _SUMMARIES=( .planning/phases/*-*/*-SUMMARY.md )
9
+ if [ -e "${_SUMMARIES[0]}" ]; then cat "${_SUMMARIES[@]}"; fi
10
+ ```
11
+
12
+ **Full review checklist:**
13
+
14
+ 1. **"What This Is" accuracy:**
15
+ - Compare current description to what was built
16
+ - Update if product has meaningfully changed
17
+
18
+ 2. **Core Value check:**
19
+ - Still the right priority? Did shipping reveal a different core value?
20
+ - Update if the ONE thing has shifted
21
+
22
+ 3. **Business Context check (only if the section is present):**
23
+ - Skip entirely if PROJECT.md has no `## Business Context` section
24
+ - Customer, revenue model, and success metric still accurate after shipping?
25
+ - Update any field that drifted; refresh the linked strategy doc reference if it moved
26
+
27
+ 4. **Requirements audit:**
28
+
29
+ **Validated section:**
30
+ - All Active requirements shipped this milestone → Move to Validated
31
+ - Format: `- ✓ [Requirement] — v[X.Y]`
32
+
33
+ **Active section:**
34
+ - Remove requirements moved to Validated
35
+ - Add new requirements for next milestone
36
+ - Keep unaddressed requirements
37
+
38
+ **Out of Scope audit:**
39
+ - Review each item — reasoning still valid?
40
+ - Remove irrelevant items
41
+ - Add requirements invalidated during milestone
42
+
43
+ 5. **Context update:**
44
+ - Current codebase state (LOC, tech stack)
45
+ - User feedback themes (if any)
46
+ - Known issues or technical debt
47
+
48
+ 6. **Key Decisions audit:**
49
+ - Extract all decisions from milestone phase summaries
50
+ - Add to Key Decisions table with outcomes
51
+ - Mark ✓ Good, ⚠️ Revisit, or — Pending
52
+
53
+ 7. **Constraints check:**
54
+ - Any constraints changed during development? Update as needed
55
+
56
+ Update PROJECT.md inline. Update "Last updated" footer:
57
+
58
+ ```markdown
59
+ ---
60
+ *Last updated: [date] after v[X.Y] milestone*
61
+ ```
62
+
63
+ **Example full evolution (v1.0 → v1.1 prep):**
64
+
65
+ Before:
66
+
67
+ ```markdown
68
+ ## What This Is
69
+
70
+ A real-time collaborative whiteboard for remote teams.
71
+
72
+ ## Core Value
73
+
74
+ Real-time sync that feels instant.
75
+
76
+ ## Requirements
77
+
78
+ ### Validated
79
+
80
+ (None yet — ship to validate)
81
+
82
+ ### Active
83
+
84
+ - [ ] Canvas drawing tools
85
+ - [ ] Real-time sync < 500ms
86
+ - [ ] User authentication
87
+ - [ ] Export to PNG
88
+
89
+ ### Out of Scope
90
+
91
+ - Mobile app — web-first approach
92
+ - Video chat — use external tools
93
+ ```
94
+
95
+ After v1.0:
96
+
97
+ ```markdown
98
+ ## What This Is
99
+
100
+ A real-time collaborative whiteboard for remote teams with instant sync and drawing tools.
101
+
102
+ ## Core Value
103
+
104
+ Real-time sync that feels instant.
105
+
106
+ ## Requirements
107
+
108
+ ### Validated
109
+
110
+ - ✓ Canvas drawing tools — v1.0
111
+ - ✓ Real-time sync < 500ms — v1.0 (achieved 200ms avg)
112
+ - ✓ User authentication — v1.0
113
+
114
+ ### Active
115
+
116
+ - [ ] Export to PNG
117
+ - [ ] Undo/redo history
118
+ - [ ] Shape tools (rectangles, circles)
119
+
120
+ ### Out of Scope
121
+
122
+ - Mobile app — web-first approach, PWA works well
123
+ - Video chat — use external tools
124
+ - Offline mode — real-time is core value
125
+
126
+ ## Context
127
+
128
+ Shipped v1.0 with 2,400 LOC TypeScript.
129
+ Tech stack: Next.js, Supabase, Canvas API.
130
+ Initial user testing showed demand for shape tools.
131
+ ```
132
+
133
+ **Step complete when:**
134
+
135
+ - [ ] "What This Is" reviewed and updated if needed
136
+ - [ ] Core Value verified as still correct
137
+ - [ ] Business Context checked (or confirmed absent)
138
+ - [ ] All shipped requirements moved to Validated
139
+ - [ ] New requirements added to Active for next milestone
140
+ - [ ] Out of Scope reasoning audited
141
+ - [ ] Context updated with current state
142
+ - [ ] All milestone decisions added to Key Decisions
143
+ - [ ] "Last updated" footer reflects milestone completion
144
+
145
+ </step>
@@ -0,0 +1,80 @@
1
+ <step name="release_map">
2
+
3
+ Per-repository release mapping (#3628, ADR-3628). Runs only when the init JSON has `repo_tagging` set to `per_repo` AND a non-empty `sub_repos` list. A GSD milestone version names planned work; each repository has its own release version, so no `v[X.Y]` tag is created in the current directory on this path.
4
+
5
+ This file is read twice: Part 1 from `archive_milestone`, Part 2 from `push_release_tags`.
6
+
7
+ Text mode: when `TEXT_MODE` is active, replace every `AskUserQuestion` with a numbered plain-text list.
8
+
9
+ Working directory for the two JSON files: `RELEASE_MAP_DIR="${TMPDIR:-/tmp}/gsd-release-map-v[X.Y]"`, created with `mkdir -p "$RELEASE_MAP_DIR"`; the map file is `"$RELEASE_MAP_DIR/release-map.json"`. Shell state does not persist between commands, so re-derive these paths in every command that uses them. Write both JSON files with the Write tool; never build them with `echo`, a heredoc or any shell interpolation of the answers.
10
+
11
+ ## Part 1 — Collect, preflight, confirm, tag (runs inside `archive_milestone`, before `milestone complete`)
12
+
13
+ 1. **Collect one entry per repository in `sub_repos`.** For each repository ask for:
14
+ - `status`: `released`, `deployed`, or `unreleased`.
15
+ - `release`: the repository's release version. When a tag is created it becomes the tag name, so it must match `^[A-Za-z0-9][A-Za-z0-9._+-]{0,199}$`; re-ask on a mismatch, never alter or skip it. Leave it empty for an `unreleased` repository and never invent one.
16
+ - `reference`: a commit SHA or pull request reference (free text).
17
+ - `environment`: free text, for example `production`, `npm`, `development`.
18
+ - tag choice: `create` (create an annotated tag named `release`; requires a non-empty `release`) or `skip` (record the repository, create nothing). An `unreleased` repository defaults to `skip`.
19
+
20
+ Every text field is limited to 200 characters and a map to 256 entries; re-ask when a value is longer. If `git_create_tag` from init is `false`, do not ask the tag choice: every entry is recorded with a `tag` of `none`, no `tags.json` is built, and steps 3, 5 and 6 are skipped (the tag verb and the tag-state update); step 4 asks "Record this release map?" instead. Part 2 does not run.
21
+
22
+ 2. **Build `release-map.json`** (array of `{ "repo", "release", "reference", "environment", "status", "tag" }`) with provisional tag states: `created` for a `create` entry, `skipped` for a `skip` entry, `none` when tagging is disabled. When tags are requested, also build `tags.json` in the same directory: `{ "repo": "<repo>", "tag": "<release>", "ref": "<ref>" }` for each `create` entry and `{ "repo": "<repo>", "skip": true }` for each `skip` entry. `ref` is the entry's `reference`, lowercased, only when it matches `^[0-9a-f]{7,40}$`; any other reference text (for example `PR #412`) is recorded but the tag is placed on the repository's current `HEAD`.
23
+
24
+ 3. **Validate everything before anything is written:**
25
+
26
+ ```bash
27
+ _GSD_SHIM_NAME="gsd-tools.cjs"; _GSD_RUNTIME_ROOT="${RUNTIME_DIR:-$(git rev-parse --show-toplevel 2>/dev/null || pwd)}"; GSD_TOOLS="${_GSD_RUNTIME_ROOT}/gsd-core/bin/${_GSD_SHIM_NAME}"; _gsd_at() { for _p; do if [ -f "$_p" ]; then GSD_TOOLS="$_p"; return 0; fi; done; return 1; }; _gsd_id_ok() { case "$("$1" runtime-identity --raw 2>/dev/null || true)" in '{"packageName":"@opengsd/gsd-core"'*'}') return 0;; *) return 1;; esac; }; _gsd_homes() { set -- "${CLAUDE_CONFIG_DIR:-$HOME/.claude}" "${ANTIGRAVITY_CONFIG_DIR:-$HOME/.gemini/antigravity}" "$HOME/.gemini/antigravity-ide" "$HOME/.gemini/antigravity-cli" "${AUGMENT_CONFIG_DIR:-$HOME/.augment}" "${CLINE_CONFIG_DIR:-$HOME/.cline}" "${CODEBUDDY_CONFIG_DIR:-$HOME/.codebuddy}" "${CODEX_HOME:-$HOME/.codex}" "${COPILOT_CONFIG_DIR:-${COPILOT_HOME:-$HOME/.copilot}}" "${CURSOR_CONFIG_DIR:-$HOME/.cursor}" "${HERMES_HOME:-$HOME/.hermes}" "${KILO_CONFIG_DIR:-${XDG_CONFIG_HOME:-$HOME/.config}/kilo}" "${KIMI_CONFIG_DIR:-$HOME/.config/agents}" "$HOME/.agents" "${KIMI_CODE_HOME:-$HOME/.kimi-code}" "${OPENCODE_CONFIG_DIR:-${XDG_CONFIG_HOME:-$HOME/.config}/opencode}" "${PI_CODING_AGENT_DIR:-$HOME/.pi/agent}" "${QWEN_CONFIG_DIR:-$HOME/.qwen}" "${TRAE_CONFIG_DIR:-$HOME/.trae}" "${WINDSURF_CONFIG_DIR:-$HOME/.codeium/windsurf}" "${ZCODE_CONFIG_DIR:-$HOME/.zcode}" "${GROK_AGENTS_HOME:-$HOME/.agents}"; for _h; do _gsd_at "$_h/gsd-core/bin/${_GSD_SHIM_NAME}" && return 0; done; return 1; }; if _gsd_at "${_GSD_RUNTIME_ROOT}/gsd-core/bin/${_GSD_SHIM_NAME}" "${_GSD_RUNTIME_ROOT}/.claude/gsd-core/bin/${_GSD_SHIM_NAME}" "${_GSD_RUNTIME_ROOT}/.codex/gsd-core/bin/${_GSD_SHIM_NAME}"; then gsd_run() { node "$GSD_TOOLS" "$@"; }; elif _gsd_homes; then gsd_run() { node "$GSD_TOOLS" "$@"; }; elif unset -f gsd_run; _G="$(command -v gsd_run)"; [ -n "$_G" ] && _gsd_id_ok "$_G"; then GSD_TOOLS="$_G"; gsd_run() { "$GSD_TOOLS" "$@"; }; else echo "ERROR: gsd-tools.cjs not found at $GSD_TOOLS and no identity-proving gsd_run is on PATH. Run: npx -y @opengsd/gsd-core@latest --claude --local" >&2; exit 1; fi; GSD_IDENTITY_STATUS=unverified; _gsd_id_ok gsd_run && GSD_IDENTITY_STATUS=ok; export GSD_IDENTITY_STATUS; [ "$GSD_IDENTITY_STATUS" = ok ] || echo "WARNING: \"$GSD_TOOLS\" did not prove it is @opengsd/gsd-core - it is either a different package or an @opengsd/gsd-core older than the runtime-identity verb. See docs/how-to/diagnose-a-foreign-gsd-tools.md" >&2; if [ -n "${CLAUDE_ENV_FILE:-}" ] && [ -n "${GSD_TOOLS:-}" ]; then printf "export PATH='%s':\"\$PATH\"\n" "${GSD_TOOLS%/*}" >> "$CLAUDE_ENV_FILE" 2>/dev/null || true; fi
28
+ gsd_run query milestone release-tags --map "$RELEASE_MAP_DIR/tags.json" --dry-run
29
+ gsd_run query milestone.complete "v[X.Y]" --dry-run --release-map "$RELEASE_MAP_DIR/release-map.json"
30
+ ```
31
+
32
+ If the first reports `ok: false`, show each error with its repository and `reason`; a `tag_conflict` means the tag already exists at a different commit and is never overwritten. If the second fails, it lists every release map problem. Let the user correct the entries or abort, and repeat. Do not continue while either check fails.
33
+
34
+ 4. **One consolidated confirmation.** Show a single table and ask once (AskUserQuestion: "Create these tags? Nothing is pushed." — Create / Edit / Cancel). Include the commit each tag will be placed on (`commit`, shortened, from the dry-run result) and say so when the tag lands on the repository's current `HEAD` rather than a given SHA or when the result reports `detached_head`:
35
+
36
+ ```text
37
+ Milestone v[X.Y] — [Name]
38
+
39
+ Repository Release Reference Environment Tag Commit
40
+ dashboard v5.78.0 PR #412 production create HEAD (a1b2c3d)
41
+ composers unreleased abc1234 development skip —
42
+ ```
43
+
44
+ On Cancel, stop: nothing has been written and `milestone complete` is not called.
45
+
46
+ 5. **Create the tags:**
47
+
48
+ ```bash
49
+ gsd_run query milestone release-tags --map "$RELEASE_MAP_DIR/tags.json"
50
+ ```
51
+
52
+ If the command exits non-zero, report every repository's status and the `created` list (`repo:tag` pairs already written). Stop before `milestone complete`; running the same command again is safe, it retries only what failed and reports tags already written as `already_tagged`. Tags are placed on commits that already exist in each repository, so merge or squash a repository's release branch before running this flow if the tag must sit on the merged commit.
53
+
54
+ 6. **Record the outcome in the map.** Rewrite `release-map.json` so each `create` entry's `tag` is that repository's `status` from the result (`created` or `already_tagged`); leave `skipped` and `none` as they are. Valid `status` values are `released`, `deployed`, `unreleased`; valid `tag` values are `created`, `already_tagged`, `skipped`, `none`.
55
+
56
+ 7. **Archive the map with the milestone** by adding `--release-map "$RELEASE_MAP_DIR/release-map.json"` to every `milestone complete` call in `archive_milestone`. The map is stored as recorded, whether or not any tag was created.
57
+
58
+ ## Part 2 — Push confirmation (runs after the archive, in place of the single-repository push prompt)
59
+
60
+ Nothing is pushed by default. For each repository whose entry has `tag` of `created` or `already_tagged`, one at a time. Take `REPO`, `REMOTE` and `TAG` only from the validated release map and the repository's own `git remote` list, and write them into the commands below as single-quoted literals.
61
+
62
+ Choose the remote: `origin` when `git -C "$REPO" remote` lists it; when there are several remotes and none is `origin`, show the list and ask which one; when there is none, report that and move on. Then show where the push would go (the push URL, with any embedded credentials removed before it is shown):
63
+
64
+ ```bash
65
+ git -C "$REPO" remote get-url --push "$REMOTE"
66
+ ```
67
+
68
+ Ask a separate question naming the repository, the tag, the remote and that URL:
69
+
70
+ `Push tag <tag> from <repo> to remote <remote> (<url>)? (y/n)`
71
+
72
+ Only on `y`, push that one tag, with `GIT_TERMINAL_PROMPT=0` exported:
73
+
74
+ ```bash
75
+ git -C "$REPO" push -- "$REMOTE" "refs/tags/$TAG"
76
+ ```
77
+
78
+ A decline, a failed push, or a push that does not finish is reported for that repository only; continue with the next repository. Never push branches, never push several tags in one command, and never push without the answer for that repository.
79
+
80
+ </step>
@@ -1,6 +1,6 @@
1
1
  <purpose>
2
2
 
3
- Mark a shipped version (v1.0, v1.1, v2.0) as complete. Creates historical record in MILESTONES.md, performs full PROJECT.md evolution review, reorganizes ROADMAP.md with milestone groupings, and tags the release in git.
3
+ Mark a shipped version (v1.0, v1.1, v2.0) as complete. Creates historical record in MILESTONES.md, performs the full PROJECT.md evolution review (flat mode only; skipped under `--ws`, because PROJECT.md is shared across workstreams), reorganizes ROADMAP.md with milestone groupings, and tags the release in git.
4
4
 
5
5
  </purpose>
6
6
 
@@ -22,7 +22,7 @@ When a milestone completes:
22
22
  2. Archive requirements to `.planning/milestones/v[X.Y]-REQUIREMENTS.md`
23
23
  3. Update ROADMAP.md — overwrite in place with milestone grouping (preserve Backlog section)
24
24
  4. Safety commit archive files + updated ROADMAP.md, then `git rm REQUIREMENTS.md` (fresh for next milestone)
25
- 5. Perform full PROJECT.md evolution review
25
+ 5. Perform full PROJECT.md evolution review (flat mode only — skipped under an active workstream, #5195)
26
26
  6. Offer to create next milestone inline
27
27
  7. Archive UI artifacts (`*-UI-SPEC.md`, `*-UI-REVIEW.md`) alongside other phase documents
28
28
  8. Clean up `.planning/ui-reviews/` screenshot files (binary assets, never archived)
@@ -244,151 +244,22 @@ If additional details are needed (e.g., user-provided "Delivered" summary, git r
244
244
 
245
245
  </step>
246
246
 
247
- <step name="evolve_project_full_review">
248
-
249
- Full PROJECT.md evolution review at milestone completion.
250
-
251
- Read all phase summaries:
247
+ **Resolve the PROJECT.md review gate first.** This is the first `init.complete-milestone` call in the workflow, so the section manifest does not exist before it; reading `section_manifest` without making this call would fall into the fail-open `null` branch below and rewrite the shared PROJECT.md under `--ws` (#5195). `init.complete-milestone` is a pure read, so the later full call in `reorganize_roadmap_and_delete_originals` is unaffected.
252
248
 
253
249
  ```bash
254
- _SUMMARIES=( .planning/phases/*-*/*-SUMMARY.md )
255
- if [ -e "${_SUMMARIES[0]}" ]; then cat "${_SUMMARIES[@]}"; fi
256
- ```
257
-
258
- **Full review checklist:**
259
-
260
- 1. **"What This Is" accuracy:**
261
- - Compare current description to what was built
262
- - Update if product has meaningfully changed
263
-
264
- 2. **Core Value check:**
265
- - Still the right priority? Did shipping reveal a different core value?
266
- - Update if the ONE thing has shifted
267
-
268
- 3. **Business Context check (only if the section is present):**
269
- - Skip entirely if PROJECT.md has no `## Business Context` section
270
- - Customer, revenue model, and success metric still accurate after shipping?
271
- - Update any field that drifted; refresh the linked strategy doc reference if it moved
272
-
273
- 4. **Requirements audit:**
274
-
275
- **Validated section:**
276
- - All Active requirements shipped this milestone → Move to Validated
277
- - Format: `- ✓ [Requirement] — v[X.Y]`
278
-
279
- **Active section:**
280
- - Remove requirements moved to Validated
281
- - Add new requirements for next milestone
282
- - Keep unaddressed requirements
283
-
284
- **Out of Scope audit:**
285
- - Review each item — reasoning still valid?
286
- - Remove irrelevant items
287
- - Add requirements invalidated during milestone
288
-
289
- 5. **Context update:**
290
- - Current codebase state (LOC, tech stack)
291
- - User feedback themes (if any)
292
- - Known issues or technical debt
293
-
294
- 6. **Key Decisions audit:**
295
- - Extract all decisions from milestone phase summaries
296
- - Add to Key Decisions table with outcomes
297
- - Mark ✓ Good, ⚠️ Revisit, or — Pending
298
-
299
- 7. **Constraints check:**
300
- - Any constraints changed during development? Update as needed
301
-
302
- Update PROJECT.md inline. Update "Last updated" footer:
303
-
304
- ```markdown
305
- ---
306
- *Last updated: [date] after v[X.Y] milestone*
307
- ```
308
-
309
- **Example full evolution (v1.0 → v1.1 prep):**
310
-
311
- Before:
312
-
313
- ```markdown
314
- ## What This Is
315
-
316
- A real-time collaborative whiteboard for remote teams.
317
-
318
- ## Core Value
319
-
320
- Real-time sync that feels instant.
321
-
322
- ## Requirements
323
-
324
- ### Validated
325
-
326
- (None yet — ship to validate)
327
-
328
- ### Active
329
-
330
- - [ ] Canvas drawing tools
331
- - [ ] Real-time sync < 500ms
332
- - [ ] User authentication
333
- - [ ] Export to PNG
334
-
335
- ### Out of Scope
336
-
337
- - Mobile app — web-first approach
338
- - Video chat — use external tools
339
- ```
340
-
341
- After v1.0:
342
-
343
- ```markdown
344
- ## What This Is
345
-
346
- A real-time collaborative whiteboard for remote teams with instant sync and drawing tools.
347
-
348
- ## Core Value
349
-
350
- Real-time sync that feels instant.
351
-
352
- ## Requirements
353
-
354
- ### Validated
355
-
356
- - ✓ Canvas drawing tools — v1.0
357
- - ✓ Real-time sync < 500ms — v1.0 (achieved 200ms avg)
358
- - ✓ User authentication — v1.0
359
-
360
- ### Active
361
-
362
- - [ ] Export to PNG
363
- - [ ] Undo/redo history
364
- - [ ] Shape tools (rectangles, circles)
365
-
366
- ### Out of Scope
367
-
368
- - Mobile app — web-first approach, PWA works well
369
- - Video chat — use external tools
370
- - Offline mode — real-time is core value
371
-
372
- ## Context
373
-
374
- Shipped v1.0 with 2,400 LOC TypeScript.
375
- Tech stack: Next.js, Supabase, Canvas API.
376
- Initial user testing showed demand for shape tools.
250
+ IFS= read -rd '' GSD_ARGS <<'GSD_ARGS_END' || true
251
+ $ARGUMENTS
252
+ GSD_ARGS_END
253
+ GSD_ARGS=${GSD_ARGS%$'\n'}
254
+ GSD_WS=$(echo " $GSD_ARGS" | sed -nE 's/.* --ws +([A-Za-z0-9][A-Za-z0-9._-]*).*/--ws \1/p' | head -n 1)
255
+ INIT_EARLY=$(gsd_run query init.complete-milestone ${GSD_WS:+--ws=${GSD_WS##* }})
256
+ if [[ "$INIT_EARLY" == @file:* ]]; then INIT_EARLY=$(cat "${INIT_EARLY#@file:}"); fi
257
+ node -e "const m=JSON.parse(process.argv[1]).section_manifest; console.log('PROJECT_MD_REVIEW=' + (m==null||m.included.includes('project-md-evolution-review') ? 'run' : 'skip'))" "$INIT_EARLY"
377
258
  ```
378
259
 
379
- **Step complete when:**
380
-
381
- - [ ] "What This Is" reviewed and updated if needed
382
- - [ ] Core Value verified as still correct
383
- - [ ] Business Context checked (or confirmed absent)
384
- - [ ] All shipped requirements moved to Validated
385
- - [ ] New requirements added to Active for next milestone
386
- - [ ] Out of Scope reasoning audited
387
- - [ ] Context updated with current state
388
- - [ ] All milestone decisions added to Key Decisions
389
- - [ ] "Last updated" footer reflects milestone completion
390
-
391
- </step>
260
+ <!-- gsd:section id="project-md-evolution-review" when="state:flat-mode" -->
261
+ If the line above printed `PROJECT_MD_REVIEW=run` (the manifest is `null` or lists `"project-md-evolution-review"` in `included`): read and execute `gsd-core/workflows/complete-milestone/steps/project-md-evolution-review.md`. If it printed `PROJECT_MD_REVIEW=skip` (a workstream is active) — do not read the file; PROJECT.md is shared across workstreams, so a workstream's milestone close never rewrites it (#2308, #5195); proceed to `archive_milestone`.
262
+ <!-- /gsd:section -->
392
263
 
393
264
  <step name="archive_milestone">
394
265
 
@@ -402,6 +273,8 @@ AskUserQuestion: "Archive completed quick tasks into this milestone too?" with o
402
273
 
403
274
  If "Yes": set `ARCHIVE_QUICK_FLAG="--archive-quick"`. If "Skip" (or `.planning/quick/` is empty): set `ARCHIVE_QUICK_FLAG=""`.
404
275
 
276
+ **Per-repository release mapping (opt-in, #3628).** Set `PER_REPO_TAGGING=true` only when `INIT_EARLY` has `repo_tagging` equal to `per_repo` AND a non-empty `sub_repos`; otherwise it is `false` and this paragraph changes nothing. Shell state does not persist between commands, so later steps recompute it from their own `init.complete-milestone` JSON (`INIT_REORG`). When `true`, read and execute `gsd-core/workflows/complete-milestone/steps/release-map.md` Part 1 now (collect, validate, one consolidated confirmation, create the tags, record the outcome in `release-map.json`), and append `--release-map "${TMPDIR:-/tmp}/gsd-release-map-v[X.Y]/release-map.json"` to EVERY `milestone complete` call below (including the `--no-archive-phases` form); when `false`, append nothing. A GSD milestone version may differ from every repository's release version.
277
+
405
278
  **Delegate archival to `gsd_run query milestone.complete`:**
406
279
 
407
280
  ```bash
@@ -438,11 +311,13 @@ If the user explicitly wants to keep phase directories in place as raw execution
438
311
  gsd_run query milestone complete v[X.Y] --no-archive-phases --confirm
439
312
  ```
440
313
 
314
+ (When `PER_REPO_TAGGING` is `true`, this form takes the same `--release-map` argument.)
315
+
441
316
  Verify after a default (archived) completion: `✅ Phase directories archived to .planning/milestones/v[X.Y]-phases/`
442
317
 
443
318
  After archival, the AI still handles:
444
319
  - Reorganizing ROADMAP.md with milestone grouping (requires judgment) — overwrite in place after extracting Backlog section, with the write-guard's single-use sentinel armed first (a per-step env var cannot reach a hook — see the reorganize step for the sentinel mechanics)
445
- - Full PROJECT.md evolution review (requires understanding)
320
+ - Full PROJECT.md evolution review (requires understanding; flat mode only — skipped under `--ws`)
446
321
  - Safety commit of archive files + updated ROADMAP.md, then `git rm .planning/REQUIREMENTS.md`
447
322
  - These are NOT fully delegated because they require AI interpretation of content
448
323
 
@@ -535,12 +410,15 @@ ROADMAP_PATH=$(_gsd_field "$INIT_REORG" roadmap_path)
535
410
  ARCHIVE_DIR=$(_gsd_field "$INIT_REORG" archive_dir)
536
411
  MILESTONES_PATH=$(_gsd_field "$INIT_REORG" milestones_path)
537
412
  PROJECT_PATH=$(_gsd_field "$INIT_REORG" project_path)
538
- gsd_run query commit "chore: archive v[X.Y] milestone files" --files "${ARCHIVE_DIR}/v[X.Y]-ROADMAP.md" "${ARCHIVE_DIR}/v[X.Y]-REQUIREMENTS.md" "${ARCHIVE_DIR}/v[X.Y]-MILESTONE-AUDIT.md" "$MILESTONES_PATH" "$PROJECT_PATH" "$STATE_PATH" "$ROADMAP_PATH"
413
+ # #5195: PROJECT.md is shared across workstreams. Stage it only when init's own section manifest says this run edited it (the evolution review is included in flat mode only) — the same source the review step is gated on, so the two cannot disagree.
414
+ _gsd_has_section() { node -e "const m=JSON.parse(process.argv[1]).section_manifest; process.exit(m==null||m.included.includes(process.argv[2])?0:1)" "$1" "$2"; }
415
+ _gsd_has_section "$INIT_REORG" project-md-evolution-review || PROJECT_PATH=""
416
+ gsd_run query commit "chore: archive v[X.Y] milestone files" --files "${ARCHIVE_DIR}/v[X.Y]-ROADMAP.md" "${ARCHIVE_DIR}/v[X.Y]-REQUIREMENTS.md" "${ARCHIVE_DIR}/v[X.Y]-MILESTONE-AUDIT.md" "$MILESTONES_PATH" ${PROJECT_PATH:+"$PROJECT_PATH"} "$STATE_PATH" "$ROADMAP_PATH"
539
417
  ```
540
418
 
541
419
  This creates a durable checkpoint in git history. If anything fails after this point, the working tree can be reconstructed from git.
542
420
 
543
- MILESTONES.md and PROJECT.md are workstream-scoped the same way STATE.md/ROADMAP.md are (`planningPaths(cwd).planning`/`.project`) — under an active workstream this commits the actual files `milestone complete` wrote, not the root copies.
421
+ MILESTONES.md is workstream-scoped the same way STATE.md/ROADMAP.md are (`planningPaths(cwd).planning`) — under an active workstream this commits the actual files `milestone complete` wrote, not the root copies. PROJECT.md is NOT: it is shared across workstreams, so under an active workstream it is neither reviewed nor staged here (#5195).
544
422
 
545
423
  **Remove REQUIREMENTS.md via git rm** (preserves history, stages deletion atomically):
546
424
 
@@ -656,9 +534,15 @@ Exact bash for each of the four options (squash, history-preserving merge, delet
656
534
  </step>
657
535
 
658
536
  <!-- gsd:section id="git-tag" when="state:git-create-tag" -->
659
- If `section_manifest` is `null` or `"git-tag"` is in its `included` list: read and execute `gsd-core/workflows/complete-milestone/steps/git-tag.md`. Otherwise skip — do not read the file; proceed to `git_commit_milestone`.
537
+ If `PER_REPO_TAGGING` is `true`, skip this section: the per-repository tags were created in `archive_milestone`, and no `v[X.Y]` tag is created in the current directory. Otherwise, if `section_manifest` is `null` or `"git-tag"` is in its `included` list: read and execute `gsd-core/workflows/complete-milestone/steps/git-tag.md`. Otherwise skip — do not read the file; proceed to `git_commit_milestone`.
660
538
  <!-- /gsd:section -->
661
539
 
540
+ <step name="push_release_tags">
541
+
542
+ Recompute `PER_REPO_TAGGING` and `git_create_tag` from the latest `init.complete-milestone` JSON (`INIT_REORG`). If `PER_REPO_TAGGING` is `true` and `git_create_tag` is not `false`: read and execute `gsd-core/workflows/complete-milestone/steps/release-map.md` Part 2 (a separate push confirmation per repository naming the repository and its remote; nothing is pushed by default). Otherwise skip this step.
543
+
544
+ </step>
545
+
662
546
  <step name="git_commit_milestone">
663
547
 
664
548
  Commit the REQUIREMENTS.md deletion (archive files and ROADMAP.md were already committed in the safety commit in `reorganize_roadmap_and_delete_originals`).
@@ -669,6 +553,8 @@ git commit -m "chore: remove REQUIREMENTS.md for v[X.Y] milestone"
669
553
 
670
554
  Confirm: "Committed: chore: remove REQUIREMENTS.md for v[X.Y] milestone"
671
555
 
556
+ When `PER_REPO_TAGGING` was `true`, remove the scratch directory: `rm -rf "${TMPDIR:-/tmp}/gsd-release-map-v[X.Y]"` (the archived copy lives in `.planning/milestones/`).
557
+
672
558
  </step>
673
559
 
674
560
  <step name="offer_next">
@@ -734,8 +620,8 @@ Milestone completion is successful when:
734
620
  - [ ] Known deferred items count noted in MILESTONES.md entry
735
621
 
736
622
  - [ ] MILESTONES.md entry created with stats and accomplishments
737
- - [ ] PROJECT.md full evolution review completed
738
- - [ ] All shipped requirements moved to Validated in PROJECT.md
623
+ - [ ] PROJECT.md full evolution review completed (flat mode only; skipped under `--ws`)
624
+ - [ ] All shipped requirements moved to Validated in PROJECT.md (flat mode only; skipped under `--ws`)
739
625
  - [ ] Key Decisions updated with outcomes
740
626
  - [ ] ROADMAP.md Backlog section extracted before rewrite, re-appended after (skipped if absent)
741
627
  - [ ] ROADMAP.md reorganized with milestone grouping (overwritten in place, not deleted)
@@ -744,7 +630,8 @@ Milestone completion is successful when:
744
630
  - [ ] Safety commit made (archive files + updated ROADMAP.md) BEFORE deleting REQUIREMENTS.md
745
631
  - [ ] REQUIREMENTS.md removed via `git rm` (fresh for next milestone, history preserved)
746
632
  - [ ] STATE.md updated with fresh project reference
747
- - [ ] Git tag created (v[X.Y]) (if `git.create_tag` enabled)
633
+ - [ ] Git tag created (v[X.Y]) (if `git.create_tag` enabled and `PER_REPO_TAGGING` is not `true`)
634
+ - [ ] Release map archived and per-repository tags created (if `PER_REPO_TAGGING` is `true`); no tag pushed without a per-repository confirmation
748
635
  - [ ] Milestone commit made (includes archive files and deletion)
749
636
  - [ ] Requirements completion checked against REQUIREMENTS.md traceability table
750
637
  - [ ] Incomplete requirements surfaced with proceed/audit/abort options
@@ -85,7 +85,7 @@ Spawning parallel debug agents to investigate root causes:
85
85
  | Delete removes comment | blocker |
86
86
 
87
87
  Each agent will:
88
- 1. Create DEBUG-{slug}.md with symptoms pre-filled
88
+ 1. Create .planning/debug/{slug}.md with symptoms pre-filled
89
89
  2. Investigate autonomously (read code, form hypotheses, test)
90
90
  3. Return root cause
91
91
 
@@ -147,7 +147,32 @@ return before spawning the next. Fanning out unisolated debuggers is the outcome
147
147
  `orchestrator-worktree` degrade exists to avoid; degrading the flag while keeping the
148
148
  parallelism would announce sequential mode and then do the opposite.
149
149
 
150
- For each gap, fill the debug-subagent-prompt template and spawn:
150
+ For each gap, fill this prompt (the `Template placeholders` below define every `{…}` field) as `filled_debug_prompt`, then spawn:
151
+
152
+ ```markdown
153
+ <objective>
154
+ Investigate issue: {slug}
155
+
156
+ **Summary:** {truth}
157
+ </objective>
158
+
159
+ <symptoms>
160
+ expected: {expected}
161
+ actual: {actual}
162
+ errors: {errors}
163
+ reproduction: {reproduction}
164
+ timeline: {timeline}
165
+ </symptoms>
166
+
167
+ <mode>
168
+ symptoms_prefilled: true
169
+ goal: find_root_cause_only
170
+ </mode>
171
+
172
+ <debug_file>
173
+ Create: .planning/debug/{slug}.md
174
+ </debug_file>
175
+ ```
151
176
 
152
177
  Print: `◆ Spawning diagnostics agent... (each runs in a subagent — no output until they return, ~1–5 min; expected, not a freeze)`
153
178
 
@@ -173,7 +198,7 @@ placeholder, not a shell variable.
173
198
 
174
199
  ```
175
200
  Agent(
176
- prompt=filled_debug_subagent_prompt + "\n\n" + WORKTREE_GUARD + "\n\n<required_reading>\n- {phase_dir}/{phase_num}-UAT.md\n- {state_path}\n</required_reading>\n${AGENT_SKILLS_DEBUGGER}",
201
+ prompt=filled_debug_prompt + "\n\n" + WORKTREE_GUARD + "\n\n<required_reading>\n- {phase_dir}/{phase_num}-UAT.md\n- {state_path}\n</required_reading>\n${AGENT_SKILLS_DEBUGGER}",
177
202
  subagent_type="gsd-debugger",
178
203
  model="{DEBUGGER_MODEL}",
179
204
  {harnessFlag}
@@ -192,7 +217,6 @@ Template placeholders:
192
217
  - `{errors}`: Any error messages from UAT (or "None reported")
193
218
  - `{reproduction}`: "Test {test_num} in UAT"
194
219
  - `{timeline}`: "Discovered during UAT"
195
- - `{goal}`: `find_root_cause_only` (UAT flow - plan-phase --gaps handles fixes)
196
220
  - `{slug}`: Generated from truth
197
221
  </step>
198
222
 
@@ -298,7 +322,7 @@ Agents only diagnose—plan-phase --gaps handles fixes (no fix application).
298
322
  - Report incomplete diagnosis
299
323
 
300
324
  **Agent times out:**
301
- - Check DEBUG-{slug}.md for partial progress
325
+ - Check .planning/debug/{slug}.md for partial progress
302
326
  - Can resume with /gsd:debug
303
327
 
304
328
  **All agents fail:**
@@ -21,7 +21,7 @@ The power user mode generates ALL questions upfront into machine-readable
21
21
  and human-friendly files, then waits for the user to answer at their own
22
22
  pace before processing all answers in a single pass.
23
23
 
24
- 1. Run the same phase analysis (gray area identification) as standard mode
24
+ 1. Load the phase SPEC (`check_spec`, from the init facts `has_spec` / `spec_path`), then run the same phase analysis (gray area identification) as standard mode, about HOW only when a SPEC locks the requirements
25
25
  2. Write all questions to
26
26
  `{phase_dir}/{padded_phase}-QUESTIONS.json` and
27
27
  `{phase_dir}/{padded_phase}-QUESTIONS.html`
@@ -82,7 +82,7 @@ ANALYZER_MODEL=$(gsd_run query resolve-model gsd-assumptions-analyzer --raw)
82
82
 
83
83
  Parse JSON for: `commit_docs`, `phase_found`, `phase_dir`, `phase_number`, `phase_name`,
84
84
  `phase_slug`, `padded_phase`, `has_research`, `has_context`, `has_plans`, `has_verification`,
85
- `plan_count`, `roadmap_exists`, `planning_exists`.
85
+ `plan_count`, `roadmap_exists`, `planning_exists`, `has_spec`, `spec_path`.
86
86
 
87
87
  **If `phase_found` is false:**
88
88
  ```
@@ -92,7 +92,7 @@ Use /gsd:progress to see available phases.
92
92
  ```
93
93
  Exit workflow.
94
94
 
95
- **If `phase_found` is true:** Continue to check_existing.
95
+ **If `phase_found` is true:** Continue to check_spec.
96
96
 
97
97
  **Auto mode** — If `--auto` is present in ARGUMENTS:
98
98
  - In `check_existing`: auto-select "Update it" (if context exists) or continue without prompting
@@ -102,6 +102,21 @@ Exit workflow.
102
102
  - After completion, auto-advance to plan-phase
103
103
  </step>
104
104
 
105
+ <step name="check_spec">
106
+ Check whether the phase has a SPEC.md (from the spec-phase workflow). SPEC.md locks requirements before implementation decisions. Init already resolved it: use `has_spec` and `spec_path`, which come from one shared definition of "the phase SPEC" (a plain `*-SPEC.md`, never `*-AI-SPEC.md` or `*-UI-SPEC.md`). Do not glob for it.
107
+
108
+ **If `has_spec` is true:**
109
+ 1. Read the SPEC.md file at `spec_path`.
110
+ 2. Count requirements (numbered items in `## Requirements`).
111
+ 3. Display: `Found SPEC.md — {N} requirements locked. Focusing on implementation decisions.`
112
+ 4. Set `spec_loaded = true`.
113
+ 5. Store requirements, boundaries, and acceptance criteria as `<locked_requirements>` — these flow directly into CONTEXT.md without re-asking.
114
+
115
+ **If `has_spec` is false:** Continue with `spec_loaded = false`.
116
+
117
+ **Note:** `*-AI-SPEC.md` (from the ai-integration-phase workflow) and `*-UI-SPEC.md` (from the ui-phase workflow) are different artifacts and never count as the phase SPEC.
118
+ </step>
119
+
105
120
  <step name="check_existing">
106
121
  Check if CONTEXT.md already exists using `has_context` from init.
107
122
 
@@ -280,6 +295,7 @@ Phase goal: {roadmap_description}
280
295
  Prior decisions: {prior_decisions_summary}
281
296
  Codebase scout hints: {codebase_context_summary}
282
297
  Calibration: {calibration_tier}
298
+ Locked requirements (already answered by SPEC.md; omit this line when spec_loaded = false): {locked_requirements}
283
299
 
284
300
  Your job:
285
301
  1. Read ROADMAP.md phase {PHASE} description
@@ -287,6 +303,7 @@ Your job:
287
303
  3. Glob/Grep for files related to: {phase_relevant_terms}
288
304
  4. Read 5-15 most relevant source files
289
305
  5. Return structured assumptions
306
+ 6. When locked requirements are given, treat them as decided: form assumptions about HOW to implement them only, never about WHAT to build or WHY
290
307
 
291
308
  ## Output Format
292
309
 
@@ -437,6 +454,7 @@ Map assumptions to CONTEXT.md sections:
437
454
  - Areas where all assumptions were Confident → marked as locked decisions
438
455
  - Areas with corrections → include user's chosen alternative as the decision
439
456
  - Folded todos → included in `<decisions>` under "### Folded Todos"
457
+ - When `spec_loaded = true`: add `<spec_lock>` immediately after `<domain>`, add the SPEC.md file to `<canonical_refs>` with the note "Locked requirements — MUST read before planning", and do NOT copy SPEC.md requirements into `<decisions>` (agents read SPEC.md directly); `<decisions>` holds only the HOW decisions from this discussion
440
458
 
441
459
  ```markdown
442
460
  # Phase {PHASE}: {phase_name} - Context
@@ -450,6 +468,19 @@ Map assumptions to CONTEXT.md sections:
450
468
  {Domain boundary from ROADMAP.md — clear statement of scope anchor}
451
469
  </domain>
452
470
 
471
+ [If spec_loaded = true, insert this section:]
472
+ <spec_lock>
473
+ ## Requirements (locked via SPEC.md)
474
+
475
+ **{N} requirements are locked.** See `{padded_phase}-SPEC.md` for full requirements, boundaries, and acceptance criteria.
476
+
477
+ Downstream agents MUST read `{padded_phase}-SPEC.md` before planning or implementing. Requirements are not duplicated here.
478
+
479
+ **In scope (from SPEC.md):** [copy the "In scope" bullet list from SPEC.md Boundaries]
480
+ **Out of scope (from SPEC.md):** [copy the "Out of scope" bullet list from SPEC.md Boundaries]
481
+
482
+ </spec_lock>
483
+
453
484
  <decisions>
454
485
  ## Implementation Decisions
455
486