gsd-opencode 1.10.2 → 1.20.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 (164) hide show
  1. package/agents/gsd-codebase-mapper.md +29 -3
  2. package/agents/gsd-debugger.md +19 -21
  3. package/agents/gsd-executor.md +213 -528
  4. package/agents/gsd-integration-checker.md +20 -0
  5. package/agents/gsd-phase-researcher.md +189 -267
  6. package/agents/gsd-plan-checker.md +278 -279
  7. package/agents/gsd-planner.md +299 -490
  8. package/agents/gsd-project-researcher.md +103 -345
  9. package/agents/gsd-research-synthesizer.md +5 -22
  10. package/agents/gsd-roadmapper.md +43 -6
  11. package/agents/gsd-verifier.md +158 -377
  12. package/{lib → bin/dm/lib}/constants.js +10 -3
  13. package/{src → bin/dm/src}/commands/install.js +5 -4
  14. package/{src → bin/dm/src}/commands/uninstall.js +3 -1
  15. package/{src → bin/dm/src}/services/backup-manager.js +1 -1
  16. package/{src → bin/dm/src}/services/config.js +1 -1
  17. package/{src → bin/dm/src}/services/file-ops.js +20 -4
  18. package/{src → bin/dm/src}/services/health-checker.js +3 -1
  19. package/{src → bin/dm/src}/services/repair-service.js +3 -1
  20. package/{src → bin/dm/src}/services/settings.js +1 -1
  21. package/{src → bin/dm/src}/services/update-service.js +2 -2
  22. package/bin/gsd-install.js +0 -0
  23. package/bin/gsd.js +9 -9
  24. package/commands/gsd/gsd-add-phase.md +43 -0
  25. package/commands/gsd/gsd-add-todo.md +47 -0
  26. package/commands/gsd/gsd-audit-milestone.md +36 -0
  27. package/commands/gsd/gsd-check-todos.md +45 -0
  28. package/commands/gsd/gsd-cleanup.md +18 -0
  29. package/commands/gsd/{complete-milestone.md → gsd-complete-milestone.md} +1 -1
  30. package/commands/gsd/{debug.md → gsd-debug.md} +16 -21
  31. package/commands/gsd/{discuss-phase.md → gsd-discuss-phase.md} +6 -9
  32. package/commands/gsd/gsd-execute-phase.md +41 -0
  33. package/commands/gsd/gsd-health.md +22 -0
  34. package/commands/gsd/gsd-help.md +22 -0
  35. package/commands/gsd/gsd-insert-phase.md +32 -0
  36. package/commands/gsd/gsd-join-discord.md +18 -0
  37. package/commands/gsd/{list-phase-assumptions.md → gsd-list-phase-assumptions.md} +3 -7
  38. package/commands/gsd/{map-codebase.md → gsd-map-codebase.md} +3 -3
  39. package/commands/gsd/gsd-new-milestone.md +44 -0
  40. package/commands/gsd/gsd-new-project.md +42 -0
  41. package/commands/gsd/gsd-pause-work.md +38 -0
  42. package/commands/gsd/gsd-plan-milestone-gaps.md +34 -0
  43. package/commands/gsd/gsd-plan-phase.md +44 -0
  44. package/commands/gsd/gsd-progress.md +24 -0
  45. package/commands/gsd/gsd-quick.md +41 -0
  46. package/commands/gsd/gsd-reapply-patches.md +119 -0
  47. package/commands/gsd/gsd-remove-phase.md +31 -0
  48. package/commands/gsd/{research-phase.md → gsd-research-phase.md} +38 -49
  49. package/commands/gsd/{resume-work.md → gsd-resume-work.md} +2 -2
  50. package/commands/gsd/gsd-set-profile.md +34 -0
  51. package/commands/gsd/gsd-settings.md +36 -0
  52. package/commands/gsd/gsd-update.md +37 -0
  53. package/commands/gsd/gsd-verify-work.md +38 -0
  54. package/get-shit-done/bin/gsd-tools.cjs +553 -0
  55. package/get-shit-done/bin/gsd-tools.test.cjs +2346 -0
  56. package/get-shit-done/bin/lib/commands.cjs +556 -0
  57. package/get-shit-done/bin/lib/config.cjs +162 -0
  58. package/get-shit-done/bin/lib/core.cjs +377 -0
  59. package/get-shit-done/bin/lib/frontmatter.cjs +299 -0
  60. package/get-shit-done/bin/lib/init.cjs +694 -0
  61. package/get-shit-done/bin/lib/milestone.cjs +215 -0
  62. package/get-shit-done/bin/lib/phase.cjs +877 -0
  63. package/get-shit-done/bin/lib/roadmap.cjs +298 -0
  64. package/get-shit-done/bin/lib/state.cjs +490 -0
  65. package/get-shit-done/bin/lib/template.cjs +222 -0
  66. package/get-shit-done/bin/lib/verify.cjs +772 -0
  67. package/get-shit-done/references/checkpoints.md +62 -364
  68. package/get-shit-done/references/decimal-phase-calculation.md +65 -0
  69. package/get-shit-done/references/git-integration.md +10 -16
  70. package/get-shit-done/references/git-planning-commit.md +38 -0
  71. package/get-shit-done/references/model-profile-resolution.md +34 -0
  72. package/get-shit-done/references/model-profiles.md +54 -66
  73. package/get-shit-done/references/phase-argument-parsing.md +61 -0
  74. package/get-shit-done/references/planning-config.md +112 -10
  75. package/get-shit-done/references/questioning.md +4 -0
  76. package/get-shit-done/references/ui-brand.md +1 -1
  77. package/get-shit-done/templates/UAT.md +1 -1
  78. package/get-shit-done/templates/VALIDATION.md +104 -0
  79. package/get-shit-done/templates/codebase/structure.md +6 -6
  80. package/get-shit-done/templates/config.json +37 -0
  81. package/get-shit-done/templates/context.md +2 -10
  82. package/get-shit-done/templates/continue-here.md +6 -6
  83. package/get-shit-done/templates/debug-subagent-prompt.md +2 -2
  84. package/get-shit-done/templates/discovery.md +6 -6
  85. package/get-shit-done/templates/milestone-archive.md +3 -3
  86. package/get-shit-done/templates/phase-prompt.md +9 -7
  87. package/get-shit-done/templates/planner-subagent-prompt.md +6 -6
  88. package/get-shit-done/templates/research-project/ARCHITECTURE.md +1 -1
  89. package/get-shit-done/templates/research.md +29 -6
  90. package/get-shit-done/templates/roadmap.md +1 -1
  91. package/get-shit-done/templates/state.md +0 -30
  92. package/get-shit-done/templates/summary-complex.md +59 -0
  93. package/get-shit-done/templates/summary-minimal.md +41 -0
  94. package/get-shit-done/templates/summary-standard.md +48 -0
  95. package/get-shit-done/templates/summary.md +16 -37
  96. package/get-shit-done/templates/user-setup.md +1 -13
  97. package/get-shit-done/templates/verification-report.md +5 -5
  98. package/get-shit-done/workflows/add-phase.md +111 -0
  99. package/{commands/gsd → get-shit-done/workflows}/add-todo.md +24 -60
  100. package/{commands/gsd → get-shit-done/workflows}/audit-milestone.md +83 -63
  101. package/{commands/gsd → get-shit-done/workflows}/check-todos.md +21 -73
  102. package/get-shit-done/workflows/cleanup.md +152 -0
  103. package/get-shit-done/workflows/complete-milestone.md +251 -312
  104. package/get-shit-done/workflows/diagnose-issues.md +6 -31
  105. package/get-shit-done/workflows/discovery-phase.md +11 -11
  106. package/get-shit-done/workflows/discuss-phase.md +156 -49
  107. package/get-shit-done/workflows/execute-phase.md +238 -396
  108. package/get-shit-done/workflows/execute-plan.md +180 -1609
  109. package/get-shit-done/workflows/health.md +156 -0
  110. package/{commands/gsd → get-shit-done/workflows}/help.md +33 -35
  111. package/get-shit-done/workflows/insert-phase.md +129 -0
  112. package/get-shit-done/workflows/list-phase-assumptions.md +3 -3
  113. package/get-shit-done/workflows/map-codebase.md +73 -80
  114. package/get-shit-done/workflows/new-milestone.md +382 -0
  115. package/{commands/gsd → get-shit-done/workflows}/new-project.md +281 -234
  116. package/get-shit-done/workflows/oc-set-profile.md +320 -0
  117. package/{commands/gsd → get-shit-done/workflows}/pause-work.md +31 -43
  118. package/{commands/gsd → get-shit-done/workflows}/plan-milestone-gaps.md +29 -50
  119. package/get-shit-done/workflows/plan-phase.md +478 -0
  120. package/{commands/gsd → get-shit-done/workflows}/progress.md +64 -47
  121. package/get-shit-done/workflows/quick.md +453 -0
  122. package/get-shit-done/workflows/remove-phase.md +154 -0
  123. package/get-shit-done/workflows/research-phase.md +73 -0
  124. package/get-shit-done/workflows/resume-project.md +17 -26
  125. package/get-shit-done/workflows/set-profile.md +80 -0
  126. package/get-shit-done/workflows/settings.md +213 -0
  127. package/get-shit-done/workflows/transition.md +84 -104
  128. package/{commands/gsd → get-shit-done/workflows}/update.md +70 -28
  129. package/get-shit-done/workflows/verify-phase.md +106 -492
  130. package/get-shit-done/workflows/verify-work.md +26 -53
  131. package/package.json +7 -4
  132. package/rules/gsd-oc-work-hard.md +36 -0
  133. package/skills/gsd-oc-select-model/SKILL.md +348 -0
  134. package/skills/gsd-oc-select-model/scripts/select-models.cjs +268 -0
  135. package/agents/gsd-set-model.md +0 -287
  136. package/agents/gsd-set-profile.md +0 -239
  137. package/agents/gsd-settings.md +0 -749
  138. package/bin/install.js +0 -323
  139. package/commands/gsd/add-phase.md +0 -207
  140. package/commands/gsd/execute-phase.md +0 -339
  141. package/commands/gsd/insert-phase.md +0 -227
  142. package/commands/gsd/new-milestone.md +0 -721
  143. package/commands/gsd/plan-phase.md +0 -525
  144. package/commands/gsd/quick.md +0 -309
  145. package/commands/gsd/remove-phase.md +0 -349
  146. package/commands/gsd/set-model.md +0 -77
  147. package/commands/gsd/set-profile.md +0 -46
  148. package/commands/gsd/settings.md +0 -33
  149. package/commands/gsd/verify-work.md +0 -219
  150. package/commands/gsd/whats-new.md +0 -124
  151. /package/{src → bin/dm/src}/commands/check.js +0 -0
  152. /package/{src → bin/dm/src}/commands/config.js +0 -0
  153. /package/{src → bin/dm/src}/commands/list.js +0 -0
  154. /package/{src → bin/dm/src}/commands/repair.js +0 -0
  155. /package/{src → bin/dm/src}/commands/update.js +0 -0
  156. /package/{src → bin/dm/src}/services/manifest-manager.js +0 -0
  157. /package/{src → bin/dm/src}/services/migration-service.js +0 -0
  158. /package/{src → bin/dm/src}/services/scope-manager.js +0 -0
  159. /package/{src → bin/dm/src}/services/structure-detector.js +0 -0
  160. /package/{src → bin/dm/src}/utils/hash.js +0 -0
  161. /package/{src → bin/dm/src}/utils/interactive.js +0 -0
  162. /package/{src → bin/dm/src}/utils/logger.js +0 -0
  163. /package/{src → bin/dm/src}/utils/npm-registry.js +0 -0
  164. /package/{src → bin/dm/src}/utils/path-resolver.js +0 -0
@@ -78,9 +78,9 @@ This runs in parallel - all gaps investigated simultaneously.
78
78
  For each gap, fill the debug-subagent-prompt template and spawn:
79
79
 
80
80
  ```
81
- Task(
82
- prompt=filled_debug_subagent_prompt,
83
- subagent_type="general",
81
+ task(
82
+ prompt=filled_debug_subagent_prompt + "\n\n<files_to_read>\n- {phase_dir}/{phase_num}-UAT.md\n- .planning/STATE.md\n</files_to_read>",
83
+ subagent_type="task",
84
84
  description="Debug: {truth_short}"
85
85
  )
86
86
  ```
@@ -156,21 +156,9 @@ For each gap in the Gaps section, add artifacts and missing fields:
156
156
 
157
157
  Update status in frontmatter to "diagnosed".
158
158
 
159
- **Check planning config:**
160
-
161
- ```bash
162
- COMMIT_PLANNING_DOCS=$(cat .planning/config.json 2>/dev/null | grep -o '"commit_docs"[[:space:]]*:[[:space:]]*[^,}]*' | grep -o 'true\|false' || echo "true")
163
- git check-ignore -q .planning 2>/dev/null && COMMIT_PLANNING_DOCS=false
164
- ```
165
-
166
- **If `COMMIT_PLANNING_DOCS=false`:** Skip git operations
167
-
168
- **If `COMMIT_PLANNING_DOCS=true` (default):**
169
-
170
159
  Commit the updated UAT.md:
171
160
  ```bash
172
- git add ".planning/phases/XX-name/{phase}-UAT.md"
173
- git commit -m "docs({phase}): add root causes from diagnosis"
161
+ node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs commit "docs({phase_num}): add root causes from diagnosis" --files ".planning/phases/XX-name/{phase_num}-UAT.md"
174
162
  ```
175
163
  </step>
176
164
 
@@ -201,21 +189,8 @@ Do NOT offer manual next steps - verify-work handles the rest.
201
189
  </process>
202
190
 
203
191
  <context_efficiency>
204
- **Orchestrator context:** ~15%
205
- - Parse UAT.md gaps
206
- - Fill template strings
207
- - Spawn parallel Task calls
208
- - Collect results
209
- - Update UAT.md
210
-
211
- **Each debug agent:** Fresh 200k context
212
- - Loads full debug workflow
213
- - Loads debugging references
214
- - Investigates with full capacity
215
- - Returns root cause
216
-
217
- **No symptom gathering.** Agents start with symptoms pre-filled from UAT.
218
- **No fix application.** Agents only diagnose - plan-phase --gaps handles fixes.
192
+ Agents start with symptoms pre-filled from UAT (no symptom gathering).
193
+ Agents only diagnose—plan-phase --gaps handles fixes (no fix application).
219
194
  </context_efficiency>
220
195
 
221
196
  <failure_handling>
@@ -20,13 +20,13 @@ NOTE: For comprehensive ecosystem research ("how do experts build this"), use /g
20
20
  </depth_levels>
21
21
 
22
22
  <source_hierarchy>
23
- **MANDATORY: Context7 BEFORE webfetch**
23
+ **MANDATORY: Context7 BEFORE websearch**
24
24
 
25
25
  OpenCode's training data is 6-18 months stale. Always verify.
26
26
 
27
27
  1. **Context7 MCP FIRST** - Current docs, no hallucination
28
28
  2. **Official docs** - When Context7 lacks coverage
29
- 3. **webfetch LAST** - For comparisons and trends only
29
+ 3. **websearch LAST** - For comparisons and trends only
30
30
 
31
31
  See ~/.config/opencode/get-shit-done/templates/discovery.md `<discovery_protocol>` for full protocol.
32
32
  </source_hierarchy>
@@ -99,13 +99,13 @@ For: Choosing between options, new external integration.
99
99
 
100
100
  3. **Official docs** for anything Context7 lacks.
101
101
 
102
- 4. **webfetch** for comparisons:
102
+ 4. **websearch** for comparisons:
103
103
 
104
104
  - "[option A] vs [option B] {current_year}"
105
105
  - "[option] known issues"
106
106
  - "[option] with [our stack]"
107
107
 
108
- 5. **Cross-verify:** Any webfetch finding → confirm with Context7/official docs.
108
+ 5. **Cross-verify:** Any websearch finding → confirm with Context7/official docs.
109
109
 
110
110
  6. **Create DISCOVERY.md** using ~/.config/opencode/get-shit-done/templates/discovery.md structure:
111
111
 
@@ -145,7 +145,7 @@ For: Architectural decisions, novel problems, high-risk choices.
145
145
  - Migration/upgrade guides
146
146
  - Known limitations
147
147
 
148
- 4. **webfetch for ecosystem context:**
148
+ 4. **websearch for ecosystem context:**
149
149
 
150
150
  - How others solved similar problems
151
151
  - Production experiences
@@ -154,7 +154,7 @@ For: Architectural decisions, novel problems, high-risk choices.
154
154
 
155
155
  5. **Cross-verify ALL findings:**
156
156
 
157
- - Every webfetch claim → verify with authoritative source
157
+ - Every websearch claim → verify with authoritative source
158
158
  - Mark what's verified vs assumed
159
159
  - Flag contradictions
160
160
 
@@ -216,7 +216,7 @@ After creating DISCOVERY.md, check confidence level.
216
216
  If confidence is LOW:
217
217
  Use question:
218
218
 
219
- - header: "Low Confidence"
219
+ - header: "Low Conf."
220
220
  - question: "Discovery confidence is LOW: [reason]. How would you like to proceed?"
221
221
  - options:
222
222
  - "Dig deeper" - Do more research before planning
@@ -236,8 +236,8 @@ If DISCOVERY.md has open_questions:
236
236
  Present them inline:
237
237
  "Open questions from discovery:
238
238
 
239
- - [Question 1]
240
- - [Question 2]
239
+ - [question 1]
240
+ - [question 2]
241
241
 
242
242
  These may affect implementation. Acknowledge and proceed? (yes / address first)"
243
243
 
@@ -272,7 +272,7 @@ NOTE: DISCOVERY.md is NOT committed separately. It will be committed with phase
272
272
 
273
273
  **Level 2 (Standard):**
274
274
  - Context7 consulted for all options
275
- - webfetch findings cross-verified
275
+ - websearch findings cross-verified
276
276
  - DISCOVERY.md created with recommendation
277
277
  - Confidence level MEDIUM or higher
278
278
  - Ready to inform PLAN.md creation
@@ -280,7 +280,7 @@ NOTE: DISCOVERY.md is NOT committed separately. It will be committed with phase
280
280
  **Level 3 (Deep Dive):**
281
281
  - Discovery scope defined
282
282
  - Context7 exhaustively consulted
283
- - All webfetch findings verified against authoritative sources
283
+ - All websearch findings verified against authoritative sources
284
284
  - DISCOVERY.md created with comprehensive analysis
285
285
  - Quality report with source attribution
286
286
  - If LOW confidence findings → validation checkpoints defined
@@ -107,15 +107,16 @@ Phase: "API documentation"
107
107
 
108
108
  <process>
109
109
 
110
- <step name="validate_phase" priority="first">
110
+ <step name="initialize" priority="first">
111
111
  Phase number from argument (required).
112
112
 
113
- Load and validate:
114
- - read `.planning/ROADMAP.md`
115
- - Find phase entry
116
- - Extract: number, name, description, status
113
+ ```bash
114
+ INIT=$(node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs init phase-op "${PHASE}")
115
+ ```
117
116
 
118
- **If phase not found:**
117
+ Parse JSON for: `commit_docs`, `phase_found`, `phase_dir`, `phase_number`, `phase_name`, `phase_slug`, `padded_phase`, `has_research`, `has_context`, `has_plans`, `has_verification`, `plan_count`, `roadmap_exists`, `planning_exists`.
118
+
119
+ **If `phase_found` is false:**
119
120
  ```
120
121
  Phase [X] not found in roadmap.
121
122
 
@@ -123,21 +124,19 @@ Use /gsd-progress to see available phases.
123
124
  ```
124
125
  Exit workflow.
125
126
 
126
- **If phase found:** Continue to analyze_phase.
127
+ **If `phase_found` is true:** Continue to check_existing.
127
128
  </step>
128
129
 
129
130
  <step name="check_existing">
130
- Check if CONTEXT.md already exists:
131
+ Check if CONTEXT.md already exists using `has_context` from init.
131
132
 
132
133
  ```bash
133
- # Match both zero-padded (05-*) and unpadded (5-*) folders
134
- PADDED_PHASE=$(printf "%02d" ${PHASE})
135
- ls .planning/phases/${PADDED_PHASE}-*/CONTEXT.md .planning/phases/${PADDED_PHASE}-*/${PADDED_PHASE}-CONTEXT.md .planning/phases/${PHASE}-*/CONTEXT.md .planning/phases/${PHASE}-*/${PHASE}-CONTEXT.md 2>/dev/null
134
+ ls ${phase_dir}/*-CONTEXT.md 2>/dev/null
136
135
  ```
137
136
 
138
137
  **If exists:**
139
138
  Use question:
140
- - header: "Existing context"
139
+ - header: "Context"
141
140
  - question: "Phase [X] already has context. What do you want to do?"
142
141
  - options:
143
142
  - "Update it" — Review and revise existing context
@@ -148,7 +147,23 @@ If "Update": Load existing, continue to analyze_phase
148
147
  If "View": Display CONTEXT.md, then offer update/skip
149
148
  If "Skip": Exit workflow
150
149
 
151
- **If doesn't exist:** Continue to analyze_phase.
150
+ **If doesn't exist:**
151
+
152
+ Check `has_plans` and `plan_count` from init. **If `has_plans` is true:**
153
+
154
+ Use question:
155
+ - header: "Plans exist"
156
+ - question: "Phase [X] already has {plan_count} plan(s) created without user context. Your decisions here won't affect existing plans unless you replan."
157
+ - options:
158
+ - "Continue and replan after" — Capture context, then run /gsd-plan-phase {X} to replan
159
+ - "View existing plans" — Show plans before deciding
160
+ - "Cancel" — Skip discuss-phase
161
+
162
+ If "Continue and replan after": Continue to analyze_phase.
163
+ If "View existing plans": Display plan files, then offer "Continue" / "Cancel".
164
+ If "Cancel": Exit workflow.
165
+
166
+ **If `has_plans` is false:** Continue to analyze_phase.
152
167
  </step>
153
168
 
154
169
  <step name="analyze_phase">
@@ -191,9 +206,10 @@ We'll clarify HOW to implement this.
191
206
  **Then use question (multiSelect: true):**
192
207
  - header: "Discuss"
193
208
  - question: "Which areas do you want to discuss for [phase name]?"
194
- - options: Generate 3-4 phase-specific gray areas, each formatted as:
209
+ - options: Generate 3-4 phase-specific gray areas, each with:
195
210
  - "[Specific area]" (label) — concrete, not generic
196
211
  - [1-2 questions this covers] (description)
212
+ - **Highlight the recommended choice with brief explanation why**
197
213
 
198
214
  **Do NOT include a "skip" or "you decide" option.** User ran this command to discuss — give them real choices.
199
215
 
@@ -241,25 +257,33 @@ Ask 4 questions per area before offering to continue or move on. Each answer oft
241
257
  ```
242
258
 
243
259
  2. **Ask 4 questions using question:**
244
- - header: "[Area]"
260
+ - header: "[Area]" (max 12 chars — abbreviate if needed)
245
261
  - question: Specific decision for this area
246
- - options: 2-3 concrete choices (question adds "Other" automatically)
262
+ - options: 2-3 concrete choices (question adds "Other" automatically), with the recommended choice highlighted and brief explanation why
247
263
  - Include "You decide" as an option when reasonable — captures OpenCode discretion
248
264
 
249
265
  3. **After 4 questions, check:**
250
- - header: "[Area]"
266
+ - header: "[Area]" (max 12 chars)
251
267
  - question: "More questions about [area], or move to next?"
252
268
  - options: "More questions" / "Next area"
253
269
 
254
270
  If "More questions" → ask 4 more, then check again
255
271
  If "Next area" → proceed to next selected area
256
-
257
- 4. **After all areas complete:**
258
- - header: "Done"
259
- - question: "That covers [list areas]. Ready to create context?"
260
- - options: "Create context" / "Revisit an area"
261
-
262
- **Question design:**
272
+ If "Other" (free text) → interpret intent: continuation phrases ("chat more", "keep going", "yes", "more") map to "More questions"; advancement phrases ("done", "move on", "next", "skip") map to "Next area". If ambiguous, ask: "Continue with more questions about [area], or move to the next area?"
273
+
274
+ 4. **After all initially-selected areas complete:**
275
+ - Summarize what was captured from the discussion so far
276
+ - question:
277
+ - header: "Done"
278
+ - question: "We've discussed [list areas]. Which gray areas remain unclear?"
279
+ - options: "Explore more gray areas" / "I'm ready for context"
280
+ - If "Explore more gray areas":
281
+ - Identify 2-4 additional gray areas based on what was learned
282
+ - Return to present_gray_areas logic with these new areas
283
+ - Loop: discuss new areas, then prompt again
284
+ - If "I'm ready for context": Proceed to write_context
285
+
286
+ **question design:**
263
287
  - Options should be concrete, not abstract ("Cards" not "Option A")
264
288
  - Each answer should inform the next question
265
289
  - If user picks "Other", receive their input, reflect it back, confirm
@@ -281,19 +305,14 @@ Create CONTEXT.md capturing decisions made.
281
305
 
282
306
  **Find or create phase directory:**
283
307
 
308
+ Use values from init: `phase_dir`, `phase_slug`, `padded_phase`.
309
+
310
+ If `phase_dir` is null (phase exists in roadmap but no directory):
284
311
  ```bash
285
- # Match existing directory (padded or unpadded)
286
- PADDED_PHASE=$(printf "%02d" ${PHASE})
287
- PHASE_DIR=$(ls -d .planning/phases/${PADDED_PHASE}-* .planning/phases/${PHASE}-* 2>/dev/null | head -1)
288
- if [ -z "$PHASE_DIR" ]; then
289
- # Create from roadmap name (lowercase, hyphens)
290
- PHASE_NAME=$(grep "Phase ${PHASE}:" .planning/ROADMAP.md | sed 's/.*Phase [0-9]*: //' | tr '[:upper:]' '[:lower:]' | tr ' ' '-')
291
- mkdir -p ".planning/phases/${PADDED_PHASE}-${PHASE_NAME}"
292
- PHASE_DIR=".planning/phases/${PADDED_PHASE}-${PHASE_NAME}"
293
- fi
312
+ mkdir -p ".planning/phases/${padded_phase}-${phase_slug}"
294
313
  ```
295
314
 
296
- **File location:** `${PHASE_DIR}/${PADDED_PHASE}-CONTEXT.md`
315
+ **File location:** `${phase_dir}/${padded_phase}-CONTEXT.md`
297
316
 
298
317
  **Structure the content by what was discussed:**
299
318
 
@@ -391,32 +410,119 @@ Created: .planning/phases/${PADDED_PHASE}-${SLUG}/${PADDED_PHASE}-CONTEXT.md
391
410
  </step>
392
411
 
393
412
  <step name="git_commit">
394
- Commit phase context:
413
+ Commit phase context (uses `commit_docs` from init internally):
414
+
415
+ ```bash
416
+ node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs commit "docs(${padded_phase}): capture phase context" --files "${phase_dir}/${padded_phase}-CONTEXT.md"
417
+ ```
395
418
 
396
- **Check planning config:**
419
+ Confirm: "Committed: docs(${padded_phase}): capture phase context"
420
+ </step>
421
+
422
+ <step name="update_state">
423
+ Update STATE.md with session info:
424
+
425
+ ```bash
426
+ node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs state record-session \
427
+ --stopped-at "Phase ${PHASE} context gathered" \
428
+ --resume-file "${phase_dir}/${padded_phase}-CONTEXT.md"
429
+ ```
430
+
431
+ Commit STATE.md:
397
432
 
398
433
  ```bash
399
- COMMIT_PLANNING_DOCS=$(cat .planning/config.json 2>/dev/null | grep -o '"commit_docs"[[:space:]]*:[[:space:]]*[^,}]*' | grep -o 'true\|false' || echo "true")
400
- git check-ignore -q .planning 2>/dev/null && COMMIT_PLANNING_DOCS=false
434
+ node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs commit "docs(state): record phase ${PHASE} context session" --files .planning/STATE.md
401
435
  ```
436
+ </step>
402
437
 
403
- **If `COMMIT_PLANNING_DOCS=false`:** Skip git operations
438
+ <step name="auto_advance">
439
+ Check for auto-advance trigger:
404
440
 
405
- **If `COMMIT_PLANNING_DOCS=true` (default):**
441
+ 1. Parse `--auto` flag from $ARGUMENTS
442
+ 2. read `workflow.auto_advance` from config:
443
+ ```bash
444
+ AUTO_CFG=$(node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs config-get workflow.auto_advance 2>/dev/null || echo "false")
445
+ ```
406
446
 
447
+ **If `--auto` flag present AND `AUTO_CFG` is not true:** Persist auto-advance to config (handles direct `--auto` usage without new-project):
407
448
  ```bash
408
- git add "${PHASE_DIR}/${PADDED_PHASE}-CONTEXT.md"
409
- git commit -m "$(cat <<'EOF'
410
- docs(${PADDED_PHASE}): capture phase context
449
+ node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs config-set workflow.auto_advance true
450
+ ```
451
+
452
+ **If `--auto` flag present OR `AUTO_CFG` is true:**
453
+
454
+ Display banner:
455
+ ```
456
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
457
+ GSD ► AUTO-ADVANCING TO PLAN
458
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
411
459
 
412
- Phase ${PADDED_PHASE}: ${PHASE_NAME}
413
- - Implementation decisions documented
414
- - Phase boundary established
415
- EOF
416
- )"
460
+ Context captured. Spawning plan-phase...
461
+ ```
462
+
463
+ Spawn plan-phase as task with direct workflow file reference (do NOT use skill tool — Skills don't resolve inside task subagents):
464
+ ```
465
+ task(
466
+ prompt="
467
+ <objective>
468
+ You are the plan-phase orchestrator. Create executable plans for Phase ${PHASE}: ${PHASE_NAME}, then auto-advance to execution.
469
+ </objective>
470
+
471
+ <execution_context>
472
+ @~/.config/opencode/get-shit-done/workflows/plan-phase.md
473
+ @~/.config/opencode/get-shit-done/references/ui-brand.md
474
+ @~/.config/opencode/get-shit-done/references/model-profile-resolution.md
475
+ </execution_context>
476
+
477
+ <arguments>
478
+ PHASE=${PHASE}
479
+ ARGUMENTS='${PHASE} --auto'
480
+ </arguments>
481
+
482
+ <instructions>
483
+ 1. read plan-phase.md from execution_context for your complete workflow
484
+ 2. Follow ALL steps: initialize, validate, load context, research, plan, verify, auto-advance
485
+ 3. When spawning agents (gsd-phase-researcher, gsd-planner, gsd-plan-checker), use task with specified subagent_type and model
486
+ 4. For step 14 (auto-advance to execute): spawn execute-phase as a task with DIRECT file reference — tell it to read execute-phase.md. Include @file refs to execute-phase.md, checkpoints.md, tdd.md, model-profile-resolution.md. Pass --no-transition flag so execute-phase returns results instead of chaining further.
487
+ 5. Do NOT use the skill tool or /gsd- commands. read workflow .md files directly.
488
+ 6. Return: PHASE COMPLETE (full pipeline success), PLANNING COMPLETE (planning done but execute failed/skipped), PLANNING INCONCLUSIVE, or GAPS FOUND
489
+ </instructions>
490
+ ",
491
+ subagent_type="task",
492
+ description="Plan Phase ${PHASE}"
493
+ )
417
494
  ```
418
495
 
419
- Confirm: "Committed: docs(${PADDED_PHASE}): capture phase context"
496
+ **Handle plan-phase return:**
497
+ - **PHASE COMPLETE** → Full chain succeeded. Display:
498
+ ```
499
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
500
+ GSD ► PHASE ${PHASE} COMPLETE
501
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
502
+
503
+ Auto-advance pipeline finished: discuss → plan → execute
504
+
505
+ Next: /gsd-discuss-phase ${NEXT_PHASE} --auto
506
+ */new first → fresh context window*
507
+ ```
508
+ - **PLANNING COMPLETE** → Planning done, execution didn't complete:
509
+ ```
510
+ Auto-advance partial: Planning complete, execution did not finish.
511
+ Continue: /gsd-execute-phase ${PHASE}
512
+ ```
513
+ - **PLANNING INCONCLUSIVE / CHECKPOINT** → Stop chain:
514
+ ```
515
+ Auto-advance stopped: Planning needs input.
516
+ Continue: /gsd-plan-phase ${PHASE}
517
+ ```
518
+ - **GAPS FOUND** → Stop chain:
519
+ ```
520
+ Auto-advance stopped: Gaps found during execution.
521
+ Continue: /gsd-plan-phase ${PHASE} --gaps
522
+ ```
523
+
524
+ **If neither `--auto` nor config enabled:**
525
+ Route to `confirm_creation` step (existing behavior — show manual next steps).
420
526
  </step>
421
527
 
422
528
  </process>
@@ -429,5 +535,6 @@ Confirm: "Committed: docs(${PADDED_PHASE}): capture phase context"
429
535
  - Scope creep redirected to deferred ideas
430
536
  - CONTEXT.md captures actual decisions, not vague vision
431
537
  - Deferred ideas preserved for future phases
538
+ - STATE.md updated with session info
432
539
  - User knows next steps
433
540
  </success_criteria>