gsd-opencode 1.22.1 → 1.33.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 (188) 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 +0 -2
  4. package/agents/gsd-debugger.md +117 -2
  5. package/agents/gsd-doc-verifier.md +207 -0
  6. package/agents/gsd-doc-writer.md +608 -0
  7. package/agents/gsd-executor.md +45 -4
  8. package/agents/gsd-integration-checker.md +0 -2
  9. package/agents/gsd-nyquist-auditor.md +0 -2
  10. package/agents/gsd-phase-researcher.md +191 -5
  11. package/agents/gsd-plan-checker.md +152 -5
  12. package/agents/gsd-planner.md +131 -157
  13. package/agents/gsd-project-researcher.md +28 -3
  14. package/agents/gsd-research-synthesizer.md +0 -2
  15. package/agents/gsd-roadmapper.md +29 -2
  16. package/agents/gsd-security-auditor.md +129 -0
  17. package/agents/gsd-ui-auditor.md +485 -0
  18. package/agents/gsd-ui-checker.md +305 -0
  19. package/agents/gsd-ui-researcher.md +368 -0
  20. package/agents/gsd-user-profiler.md +173 -0
  21. package/agents/gsd-verifier.md +207 -22
  22. package/commands/gsd/gsd-add-backlog.md +76 -0
  23. package/commands/gsd/gsd-analyze-dependencies.md +34 -0
  24. package/commands/gsd/gsd-audit-uat.md +24 -0
  25. package/commands/gsd/gsd-autonomous.md +45 -0
  26. package/commands/gsd/gsd-cleanup.md +5 -0
  27. package/commands/gsd/gsd-debug.md +29 -21
  28. package/commands/gsd/gsd-discuss-phase.md +15 -36
  29. package/commands/gsd/gsd-do.md +30 -0
  30. package/commands/gsd/gsd-docs-update.md +48 -0
  31. package/commands/gsd/gsd-execute-phase.md +24 -2
  32. package/commands/gsd/gsd-fast.md +30 -0
  33. package/commands/gsd/gsd-forensics.md +56 -0
  34. package/commands/gsd/gsd-help.md +2 -0
  35. package/commands/gsd/gsd-join-discord.md +2 -1
  36. package/commands/gsd/gsd-list-workspaces.md +19 -0
  37. package/commands/gsd/gsd-manager.md +40 -0
  38. package/commands/gsd/gsd-milestone-summary.md +51 -0
  39. package/commands/gsd/gsd-new-project.md +4 -0
  40. package/commands/gsd/gsd-new-workspace.md +44 -0
  41. package/commands/gsd/gsd-next.md +24 -0
  42. package/commands/gsd/gsd-note.md +34 -0
  43. package/commands/gsd/gsd-plan-phase.md +8 -1
  44. package/commands/gsd/gsd-plant-seed.md +28 -0
  45. package/commands/gsd/gsd-pr-branch.md +25 -0
  46. package/commands/gsd/gsd-profile-user.md +46 -0
  47. package/commands/gsd/gsd-quick.md +7 -3
  48. package/commands/gsd/gsd-reapply-patches.md +178 -45
  49. package/commands/gsd/gsd-remove-workspace.md +26 -0
  50. package/commands/gsd/gsd-research-phase.md +7 -12
  51. package/commands/gsd/gsd-review-backlog.md +62 -0
  52. package/commands/gsd/gsd-review.md +38 -0
  53. package/commands/gsd/gsd-secure-phase.md +35 -0
  54. package/commands/gsd/gsd-session-report.md +19 -0
  55. package/commands/gsd/gsd-set-profile.md +24 -23
  56. package/commands/gsd/gsd-ship.md +23 -0
  57. package/commands/gsd/gsd-stats.md +18 -0
  58. package/commands/gsd/gsd-thread.md +127 -0
  59. package/commands/gsd/gsd-ui-phase.md +34 -0
  60. package/commands/gsd/gsd-ui-review.md +32 -0
  61. package/commands/gsd/gsd-workstreams.md +71 -0
  62. package/get-shit-done/bin/gsd-tools.cjs +450 -90
  63. package/get-shit-done/bin/lib/commands.cjs +489 -24
  64. package/get-shit-done/bin/lib/config.cjs +329 -48
  65. package/get-shit-done/bin/lib/core.cjs +1143 -102
  66. package/get-shit-done/bin/lib/docs.cjs +267 -0
  67. package/get-shit-done/bin/lib/frontmatter.cjs +125 -43
  68. package/get-shit-done/bin/lib/init.cjs +918 -106
  69. package/get-shit-done/bin/lib/milestone.cjs +65 -33
  70. package/get-shit-done/bin/lib/model-profiles.cjs +70 -0
  71. package/get-shit-done/bin/lib/phase.cjs +434 -404
  72. package/get-shit-done/bin/lib/profile-output.cjs +1048 -0
  73. package/get-shit-done/bin/lib/profile-pipeline.cjs +539 -0
  74. package/get-shit-done/bin/lib/roadmap.cjs +156 -101
  75. package/get-shit-done/bin/lib/schema-detect.cjs +238 -0
  76. package/get-shit-done/bin/lib/security.cjs +384 -0
  77. package/get-shit-done/bin/lib/state.cjs +711 -79
  78. package/get-shit-done/bin/lib/template.cjs +2 -2
  79. package/get-shit-done/bin/lib/uat.cjs +282 -0
  80. package/get-shit-done/bin/lib/verify.cjs +254 -42
  81. package/get-shit-done/bin/lib/workstream.cjs +495 -0
  82. package/get-shit-done/references/agent-contracts.md +79 -0
  83. package/get-shit-done/references/artifact-types.md +113 -0
  84. package/get-shit-done/references/checkpoints.md +12 -10
  85. package/get-shit-done/references/context-budget.md +49 -0
  86. package/get-shit-done/references/continuation-format.md +15 -15
  87. package/get-shit-done/references/decimal-phase-calculation.md +2 -3
  88. package/get-shit-done/references/domain-probes.md +125 -0
  89. package/get-shit-done/references/gate-prompts.md +100 -0
  90. package/get-shit-done/references/git-integration.md +47 -0
  91. package/get-shit-done/references/model-profile-resolution.md +2 -0
  92. package/get-shit-done/references/model-profiles.md +62 -16
  93. package/get-shit-done/references/phase-argument-parsing.md +2 -2
  94. package/get-shit-done/references/planner-gap-closure.md +62 -0
  95. package/get-shit-done/references/planner-reviews.md +39 -0
  96. package/get-shit-done/references/planner-revision.md +87 -0
  97. package/get-shit-done/references/planning-config.md +18 -1
  98. package/get-shit-done/references/revision-loop.md +97 -0
  99. package/get-shit-done/references/ui-brand.md +2 -2
  100. package/get-shit-done/references/universal-anti-patterns.md +58 -0
  101. package/get-shit-done/references/user-profiling.md +681 -0
  102. package/get-shit-done/references/workstream-flag.md +111 -0
  103. package/get-shit-done/templates/SECURITY.md +61 -0
  104. package/get-shit-done/templates/UAT.md +21 -3
  105. package/get-shit-done/templates/UI-SPEC.md +100 -0
  106. package/get-shit-done/templates/VALIDATION.md +3 -3
  107. package/get-shit-done/templates/claude-md.md +145 -0
  108. package/get-shit-done/templates/config.json +14 -3
  109. package/get-shit-done/templates/context.md +61 -6
  110. package/get-shit-done/templates/debug-subagent-prompt.md +2 -6
  111. package/get-shit-done/templates/dev-preferences.md +21 -0
  112. package/get-shit-done/templates/discussion-log.md +63 -0
  113. package/get-shit-done/templates/phase-prompt.md +46 -5
  114. package/get-shit-done/templates/planner-subagent-prompt.md +2 -10
  115. package/get-shit-done/templates/project.md +2 -0
  116. package/get-shit-done/templates/state.md +2 -2
  117. package/get-shit-done/templates/user-profile.md +146 -0
  118. package/get-shit-done/workflows/add-phase.md +4 -4
  119. package/get-shit-done/workflows/add-tests.md +4 -4
  120. package/get-shit-done/workflows/add-todo.md +4 -4
  121. package/get-shit-done/workflows/analyze-dependencies.md +96 -0
  122. package/get-shit-done/workflows/audit-milestone.md +20 -16
  123. package/get-shit-done/workflows/audit-uat.md +109 -0
  124. package/get-shit-done/workflows/autonomous.md +1036 -0
  125. package/get-shit-done/workflows/check-todos.md +4 -4
  126. package/get-shit-done/workflows/cleanup.md +4 -4
  127. package/get-shit-done/workflows/complete-milestone.md +22 -10
  128. package/get-shit-done/workflows/diagnose-issues.md +21 -7
  129. package/get-shit-done/workflows/discovery-phase.md +2 -2
  130. package/get-shit-done/workflows/discuss-phase-assumptions.md +671 -0
  131. package/get-shit-done/workflows/discuss-phase-power.md +291 -0
  132. package/get-shit-done/workflows/discuss-phase.md +558 -47
  133. package/get-shit-done/workflows/do.md +104 -0
  134. package/get-shit-done/workflows/docs-update.md +1093 -0
  135. package/get-shit-done/workflows/execute-phase.md +741 -58
  136. package/get-shit-done/workflows/execute-plan.md +77 -12
  137. package/get-shit-done/workflows/fast.md +105 -0
  138. package/get-shit-done/workflows/forensics.md +265 -0
  139. package/get-shit-done/workflows/health.md +28 -6
  140. package/get-shit-done/workflows/help.md +127 -7
  141. package/get-shit-done/workflows/insert-phase.md +4 -4
  142. package/get-shit-done/workflows/list-phase-assumptions.md +2 -2
  143. package/get-shit-done/workflows/list-workspaces.md +56 -0
  144. package/get-shit-done/workflows/manager.md +363 -0
  145. package/get-shit-done/workflows/map-codebase.md +83 -44
  146. package/get-shit-done/workflows/milestone-summary.md +223 -0
  147. package/get-shit-done/workflows/new-milestone.md +133 -25
  148. package/get-shit-done/workflows/new-project.md +216 -54
  149. package/get-shit-done/workflows/new-workspace.md +237 -0
  150. package/get-shit-done/workflows/next.md +97 -0
  151. package/get-shit-done/workflows/node-repair.md +92 -0
  152. package/get-shit-done/workflows/note.md +156 -0
  153. package/get-shit-done/workflows/pause-work.md +132 -15
  154. package/get-shit-done/workflows/plan-milestone-gaps.md +6 -7
  155. package/get-shit-done/workflows/plan-phase.md +513 -62
  156. package/get-shit-done/workflows/plant-seed.md +169 -0
  157. package/get-shit-done/workflows/pr-branch.md +129 -0
  158. package/get-shit-done/workflows/profile-user.md +450 -0
  159. package/get-shit-done/workflows/progress.md +154 -29
  160. package/get-shit-done/workflows/quick.md +285 -111
  161. package/get-shit-done/workflows/remove-phase.md +2 -2
  162. package/get-shit-done/workflows/remove-workspace.md +90 -0
  163. package/get-shit-done/workflows/research-phase.md +13 -9
  164. package/get-shit-done/workflows/resume-project.md +37 -18
  165. package/get-shit-done/workflows/review.md +281 -0
  166. package/get-shit-done/workflows/secure-phase.md +154 -0
  167. package/get-shit-done/workflows/session-report.md +146 -0
  168. package/get-shit-done/workflows/set-profile.md +2 -2
  169. package/get-shit-done/workflows/settings.md +91 -11
  170. package/get-shit-done/workflows/ship.md +237 -0
  171. package/get-shit-done/workflows/stats.md +60 -0
  172. package/get-shit-done/workflows/transition.md +150 -23
  173. package/get-shit-done/workflows/ui-phase.md +292 -0
  174. package/get-shit-done/workflows/ui-review.md +183 -0
  175. package/get-shit-done/workflows/update.md +262 -30
  176. package/get-shit-done/workflows/validate-phase.md +14 -17
  177. package/get-shit-done/workflows/verify-phase.md +143 -11
  178. package/get-shit-done/workflows/verify-work.md +141 -39
  179. package/package.json +1 -1
  180. package/skills/gsd-audit-milestone/SKILL.md +29 -0
  181. package/skills/gsd-cleanup/SKILL.md +19 -0
  182. package/skills/gsd-complete-milestone/SKILL.md +131 -0
  183. package/skills/gsd-discuss-phase/SKILL.md +54 -0
  184. package/skills/gsd-execute-phase/SKILL.md +49 -0
  185. package/skills/gsd-plan-phase/SKILL.md +37 -0
  186. package/skills/gsd-ui-phase/SKILL.md +24 -0
  187. package/skills/gsd-ui-review/SKILL.md +24 -0
  188. package/skills/gsd-verify-work/SKILL.md +30 -0
@@ -0,0 +1,671 @@
1
+ <objective>
2
+ Extract implementation decisions that downstream agents need — using codebase-first analysis
3
+ and assumption surfacing instead of interview-style questioning.
4
+
5
+ You are a thinking partner, not an interviewer. Analyze the codebase deeply, surface what you
6
+ believe based on evidence, and ask the user only to correct what's wrong.
7
+ </objective>
8
+
9
+ <available_agent_types>
10
+ Valid GSD subagent types (use exact names — do not fall back to 'general'):
11
+ - gsd-assumptions-analyzer — Analyzes codebase to surface implementation assumptions
12
+ </available_agent_types>
13
+
14
+ <downstream_awareness>
15
+ **CONTEXT.md feeds into:**
16
+
17
+ 1. **gsd-phase-researcher** — Reads CONTEXT.md to know WHAT to research
18
+ 2. **gsd-planner** — Reads CONTEXT.md to know WHAT decisions are locked
19
+
20
+ **Your job:** Capture decisions clearly enough that downstream agents can act on them
21
+ without asking the user again. Output is identical to discuss mode — same CONTEXT.md format.
22
+ </downstream_awareness>
23
+
24
+ <philosophy>
25
+ **Assumptions mode philosophy:**
26
+
27
+ The user is a visionary, not a codebase archaeologist. They need enough context to evaluate
28
+ whether your assumptions match their intent — not to answer questions you could figure out
29
+ by reading the code.
30
+
31
+ - read the codebase FIRST, form opinions SECOND, ask ONLY about what's genuinely unclear
32
+ - Every assumption must cite evidence (file paths, patterns found)
33
+ - Every assumption must state consequences if wrong
34
+ - Minimize user interactions: ~2-4 corrections vs ~15-20 questions
35
+ </philosophy>
36
+
37
+ <scope_guardrail>
38
+ **CRITICAL: No scope creep.**
39
+
40
+ The phase boundary comes from ROADMAP.md and is FIXED. Discussion clarifies HOW to implement
41
+ what's scoped, never WHETHER to add new capabilities.
42
+
43
+ When user suggests scope creep:
44
+ "[Feature X] would be a new capability — that's its own phase.
45
+ Want me to note it for the roadmap backlog? For now, let's focus on [phase domain]."
46
+
47
+ Capture the idea in "Deferred Ideas". Don't lose it, don't act on it.
48
+ </scope_guardrail>
49
+
50
+ <answer_validation>
51
+ **IMPORTANT: Answer validation** — After every question call, check if the response
52
+ is empty or whitespace-only. If so:
53
+ 1. Retry the question once with the same parameters
54
+ 2. If still empty, present the options as a plain-text numbered list
55
+
56
+ **Text mode (`workflow.text_mode: true` in config or `--text` flag):**
57
+ When text mode is active, do not use question at all. Present every question as a
58
+ plain-text numbered list and ask the user to type their choice number.
59
+ </answer_validation>
60
+
61
+ <process>
62
+
63
+ <step name="initialize" priority="first">
64
+ Phase number from argument (required).
65
+
66
+ ```bash
67
+ INIT=$(node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" init phase-op "${PHASE}")
68
+ if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
69
+ AGENT_SKILLS_ANALYZER=$(node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" agent-skills gsd-assumptions-analyzer 2>/dev/null)
70
+ ```
71
+
72
+ Parse JSON for: `commit_docs`, `phase_found`, `phase_dir`, `phase_number`, `phase_name`,
73
+ `phase_slug`, `padded_phase`, `has_research`, `has_context`, `has_plans`, `has_verification`,
74
+ `plan_count`, `roadmap_exists`, `planning_exists`.
75
+
76
+ **If `phase_found` is false:**
77
+ ```
78
+ Phase [X] not found in roadmap.
79
+
80
+ Use /gsd-progress to see available phases.
81
+ ```
82
+ Exit workflow.
83
+
84
+ **If `phase_found` is true:** Continue to check_existing.
85
+
86
+ **Auto mode** — If `--auto` is present in ARGUMENTS:
87
+ - In `check_existing`: auto-select "Update it" (if context exists) or continue without prompting
88
+ - In `present_assumptions`: skip confirmation gate, proceed directly to write CONTEXT.md
89
+ - In `correct_assumptions`: auto-select recommended option for each correction
90
+ - Log each auto-selected choice inline
91
+ - After completion, auto-advance to plan-phase
92
+ </step>
93
+
94
+ <step name="check_existing">
95
+ Check if CONTEXT.md already exists using `has_context` from init.
96
+
97
+ ```bash
98
+ ls ${phase_dir}/*-CONTEXT.md 2>/dev/null || true
99
+ ```
100
+
101
+ **If exists:**
102
+
103
+ **If `--auto`:** Auto-select "Update it". Log: `[auto] Context exists — updating with assumption-based analysis.`
104
+
105
+ **Otherwise:** Use question:
106
+ - header: "Context"
107
+ - question: "Phase [X] already has context. What do you want to do?"
108
+ - options:
109
+ - "Update it" — Re-analyze codebase and refresh assumptions
110
+ - "View it" — Show me what's there
111
+ - "Skip" — Use existing context as-is
112
+
113
+ If "Update": Load existing, continue to load_prior_context
114
+ If "View": Display CONTEXT.md, then offer update/skip
115
+ If "Skip": Exit workflow
116
+
117
+ **If doesn't exist:**
118
+
119
+ Check `has_plans` and `plan_count` from init. **If `has_plans` is true:**
120
+
121
+ **If `--auto`:** Auto-select "Continue and replan after". Log: `[auto] Plans exist — continuing with assumption analysis, will replan after.`
122
+
123
+ **Otherwise:** Use question:
124
+ - header: "Plans exist"
125
+ - question: "Phase [X] already has {plan_count} plan(s) created without user context. Your decisions here won't affect existing plans unless you replan."
126
+ - options:
127
+ - "Continue and replan after"
128
+ - "View existing plans"
129
+ - "Cancel"
130
+
131
+ If "Continue and replan after": Continue to load_prior_context.
132
+ If "View existing plans": Display plan files, then offer "Continue" / "Cancel".
133
+ If "Cancel": Exit workflow.
134
+
135
+ **If `has_plans` is false:** Continue to load_prior_context.
136
+ </step>
137
+
138
+ <step name="load_prior_context">
139
+ read project-level and prior phase context to avoid re-asking decided questions.
140
+
141
+ **Step 1: read project-level files**
142
+ ```bash
143
+ cat .planning/PROJECT.md 2>/dev/null || true
144
+ cat .planning/REQUIREMENTS.md 2>/dev/null || true
145
+ cat .planning/STATE.md 2>/dev/null || true
146
+ ```
147
+
148
+ Extract from these:
149
+ - **PROJECT.md** — Vision, principles, non-negotiables, user preferences
150
+ - **REQUIREMENTS.md** — Acceptance criteria, constraints
151
+ - **STATE.md** — Current progress, any flags
152
+
153
+ **Step 2: read all prior CONTEXT.md files**
154
+ ```bash
155
+ (find .planning/phases -name "*-CONTEXT.md" 2>/dev/null || true) | sort
156
+ ```
157
+
158
+ For each CONTEXT.md where phase number < current phase:
159
+ - read the `<decisions>` section — these are locked preferences
160
+ - read `<specifics>` — particular references or "I want it like X" moments
161
+ - Note patterns (e.g., "user consistently prefers minimal UI")
162
+
163
+ **Step 3: Build internal `<prior_decisions>` context**
164
+
165
+ Structure the extracted information for use in assumption generation.
166
+
167
+ **If no prior context exists:** Continue without — expected for early phases.
168
+ </step>
169
+
170
+ <step name="cross_reference_todos">
171
+ Check if any pending todos are relevant to this phase's scope.
172
+
173
+ ```bash
174
+ TODO_MATCHES=$(node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" todo match-phase "${PHASE_NUMBER}")
175
+ ```
176
+
177
+ Parse JSON for: `todo_count`, `matches[]`.
178
+
179
+ **If `todo_count` is 0:** Skip silently.
180
+
181
+ **If matches found:** Present matched todos, use question (multiSelect) to fold relevant ones into scope.
182
+
183
+ **For selected (folded) todos:** Store as `<folded_todos>` for CONTEXT.md `<decisions>` section.
184
+ **For unselected:** Store as `<reviewed_todos>` for CONTEXT.md `<deferred>` section.
185
+
186
+ **Auto mode (`--auto`):** Fold all todos with score >= 0.4 automatically. Log the selection.
187
+ </step>
188
+
189
+ <step name="load_methodology">
190
+ read the project-level methodology file if it exists. This must happen before assumption analysis
191
+ so that active lenses shape how assumptions are generated and evaluated.
192
+
193
+ ```bash
194
+ cat .planning/METHODOLOGY.md 2>/dev/null || true
195
+ ```
196
+
197
+ **If METHODOLOGY.md exists:**
198
+ - Parse each named lens: its diagnoses, recommendations, and triggering conditions
199
+ - Store as internal `<active_lenses>` for use in deep_codebase_analysis and present_assumptions
200
+ - When spawning the gsd-assumptions-analyzer, pass the lens list so it can flag which lenses apply
201
+ - When presenting assumptions, append a "Methodology" section showing which lenses were applied
202
+ and what they flagged (if anything)
203
+
204
+ **If METHODOLOGY.md does not exist:** Skip silently. This artifact is optional.
205
+ </step>
206
+
207
+ <step name="scout_codebase">
208
+ Lightweight scan of existing code to inform assumption generation.
209
+
210
+ **Step 1: Check for existing codebase maps**
211
+ ```bash
212
+ ls .planning/codebase/*.md 2>/dev/null || true
213
+ ```
214
+
215
+ **If codebase maps exist:** read relevant ones (CONVENTIONS.md, STRUCTURE.md, STACK.md). Extract reusable components, patterns, integration points. Skip to Step 3.
216
+
217
+ **Step 2: If no codebase maps, do targeted grep**
218
+
219
+ Extract key terms from phase goal, search for related files.
220
+
221
+ ```bash
222
+ grep -rl "{term1}\|{term2}" src/ app/ --include="*.ts" --include="*.tsx" 2>/dev/null | head -10
223
+ ```
224
+
225
+ read the 3-5 most relevant files.
226
+
227
+ **Step 3: Build internal `<codebase_context>`**
228
+
229
+ Identify reusable assets, established patterns, integration points, and creative options. Store internally for use in deep_codebase_analysis.
230
+ </step>
231
+
232
+ <step name="deep_codebase_analysis">
233
+ Spawn a `gsd-assumptions-analyzer` agent to deeply analyze the codebase for this phase. This
234
+ keeps raw file contents out of the main context window, protecting token budget.
235
+
236
+ **Resolve calibration tier (if USER-PROFILE.md exists):**
237
+
238
+ ```bash
239
+ PROFILE_PATH="$HOME/.config/opencode/get-shit-done/USER-PROFILE.md"
240
+ ```
241
+
242
+ If file exists at PROFILE_PATH:
243
+ - Priority 1: read config.json > preferences.vendor_philosophy (project-level override)
244
+ - Priority 2: read USER-PROFILE.md Vendor Choices/Philosophy rating (global)
245
+ - Priority 3: Default to "standard"
246
+
247
+ Map to calibration tier:
248
+ - conservative OR thorough-evaluator → full_maturity (more alternatives, detailed evidence)
249
+ - opinionated → minimal_decisive (fewer alternatives, decisive recommendations)
250
+ - pragmatic-fast OR any other value → standard
251
+
252
+ If no USER-PROFILE.md: calibration_tier = "standard"
253
+
254
+ **Spawn Explore subagent:**
255
+
256
+ ```
257
+ @gsd-assumptions-analyzer """
258
+ Analyze the codebase for Phase {PHASE}: {phase_name}.
259
+
260
+ Phase goal: {roadmap_description}
261
+ Prior decisions: {prior_decisions_summary}
262
+ Codebase scout hints: {codebase_context_summary}
263
+ Calibration: {calibration_tier}
264
+
265
+ Your job:
266
+ 1. read ROADMAP.md phase {PHASE} description
267
+ 2. read any prior CONTEXT.md files from earlier phases
268
+ 3. glob/grep for files related to: {phase_relevant_terms}
269
+ 4. read 5-15 most relevant source files
270
+ 5. Return structured assumptions
271
+
272
+ ## Output Format
273
+
274
+ Return EXACTLY this structure:
275
+
276
+ ## Assumptions
277
+
278
+ ### [Area Name] (e.g., "Technical Approach")
279
+ - **Assumption:** [Decision statement]
280
+ - **Why this way:** [Evidence from codebase — cite file paths]
281
+ - **If wrong:** [Concrete consequence of this being wrong]
282
+ - **Confidence:** Confident | Likely | Unclear
283
+
284
+ (3-5 areas, calibrated by tier:
285
+ - full_maturity: 3-5 areas, 2-3 alternatives per Likely/Unclear item
286
+ - standard: 3-4 areas, 2 alternatives per Likely/Unclear item
287
+ - minimal_decisive: 2-3 areas, decisive single recommendation per item)
288
+
289
+ ## Needs External Research
290
+ [Topics where codebase alone is insufficient — library version compatibility,
291
+ ecosystem best practices, etc. Leave empty if codebase provides enough evidence.]
292
+
293
+ ${AGENT_SKILLS_ANALYZER}
294
+ """
295
+ ```
296
+
297
+ Parse the subagent's response. Extract:
298
+ - `assumptions[]` — each with area, statement, evidence, consequence, confidence
299
+ - `needs_research[]` — topics requiring external research (may be empty)
300
+
301
+ **Initialize canonical refs accumulator:**
302
+ - Source 1: Copy `Canonical refs:` from ROADMAP.md for this phase, expand to full paths
303
+ - Source 2: Check REQUIREMENTS.md and PROJECT.md for specs/ADRs referenced
304
+ - Source 3: Add any docs referenced in codebase scout results
305
+ </step>
306
+
307
+ <step name="external_research">
308
+ **Skip if:** `needs_research` from deep_codebase_analysis is empty.
309
+
310
+ If research topics were flagged, spawn a general research agent:
311
+
312
+ ```
313
+ task(subagent_type="general", prompt="""
314
+ Research the following topics for Phase {PHASE}: {phase_name}.
315
+
316
+ Topics needing research:
317
+ {needs_research_content}
318
+
319
+ For each topic, return:
320
+ - **Finding:** [What you learned]
321
+ - **Source:** [URL or library docs reference]
322
+ - **Confidence impact:** [Which assumption this resolves and to what confidence level]
323
+
324
+ Use Context7 (resolve-library-id then query-docs) for library-specific questions.
325
+ Use websearch for ecosystem/best-practice questions.
326
+ """)
327
+ ```
328
+
329
+ Merge findings back into assumptions:
330
+ - Update confidence levels where research resolves ambiguity
331
+ - Add source attribution to affected assumptions
332
+ - Store research findings for DISCUSSION-LOG.md
333
+
334
+ **If no gaps flagged:** Skip entirely. Most phases will skip this step.
335
+ </step>
336
+
337
+ <step name="present_assumptions">
338
+ Display all assumptions grouped by area with confidence badges.
339
+
340
+ **Format for display:**
341
+
342
+ ```
343
+ ## Phase {PHASE}: {phase_name} — Assumptions
344
+
345
+ Based on codebase analysis, here's what I'd go with:
346
+
347
+ ### {Area Name}
348
+ {Confidence badge} **{Assumption statement}**
349
+ ↳ Evidence: {file paths cited}
350
+ ↳ If wrong: {consequence}
351
+
352
+ ### {Area Name 2}
353
+ ...
354
+
355
+ [If external research was done:]
356
+ ### External Research Applied
357
+ - {Topic}: {Finding} (Source: {URL})
358
+ ```
359
+
360
+ **If `--auto`:**
361
+ - If all assumptions are Confident or Likely: log assumptions, skip to write_context.
362
+ Log: `[auto] All assumptions Confident/Likely — proceeding to context capture.`
363
+ - If any assumptions are Unclear: log a warning, auto-select recommended alternative for
364
+ each Unclear item. Log: `[auto] {N} Unclear assumptions auto-resolved with recommended defaults.`
365
+ Proceed to write_context.
366
+
367
+ **Otherwise:** Use question:
368
+ - header: "Assumptions"
369
+ - question: "These all look right?"
370
+ - options:
371
+ - "Yes, proceed" — write CONTEXT.md with these assumptions as decisions
372
+ - "Let me correct some" — Select which assumptions to change
373
+
374
+ **If "Yes, proceed":** Skip to write_context.
375
+ **If "Let me correct some":** Continue to correct_assumptions.
376
+ </step>
377
+
378
+ <step name="correct_assumptions">
379
+ The assumptions are already displayed above from present_assumptions.
380
+
381
+ Present a multiSelect where each option's label is the assumption statement and description
382
+ is the "If wrong" consequence:
383
+
384
+ Use question (multiSelect):
385
+ - header: "Corrections"
386
+ - question: "Which assumptions need correcting?"
387
+ - options: [one per assumption, label = assumption statement, description = "If wrong: {consequence}"]
388
+
389
+ For each selected correction, ask ONE focused question:
390
+
391
+ Use question:
392
+ - header: "{Area Name}"
393
+ - question: "What should we do instead for: {assumption statement}?"
394
+ - options: [2-3 concrete alternatives describing user-visible outcomes, recommended option first]
395
+
396
+ Record each correction:
397
+ - Original assumption
398
+ - User's chosen alternative
399
+ - Reason (if provided via "Other" free text)
400
+
401
+ After all corrections processed, continue to write_context with updated assumptions.
402
+
403
+ **Auto mode:** Should not reach this step (--auto skips from present_assumptions).
404
+ </step>
405
+
406
+ <step name="write_context">
407
+ Create phase directory if needed. write CONTEXT.md using the standard 6-section format.
408
+
409
+ **File:** `${phase_dir}/${padded_phase}-CONTEXT.md`
410
+
411
+ Map assumptions to CONTEXT.md sections:
412
+ - Assumptions → `<decisions>` (each assumption becomes a locked decision: D-01, D-02, etc.)
413
+ - Corrections → override the original assumption in `<decisions>`
414
+ - Areas where all assumptions were Confident → marked as locked decisions
415
+ - Areas with corrections → include user's chosen alternative as the decision
416
+ - Folded todos → included in `<decisions>` under "### Folded Todos"
417
+
418
+ ```markdown
419
+ # Phase {PHASE}: {phase_name} - Context
420
+
421
+ **Gathered:** {date} (assumptions mode)
422
+ **Status:** Ready for planning
423
+
424
+ <domain>
425
+ ## Phase Boundary
426
+
427
+ {Domain boundary from ROADMAP.md — clear statement of scope anchor}
428
+ </domain>
429
+
430
+ <decisions>
431
+ ## Implementation Decisions
432
+
433
+ ### {Area Name 1}
434
+ - **D-01:** {Decision — from assumption or correction}
435
+ - **D-02:** {Decision}
436
+
437
+ ### {Area Name 2}
438
+ - **D-03:** {Decision}
439
+
440
+ ### OpenCode's Discretion
441
+ {Any assumptions where the user confirmed "you decide" or left as-is with Likely confidence}
442
+
443
+ ### Folded Todos
444
+ {If any todos were folded into scope}
445
+ </decisions>
446
+
447
+ <canonical_refs>
448
+ ## Canonical References
449
+
450
+ **Downstream agents MUST read these before planning or implementing.**
451
+
452
+ {Accumulated canonical refs from analyze step — full relative paths}
453
+
454
+ [If no external specs: "No external specs — requirements fully captured in decisions above"]
455
+ </canonical_refs>
456
+
457
+ <code_context>
458
+ ## Existing Code Insights
459
+
460
+ ### Reusable Assets
461
+ {From codebase scout + Explore subagent findings}
462
+
463
+ ### Established Patterns
464
+ {Patterns that constrain/enable this phase}
465
+
466
+ ### Integration Points
467
+ {Where new code connects to existing system}
468
+ </code_context>
469
+
470
+ <specifics>
471
+ ## Specific Ideas
472
+
473
+ {Any particular references from corrections or user input}
474
+
475
+ [If none: "No specific requirements — open to standard approaches"]
476
+ </specifics>
477
+
478
+ <deferred>
479
+ ## Deferred Ideas
480
+
481
+ {Ideas mentioned during corrections that are out of scope}
482
+
483
+ ### Reviewed Todos (not folded)
484
+ {Todos reviewed but not folded — with reason}
485
+
486
+ [If none: "None — analysis stayed within phase scope"]
487
+ </deferred>
488
+ ```
489
+
490
+ write file.
491
+ </step>
492
+
493
+ <step name="write_discussion_log">
494
+ write audit trail of assumptions and corrections.
495
+
496
+ **File:** `${phase_dir}/${padded_phase}-DISCUSSION-LOG.md`
497
+
498
+ ```markdown
499
+ # Phase {PHASE}: {phase_name} - Discussion Log (Assumptions Mode)
500
+
501
+ > **Audit trail only.** Do not use as input to planning, research, or execution agents.
502
+ > Decisions captured in CONTEXT.md — this log preserves the analysis.
503
+
504
+ **Date:** {ISO date}
505
+ **Phase:** {padded_phase}-{phase_name}
506
+ **Mode:** assumptions
507
+ **Areas analyzed:** {comma-separated area names}
508
+
509
+ ## Assumptions Presented
510
+
511
+ ### {Area Name}
512
+ | Assumption | Confidence | Evidence |
513
+ |------------|-----------|----------|
514
+ | {Statement} | {Confident/Likely/Unclear} | {file paths} |
515
+
516
+ {Repeat for each area}
517
+
518
+ ## Corrections Made
519
+
520
+ {If corrections were made:}
521
+
522
+ ### {Area Name}
523
+ - **Original assumption:** {what OpenCode assumed}
524
+ - **User correction:** {what the user chose instead}
525
+ - **Reason:** {user's rationale, if provided}
526
+
527
+ {If no corrections: "No corrections — all assumptions confirmed."}
528
+
529
+ ## Auto-Resolved
530
+
531
+ {If --auto and Unclear items existed:}
532
+ - {Assumption}: auto-selected {recommended option}
533
+
534
+ {If not applicable: omit this section}
535
+
536
+ ## External Research
537
+
538
+ {If research was performed:}
539
+ - {Topic}: {Finding} (Source: {URL})
540
+
541
+ {If no research: omit this section}
542
+ ```
543
+
544
+ write file.
545
+ </step>
546
+
547
+ <step name="git_commit">
548
+ Commit phase context and discussion log:
549
+
550
+ ```bash
551
+ node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" commit "docs(${padded_phase}): capture phase context (assumptions mode)" --files "${phase_dir}/${padded_phase}-CONTEXT.md" "${phase_dir}/${padded_phase}-DISCUSSION-LOG.md"
552
+ ```
553
+
554
+ Confirm: "Committed: docs(${padded_phase}): capture phase context (assumptions mode)"
555
+ </step>
556
+
557
+ <step name="update_state">
558
+ Update STATE.md with session info:
559
+
560
+ ```bash
561
+ node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" state record-session \
562
+ --stopped-at "Phase ${PHASE} context gathered (assumptions mode)" \
563
+ --resume-file "${phase_dir}/${padded_phase}-CONTEXT.md"
564
+ ```
565
+
566
+ Commit STATE.md:
567
+
568
+ ```bash
569
+ node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" commit "docs(state): record phase ${PHASE} context session" --files .planning/STATE.md
570
+ ```
571
+ </step>
572
+
573
+ <step name="confirm_creation">
574
+ Present summary and next steps:
575
+
576
+ ```
577
+ Created: .planning/phases/${PADDED_PHASE}-${SLUG}/${PADDED_PHASE}-CONTEXT.md
578
+
579
+ ## Decisions Captured (Assumptions Mode)
580
+
581
+ ### {Area Name}
582
+ - {Key decision} (from assumption / corrected)
583
+
584
+ {Repeat per area}
585
+
586
+ [If corrections were made:]
587
+ ## Corrections Applied
588
+ - {Area}: {original} → {corrected}
589
+
590
+ [If deferred ideas exist:]
591
+ ## Noted for Later
592
+ - {Deferred idea} — future phase
593
+
594
+ ---
595
+
596
+ ## ▶ Next Up
597
+
598
+ **Phase ${PHASE}: {phase_name}** — {Goal from ROADMAP.md}
599
+
600
+ `/new` then:
601
+
602
+ `/gsd-plan-phase ${PHASE}`
603
+
604
+ ---
605
+
606
+ **Also available:**
607
+ - `/gsd-plan-phase ${PHASE} --skip-research` — plan without research
608
+ - `/gsd-ui-phase ${PHASE}` — generate UI design contract (if frontend work)
609
+ - Review/edit CONTEXT.md before continuing
610
+
611
+ ---
612
+ ```
613
+ </step>
614
+
615
+ <step name="auto_advance">
616
+ Check for auto-advance trigger:
617
+
618
+ 1. Parse `--auto` flag from $ARGUMENTS
619
+ 2. Sync chain flag:
620
+ ```bash
621
+ if [[ ! "$ARGUMENTS" =~ --auto ]]; then
622
+ node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" config-set workflow._auto_chain_active false 2>/dev/null
623
+ fi
624
+ ```
625
+ 3. read chain flag and user preference:
626
+ ```bash
627
+ AUTO_CHAIN=$(node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" config-get workflow._auto_chain_active 2>/dev/null || echo "false")
628
+ AUTO_CFG=$(node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" config-get workflow.auto_advance 2>/dev/null || echo "false")
629
+ ```
630
+
631
+ **If `--auto` flag present AND `AUTO_CHAIN` is not true:**
632
+ ```bash
633
+ node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" config-set workflow._auto_chain_active true
634
+ ```
635
+
636
+ **If `--auto` flag present OR `AUTO_CHAIN` is true OR `AUTO_CFG` is true:**
637
+
638
+ Display banner:
639
+ ```
640
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
641
+ GSD ► AUTO-ADVANCING TO PLAN
642
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
643
+
644
+ Context captured (assumptions mode). Launching plan-phase...
645
+ ```
646
+
647
+ Launch: `skill(skill="gsd-plan-phase", args="${PHASE} --auto")`
648
+
649
+ Handle return: PHASE COMPLETE / PLANNING COMPLETE / INCONCLUSIVE / GAPS FOUND
650
+ (identical handling to discuss-phase.md auto_advance step)
651
+
652
+ **If neither `--auto` nor config enabled:**
653
+ Route to confirm_creation step.
654
+ </step>
655
+
656
+ </process>
657
+
658
+ <success_criteria>
659
+ - Phase validated against roadmap
660
+ - Prior context loaded (no re-asking decided questions)
661
+ - Codebase deeply analyzed via Explore subagent (5-15 files read)
662
+ - Assumptions surfaced with evidence and confidence levels
663
+ - User confirmed or corrected assumptions (~2-4 interactions max)
664
+ - Scope creep redirected to deferred ideas
665
+ - CONTEXT.md captures actual decisions (identical format to discuss mode)
666
+ - CONTEXT.md includes canonical_refs with full file paths (MANDATORY)
667
+ - CONTEXT.md includes code_context from codebase analysis
668
+ - DISCUSSION-LOG.md records assumptions and corrections as audit trail
669
+ - STATE.md updated with session info
670
+ - User knows next steps
671
+ </success_criteria>