gsd-opencode 1.22.0 → 1.30.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 (157) hide show
  1. package/agents/gsd-advisor-researcher.md +112 -0
  2. package/agents/gsd-assumptions-analyzer.md +110 -0
  3. package/agents/gsd-codebase-mapper.md +1 -2
  4. package/agents/gsd-debugger.md +119 -2
  5. package/agents/gsd-executor.md +25 -4
  6. package/agents/gsd-integration-checker.md +1 -2
  7. package/agents/gsd-nyquist-auditor.md +1 -2
  8. package/agents/gsd-phase-researcher.md +151 -5
  9. package/agents/gsd-plan-checker.md +71 -5
  10. package/agents/gsd-planner.md +50 -4
  11. package/agents/gsd-project-researcher.md +29 -3
  12. package/agents/gsd-research-synthesizer.md +1 -2
  13. package/agents/gsd-roadmapper.md +30 -2
  14. package/agents/gsd-ui-auditor.md +445 -0
  15. package/agents/gsd-ui-checker.md +305 -0
  16. package/agents/gsd-ui-researcher.md +368 -0
  17. package/agents/gsd-user-profiler.md +173 -0
  18. package/agents/gsd-verifier.md +124 -4
  19. package/commands/gsd/gsd-add-backlog.md +76 -0
  20. package/commands/gsd/gsd-audit-uat.md +24 -0
  21. package/commands/gsd/gsd-autonomous.md +41 -0
  22. package/commands/gsd/gsd-debug.md +5 -0
  23. package/commands/gsd/gsd-discuss-phase.md +10 -36
  24. package/commands/gsd/gsd-do.md +30 -0
  25. package/commands/gsd/gsd-execute-phase.md +20 -2
  26. package/commands/gsd/gsd-fast.md +30 -0
  27. package/commands/gsd/gsd-forensics.md +56 -0
  28. package/commands/gsd/gsd-list-workspaces.md +19 -0
  29. package/commands/gsd/gsd-manager.md +39 -0
  30. package/commands/gsd/gsd-milestone-summary.md +51 -0
  31. package/commands/gsd/gsd-new-workspace.md +44 -0
  32. package/commands/gsd/gsd-next.md +24 -0
  33. package/commands/gsd/gsd-note.md +34 -0
  34. package/commands/gsd/gsd-plan-phase.md +3 -1
  35. package/commands/gsd/gsd-plant-seed.md +28 -0
  36. package/commands/gsd/gsd-pr-branch.md +25 -0
  37. package/commands/gsd/gsd-profile-user.md +46 -0
  38. package/commands/gsd/gsd-quick.md +4 -2
  39. package/commands/gsd/gsd-reapply-patches.md +10 -6
  40. package/commands/gsd/gsd-remove-workspace.md +26 -0
  41. package/commands/gsd/gsd-research-phase.md +5 -0
  42. package/commands/gsd/gsd-resume-work.md +1 -1
  43. package/commands/gsd/gsd-review-backlog.md +61 -0
  44. package/commands/gsd/gsd-review.md +37 -0
  45. package/commands/gsd/gsd-session-report.md +19 -0
  46. package/commands/gsd/gsd-set-profile.md +24 -23
  47. package/commands/gsd/gsd-ship.md +23 -0
  48. package/commands/gsd/gsd-stats.md +18 -0
  49. package/commands/gsd/gsd-thread.md +127 -0
  50. package/commands/gsd/gsd-ui-phase.md +34 -0
  51. package/commands/gsd/gsd-ui-review.md +32 -0
  52. package/commands/gsd/gsd-workstreams.md +66 -0
  53. package/get-shit-done/bin/gsd-tools.cjs +410 -84
  54. package/get-shit-done/bin/lib/commands.cjs +429 -18
  55. package/get-shit-done/bin/lib/config.cjs +318 -45
  56. package/get-shit-done/bin/lib/core.cjs +822 -84
  57. package/get-shit-done/bin/lib/frontmatter.cjs +78 -41
  58. package/get-shit-done/bin/lib/init.cjs +836 -104
  59. package/get-shit-done/bin/lib/milestone.cjs +44 -33
  60. package/get-shit-done/bin/lib/model-profiles.cjs +68 -0
  61. package/get-shit-done/bin/lib/phase.cjs +293 -306
  62. package/get-shit-done/bin/lib/profile-output.cjs +952 -0
  63. package/get-shit-done/bin/lib/profile-pipeline.cjs +539 -0
  64. package/get-shit-done/bin/lib/roadmap.cjs +55 -24
  65. package/get-shit-done/bin/lib/security.cjs +382 -0
  66. package/get-shit-done/bin/lib/state.cjs +363 -53
  67. package/get-shit-done/bin/lib/template.cjs +2 -2
  68. package/get-shit-done/bin/lib/uat.cjs +282 -0
  69. package/get-shit-done/bin/lib/verify.cjs +104 -36
  70. package/get-shit-done/bin/lib/workstream.cjs +491 -0
  71. package/get-shit-done/references/checkpoints.md +12 -10
  72. package/get-shit-done/references/decimal-phase-calculation.md +2 -3
  73. package/get-shit-done/references/git-integration.md +47 -0
  74. package/get-shit-done/references/model-profile-resolution.md +2 -0
  75. package/get-shit-done/references/model-profiles.md +62 -16
  76. package/get-shit-done/references/phase-argument-parsing.md +2 -2
  77. package/get-shit-done/references/planning-config.md +3 -1
  78. package/get-shit-done/references/user-profiling.md +681 -0
  79. package/get-shit-done/references/workstream-flag.md +58 -0
  80. package/get-shit-done/templates/UAT.md +21 -3
  81. package/get-shit-done/templates/UI-SPEC.md +100 -0
  82. package/get-shit-done/templates/claude-md.md +122 -0
  83. package/get-shit-done/templates/config.json +10 -3
  84. package/get-shit-done/templates/context.md +61 -6
  85. package/get-shit-done/templates/dev-preferences.md +21 -0
  86. package/get-shit-done/templates/discussion-log.md +63 -0
  87. package/get-shit-done/templates/phase-prompt.md +46 -5
  88. package/get-shit-done/templates/project.md +2 -0
  89. package/get-shit-done/templates/state.md +2 -2
  90. package/get-shit-done/templates/user-profile.md +146 -0
  91. package/get-shit-done/workflows/add-phase.md +2 -2
  92. package/get-shit-done/workflows/add-tests.md +4 -4
  93. package/get-shit-done/workflows/add-todo.md +3 -3
  94. package/get-shit-done/workflows/audit-milestone.md +13 -5
  95. package/get-shit-done/workflows/audit-uat.md +109 -0
  96. package/get-shit-done/workflows/autonomous.md +891 -0
  97. package/get-shit-done/workflows/check-todos.md +2 -2
  98. package/get-shit-done/workflows/cleanup.md +4 -4
  99. package/get-shit-done/workflows/complete-milestone.md +9 -6
  100. package/get-shit-done/workflows/diagnose-issues.md +15 -3
  101. package/get-shit-done/workflows/discovery-phase.md +2 -2
  102. package/get-shit-done/workflows/discuss-phase-assumptions.md +653 -0
  103. package/get-shit-done/workflows/discuss-phase.md +411 -38
  104. package/get-shit-done/workflows/do.md +104 -0
  105. package/get-shit-done/workflows/execute-phase.md +405 -18
  106. package/get-shit-done/workflows/execute-plan.md +77 -12
  107. package/get-shit-done/workflows/fast.md +105 -0
  108. package/get-shit-done/workflows/forensics.md +265 -0
  109. package/get-shit-done/workflows/health.md +28 -6
  110. package/get-shit-done/workflows/help.md +124 -7
  111. package/get-shit-done/workflows/insert-phase.md +2 -2
  112. package/get-shit-done/workflows/list-phase-assumptions.md +2 -2
  113. package/get-shit-done/workflows/list-workspaces.md +56 -0
  114. package/get-shit-done/workflows/manager.md +362 -0
  115. package/get-shit-done/workflows/map-codebase.md +74 -13
  116. package/get-shit-done/workflows/milestone-summary.md +223 -0
  117. package/get-shit-done/workflows/new-milestone.md +120 -18
  118. package/get-shit-done/workflows/new-project.md +178 -39
  119. package/get-shit-done/workflows/new-workspace.md +237 -0
  120. package/get-shit-done/workflows/next.md +97 -0
  121. package/get-shit-done/workflows/node-repair.md +92 -0
  122. package/get-shit-done/workflows/note.md +156 -0
  123. package/get-shit-done/workflows/pause-work.md +62 -8
  124. package/get-shit-done/workflows/plan-milestone-gaps.md +4 -5
  125. package/get-shit-done/workflows/plan-phase.md +332 -33
  126. package/get-shit-done/workflows/plant-seed.md +169 -0
  127. package/get-shit-done/workflows/pr-branch.md +129 -0
  128. package/get-shit-done/workflows/profile-user.md +450 -0
  129. package/get-shit-done/workflows/progress.md +145 -20
  130. package/get-shit-done/workflows/quick.md +205 -49
  131. package/get-shit-done/workflows/remove-phase.md +2 -2
  132. package/get-shit-done/workflows/remove-workspace.md +90 -0
  133. package/get-shit-done/workflows/research-phase.md +11 -3
  134. package/get-shit-done/workflows/resume-project.md +35 -16
  135. package/get-shit-done/workflows/review.md +228 -0
  136. package/get-shit-done/workflows/session-report.md +146 -0
  137. package/get-shit-done/workflows/set-profile.md +2 -2
  138. package/get-shit-done/workflows/settings.md +80 -11
  139. package/get-shit-done/workflows/ship.md +228 -0
  140. package/get-shit-done/workflows/stats.md +60 -0
  141. package/get-shit-done/workflows/transition.md +147 -20
  142. package/get-shit-done/workflows/ui-phase.md +302 -0
  143. package/get-shit-done/workflows/ui-review.md +165 -0
  144. package/get-shit-done/workflows/update.md +108 -25
  145. package/get-shit-done/workflows/validate-phase.md +15 -8
  146. package/get-shit-done/workflows/verify-phase.md +16 -5
  147. package/get-shit-done/workflows/verify-work.md +72 -18
  148. package/package.json +1 -1
  149. package/skills/gsd-audit-milestone/SKILL.md +29 -0
  150. package/skills/gsd-cleanup/SKILL.md +19 -0
  151. package/skills/gsd-complete-milestone/SKILL.md +131 -0
  152. package/skills/gsd-discuss-phase/SKILL.md +54 -0
  153. package/skills/gsd-execute-phase/SKILL.md +49 -0
  154. package/skills/gsd-plan-phase/SKILL.md +37 -0
  155. package/skills/gsd-ui-phase/SKILL.md +24 -0
  156. package/skills/gsd-ui-review/SKILL.md +24 -0
  157. package/skills/gsd-verify-work/SKILL.md +30 -0
@@ -1,10 +1,15 @@
1
- <purpose>
1
+ <objective>
2
2
  Orchestrate parallel codebase mapper agents to analyze codebase and produce structured documents in .planning/codebase/
3
3
 
4
4
  Each agent has fresh context, explores a specific focus area, and **writes documents directly**. The orchestrator only receives confirmation + line counts, then writes a summary.
5
5
 
6
6
  Output: .planning/codebase/ folder with 7 structured documents about the codebase state.
7
- </purpose>
7
+ </objective>
8
+
9
+ <available_agent_types>
10
+ Valid GSD subagent types (use exact names — do not fall back to 'general'):
11
+ - gsd-codebase-mapper — Maps project structure and dependencies
12
+ </available_agent_types>
8
13
 
9
14
  <philosophy>
10
15
  **Why dedicated mapper agents:**
@@ -28,6 +33,7 @@ Load codebase mapping context:
28
33
  ```bash
29
34
  INIT=$(node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" init map-codebase)
30
35
  if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
36
+ AGENT_SKILLS_MAPPER=$(node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" agent-skills gsd-codebase-mapper 2>/dev/null)
31
37
  ```
32
38
 
33
39
  Extract from init JSON: `mapper_model`, `commit_docs`, `codebase_dir`, `existing_maps`, `has_maps`, `codebase_dir_exists`.
@@ -82,12 +88,22 @@ mkdir -p .planning/codebase
82
88
  Continue to spawn_agents.
83
89
  </step>
84
90
 
85
- <step name="spawn_agents">
91
+ <step name="detect_runtime_capabilities">
92
+ Before spawning agents, detect whether the current runtime supports the `task` tool for subagent delegation.
93
+
94
+ **How to detect:** Check if you have access to a `task` tool (may be capitalized as `task` or lowercase as `task` depending on runtime). If you do NOT have a `task`/`task` tool (or only have tools like `browser_subagent` which is for web browsing, NOT code analysis):
95
+
96
+ → **Skip `spawn_agents` and `collect_confirmations`** — go directly to `sequential_mapping` instead.
97
+
98
+ **CRITICAL:** Never use `browser_subagent` or `Explore` as a substitute for `task`. The `browser_subagent` tool is exclusively for web page interaction and will fail for codebase analysis. If `task` is unavailable, perform the mapping sequentially in-context.
99
+ </step>
100
+
101
+ <step name="spawn_agents" condition="task tool is available">
86
102
  Spawn 4 parallel gsd-codebase-mapper agents.
87
103
 
88
104
  Use task tool with `subagent_type="gsd-codebase-mapper"`, `model="{mapper_model}"`, and `run_in_background=true` for parallel execution.
89
105
 
90
- **CRITICAL:** Use the dedicated `gsd-codebase-mapper` agent, NOT `Explore`. The mapper agent writes documents directly.
106
+ **CRITICAL:** Use the dedicated `gsd-codebase-mapper` agent, NOT `Explore` or `browser_subagent`. The mapper agent writes documents directly.
91
107
 
92
108
  **Agent 1: Tech Focus**
93
109
 
@@ -105,7 +121,8 @@ write these documents to .planning/codebase/:
105
121
  - STACK.md - Languages, runtime, frameworks, dependencies, configuration
106
122
  - INTEGRATIONS.md - External APIs, databases, auth providers, webhooks
107
123
 
108
- Explore thoroughly. write documents directly using templates. Return confirmation only."
124
+ Explore thoroughly. write documents directly using templates. Return confirmation only.
125
+ ${AGENT_SKILLS_MAPPER}"
109
126
  )
110
127
  ```
111
128
 
@@ -125,7 +142,8 @@ write these documents to .planning/codebase/:
125
142
  - ARCHITECTURE.md - Pattern, layers, data flow, abstractions, entry points
126
143
  - STRUCTURE.md - Directory layout, key locations, naming conventions
127
144
 
128
- Explore thoroughly. write documents directly using templates. Return confirmation only."
145
+ Explore thoroughly. write documents directly using templates. Return confirmation only.
146
+ ${AGENT_SKILLS_MAPPER}"
129
147
  )
130
148
  ```
131
149
 
@@ -145,7 +163,8 @@ write these documents to .planning/codebase/:
145
163
  - CONVENTIONS.md - Code style, naming, patterns, error handling
146
164
  - TESTING.md - Framework, structure, mocking, coverage
147
165
 
148
- Explore thoroughly. write documents directly using templates. Return confirmation only."
166
+ Explore thoroughly. write documents directly using templates. Return confirmation only.
167
+ ${AGENT_SKILLS_MAPPER}"
149
168
  )
150
169
  ```
151
170
 
@@ -164,7 +183,8 @@ Analyze this codebase for technical debt, known issues, and areas of concern.
164
183
  write this document to .planning/codebase/:
165
184
  - CONCERNS.md - Tech debt, bugs, security, performance, fragile areas
166
185
 
167
- Explore thoroughly. write document directly using template. Return confirmation only."
186
+ Explore thoroughly. write document directly using template. Return confirmation only.
187
+ ${AGENT_SKILLS_MAPPER}"
168
188
  )
169
189
  ```
170
190
 
@@ -172,9 +192,19 @@ Continue to collect_confirmations.
172
192
  </step>
173
193
 
174
194
  <step name="collect_confirmations">
175
- Wait for all 4 agents to complete.
195
+ Wait for all 4 agents to complete using TaskOutput tool.
176
196
 
177
- read each agent's output file to collect confirmations.
197
+ **For each agent task_id returned by the Agent tool calls above:**
198
+ ```
199
+ TaskOutput tool:
200
+ task_id: "{task_id from Agent result}"
201
+ block: true
202
+ timeout: 300000
203
+ ```
204
+
205
+ Call TaskOutput for all 4 agents in parallel (single message with 4 TaskOutput calls).
206
+
207
+ Once all TaskOutput calls return, read each agent's output file to collect confirmations.
178
208
 
179
209
  **Expected confirmation format from each agent:**
180
210
  ```
@@ -195,6 +225,37 @@ If any agent failed, note the failure and continue with successful documents.
195
225
  Continue to verify_output.
196
226
  </step>
197
227
 
228
+ <step name="sequential_mapping" condition="task tool is NOT available (e.g. Antigravity, Gemini CLI, Codex)">
229
+ When the `task` tool is unavailable, perform codebase mapping sequentially in the current context. This replaces `spawn_agents` and `collect_confirmations`.
230
+
231
+ **IMPORTANT:** Do NOT use `browser_subagent`, `Explore`, or any browser-based tool. Use only file system tools (read, bash, write, grep, glob, list_dir, view_file, grep_search, or equivalent tools available in your runtime).
232
+
233
+ Perform all 4 mapping passes sequentially:
234
+
235
+ **Pass 1: Tech Focus**
236
+ - Explore package.json/Cargo.toml/go.mod/requirements.txt, config files, dependency trees
237
+ - write `.planning/codebase/STACK.md` — Languages, runtime, frameworks, dependencies, configuration
238
+ - write `.planning/codebase/INTEGRATIONS.md` — External APIs, databases, auth providers, webhooks
239
+
240
+ **Pass 2: Architecture Focus**
241
+ - Explore directory structure, entry points, module boundaries, data flow
242
+ - write `.planning/codebase/ARCHITECTURE.md` — Pattern, layers, data flow, abstractions, entry points
243
+ - write `.planning/codebase/STRUCTURE.md` — Directory layout, key locations, naming conventions
244
+
245
+ **Pass 3: Quality Focus**
246
+ - Explore code style, error handling patterns, test files, CI config
247
+ - write `.planning/codebase/CONVENTIONS.md` — Code style, naming, patterns, error handling
248
+ - write `.planning/codebase/TESTING.md` — Framework, structure, mocking, coverage
249
+
250
+ **Pass 4: Concerns Focus**
251
+ - Explore TODOs, known issues, fragile areas, security patterns
252
+ - write `.planning/codebase/CONCERNS.md` — Tech debt, bugs, security, performance, fragile areas
253
+
254
+ Use the same document templates as the `gsd-codebase-mapper` agent. Include actual file paths formatted with backticks.
255
+
256
+ Continue to verify_output.
257
+ </step>
258
+
198
259
  <step name="verify_output">
199
260
  Verify all documents created successfully:
200
261
 
@@ -307,10 +368,10 @@ End workflow.
307
368
 
308
369
  <success_criteria>
309
370
  - .planning/codebase/ directory created
310
- - 4 parallel gsd-codebase-mapper agents spawned with run_in_background=true
311
- - Agents write documents directly (orchestrator doesn't receive document contents)
312
- - read agent output files to collect confirmations
371
+ - If task tool available: 4 parallel gsd-codebase-mapper agents spawned with run_in_background=true
372
+ - If task tool NOT available: 4 sequential mapping passes performed inline (never using browser_subagent)
313
373
  - All 7 codebase documents exist
374
+ - No empty documents (each should have >20 lines)
314
375
  - Clear completion summary with line counts
315
376
  - User offered clear next steps in GSD style
316
377
  </success_criteria>
@@ -0,0 +1,223 @@
1
+ # Milestone Summary Workflow
2
+
3
+ Generate a comprehensive, human-friendly project summary from completed milestone artifacts.
4
+ Designed for team onboarding — a new contributor can read the output and understand the entire project.
5
+
6
+ ---
7
+
8
+ ## Step 1: Resolve Version
9
+
10
+ ```bash
11
+ VERSION="$ARGUMENTS"
12
+ ```
13
+
14
+ If `$ARGUMENTS` is empty:
15
+ 1. Check `.planning/STATE.md` for current milestone version
16
+ 2. Check `.planning/milestones/` for the latest archived version
17
+ 3. If neither found, check if `.planning/ROADMAP.md` exists (project may be mid-milestone)
18
+ 4. If nothing found: error "No milestone found. Run /gsd-new-project or /gsd-new-milestone first."
19
+
20
+ Set `VERSION` to the resolved version (e.g., "1.0").
21
+
22
+ ## Step 2: Locate Artifacts
23
+
24
+ Determine whether the milestone is **archived** or **current**:
25
+
26
+ **Archived milestone** (`.planning/milestones/v{VERSION}-ROADMAP.md` exists):
27
+ ```
28
+ ROADMAP_PATH=".planning/milestones/v${VERSION}-ROADMAP.md"
29
+ REQUIREMENTS_PATH=".planning/milestones/v${VERSION}-REQUIREMENTS.md"
30
+ AUDIT_PATH=".planning/milestones/v${VERSION}-MILESTONE-AUDIT.md"
31
+ ```
32
+
33
+ **Current/in-progress milestone** (no archive yet):
34
+ ```
35
+ ROADMAP_PATH=".planning/ROADMAP.md"
36
+ REQUIREMENTS_PATH=".planning/REQUIREMENTS.md"
37
+ AUDIT_PATH=".planning/v${VERSION}-MILESTONE-AUDIT.md"
38
+ ```
39
+
40
+ Note: The audit file moves to `.planning/milestones/` on archive (per `complete-milestone` workflow). Check both locations as a fallback.
41
+
42
+ **Always available:**
43
+ ```
44
+ PROJECT_PATH=".planning/PROJECT.md"
45
+ RETRO_PATH=".planning/RETROSPECTIVE.md"
46
+ STATE_PATH=".planning/STATE.md"
47
+ ```
48
+
49
+ read all files that exist. Missing files are fine — the summary adapts to what's available.
50
+
51
+ ## Step 3: Discover Phase Artifacts
52
+
53
+ Find all phase directories:
54
+
55
+ ```bash
56
+ gsd-tools.cjs init progress
57
+ ```
58
+
59
+ This returns phase metadata. For each phase in the milestone scope:
60
+
61
+ - read `{phase_dir}/{padded}-SUMMARY.md` if it exists — extract `one_liner`, `accomplishments`, `decisions`
62
+ - read `{phase_dir}/{padded}-VERIFICATION.md` if it exists — extract status, gaps, deferred items
63
+ - read `{phase_dir}/{padded}-CONTEXT.md` if it exists — extract key decisions from `<decisions>` section
64
+ - read `{phase_dir}/{padded}-RESEARCH.md` if it exists — note what was researched
65
+
66
+ Track which phases have which artifacts.
67
+
68
+ **If no phase directories exist** (empty milestone or pre-build state): skip to Step 5 and generate a minimal summary noting "No phases have been executed yet." Do not error — the summary should still capture PROJECT.md and ROADMAP.md content.
69
+
70
+ ## Step 4: Gather Git Statistics
71
+
72
+ Try each method in order until one succeeds:
73
+
74
+ **Method 1 — Tagged milestone** (check first):
75
+ ```bash
76
+ git tag -l "v${VERSION}" | head -1
77
+ ```
78
+ If the tag exists:
79
+ ```bash
80
+ git log v${VERSION} --oneline | wc -l
81
+ git diff --stat $(git log --format=%H --reverse v${VERSION} | head -1)..v${VERSION}
82
+ ```
83
+
84
+ **Method 2 — STATE.md date range** (if no tag):
85
+ read STATE.md and extract the `started_at` or earliest session date. Use it as the `--since` boundary:
86
+ ```bash
87
+ git log --oneline --since="<started_at_date>" | wc -l
88
+ ```
89
+
90
+ **Method 3 — Earliest phase commit** (if STATE.md has no date):
91
+ Find the earliest `.planning/phases/` commit:
92
+ ```bash
93
+ git log --oneline --diff-filter=A -- ".planning/phases/" | tail -1
94
+ ```
95
+ Use that commit's date as the start boundary.
96
+
97
+ **Method 4 — Skip stats** (if none of the above work):
98
+ Report "Git statistics unavailable — no tag or date range could be determined." This is not an error — the summary continues without the Stats section.
99
+
100
+ Extract (when available):
101
+ - Total commits in milestone
102
+ - Files changed, insertions, deletions
103
+ - Timeline (start date → end date)
104
+ - Contributors (from git log authors)
105
+
106
+ ## Step 5: Generate Summary Document
107
+
108
+ write to `.planning/reports/MILESTONE_SUMMARY-v${VERSION}.md`:
109
+
110
+ ```markdown
111
+ # Milestone v{VERSION} — Project Summary
112
+
113
+ **Generated:** {date}
114
+ **Purpose:** Team onboarding and project review
115
+
116
+ ---
117
+
118
+ ## 1. Project Overview
119
+
120
+ {From PROJECT.md: "What This Is", core value proposition, target users}
121
+ {If mid-milestone: note which phases are complete vs in-progress}
122
+
123
+ ## 2. Architecture & Technical Decisions
124
+
125
+ {From CONTEXT.md files across phases: key technical choices}
126
+ {From SUMMARY.md decisions: patterns, libraries, frameworks chosen}
127
+ {From PROJECT.md: tech stack if documented}
128
+
129
+ Present as a bulleted list of decisions with brief rationale:
130
+ - **Decision:** {what was chosen}
131
+ - **Why:** {rationale from CONTEXT.md}
132
+ - **Phase:** {which phase made this decision}
133
+
134
+ ## 3. Phases Delivered
135
+
136
+ | Phase | Name | Status | One-Liner |
137
+ |-------|------|--------|-----------|
138
+ {For each phase: number, name, status (complete/in-progress/planned), one_liner from SUMMARY.md}
139
+
140
+ ## 4. Requirements Coverage
141
+
142
+ {From REQUIREMENTS.md: list each requirement with status}
143
+ - ✅ {Requirement met}
144
+ - ⚠️ {Requirement partially met — note gap}
145
+ - ❌ {Requirement not met — note reason}
146
+
147
+ {If MILESTONE-AUDIT.md exists: include audit verdict}
148
+
149
+ ## 5. Key Decisions Log
150
+
151
+ {Aggregate from all CONTEXT.md <decisions> sections}
152
+ {Each decision with: ID, description, phase, rationale}
153
+
154
+ ## 6. Tech Debt & Deferred Items
155
+
156
+ {From VERIFICATION.md files: gaps found, anti-patterns noted}
157
+ {From RETROSPECTIVE.md: lessons learned, what to improve}
158
+ {From CONTEXT.md <deferred> sections: ideas parked for later}
159
+
160
+ ## 7. Getting Started
161
+
162
+ {Entry points for new contributors:}
163
+ - **Run the project:** {from PROJECT.md or SUMMARY.md}
164
+ - **Key directories:** {from codebase structure}
165
+ - **Tests:** {test command from PROJECT.md or AGENTS.md}
166
+ - **Where to look first:** {main entry points, core modules}
167
+
168
+ ---
169
+
170
+ ## Stats
171
+
172
+ - **Timeline:** {start} → {end} ({duration})
173
+ - **Phases:** {count complete} / {count total}
174
+ - **Commits:** {count}
175
+ - **Files changed:** {count} (+{insertions} / -{deletions})
176
+ - **Contributors:** {list}
177
+ ```
178
+
179
+ ## Step 6: write and Commit
180
+
181
+ **Overwrite guard:** If `.planning/reports/MILESTONE_SUMMARY-v${VERSION}.md` already exists, ask the user:
182
+ > "A milestone summary for v{VERSION} already exists. Overwrite it, or view the existing one?"
183
+ If "view": display existing file and skip to Step 8 (interactive mode). If "overwrite": proceed.
184
+
185
+ Create the reports directory if needed:
186
+ ```bash
187
+ mkdir -p .planning/reports
188
+ ```
189
+
190
+ write the summary, then commit:
191
+ ```bash
192
+ gsd-tools.cjs commit "docs(v${VERSION}): generate milestone summary for onboarding" \
193
+ --files ".planning/reports/MILESTONE_SUMMARY-v${VERSION}.md"
194
+ ```
195
+
196
+ ## Step 7: Present Summary
197
+
198
+ Display the full summary document inline.
199
+
200
+ ## Step 8: Offer Interactive Mode
201
+
202
+ After presenting the summary:
203
+
204
+ > "Summary written to `.planning/reports/MILESTONE_SUMMARY-v{VERSION}.md`.
205
+ >
206
+ > I have full context from the build artifacts. Want to ask anything about the project?
207
+ > Architecture decisions, specific phases, requirements, tech debt — ask away."
208
+
209
+ If the user asks questions:
210
+ - Answer from the artifacts already loaded (CONTEXT.md, SUMMARY.md, VERIFICATION.md, etc.)
211
+ - Reference specific files and decisions
212
+ - Stay grounded in what was actually built (not speculation)
213
+
214
+ If the user is done:
215
+ - Suggest next steps: `/gsd-new-milestone`, `/gsd-progress`, or sharing the summary with the team
216
+
217
+ ## Step 9: Update STATE.md
218
+
219
+ ```bash
220
+ gsd-tools.cjs state record-session \
221
+ --stopped-at "Milestone v${VERSION} summary generated" \
222
+ --resume-file ".planning/reports/MILESTONE_SUMMARY-v${VERSION}.md"
223
+ ```
@@ -1,8 +1,8 @@
1
- <purpose>
1
+ <objective>
2
2
 
3
3
  Start a new milestone cycle for an existing project. Loads project context, gathers milestone goals (from MILESTONE-CONTEXT.md or conversation), updates PROJECT.md and STATE.md, optionally runs parallel research, defines scoped requirements with REQ-IDs, spawns the roadmapper to create phased execution plan, and commits all artifacts. Brownfield equivalent of new-project.
4
4
 
5
- </purpose>
5
+ </objective>
6
6
 
7
7
  <required_reading>
8
8
 
@@ -10,10 +10,23 @@ read all files referenced by the invoking prompt's execution_context before star
10
10
 
11
11
  </required_reading>
12
12
 
13
+ <available_agent_types>
14
+ Valid GSD subagent types (use exact names — do not fall back to 'general'):
15
+ - gsd-project-researcher — Researches project-level technical decisions
16
+ - gsd-research-synthesizer — Synthesizes findings from parallel research agents
17
+ - gsd-roadmapper — Creates phased execution roadmaps
18
+ </available_agent_types>
19
+
13
20
  <process>
14
21
 
15
22
  ## 1. Load Context
16
23
 
24
+ Parse `$ARGUMENTS` before doing anything else:
25
+ - `--reset-phase-numbers` flag → opt into restarting roadmap phase numbering at `1`
26
+ - remaining text → use as milestone name if present
27
+
28
+ If the flag is absent, keep the current behavior of continuing phase numbering from the previous milestone.
29
+
17
30
  - read PROJECT.md (existing project, validated requirements, decisions)
18
31
  - read MILESTONES.md (what shipped previously)
19
32
  - read STATE.md (pending todos, blockers)
@@ -37,6 +50,38 @@ read all files referenced by the invoking prompt's execution_context before star
37
50
  - Suggest next version (v1.0 → v1.1, or v2.0 for major)
38
51
  - Confirm with user
39
52
 
53
+ ## 3.5. Verify Milestone Understanding
54
+
55
+ Before writing any files, present a summary of what was gathered and ask for confirmation.
56
+
57
+ ```
58
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
59
+ GSD ► MILESTONE SUMMARY
60
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
61
+
62
+ **Milestone v[X.Y]: [Name]**
63
+
64
+ **Goal:** [One sentence]
65
+
66
+ **Target features:**
67
+ - [Feature 1]
68
+ - [Feature 2]
69
+ - [Feature 3]
70
+
71
+ **Key context:** [Any important constraints, decisions, or notes from questioning]
72
+ ```
73
+
74
+ question:
75
+ - header: "Confirm?"
76
+ - question: "Does this capture what you want to build in this milestone?"
77
+ - options:
78
+ - "Looks good" — Proceed to write PROJECT.md
79
+ - "Adjust" — Let me correct or add details
80
+
81
+ **If "Adjust":** Ask what needs changing (plain text, NOT question). Incorporate changes, re-present the summary. Loop until "Looks good" is selected.
82
+
83
+ **If "Looks good":** Proceed to Step 4.
84
+
40
85
  ## 4. Update PROJECT.md
41
86
 
42
87
  Add/update:
@@ -54,6 +99,27 @@ Add/update:
54
99
 
55
100
  Update Active requirements section and "Last updated" footer.
56
101
 
102
+ Ensure the `## Evolution` section exists in PROJECT.md. If missing (projects created before this feature), add it before the footer:
103
+
104
+ ```markdown
105
+ ## Evolution
106
+
107
+ This document evolves at phase transitions and milestone boundaries.
108
+
109
+ **After each phase transition** (via `/gsd-transition`):
110
+ 1. Requirements invalidated? → Move to Out of Scope with reason
111
+ 2. Requirements validated? → Move to Validated with phase reference
112
+ 3. New requirements emerged? → Add to Active
113
+ 4. Decisions to log? → Add to Key Decisions
114
+ 5. "What This Is" still accurate? → Update if drifted
115
+
116
+ **After each milestone** (via `/gsd-complete-milestone`):
117
+ 1. Full review of all sections
118
+ 2. Core Value check — still the right priority?
119
+ 3. Audit Out of Scope — reasons still valid?
120
+ 4. Update Context with current state
121
+ ```
122
+
57
123
  ## 5. Update STATE.md
58
124
 
59
125
  ```markdown
@@ -80,27 +146,52 @@ node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" commit "docs: star
80
146
  ```bash
81
147
  INIT=$(node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" init new-milestone)
82
148
  if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
149
+ AGENT_SKILLS_RESEARCHER=$(node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" agent-skills gsd-project-researcher 2>/dev/null)
150
+ AGENT_SKILLS_SYNTHESIZER=$(node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" agent-skills gsd-synthesizer 2>/dev/null)
151
+ AGENT_SKILLS_ROADMAPPER=$(node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" agent-skills gsd-roadmapper 2>/dev/null)
152
+ ```
153
+
154
+ Extract from init JSON: `researcher_model`, `synthesizer_model`, `roadmapper_model`, `commit_docs`, `research_enabled`, `current_milestone`, `project_exists`, `roadmap_exists`, `latest_completed_milestone`, `phase_dir_count`, `phase_archive_path`.
155
+
156
+ ## 7.5 Reset-phase safety (only when `--reset-phase-numbers`)
157
+
158
+ If `--reset-phase-numbers` is active:
159
+
160
+ 1. Set starting phase number to `1` for the upcoming roadmap.
161
+ 2. If `phase_dir_count > 0`, archive the old phase directories before roadmapping so new `01-*` / `02-*` directories cannot collide with stale milestone directories.
162
+
163
+ If `phase_dir_count > 0` and `phase_archive_path` is available:
164
+
165
+ ```bash
166
+ mkdir -p "${phase_archive_path}"
167
+ find .planning/phases -mindepth 1 -maxdepth 1 -type d -exec mv {} "${phase_archive_path}/" \;
83
168
  ```
84
169
 
85
- Extract from init JSON: `researcher_model`, `synthesizer_model`, `roadmapper_model`, `commit_docs`, `research_enabled`, `current_milestone`, `project_exists`, `roadmap_exists`.
170
+ Then verify `.planning/phases/` no longer contains old milestone directories before continuing.
171
+
172
+ If `phase_dir_count > 0` but `phase_archive_path` is missing:
173
+ - Stop and explain that reset numbering is unsafe without a completed milestone archive target.
174
+ - Tell the user to complete/archive the previous milestone first, then rerun `/gsd-new-milestone --reset-phase-numbers ${GSD_WS}`.
86
175
 
87
176
  ## 8. Research Decision
88
177
 
178
+ Check `research_enabled` from init JSON (loaded from config).
179
+
180
+ **If `research_enabled` is `true`:**
181
+
89
182
  question: "Research the domain ecosystem for new features before defining requirements?"
90
183
  - "Research first (Recommended)" — Discover patterns, features, architecture for NEW capabilities
91
- - "Skip research" — Go straight to requirements
184
+ - "Skip research for this milestone" — Go straight to requirements (does not change your default)
92
185
 
93
- **Persist choice to config** (so future `/gsd-plan-phase` honors it):
186
+ **If `research_enabled` is `false`:**
94
187
 
95
- ```bash
96
- # If "Research first": persist true
97
- node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" config-set workflow.research true
188
+ question: "Research the domain ecosystem for new features before defining requirements?"
189
+ - "Skip research (current default)" Go straight to requirements
190
+ - "Research first" Discover patterns, features, architecture for NEW capabilities
98
191
 
99
- # If "Skip research": persist false
100
- node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" config-set workflow.research false
101
- ```
192
+ **IMPORTANT:** Do NOT persist this choice to config.json. The `workflow.research` setting is a persistent user preference that controls plan-phase behavior across the project. Changing it here would silently alter future `/gsd-plan-phase` behavior. To change the default, use `/gsd-settings`.
102
193
 
103
- **If "Research first":**
194
+ **If user chose "Research first":**
104
195
 
105
196
  ```
106
197
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
@@ -134,6 +225,8 @@ Focus ONLY on what's needed for the NEW features.
134
225
  - .planning/PROJECT.md (Project context)
135
226
  </files_to_read>
136
227
 
228
+ ${AGENT_SKILLS_RESEARCHER}
229
+
137
230
  <downstream_consumer>{CONSUMER}</downstream_consumer>
138
231
 
139
232
  <quality_gate>{GATES}</quality_gate>
@@ -168,6 +261,8 @@ Synthesize research outputs into SUMMARY.md.
168
261
  - .planning/research/PITFALLS.md
169
262
  </files_to_read>
170
263
 
264
+ ${AGENT_SKILLS_SYNTHESIZER}
265
+
171
266
  write to: .planning/research/SUMMARY.md
172
267
  Use template: $HOME/.config/opencode/get-shit-done/templates/research-project/SUMMARY.md
173
268
  Commit after writing.
@@ -268,7 +363,9 @@ node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" commit "docs: defi
268
363
  ◆ Spawning roadmapper...
269
364
  ```
270
365
 
271
- **Starting phase number:** read MILESTONES.md for last phase number. Continue from there (v1.0 ended at phase 5 → v1.1 starts at phase 6).
366
+ **Starting phase number:**
367
+ - If `--reset-phase-numbers` is active, start at **Phase 1**
368
+ - Otherwise, continue from the previous milestone's last phase number (v1.0 ended at phase 5 → v1.1 starts at phase 6)
272
369
 
273
370
  ```
274
371
  task(prompt="
@@ -280,11 +377,16 @@ task(prompt="
280
377
  - .planning/config.json
281
378
  - .planning/MILESTONES.md
282
379
  </files_to_read>
380
+
381
+ ${AGENT_SKILLS_ROADMAPPER}
382
+
283
383
  </planning_context>
284
384
 
285
385
  <instructions>
286
386
  Create roadmap for milestone v[X.Y]:
287
- 1. Start phase numbering from [N]
387
+ 1. Respect the selected numbering mode:
388
+ - `--reset-phase-numbers` → start at Phase 1
389
+ - default behavior → continue from the previous milestone's last phase number
288
390
  2. Derive phases from THIS MILESTONE's requirements only
289
391
  3. Map every requirement to exactly one phase
290
392
  4. Derive 2-5 success criteria per phase (observable user behaviors)
@@ -357,11 +459,11 @@ node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" commit "docs: crea
357
459
 
358
460
  **Phase [N]: [Phase Name]** — [Goal]
359
461
 
360
- `/gsd-discuss-phase [N]` — gather context and clarify approach
462
+ `/gsd-discuss-phase [N] ${GSD_WS}` — gather context and clarify approach
361
463
 
362
464
  *`/new` first → fresh context window*
363
465
 
364
- Also: `/gsd-plan-phase [N]` — skip discussion, plan directly
466
+ Also: `/gsd-plan-phase [N] ${GSD_WS}` — skip discussion, plan directly
365
467
  ```
366
468
 
367
469
  </process>
@@ -376,9 +478,9 @@ Also: `/gsd-plan-phase [N]` — skip discussion, plan directly
376
478
  - [ ] gsd-roadmapper spawned with phase numbering context
377
479
  - [ ] Roadmap files written immediately (not draft)
378
480
  - [ ] User feedback incorporated (if any)
379
- - [ ] ROADMAP.md phases continue from previous milestone
481
+ - [ ] Phase numbering mode respected (continued or reset)
380
482
  - [ ] All commits made (if planning docs committed)
381
- - [ ] User knows next step: `/gsd-discuss-phase [N]`
483
+ - [ ] User knows next step: `/gsd-discuss-phase [N] ${GSD_WS}`
382
484
 
383
485
  **Atomic commits:** Each phase commits its artifacts immediately.
384
486
  </success_criteria>