gsd-opencode 1.30.0 → 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 (112) hide show
  1. package/agents/gsd-debugger.md +0 -1
  2. package/agents/gsd-doc-verifier.md +207 -0
  3. package/agents/gsd-doc-writer.md +608 -0
  4. package/agents/gsd-executor.md +22 -1
  5. package/agents/gsd-phase-researcher.md +41 -0
  6. package/agents/gsd-plan-checker.md +82 -0
  7. package/agents/gsd-planner.md +123 -194
  8. package/agents/gsd-security-auditor.md +129 -0
  9. package/agents/gsd-ui-auditor.md +40 -0
  10. package/agents/gsd-user-profiler.md +2 -2
  11. package/agents/gsd-verifier.md +84 -18
  12. package/commands/gsd/gsd-add-backlog.md +1 -1
  13. package/commands/gsd/gsd-analyze-dependencies.md +34 -0
  14. package/commands/gsd/gsd-autonomous.md +6 -2
  15. package/commands/gsd/gsd-cleanup.md +5 -0
  16. package/commands/gsd/gsd-debug.md +24 -21
  17. package/commands/gsd/gsd-discuss-phase.md +7 -2
  18. package/commands/gsd/gsd-docs-update.md +48 -0
  19. package/commands/gsd/gsd-execute-phase.md +4 -0
  20. package/commands/gsd/gsd-help.md +2 -0
  21. package/commands/gsd/gsd-join-discord.md +2 -1
  22. package/commands/gsd/gsd-manager.md +1 -0
  23. package/commands/gsd/gsd-new-project.md +4 -0
  24. package/commands/gsd/gsd-plan-phase.md +5 -0
  25. package/commands/gsd/gsd-quick.md +5 -3
  26. package/commands/gsd/gsd-reapply-patches.md +171 -39
  27. package/commands/gsd/gsd-research-phase.md +2 -12
  28. package/commands/gsd/gsd-review-backlog.md +1 -0
  29. package/commands/gsd/gsd-review.md +3 -2
  30. package/commands/gsd/gsd-secure-phase.md +35 -0
  31. package/commands/gsd/gsd-thread.md +1 -1
  32. package/commands/gsd/gsd-workstreams.md +7 -2
  33. package/get-shit-done/bin/gsd-tools.cjs +42 -8
  34. package/get-shit-done/bin/lib/commands.cjs +68 -14
  35. package/get-shit-done/bin/lib/config.cjs +18 -10
  36. package/get-shit-done/bin/lib/core.cjs +383 -80
  37. package/get-shit-done/bin/lib/docs.cjs +267 -0
  38. package/get-shit-done/bin/lib/frontmatter.cjs +47 -2
  39. package/get-shit-done/bin/lib/init.cjs +85 -5
  40. package/get-shit-done/bin/lib/milestone.cjs +21 -0
  41. package/get-shit-done/bin/lib/model-profiles.cjs +2 -0
  42. package/get-shit-done/bin/lib/phase.cjs +232 -189
  43. package/get-shit-done/bin/lib/profile-output.cjs +97 -1
  44. package/get-shit-done/bin/lib/roadmap.cjs +137 -113
  45. package/get-shit-done/bin/lib/schema-detect.cjs +238 -0
  46. package/get-shit-done/bin/lib/security.cjs +5 -3
  47. package/get-shit-done/bin/lib/state.cjs +366 -44
  48. package/get-shit-done/bin/lib/verify.cjs +158 -14
  49. package/get-shit-done/bin/lib/workstream.cjs +6 -2
  50. package/get-shit-done/references/agent-contracts.md +79 -0
  51. package/get-shit-done/references/artifact-types.md +113 -0
  52. package/get-shit-done/references/context-budget.md +49 -0
  53. package/get-shit-done/references/continuation-format.md +15 -15
  54. package/get-shit-done/references/domain-probes.md +125 -0
  55. package/get-shit-done/references/gate-prompts.md +100 -0
  56. package/get-shit-done/references/model-profiles.md +2 -2
  57. package/get-shit-done/references/planner-gap-closure.md +62 -0
  58. package/get-shit-done/references/planner-reviews.md +39 -0
  59. package/get-shit-done/references/planner-revision.md +87 -0
  60. package/get-shit-done/references/planning-config.md +15 -0
  61. package/get-shit-done/references/revision-loop.md +97 -0
  62. package/get-shit-done/references/ui-brand.md +2 -2
  63. package/get-shit-done/references/universal-anti-patterns.md +58 -0
  64. package/get-shit-done/references/workstream-flag.md +56 -3
  65. package/get-shit-done/templates/SECURITY.md +61 -0
  66. package/get-shit-done/templates/VALIDATION.md +3 -3
  67. package/get-shit-done/templates/claude-md.md +27 -4
  68. package/get-shit-done/templates/config.json +4 -0
  69. package/get-shit-done/templates/debug-subagent-prompt.md +2 -6
  70. package/get-shit-done/templates/planner-subagent-prompt.md +2 -10
  71. package/get-shit-done/workflows/add-phase.md +2 -2
  72. package/get-shit-done/workflows/add-todo.md +1 -1
  73. package/get-shit-done/workflows/analyze-dependencies.md +96 -0
  74. package/get-shit-done/workflows/audit-milestone.md +8 -12
  75. package/get-shit-done/workflows/autonomous.md +158 -13
  76. package/get-shit-done/workflows/check-todos.md +2 -2
  77. package/get-shit-done/workflows/complete-milestone.md +13 -4
  78. package/get-shit-done/workflows/diagnose-issues.md +8 -6
  79. package/get-shit-done/workflows/discovery-phase.md +1 -1
  80. package/get-shit-done/workflows/discuss-phase-assumptions.md +22 -4
  81. package/get-shit-done/workflows/discuss-phase-power.md +291 -0
  82. package/get-shit-done/workflows/discuss-phase.md +149 -11
  83. package/get-shit-done/workflows/docs-update.md +1093 -0
  84. package/get-shit-done/workflows/execute-phase.md +362 -66
  85. package/get-shit-done/workflows/execute-plan.md +1 -1
  86. package/get-shit-done/workflows/help.md +9 -6
  87. package/get-shit-done/workflows/insert-phase.md +2 -2
  88. package/get-shit-done/workflows/manager.md +27 -26
  89. package/get-shit-done/workflows/map-codebase.md +10 -32
  90. package/get-shit-done/workflows/new-milestone.md +14 -8
  91. package/get-shit-done/workflows/new-project.md +48 -25
  92. package/get-shit-done/workflows/next.md +1 -1
  93. package/get-shit-done/workflows/note.md +1 -1
  94. package/get-shit-done/workflows/pause-work.md +73 -10
  95. package/get-shit-done/workflows/plan-milestone-gaps.md +2 -2
  96. package/get-shit-done/workflows/plan-phase.md +184 -32
  97. package/get-shit-done/workflows/progress.md +20 -20
  98. package/get-shit-done/workflows/quick.md +102 -84
  99. package/get-shit-done/workflows/research-phase.md +2 -6
  100. package/get-shit-done/workflows/resume-project.md +4 -4
  101. package/get-shit-done/workflows/review.md +56 -3
  102. package/get-shit-done/workflows/secure-phase.md +154 -0
  103. package/get-shit-done/workflows/settings.md +13 -2
  104. package/get-shit-done/workflows/ship.md +13 -4
  105. package/get-shit-done/workflows/transition.md +6 -6
  106. package/get-shit-done/workflows/ui-phase.md +4 -14
  107. package/get-shit-done/workflows/ui-review.md +25 -7
  108. package/get-shit-done/workflows/update.md +165 -16
  109. package/get-shit-done/workflows/validate-phase.md +1 -11
  110. package/get-shit-done/workflows/verify-phase.md +127 -6
  111. package/get-shit-done/workflows/verify-work.md +69 -21
  112. package/package.json +1 -1
@@ -23,7 +23,14 @@ INIT=$(node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" init manage
23
23
  if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
24
24
  ```
25
25
 
26
- Parse JSON for: `milestone_version`, `milestone_name`, `phase_count`, `completed_count`, `in_progress_count`, `phases`, `recommended_actions`, `all_complete`, `waiting_signal`.
26
+ Parse JSON for: `milestone_version`, `milestone_name`, `phase_count`, `completed_count`, `in_progress_count`, `phases`, `recommended_actions`, `all_complete`, `waiting_signal`, `manager_flags`.
27
+
28
+ `manager_flags` contains per-step passthrough flags from config:
29
+ - `manager_flags.discuss` — appended to `/gsd-discuss-phase` args (e.g. `"--auto --analyze"`)
30
+ - `manager_flags.plan` — appended to plan agent init command
31
+ - `manager_flags.execute` — appended to execute agent init command
32
+
33
+ These are empty strings by default. Set via: `gsd-tools config-set manager.flags.discuss "--auto --analyze"`
27
34
 
28
35
  **If error:** Display the error message and exit.
29
36
 
@@ -193,24 +200,24 @@ When the user selects a compound option:
193
200
  2. **Then run the inline discuss:**
194
201
 
195
202
  ```
196
- skill(skill="gsd-discuss-phase", args="{PHASE_NUM}")
203
+ skill(skill="gsd-discuss-phase", args="{PHASE_NUM} {manager_flags.discuss}")
197
204
  ```
198
205
 
199
206
  After discuss completes, loop back to dashboard step (background agents continue running).
200
207
 
201
208
  ### Discuss Phase N
202
209
 
203
- Discussion is interactive — needs user input. Run inline:
210
+ Discussion is interactive — needs user input. Run inline with any configured flags:
204
211
 
205
212
  ```
206
- skill(skill="gsd-discuss-phase", args="{PHASE_NUM}")
213
+ skill(skill="gsd-discuss-phase", args="{PHASE_NUM} {manager_flags.discuss}")
207
214
  ```
208
215
 
209
216
  After discuss completes, loop back to dashboard step.
210
217
 
211
218
  ### Plan Phase N
212
219
 
213
- Planning runs autonomously. Spawn a background agent:
220
+ Planning runs autonomously. Spawn a background agent that delegates to the skill pipeline with any configured flags:
214
221
 
215
222
  ```
216
223
  task(
@@ -221,17 +228,14 @@ task(
221
228
  Working directory: {cwd}
222
229
  Phase: {N} — {phase_name}
223
230
  Goal: {goal}
231
+ Manager flags: {manager_flags.plan}
224
232
 
225
- Steps:
226
- 1. read the plan-phase workflow: cat $HOME/.config/opencode/get-shit-done/workflows/plan-phase.md
227
- 2. Run: node \"$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs\" init plan-phase {N}
228
- 3. Follow the workflow steps to produce PLAN.md files for this phase.
229
- 4. If research is enabled in config, run the research step first.
230
- 5. Spawn a gsd-planner subagent via task() to create the plans.
231
- 6. If plan-checker is enabled, spawn a gsd-plan-checker subagent to verify.
232
- 7. Commit plan files when complete.
233
+ Run the plan-phase skill with any configured manager flags:
234
+ skill(skill=\"gsd-plan-phase\", args=\"{N} --auto {manager_flags.plan}\")
233
235
 
234
- Important: You are running in the background. Do NOT use question make autonomous decisions based on project context. If you hit a blocker, write it to STATE.md as a blocker and stop. Do NOT silently work around permission or file access errors — let them fail so the manager can surface them with resolution hints."
236
+ This delegates to the full plan-phase pipeline including local patches, research, plan-checker, and all quality gates.
237
+
238
+ Important: You are running in the background. Do NOT use question — make autonomous decisions based on project context. If you hit a blocker, write it to STATE.md as a blocker and stop. Do NOT silently work around permission or file access errors — let them fail so the manager can surface them with resolution hints. Do NOT use --no-verify on git commits."
235
239
  )
236
240
  ```
237
241
 
@@ -245,7 +249,7 @@ Loop back to dashboard step.
245
249
 
246
250
  ### Execute Phase N
247
251
 
248
- Execution runs autonomously. Spawn a background agent:
252
+ Execution runs autonomously. Spawn a background agent that delegates to the skill pipeline with any configured flags:
249
253
 
250
254
  ```
251
255
  task(
@@ -256,17 +260,14 @@ task(
256
260
  Working directory: {cwd}
257
261
  Phase: {N} — {phase_name}
258
262
  Goal: {goal}
263
+ Manager flags: {manager_flags.execute}
264
+
265
+ Run the execute-phase skill with any configured manager flags:
266
+ skill(skill=\"gsd-execute-phase\", args=\"{N} {manager_flags.execute}\")
259
267
 
260
- Steps:
261
- 1. read the execute-phase workflow: cat $HOME/.config/opencode/get-shit-done/workflows/execute-phase.md
262
- 2. Run: node \"$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs\" init execute-phase {N}
263
- 3. Follow the workflow steps: discover plans, analyze dependencies, group into waves.
264
- 4. For each wave, spawn gsd-executor subagents via task() to execute plans in parallel.
265
- 5. After all waves complete, spawn a gsd-verifier subagent if verifier is enabled.
266
- 6. Update ROADMAP.md and STATE.md with progress.
267
- 7. Commit all changes.
268
+ This delegates to the full execute-phase pipeline including local patches, branching, wave-based execution, verification, and all quality gates.
268
269
 
269
- Important: You are running in the background. Do NOT use question — make autonomous decisions. Use --no-verify on git commits. If you hit a permission error, file lock, or any access issue, do NOT work around it — let it fail and write the error to STATE.md as a blocker so the manager can surface it with resolution guidance."
270
+ Important: You are running in the background. Do NOT use question — make autonomous decisions. Do NOT use --no-verify on git commits — let pre-commit hooks run normally. If you hit a permission error, file lock, or any access issue, do NOT work around it — let it fail and write the error to STATE.md as a blocker so the manager can surface it with resolution guidance."
270
271
  )
271
272
  ```
272
273
 
@@ -306,7 +307,7 @@ Classify the error:
306
307
  - **question:** "Phase {N} failed — permission denied for `{tool_or_command}`. Want me to add it to settings.local.json so it's allowed?"
307
308
  - **options:** "Add permission and retry" / "Run this phase inline instead" / "Skip and continue"
308
309
  - "Add permission and retry": Use `skill(skill="update-config")` to add the permission to `settings.local.json`, then re-spawn the background agent. Loop to dashboard.
309
- - "Run this phase inline instead": Dispatch the same action (plan/execute) inline via `skill()` instead of a background task. Loop to dashboard after.
310
+ - "Run this phase inline instead": Dispatch the same action inline via the appropriate skill — use `skill(skill="gsd-plan-phase", args="{N}")` if the failed action was planning, or `skill(skill="gsd-execute-phase", args="{N}")` if the failed action was execution. Loop to dashboard after.
310
311
  - "Skip and continue": Loop to dashboard (phase stays in current state).
311
312
 
312
313
  **Other errors** (git lock, file conflict, logic error, etc.):
@@ -314,7 +315,7 @@ Classify the error:
314
315
  - **question:** "Background agent for Phase {N} encountered an issue: {error}. What next?"
315
316
  - **options:** "Retry" / "Run inline instead" / "Skip and continue" / "View details"
316
317
  - "Retry": Re-spawn the same background agent. Loop to dashboard.
317
- - "Run inline instead": Dispatch the action inline via `skill()`. Loop to dashboard after.
318
+ - "Run inline instead": Dispatch the action inline via the appropriate skill — use `skill(skill="gsd-plan-phase", args="{N}")` if the failed action was planning, or `skill(skill="gsd-execute-phase", args="{N}")` if the failed action was execution. Loop to dashboard after.
318
319
  - "Skip and continue": Loop to dashboard (phase stays in current state).
319
320
  - "View details": read STATE.md blockers section, display, then re-present options.
320
321
 
@@ -36,7 +36,7 @@ if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
36
36
  AGENT_SKILLS_MAPPER=$(node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" agent-skills gsd-codebase-mapper 2>/dev/null)
37
37
  ```
38
38
 
39
- Extract from init JSON: `mapper_model`, `commit_docs`, `codebase_dir`, `existing_maps`, `has_maps`, `codebase_dir_exists`.
39
+ Extract from init JSON: `mapper_model`, `commit_docs`, `codebase_dir`, `existing_maps`, `has_maps`, `codebase_dir_exists`, `subagent_timeout`.
40
40
  </step>
41
41
 
42
42
  <step name="check_existing">
@@ -108,12 +108,7 @@ Use task tool with `subagent_type="gsd-codebase-mapper"`, `model="{mapper_model}
108
108
  **Agent 1: Tech Focus**
109
109
 
110
110
  ```
111
- task(
112
- subagent_type="gsd-codebase-mapper",
113
- model="{mapper_model}",
114
- run_in_background=true,
115
- description="Map codebase tech stack",
116
- prompt="Focus: tech
111
+ @gsd-codebase-mapper "Focus: tech
117
112
 
118
113
  Analyze this codebase for technology stack and external integrations.
119
114
 
@@ -123,18 +118,12 @@ write these documents to .planning/codebase/:
123
118
 
124
119
  Explore thoroughly. write documents directly using templates. Return confirmation only.
125
120
  ${AGENT_SKILLS_MAPPER}"
126
- )
127
121
  ```
128
122
 
129
123
  **Agent 2: Architecture Focus**
130
124
 
131
125
  ```
132
- task(
133
- subagent_type="gsd-codebase-mapper",
134
- model="{mapper_model}",
135
- run_in_background=true,
136
- description="Map codebase architecture",
137
- prompt="Focus: arch
126
+ @gsd-codebase-mapper "Focus: arch
138
127
 
139
128
  Analyze this codebase architecture and directory structure.
140
129
 
@@ -144,18 +133,12 @@ write these documents to .planning/codebase/:
144
133
 
145
134
  Explore thoroughly. write documents directly using templates. Return confirmation only.
146
135
  ${AGENT_SKILLS_MAPPER}"
147
- )
148
136
  ```
149
137
 
150
138
  **Agent 3: Quality Focus**
151
139
 
152
140
  ```
153
- task(
154
- subagent_type="gsd-codebase-mapper",
155
- model="{mapper_model}",
156
- run_in_background=true,
157
- description="Map codebase conventions",
158
- prompt="Focus: quality
141
+ @gsd-codebase-mapper "Focus: quality
159
142
 
160
143
  Analyze this codebase for coding conventions and testing patterns.
161
144
 
@@ -165,18 +148,12 @@ write these documents to .planning/codebase/:
165
148
 
166
149
  Explore thoroughly. write documents directly using templates. Return confirmation only.
167
150
  ${AGENT_SKILLS_MAPPER}"
168
- )
169
151
  ```
170
152
 
171
153
  **Agent 4: Concerns Focus**
172
154
 
173
155
  ```
174
- task(
175
- subagent_type="gsd-codebase-mapper",
176
- model="{mapper_model}",
177
- run_in_background=true,
178
- description="Map codebase concerns",
179
- prompt="Focus: concerns
156
+ @gsd-codebase-mapper "Focus: concerns
180
157
 
181
158
  Analyze this codebase for technical debt, known issues, and areas of concern.
182
159
 
@@ -185,7 +162,6 @@ write this document to .planning/codebase/:
185
162
 
186
163
  Explore thoroughly. write document directly using template. Return confirmation only.
187
164
  ${AGENT_SKILLS_MAPPER}"
188
- )
189
165
  ```
190
166
 
191
167
  Continue to collect_confirmations.
@@ -199,9 +175,11 @@ Wait for all 4 agents to complete using TaskOutput tool.
199
175
  TaskOutput tool:
200
176
  task_id: "{task_id from Agent result}"
201
177
  block: true
202
- timeout: 300000
178
+ timeout: {subagent_timeout from init context, default 300000}
203
179
  ```
204
180
 
181
+ > The timeout is configurable via `workflow.subagent_timeout` in `.planning/config.json` (milliseconds). Default: 300000 (5 minutes). Increase for large codebases or slower models.
182
+
205
183
  Call TaskOutput for all 4 agents in parallel (single message with 4 TaskOutput calls).
206
184
 
207
185
  Once all TaskOutput calls return, read each agent's output file to collect confirmations.
@@ -347,9 +325,9 @@ Created .planning/codebase/:
347
325
 
348
326
  **Initialize project** — use codebase context for planning
349
327
 
350
- `/gsd-new-project`
328
+ `/new` then:
351
329
 
352
- *`/new` first → fresh context window*
330
+ `/gsd-new-project`
353
331
 
354
332
  ---
355
333
 
@@ -137,6 +137,12 @@ Keep Accumulated Context section from previous milestone.
137
137
 
138
138
  Delete MILESTONE-CONTEXT.md if exists (consumed).
139
139
 
140
+ Clear leftover phase directories from the previous milestone:
141
+
142
+ ```bash
143
+ node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" phases clear
144
+ ```
145
+
140
146
  ```bash
141
147
  node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" commit "docs: start milestone v[X.Y] [Name]" --files .planning/PROJECT.md .planning/STATE.md
142
148
  ```
@@ -210,7 +216,7 @@ Spawn 4 parallel gsd-project-researcher agents. Each uses this template with dim
210
216
 
211
217
  **Common structure for all 4 researchers:**
212
218
  ```
213
- task(prompt="
219
+ @gsd-project-researcher "
214
220
  <research_type>Project Research — {DIMENSION} for [new features].</research_type>
215
221
 
216
222
  <milestone_context>
@@ -235,7 +241,7 @@ ${AGENT_SKILLS_RESEARCHER}
235
241
  write to: .planning/research/{FILE}
236
242
  Use template: $HOME/.config/opencode/get-shit-done/templates/research-project/{FILE}
237
243
  </output>
238
- ", subagent_type="gsd-project-researcher", model="{researcher_model}", description="{DIMENSION} research")
244
+ "
239
245
  ```
240
246
 
241
247
  **Dimension-specific fields:**
@@ -251,7 +257,7 @@ Use template: $HOME/.config/opencode/get-shit-done/templates/research-project/{F
251
257
  After all 4 complete, spawn synthesizer:
252
258
 
253
259
  ```
254
- task(prompt="
260
+ @gsd-research-synthesizer "
255
261
  Synthesize research outputs into SUMMARY.md.
256
262
 
257
263
  <files_to_read>
@@ -266,7 +272,7 @@ ${AGENT_SKILLS_SYNTHESIZER}
266
272
  write to: .planning/research/SUMMARY.md
267
273
  Use template: $HOME/.config/opencode/get-shit-done/templates/research-project/SUMMARY.md
268
274
  Commit after writing.
269
- ", subagent_type="gsd-research-synthesizer", model="{synthesizer_model}", description="Synthesize research")
275
+ "
270
276
  ```
271
277
 
272
278
  Display key findings from SUMMARY.md:
@@ -368,7 +374,7 @@ node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" commit "docs: defi
368
374
  - Otherwise, continue from the previous milestone's last phase number (v1.0 ended at phase 5 → v1.1 starts at phase 6)
369
375
 
370
376
  ```
371
- task(prompt="
377
+ @gsd-roadmapper "
372
378
  <planning_context>
373
379
  <files_to_read>
374
380
  - .planning/PROJECT.md
@@ -396,7 +402,7 @@ Create roadmap for milestone v[X.Y]:
396
402
 
397
403
  write files first, then return.
398
404
  </instructions>
399
- ", subagent_type="gsd-roadmapper", model="{roadmapper_model}", description="Create roadmap")
405
+ "
400
406
  ```
401
407
 
402
408
  **Handle return:**
@@ -459,9 +465,9 @@ node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" commit "docs: crea
459
465
 
460
466
  **Phase [N]: [Phase Name]** — [Goal]
461
467
 
462
- `/gsd-discuss-phase [N] ${GSD_WS}` — gather context and clarify approach
468
+ `/new` then:
463
469
 
464
- *`/new` first fresh context window*
470
+ `/gsd-discuss-phase [N] ${GSD_WS}` gather context and clarify approach
465
471
 
466
472
  Also: `/gsd-plan-phase [N] ${GSD_WS}` — skip discussion, plan directly
467
473
  ```
@@ -66,6 +66,29 @@ AGENT_SKILLS_ROADMAPPER=$(node "$HOME/.config/opencode/get-shit-done/bin/gsd-too
66
66
 
67
67
  Parse JSON for: `researcher_model`, `synthesizer_model`, `roadmapper_model`, `commit_docs`, `project_exists`, `has_codebase_map`, `planning_exists`, `has_existing_code`, `has_package_file`, `is_brownfield`, `needs_codebase_map`, `has_git`, `project_path`.
68
68
 
69
+ **Detect runtime and set instruction file name:**
70
+
71
+ Derive `RUNTIME` from the invoking prompt's `execution_context` path:
72
+ - Path contains `/.codex/` → `RUNTIME=codex`
73
+ - Path contains `/.gemini/` → `RUNTIME=gemini`
74
+ - Path contains `/.config/opencode/` or `/.opencode/` → `RUNTIME=opencode`
75
+ - Otherwise → `RUNTIME=OpenCode`
76
+
77
+ If `execution_context` path is not available, fall back to env vars:
78
+ ```bash
79
+ if [ -n "$CODEX_HOME" ]; then RUNTIME="codex"
80
+ elif [ -n "$GEMINI_CONFIG_DIR" ]; then RUNTIME="gemini"
81
+ elif [ -n "$OPENCODE_CONFIG_DIR" ] || [ -n "$OPENCODE_CONFIG" ]; then RUNTIME="opencode"
82
+ else RUNTIME="OpenCode"; fi
83
+ ```
84
+
85
+ Set the instruction file variable:
86
+ ```bash
87
+ if [ "$RUNTIME" = "codex" ]; then INSTRUCTION_FILE="AGENTS.md"; else INSTRUCTION_FILE="AGENTS.md"; fi
88
+ ```
89
+
90
+ All subsequent references to the project instruction file use `$INSTRUCTION_FILE`.
91
+
69
92
  **If `project_exists` is true:** Error — project already initialized. Use `/gsd-progress`.
70
93
 
71
94
  **If `has_git` is false:** Initialize git:
@@ -614,7 +637,7 @@ Display spawning indicator:
614
637
  Spawn 4 parallel gsd-project-researcher agents with path references:
615
638
 
616
639
  ```
617
- task(prompt="<research_type>
640
+ @gsd-project-researcher "<research_type>
618
641
  Project Research — Stack dimension for [domain].
619
642
  </research_type>
620
643
 
@@ -652,9 +675,9 @@ Your STACK.md feeds into roadmap creation. Be prescriptive:
652
675
  write to: .planning/research/STACK.md
653
676
  Use template: $HOME/.config/opencode/get-shit-done/templates/research-project/STACK.md
654
677
  </output>
655
- ", subagent_type="gsd-project-researcher", model="{researcher_model}", description="Stack research")
678
+ "
656
679
 
657
- task(prompt="<research_type>
680
+ @gsd-project-researcher "<research_type>
658
681
  Project Research — Features dimension for [domain].
659
682
  </research_type>
660
683
 
@@ -692,9 +715,9 @@ Your FEATURES.md feeds into requirements definition. Categorize clearly:
692
715
  write to: .planning/research/FEATURES.md
693
716
  Use template: $HOME/.config/opencode/get-shit-done/templates/research-project/FEATURES.md
694
717
  </output>
695
- ", subagent_type="gsd-project-researcher", model="{researcher_model}", description="Features research")
718
+ "
696
719
 
697
- task(prompt="<research_type>
720
+ @gsd-project-researcher "<research_type>
698
721
  Project Research — Architecture dimension for [domain].
699
722
  </research_type>
700
723
 
@@ -732,9 +755,9 @@ Your ARCHITECTURE.md informs phase structure in roadmap. Include:
732
755
  write to: .planning/research/ARCHITECTURE.md
733
756
  Use template: $HOME/.config/opencode/get-shit-done/templates/research-project/ARCHITECTURE.md
734
757
  </output>
735
- ", subagent_type="gsd-project-researcher", model="{researcher_model}", description="Architecture research")
758
+ "
736
759
 
737
- task(prompt="<research_type>
760
+ @gsd-project-researcher "<research_type>
738
761
  Project Research — Pitfalls dimension for [domain].
739
762
  </research_type>
740
763
 
@@ -772,13 +795,13 @@ Your PITFALLS.md prevents mistakes in roadmap/planning. For each pitfall:
772
795
  write to: .planning/research/PITFALLS.md
773
796
  Use template: $HOME/.config/opencode/get-shit-done/templates/research-project/PITFALLS.md
774
797
  </output>
775
- ", subagent_type="gsd-project-researcher", model="{researcher_model}", description="Pitfalls research")
798
+ "
776
799
  ```
777
800
 
778
801
  After all 4 agents complete, spawn synthesizer to create SUMMARY.md:
779
802
 
780
803
  ```
781
- task(prompt="
804
+ @gsd-research-synthesizer "
782
805
  <task>
783
806
  Synthesize research outputs into SUMMARY.md.
784
807
  </task>
@@ -797,7 +820,7 @@ write to: .planning/research/SUMMARY.md
797
820
  Use template: $HOME/.config/opencode/get-shit-done/templates/research-project/SUMMARY.md
798
821
  Commit after writing.
799
822
  </output>
800
- ", subagent_type="gsd-research-synthesizer", model="{synthesizer_model}", description="Synthesize research")
823
+ "
801
824
  ```
802
825
 
803
826
  Display research complete banner and key findings:
@@ -987,7 +1010,7 @@ Display stage banner:
987
1010
  Spawn gsd-roadmapper agent with path references:
988
1011
 
989
1012
  ```
990
- task(prompt="
1013
+ @gsd-roadmapper "
991
1014
  <planning_context>
992
1015
 
993
1016
  <files_to_read>
@@ -1012,7 +1035,7 @@ Create roadmap:
1012
1035
 
1013
1036
  write files first, then return. This ensures artifacts persist even if context is lost.
1014
1037
  </instructions>
1015
- ", subagent_type="gsd-roadmapper", model="{roadmapper_model}", description="Create roadmap")
1038
+ "
1016
1039
  ```
1017
1040
 
1018
1041
  **Handle roadmapper return:**
@@ -1084,7 +1107,7 @@ Use question:
1084
1107
  - Re-spawn roadmapper with revision context:
1085
1108
 
1086
1109
  ```
1087
- task(prompt="
1110
+ @gsd-roadmapper "
1088
1111
  <revision>
1089
1112
  User feedback on roadmap:
1090
1113
  [user's notes]
@@ -1098,7 +1121,7 @@ Use question:
1098
1121
  Update the roadmap based on feedback. edit files in place.
1099
1122
  Return ROADMAP REVISED with changes made.
1100
1123
  </revision>
1101
- ", subagent_type="gsd-roadmapper", model="{roadmapper_model}", description="Revise roadmap")
1124
+ "
1102
1125
  ```
1103
1126
 
1104
1127
  - Present revised roadmap
@@ -1106,18 +1129,18 @@ Use question:
1106
1129
 
1107
1130
  **If "Review full file":** Display raw `cat .planning/ROADMAP.md`, then re-ask.
1108
1131
 
1109
- **Generate or refresh project AGENTS.md before final commit:**
1132
+ **Generate or refresh project instruction file before final commit:**
1110
1133
 
1111
1134
  ```bash
1112
- node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" generate-OpenCode-md
1135
+ node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" generate-OpenCode-md --output "$INSTRUCTION_FILE"
1113
1136
  ```
1114
1137
 
1115
- This ensures new projects get the default GSD workflow-enforcement guidance and current project context in `AGENTS.md`.
1138
+ This ensures new projects get the default GSD workflow-enforcement guidance and current project context in `$INSTRUCTION_FILE`.
1116
1139
 
1117
1140
  **Commit roadmap (after approval or auto mode):**
1118
1141
 
1119
1142
  ```bash
1120
- node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" commit "docs: create roadmap ([N] phases)" --files .planning/ROADMAP.md .planning/STATE.md .planning/REQUIREMENTS.md AGENTS.md
1143
+ node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" commit "docs: create roadmap ([N] phases)" --files .planning/ROADMAP.md .planning/STATE.md .planning/REQUIREMENTS.md "$INSTRUCTION_FILE"
1121
1144
  ```
1122
1145
 
1123
1146
  ## 9. Done
@@ -1138,7 +1161,7 @@ Present completion summary:
1138
1161
  | Research | `.planning/research/` |
1139
1162
  | Requirements | `.planning/REQUIREMENTS.md` |
1140
1163
  | Roadmap | `.planning/ROADMAP.md` |
1141
- | Project guide | `AGENTS.md` |
1164
+ | Project guide | `$INSTRUCTION_FILE` |
1142
1165
 
1143
1166
  **[N] phases** | **[X] requirements** | Ready to build ✓
1144
1167
  ```
@@ -1171,9 +1194,9 @@ PHASE1_HAS_UI=$(echo "$PHASE1_SECTION" | grep -qi "UI hint.*yes" && echo "true"
1171
1194
 
1172
1195
  **Phase 1: [Phase Name]** — [Goal from ROADMAP.md]
1173
1196
 
1174
- /gsd-discuss-phase 1 — gather context and clarify approach
1197
+ /new then:
1175
1198
 
1176
- */new first fresh context window*
1199
+ /gsd-discuss-phase 1 gather context and clarify approach
1177
1200
 
1178
1201
  ---
1179
1202
 
@@ -1193,9 +1216,9 @@ PHASE1_HAS_UI=$(echo "$PHASE1_SECTION" | grep -qi "UI hint.*yes" && echo "true"
1193
1216
 
1194
1217
  **Phase 1: [Phase Name]** — [Goal from ROADMAP.md]
1195
1218
 
1196
- /gsd-discuss-phase 1 — gather context and clarify approach
1219
+ /new then:
1197
1220
 
1198
- */new first fresh context window*
1221
+ /gsd-discuss-phase 1 gather context and clarify approach
1199
1222
 
1200
1223
  ---
1201
1224
 
@@ -1220,7 +1243,7 @@ PHASE1_HAS_UI=$(echo "$PHASE1_SECTION" | grep -qi "UI hint.*yes" && echo "true"
1220
1243
  - `.planning/REQUIREMENTS.md`
1221
1244
  - `.planning/ROADMAP.md`
1222
1245
  - `.planning/STATE.md`
1223
- - `AGENTS.md`
1246
+ - `$INSTRUCTION_FILE` (`AGENTS.md` for Codex, `AGENTS.md` for all other runtimes)
1224
1247
 
1225
1248
  </output>
1226
1249
 
@@ -1242,7 +1265,7 @@ PHASE1_HAS_UI=$(echo "$PHASE1_SECTION" | grep -qi "UI hint.*yes" && echo "true"
1242
1265
  - [ ] ROADMAP.md created with phases, requirement mappings, success criteria
1243
1266
  - [ ] STATE.md initialized
1244
1267
  - [ ] REQUIREMENTS.md traceability updated
1245
- - [ ] AGENTS.md generated with GSD workflow guidance
1268
+ - [ ] `$INSTRUCTION_FILE` generated with GSD workflow guidance (AGENTS.md for Codex, AGENTS.md otherwise)
1246
1269
  - [ ] User knows next step is `/gsd-discuss-phase 1`
1247
1270
 
1248
1271
  **Atomic commits:** Each phase commits its artifacts immediately. If context is lost, artifacts persist.
@@ -55,7 +55,7 @@ If plans exist but not all have matching summaries:
55
55
 
56
56
  **Route 5: All plans have summaries → verify and complete**
57
57
  If all plans in the current phase have summaries:
58
- → Next action: `/gsd-verify-work` then `/gsd-complete-phase`
58
+ → Next action: `/gsd-verify-work`
59
59
 
60
60
  **Route 6: Phase complete, next phase exists → advance**
61
61
  If the current phase is complete and the next phase exists in ROADMAP:
@@ -101,7 +101,7 @@ If a scope has no directory or no entries, show: `(no notes)`
101
101
  3. If N is invalid or refers to an already-promoted note, tell the user and stop
102
102
  4. **Requires `.planning/` directory** — if it doesn't exist, warn: "Todos require a GSD project. Run `/gsd-new-project` to initialize one."
103
103
  5. Ensure `.planning/todos/pending/` directory exists
104
- 6. Generate todo ID: `{NNN}-{slug}` where NNN is the next sequential number (scan both `.planning/todos/pending/` and `.planning/todos/done/` for the highest existing number, increment by 1, zero-pad to 3 digits) and slug is the first ~4 meaningful words of the note text
104
+ 6. Generate todo ID: `{NNN}-{slug}` where NNN is the next sequential number (scan both `.planning/todos/pending/` and `.planning/todos/completed/` for the highest existing number, increment by 1, zero-pad to 3 digits) and slug is the first ~4 meaningful words of the note text
105
105
  7. Extract the note text from the source file (body after frontmatter)
106
106
  8. Create `.planning/todos/pending/{id}.md`:
107
107