gsd-opencode 1.20.4 → 1.22.1

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 (110) hide show
  1. package/agents/gsd-codebase-mapper.md +10 -1
  2. package/agents/gsd-debugger.md +67 -10
  3. package/agents/gsd-executor.md +37 -16
  4. package/agents/gsd-integration-checker.md +3 -0
  5. package/agents/gsd-nyquist-auditor.md +179 -0
  6. package/agents/gsd-phase-researcher.md +29 -34
  7. package/agents/gsd-plan-checker.md +43 -78
  8. package/agents/gsd-planner.md +140 -24
  9. package/agents/gsd-project-researcher.md +12 -1
  10. package/agents/gsd-research-synthesizer.md +14 -3
  11. package/agents/gsd-roadmapper.md +26 -15
  12. package/agents/gsd-verifier.md +30 -6
  13. package/bin/dm/lib/constants.js +6 -1
  14. package/bin/dm/src/services/file-ops.js +14 -1
  15. package/commands/gsd/gsd-add-phase.md +6 -6
  16. package/commands/gsd/gsd-add-tests.md +41 -0
  17. package/commands/gsd/gsd-add-todo.md +7 -7
  18. package/commands/gsd/gsd-audit-milestone.md +9 -9
  19. package/commands/gsd/gsd-check-profile.md +3 -3
  20. package/commands/gsd/gsd-check-todos.md +7 -7
  21. package/commands/gsd/gsd-cleanup.md +2 -2
  22. package/commands/gsd/gsd-complete-milestone.md +6 -6
  23. package/commands/gsd/gsd-debug.md +11 -7
  24. package/commands/gsd/gsd-discuss-phase.md +26 -19
  25. package/commands/gsd/gsd-execute-phase.md +13 -13
  26. package/commands/gsd/gsd-health.md +7 -7
  27. package/commands/gsd/gsd-help.md +2 -2
  28. package/commands/gsd/gsd-insert-phase.md +6 -6
  29. package/commands/gsd/gsd-join-discord.md +1 -1
  30. package/commands/gsd/gsd-list-phase-assumptions.md +6 -6
  31. package/commands/gsd/gsd-map-codebase.md +8 -8
  32. package/commands/gsd/gsd-new-milestone.md +12 -12
  33. package/commands/gsd/gsd-new-project.md +12 -12
  34. package/commands/gsd/gsd-pause-work.md +6 -6
  35. package/commands/gsd/gsd-plan-milestone-gaps.md +9 -9
  36. package/commands/gsd/gsd-plan-phase.md +14 -13
  37. package/commands/gsd/gsd-progress.md +8 -8
  38. package/commands/gsd/gsd-quick.md +17 -13
  39. package/commands/gsd/gsd-reapply-patches.md +20 -9
  40. package/commands/gsd/gsd-remove-phase.md +7 -7
  41. package/commands/gsd/gsd-research-phase.md +12 -11
  42. package/commands/gsd/gsd-resume-work.md +8 -8
  43. package/commands/gsd/gsd-set-profile.md +6 -6
  44. package/commands/gsd/gsd-settings.md +7 -7
  45. package/commands/gsd/gsd-update.md +5 -5
  46. package/commands/gsd/gsd-validate-phase.md +35 -0
  47. package/commands/gsd/gsd-verify-work.md +11 -11
  48. package/get-shit-done/bin/gsd-tools.cjs +45 -6
  49. package/get-shit-done/bin/lib/commands.cjs +11 -19
  50. package/get-shit-done/bin/lib/config.cjs +8 -1
  51. package/get-shit-done/bin/lib/core.cjs +131 -16
  52. package/get-shit-done/bin/lib/init.cjs +28 -12
  53. package/get-shit-done/bin/lib/milestone.cjs +34 -8
  54. package/get-shit-done/bin/lib/phase.cjs +74 -50
  55. package/get-shit-done/bin/lib/roadmap.cjs +7 -7
  56. package/get-shit-done/bin/lib/state.cjs +294 -63
  57. package/get-shit-done/bin/lib/template.cjs +3 -3
  58. package/get-shit-done/bin/lib/verify.cjs +56 -8
  59. package/get-shit-done/references/checkpoints.md +1 -1
  60. package/get-shit-done/references/decimal-phase-calculation.md +6 -6
  61. package/get-shit-done/references/git-integration.md +3 -3
  62. package/get-shit-done/references/git-planning-commit.md +2 -2
  63. package/get-shit-done/references/model-profile-resolution.md +1 -1
  64. package/get-shit-done/references/model-profiles.md +1 -0
  65. package/get-shit-done/references/phase-argument-parsing.md +4 -4
  66. package/get-shit-done/references/planning-config.md +10 -6
  67. package/get-shit-done/references/questioning.md +17 -0
  68. package/get-shit-done/references/verification-patterns.md +1 -1
  69. package/get-shit-done/templates/DEBUG.md +7 -2
  70. package/get-shit-done/templates/VALIDATION.md +18 -46
  71. package/get-shit-done/templates/codebase/structure.md +3 -3
  72. package/get-shit-done/templates/config.json +2 -2
  73. package/get-shit-done/templates/context.md +14 -0
  74. package/get-shit-done/templates/phase-prompt.md +10 -10
  75. package/get-shit-done/templates/retrospective.md +54 -0
  76. package/get-shit-done/templates/roadmap.md +1 -1
  77. package/get-shit-done/workflows/add-phase.md +3 -2
  78. package/get-shit-done/workflows/add-tests.md +351 -0
  79. package/get-shit-done/workflows/add-todo.md +4 -3
  80. package/get-shit-done/workflows/audit-milestone.md +40 -5
  81. package/get-shit-done/workflows/check-todos.md +3 -2
  82. package/get-shit-done/workflows/cleanup.md +1 -1
  83. package/get-shit-done/workflows/complete-milestone.md +69 -5
  84. package/get-shit-done/workflows/diagnose-issues.md +2 -2
  85. package/get-shit-done/workflows/discovery-phase.md +6 -6
  86. package/get-shit-done/workflows/discuss-phase.md +194 -58
  87. package/get-shit-done/workflows/execute-phase.md +29 -23
  88. package/get-shit-done/workflows/execute-plan.md +22 -18
  89. package/get-shit-done/workflows/health.md +5 -2
  90. package/get-shit-done/workflows/help.md +4 -1
  91. package/get-shit-done/workflows/insert-phase.md +3 -2
  92. package/get-shit-done/workflows/map-codebase.md +3 -2
  93. package/get-shit-done/workflows/new-milestone.md +12 -10
  94. package/get-shit-done/workflows/new-project.md +44 -49
  95. package/get-shit-done/workflows/pause-work.md +2 -2
  96. package/get-shit-done/workflows/plan-milestone-gaps.md +3 -3
  97. package/get-shit-done/workflows/plan-phase.md +155 -73
  98. package/get-shit-done/workflows/progress.md +8 -7
  99. package/get-shit-done/workflows/quick.md +158 -10
  100. package/get-shit-done/workflows/remove-phase.md +5 -4
  101. package/get-shit-done/workflows/research-phase.md +5 -4
  102. package/get-shit-done/workflows/resume-project.md +3 -2
  103. package/get-shit-done/workflows/set-profile.md +3 -2
  104. package/get-shit-done/workflows/settings.md +6 -6
  105. package/get-shit-done/workflows/transition.md +5 -5
  106. package/get-shit-done/workflows/update.md +45 -19
  107. package/get-shit-done/workflows/validate-phase.md +167 -0
  108. package/get-shit-done/workflows/verify-phase.md +10 -9
  109. package/get-shit-done/workflows/verify-work.md +18 -4
  110. package/package.json +1 -1
@@ -12,7 +12,8 @@ read all files referenced by the invoking prompt's execution_context before star
12
12
  **Load progress context (paths only):**
13
13
 
14
14
  ```bash
15
- INIT=$(node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs init progress)
15
+ INIT=$(node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" init progress)
16
+ if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
16
17
  ```
17
18
 
18
19
  Extract from init JSON: `project_exists`, `roadmap_exists`, `state_exists`, `phases`, `current_phase`, `next_phase`, `milestone_version`, `completed_count`, `phase_count`, `paused_at`, `state_path`, `roadmap_path`, `project_path`, `config_path`.
@@ -40,8 +41,8 @@ If missing both ROADMAP.md and PROJECT.md: suggest `/gsd-new-project`.
40
41
  **Use structured extraction from gsd-tools:**
41
42
 
42
43
  Instead of reading full files, use targeted tools to get only the data needed for the report:
43
- - `ROADMAP=$(node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs roadmap analyze)`
44
- - `STATE=$(node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs state-snapshot)`
44
+ - `ROADMAP=$(node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" roadmap analyze)`
45
+ - `STATE=$(node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" state-snapshot)`
45
46
 
46
47
  This minimizes orchestrator context usage.
47
48
  </step>
@@ -50,7 +51,7 @@ This minimizes orchestrator context usage.
50
51
  **Get comprehensive roadmap analysis (replaces manual parsing):**
51
52
 
52
53
  ```bash
53
- ROADMAP=$(node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs roadmap analyze)
54
+ ROADMAP=$(node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" roadmap analyze)
54
55
  ```
55
56
 
56
57
  This returns structured JSON with:
@@ -69,7 +70,7 @@ Use this instead of manually reading/parsing ROADMAP.md.
69
70
  - Find the 2-3 most recent SUMMARY.md files
70
71
  - Use `summary-extract` for efficient parsing:
71
72
  ```bash
72
- node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs summary-extract <path> --fields one_liner
73
+ node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" summary-extract <path> --fields one_liner
73
74
  ```
74
75
  - This shows "what we've been working on"
75
76
  </step>
@@ -88,7 +89,7 @@ Use this instead of manually reading/parsing ROADMAP.md.
88
89
 
89
90
  ```bash
90
91
  # Get formatted progress bar
91
- PROGRESS_BAR=$(node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs progress bar --raw)
92
+ PROGRESS_BAR=$(node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" progress bar --raw)
92
93
  ```
93
94
 
94
95
  Present:
@@ -97,7 +98,7 @@ Present:
97
98
  # [Project Name]
98
99
 
99
100
  **Progress:** {PROGRESS_BAR}
100
- **Profile:** [simple/smart/custom]
101
+ **Profile:** [simple/smart/genius]
101
102
 
102
103
  ## Recent Work
103
104
  - [Phase X, Plan Y]: [what was accomplished - 1 line from summary-extract]
@@ -1,7 +1,11 @@
1
1
  <purpose>
2
2
  Execute small, ad-hoc tasks with GSD guarantees (atomic commits, STATE.md tracking). Quick mode spawns gsd-planner (quick mode) + gsd-executor(s), tracks tasks in `.planning/quick/`, and updates STATE.md's "Quick Tasks Completed" table.
3
3
 
4
+ With `--discuss` flag: lightweight discussion phase before planning. Surfaces assumptions, clarifies gray areas, captures decisions in CONTEXT.md so the planner treats them as locked.
5
+
4
6
  With `--full` flag: enables plan-checking (max 2 iterations) and post-execution verification for quality guarantees without full milestone ceremony.
7
+
8
+ Flags are composable: `--discuss --full` gives discussion + plan-checking + verification.
5
9
  </purpose>
6
10
 
7
11
  <required_reading>
@@ -13,6 +17,7 @@ read all files referenced by the invoking prompt's execution_context before star
13
17
 
14
18
  Parse `$ARGUMENTS` for:
15
19
  - `--full` flag → store as `$FULL_MODE` (true/false)
20
+ - `--discuss` flag → store as `$DISCUSS_MODE` (true/false)
16
21
  - Remaining text → use as `$DESCRIPTION` if non-empty
17
22
 
18
23
  If `$DESCRIPTION` is empty after parsing, prompt user interactively:
@@ -29,7 +34,27 @@ Store response as `$DESCRIPTION`.
29
34
 
30
35
  If still empty, re-prompt: "Please provide a task description."
31
36
 
32
- If `$FULL_MODE`:
37
+ Display banner based on active flags:
38
+
39
+ If `$DISCUSS_MODE` and `$FULL_MODE`:
40
+ ```
41
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
42
+ GSD ► QUICK TASK (DISCUSS + FULL)
43
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
44
+
45
+ ◆ Discussion + plan checking + verification enabled
46
+ ```
47
+
48
+ If `$DISCUSS_MODE` only:
49
+ ```
50
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
51
+ GSD ► QUICK TASK (DISCUSS)
52
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
53
+
54
+ ◆ Discussion phase enabled — surfacing gray areas before planning
55
+ ```
56
+
57
+ If `$FULL_MODE` only:
33
58
  ```
34
59
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
35
60
  GSD ► QUICK TASK (FULL MODE)
@@ -43,7 +68,8 @@ If `$FULL_MODE`:
43
68
  **Step 2: Initialize**
44
69
 
45
70
  ```bash
46
- INIT=$(node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs init quick "$DESCRIPTION")
71
+ INIT=$(node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" init quick "$DESCRIPTION")
72
+ if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
47
73
  ```
48
74
 
49
75
  Parse JSON for: `planner_model`, `executor_model`, `checker_model`, `verifier_model`, `commit_docs`, `next_num`, `slug`, `date`, `timestamp`, `quick_dir`, `task_dir`, `roadmap_exists`, `planning_exists`.
@@ -81,6 +107,124 @@ Store `$QUICK_DIR` for use in orchestration.
81
107
 
82
108
  ---
83
109
 
110
+ **Step 4.5: Discussion phase (only when `$DISCUSS_MODE`)**
111
+
112
+ Skip this step entirely if NOT `$DISCUSS_MODE`.
113
+
114
+ Display banner:
115
+ ```
116
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
117
+ GSD ► DISCUSSING QUICK TASK
118
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
119
+
120
+ ◆ Surfacing gray areas for: ${DESCRIPTION}
121
+ ```
122
+
123
+ **4.5a. Identify gray areas**
124
+
125
+ Analyze `$DESCRIPTION` to identify 2-4 gray areas — implementation decisions that would change the outcome and that the user should weigh in on.
126
+
127
+ Use the domain-aware heuristic to generate phase-specific (not generic) gray areas:
128
+ - Something users **SEE** → layout, density, interactions, states
129
+ - Something users **CALL** → responses, errors, auth, versioning
130
+ - Something users **RUN** → output format, flags, modes, error handling
131
+ - Something users **READ** → structure, tone, depth, flow
132
+ - Something being **ORGANIZED** → criteria, grouping, naming, exceptions
133
+
134
+ Each gray area should be a concrete decision point, not a vague category. Example: "Loading behavior" not "UX".
135
+
136
+ **4.5b. Present gray areas**
137
+
138
+ ```
139
+ question(
140
+ header: "Gray Areas",
141
+ question: "Which areas need clarification before planning?",
142
+ options: [
143
+ { label: "${area_1}", description: "${why_it_matters_1}" },
144
+ { label: "${area_2}", description: "${why_it_matters_2}" },
145
+ { label: "${area_3}", description: "${why_it_matters_3}" },
146
+ { label: "All clear", description: "Skip discussion — I know what I want" }
147
+ ],
148
+ multiSelect: true
149
+ )
150
+ ```
151
+
152
+ If user selects "All clear" → skip to Step 5 (no CONTEXT.md written).
153
+
154
+ **4.5c. Discuss selected areas**
155
+
156
+ For each selected area, ask 1-2 focused questions via question:
157
+
158
+ ```
159
+ question(
160
+ header: "${area_name}",
161
+ question: "${specific_question_about_this_area}",
162
+ options: [
163
+ { label: "${concrete_choice_1}", description: "${what_this_means}" },
164
+ { label: "${concrete_choice_2}", description: "${what_this_means}" },
165
+ { label: "${concrete_choice_3}", description: "${what_this_means}" },
166
+ { label: "You decide", description: "OpenCode's discretion" }
167
+ ],
168
+ multiSelect: false
169
+ )
170
+ ```
171
+
172
+ Rules:
173
+ - Options must be concrete choices, not abstract categories
174
+ - Highlight recommended choice where you have a clear opinion
175
+ - If user selects "Other" with freeform text, switch to plain text follow-up (per questioning.md freeform rule)
176
+ - If user selects "You decide", capture as OpenCode's Discretion in CONTEXT.md
177
+ - Max 2 questions per area — this is lightweight, not a deep dive
178
+
179
+ Collect all decisions into `$DECISIONS`.
180
+
181
+ **4.5d. write CONTEXT.md**
182
+
183
+ write `${QUICK_DIR}/${next_num}-CONTEXT.md` using the standard context template structure:
184
+
185
+ ```markdown
186
+ # Quick task ${next_num}: ${DESCRIPTION} - Context
187
+
188
+ **Gathered:** ${date}
189
+ **Status:** Ready for planning
190
+
191
+ <domain>
192
+ ## task Boundary
193
+
194
+ ${DESCRIPTION}
195
+
196
+ </domain>
197
+
198
+ <decisions>
199
+ ## Implementation Decisions
200
+
201
+ ### ${area_1_name}
202
+ - ${decision_from_discussion}
203
+
204
+ ### ${area_2_name}
205
+ - ${decision_from_discussion}
206
+
207
+ ### OpenCode's Discretion
208
+ ${areas_where_user_said_you_decide_or_areas_not_discussed}
209
+
210
+ </decisions>
211
+
212
+ <specifics>
213
+ ## Specific Ideas
214
+
215
+ ${any_specific_references_or_examples_from_discussion}
216
+
217
+ [If none: "No specific requirements — open to standard approaches"]
218
+
219
+ </specifics>
220
+ ```
221
+
222
+ Note: Quick task CONTEXT.md omits `<code_context>` and `<deferred>` sections (no codebase scouting, no phase scope to defer to). Keep it lean.
223
+
224
+ Report: `Context captured: ${QUICK_DIR}/${next_num}-CONTEXT.md`
225
+
226
+ ---
227
+
84
228
  **Step 5: Spawn planner (quick mode)**
85
229
 
86
230
  **If `$FULL_MODE`:** Use `quick-full` mode with stricter constraints.
@@ -99,9 +243,10 @@ task(
99
243
  <files_to_read>
100
244
  - .planning/STATE.md (Project State)
101
245
  - ./AGENTS.md (if exists — follow project-specific guidelines)
246
+ ${DISCUSS_MODE ? '- ' + QUICK_DIR + '/' + next_num + '-CONTEXT.md (User decisions — locked, do not revisit)' : ''}
102
247
  </files_to_read>
103
248
 
104
- **Project skills:** Check .agents/skills/ directory (if exists) — read SKILL.md files, plans should account for project skill rules
249
+ **Project skills:** Check .OpenCode/skills/ or .agents/skills/ directory (if either exists) — read SKILL.md files, plans should account for project skill rules
105
250
 
106
251
  </planning_context>
107
252
 
@@ -168,7 +313,8 @@ Checker prompt:
168
313
  - Scope sanity: Is this appropriately sized for a quick task (1-3 tasks)?
169
314
  - must_haves derivation: Are must_haves traceable to the task description?
170
315
 
171
- Skip: context compliance (no CONTEXT.md), cross-plan deps (single plan), ROADMAP alignment
316
+ Skip: cross-plan deps (single plan), ROADMAP alignment
317
+ ${DISCUSS_MODE ? '- Context compliance: Does the plan honor locked decisions from CONTEXT.md?' : '- Skip: context compliance (no CONTEXT.md)'}
172
318
  </check_dimensions>
173
319
 
174
320
  <expected_output>
@@ -222,8 +368,8 @@ Return what changed.
222
368
 
223
369
  ```
224
370
  task(
225
- prompt="First, read ~/.config/opencode/agents/gsd-planner.md for your role and instructions.\n\n" + revision_prompt,
226
- subagent_type="general",
371
+ prompt=revision_prompt,
372
+ subagent_type="gsd-planner",
227
373
  model="{planner_model}",
228
374
  description="Revise quick plan: ${DESCRIPTION}"
229
375
  )
@@ -252,7 +398,7 @@ Execute quick task ${next_num}.
252
398
  - ${QUICK_DIR}/${next_num}-PLAN.md (Plan)
253
399
  - .planning/STATE.md (Project state)
254
400
  - ./AGENTS.md (Project instructions, if exists)
255
- - .agents/skills/ (Project skills, if exists — list skills, read SKILL.md for each, follow relevant rules during implementation)
401
+ - .OpenCode/skills/ or .agents/skills/ (Project skills, if either exists — list skills, read SKILL.md for each, follow relevant rules during implementation)
256
402
  </files_to_read>
257
403
 
258
404
  <constraints>
@@ -389,10 +535,11 @@ Build file list:
389
535
  - `${QUICK_DIR}/${next_num}-PLAN.md`
390
536
  - `${QUICK_DIR}/${next_num}-SUMMARY.md`
391
537
  - `.planning/STATE.md`
538
+ - If `$DISCUSS_MODE` and context file exists: `${QUICK_DIR}/${next_num}-CONTEXT.md`
392
539
  - If `$FULL_MODE` and verification file exists: `${QUICK_DIR}/${next_num}-VERIFICATION.md`
393
540
 
394
541
  ```bash
395
- node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs commit "docs(quick-${next_num}): ${DESCRIPTION}" --files ${file_list}
542
+ node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" commit "docs(quick-${next_num}): ${DESCRIPTION}" --files ${file_list}
396
543
  ```
397
544
 
398
545
  Get final commit hash:
@@ -440,11 +587,12 @@ Ready for next task: /gsd-quick
440
587
  <success_criteria>
441
588
  - [ ] ROADMAP.md validation passes
442
589
  - [ ] User provides task description
443
- - [ ] `--full` flag parsed from arguments when present
590
+ - [ ] `--full` and `--discuss` flags parsed from arguments when present
444
591
  - [ ] Slug generated (lowercase, hyphens, max 40 chars)
445
592
  - [ ] Next number calculated (001, 002, 003...)
446
593
  - [ ] Directory created at `.planning/quick/NNN-slug/`
447
- - [ ] `${next_num}-PLAN.md` created by planner
594
+ - [ ] (--discuss) Gray areas identified and presented, decisions captured in `${next_num}-CONTEXT.md`
595
+ - [ ] `${next_num}-PLAN.md` created by planner (honors CONTEXT.md decisions when --discuss)
448
596
  - [ ] (--full) Plan checker validates plan, revision loop capped at 2
449
597
  - [ ] `${next_num}-SUMMARY.md` created by executor
450
598
  - [ ] (--full) `${next_num}-VERIFICATION.md` created by verifier
@@ -29,7 +29,8 @@ Exit.
29
29
  Load phase operation context:
30
30
 
31
31
  ```bash
32
- INIT=$(node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs init phase-op "${target}")
32
+ INIT=$(node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" init phase-op "${target}")
33
+ if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
33
34
  ```
34
35
 
35
36
  Extract: `phase_found`, `phase_dir`, `phase_number`, `commit_docs`, `roadmap_exists`.
@@ -79,13 +80,13 @@ Wait for confirmation.
79
80
  **Delegate the entire removal operation to gsd-tools:**
80
81
 
81
82
  ```bash
82
- RESULT=$(node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs phase remove "${target}")
83
+ RESULT=$(node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" phase remove "${target}")
83
84
  ```
84
85
 
85
86
  If the phase has executed plans (SUMMARY.md files), gsd-tools will error. Use `--force` only if the user confirms:
86
87
 
87
88
  ```bash
88
- RESULT=$(node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs phase remove "${target}" --force)
89
+ RESULT=$(node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" phase remove "${target}" --force)
89
90
  ```
90
91
 
91
92
  The CLI handles:
@@ -102,7 +103,7 @@ Extract from result: `removed`, `directory_deleted`, `renamed_directories`, `ren
102
103
  Stage and commit the removal:
103
104
 
104
105
  ```bash
105
- node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs commit "chore: remove phase {target} ({original-phase-name})" --files .planning/
106
+ node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" commit "chore: remove phase {target} ({original-phase-name})" --files .planning/
106
107
  ```
107
108
 
108
109
  The commit message preserves the historical record of what was removed.
@@ -8,17 +8,17 @@ Standalone research command. For most workflows, use `/gsd-plan-phase` which int
8
8
 
9
9
  ## Step 0: Resolve Model Profile
10
10
 
11
- @~/.config/opencode/get-shit-done/references/model-profile-resolution.md
11
+ @$HOME/.config/opencode/get-shit-done/references/model-profile-resolution.md
12
12
 
13
13
  Resolve model for:
14
14
  - `gsd-phase-researcher`
15
15
 
16
16
  ## Step 1: Normalize and Validate Phase
17
17
 
18
- @~/.config/opencode/get-shit-done/references/phase-argument-parsing.md
18
+ @$HOME/.config/opencode/get-shit-done/references/phase-argument-parsing.md
19
19
 
20
20
  ```bash
21
- PHASE_INFO=$(node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs roadmap get-phase "${PHASE}")
21
+ PHASE_INFO=$(node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" roadmap get-phase "${PHASE}")
22
22
  ```
23
23
 
24
24
  If `found` is false: Error and exit.
@@ -34,7 +34,8 @@ If exists: Offer update/view/skip options.
34
34
  ## Step 3: Gather Phase Context
35
35
 
36
36
  ```bash
37
- INIT=$(node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs init phase-op "${PHASE}")
37
+ INIT=$(node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" init phase-op "${PHASE}")
38
+ if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
38
39
  # Extract: phase_dir, padded_phase, phase_number, state_path, requirements_path, context_path
39
40
  ```
40
41
 
@@ -11,7 +11,7 @@ Instantly restore full project context so "Where were we?" has an immediate, com
11
11
  </purpose>
12
12
 
13
13
  <required_reading>
14
- @~/.config/opencode/get-shit-done/references/continuation-format.md
14
+ @$HOME/.config/opencode/get-shit-done/references/continuation-format.md
15
15
  </required_reading>
16
16
 
17
17
  <process>
@@ -20,7 +20,8 @@ Instantly restore full project context so "Where were we?" has an immediate, com
20
20
  Load all context in one call:
21
21
 
22
22
  ```bash
23
- INIT=$(node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs init resume)
23
+ INIT=$(node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" init resume)
24
+ if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
24
25
  ```
25
26
 
26
27
  Parse JSON for: `state_exists`, `roadmap_exists`, `project_exists`, `planning_exists`, `has_interrupted_agent`, `interrupted_agent_id`, `commit_docs`.
@@ -23,8 +23,9 @@ if $ARGUMENTS.profile not in ["quality", "balanced", "budget"]:
23
23
  Ensure config exists and load current state:
24
24
 
25
25
  ```bash
26
- node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs config-ensure-section
27
- INIT=$(node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs state load)
26
+ node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" config-ensure-section
27
+ INIT=$(node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" state load)
28
+ if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
28
29
  ```
29
30
 
30
31
  This creates `.planning/config.json` with defaults if missing and loads current config.
@@ -12,8 +12,9 @@ read all files referenced by the invoking prompt's execution_context before star
12
12
  Ensure config exists and load current state:
13
13
 
14
14
  ```bash
15
- node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs config-ensure-section
16
- INIT=$(node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs state load)
15
+ node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" config-ensure-section
16
+ INIT=$(node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" state load)
17
+ if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
17
18
  ```
18
19
 
19
20
  Creates `.planning/config.json` with defaults if missing and loads current config values.
@@ -28,7 +29,7 @@ Parse current values (default to `true` if not present):
28
29
  - `workflow.research` — spawn researcher during plan-phase
29
30
  - `workflow.plan_check` — spawn plan checker during plan-phase
30
31
  - `workflow.verifier` — spawn verifier during execute-phase
31
- - `workflow.nyquist_validation` — validation architecture research during plan-phase
32
+ - `workflow.nyquist_validation` — validation architecture research during plan-phase (default: true if absent)
32
33
  - `model_profile` — which model each agent uses (default: `simple`)
33
34
  - `git.branching_strategy` — branching approach (default: `"none"`)
34
35
  </step>
@@ -128,7 +129,6 @@ Merge new settings into existing config.json:
128
129
  ```
129
130
 
130
131
  write updated config to `.planning/config.json`.
131
-
132
132
  </step>
133
133
 
134
134
  <step name="save_as_defaults">
@@ -158,7 +158,7 @@ write `~/.gsd/defaults.json` with:
158
158
  ```json
159
159
  {
160
160
  "mode": <current>,
161
- "depth": <current>,
161
+ "granularity": <current>,
162
162
  "model_profile": <current>,
163
163
  "commit_docs": <current>,
164
164
  "parallelization": <current>,
@@ -196,7 +196,7 @@ Display:
196
196
  These settings apply to future /gsd-plan-phase and /gsd-execute-phase runs.
197
197
 
198
198
  Quick commands:
199
- - /gsd-set-profile <profile> — switch model profile
199
+ - /gsd-set-profile <profile> — switch model profile/choose models
200
200
  - /gsd-plan-phase --research — force research
201
201
  - /gsd-plan-phase --skip-research — skip research
202
202
  - /gsd-plan-phase --skip-verify — skip plan check
@@ -123,7 +123,7 @@ If found, delete them — phase is complete, handoffs are stale.
123
123
  **Delegate ROADMAP.md and STATE.md updates to gsd-tools:**
124
124
 
125
125
  ```bash
126
- TRANSITION=$(node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs phase complete "${current_phase}")
126
+ TRANSITION=$(node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" phase complete "${current_phase}")
127
127
  ```
128
128
 
129
129
  The CLI handles:
@@ -238,7 +238,7 @@ After (Phase 2 shipped JWT auth, discovered rate limiting needed):
238
238
  Verify the updates are correct by reading STATE.md. If the progress bar needs updating, use:
239
239
 
240
240
  ```bash
241
- PROGRESS=$(node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs progress bar --raw)
241
+ PROGRESS=$(node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" progress bar --raw)
242
242
  ```
243
243
 
244
244
  Update the progress bar line in STATE.md with the result.
@@ -347,7 +347,7 @@ The `next_phase` and `next_phase_name` fields give you the next phase details.
347
347
 
348
348
  If you need additional context, use:
349
349
  ```bash
350
- ROADMAP=$(node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs roadmap analyze)
350
+ ROADMAP=$(node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" roadmap analyze)
351
351
  ```
352
352
 
353
353
  This returns all phases with goals, disk status, and completion info.
@@ -451,9 +451,9 @@ Exit skill and invoke command("/gsd-discuss-phase [X+1] --auto")
451
451
 
452
452
  **Route B: Milestone complete (all phases done)**
453
453
 
454
- **Clear auto-advance** — milestone boundary is the natural stopping point:
454
+ **Clear auto-advance chain flag** — milestone boundary is the natural stopping point:
455
455
  ```bash
456
- node ~/.config/opencode/get-shit-done/bin/gsd-tools.cjs config-set workflow.auto_advance false
456
+ node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" config-set workflow._auto_chain_active false
457
457
  ```
458
458
 
459
459
  <if mode="yolo">
@@ -9,16 +9,43 @@ read all files referenced by the invoking prompt's execution_context before star
9
9
  <process>
10
10
 
11
11
  <step name="get_installed_version">
12
- Detect whether GSD is installed locally or globally by checking both locations:
12
+ Detect whether GSD is installed locally or globally by checking both locations and validating install integrity:
13
13
 
14
14
  ```bash
15
- # Check local first (takes priority)
16
- # Paths templated at install time for runtime compatibility
17
- if [ -f ./.OpenCode/get-shit-done/VERSION ]; then
18
- cat ./.OpenCode/get-shit-done/VERSION
15
+ # Check local first (takes priority only if valid)
16
+ # Detect runtime config directory (supports OpenCode, OpenCode, Gemini)
17
+ LOCAL_VERSION_FILE="" LOCAL_MARKER_FILE="" LOCAL_DIR=""
18
+ for dir in .OpenCode .config/opencode .opencode .gemini; do
19
+ if [ -f "./$dir/get-shit-done/VERSION" ]; then
20
+ LOCAL_VERSION_FILE="./$dir/get-shit-done/VERSION"
21
+ LOCAL_MARKER_FILE="./$dir/get-shit-done/workflows/update.md"
22
+ LOCAL_DIR="$(cd "./$dir" 2>/dev/null && pwd)"
23
+ break
24
+ fi
25
+ done
26
+ GLOBAL_VERSION_FILE="" GLOBAL_MARKER_FILE="" GLOBAL_DIR=""
27
+ for dir in .OpenCode .config/opencode .opencode .gemini; do
28
+ if [ -f "$HOME/$dir/get-shit-done/VERSION" ]; then
29
+ GLOBAL_VERSION_FILE="$HOME/$dir/get-shit-done/VERSION"
30
+ GLOBAL_MARKER_FILE="$HOME/$dir/get-shit-done/workflows/update.md"
31
+ GLOBAL_DIR="$(cd "$HOME/$dir" 2>/dev/null && pwd)"
32
+ break
33
+ fi
34
+ done
35
+
36
+ # Only treat as LOCAL if the resolved paths differ (prevents misdetection when CWD=$HOME)
37
+ IS_LOCAL=false
38
+ if [ -n "$LOCAL_VERSION_FILE" ] && [ -f "$LOCAL_VERSION_FILE" ] && [ -f "$LOCAL_MARKER_FILE" ] && grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+' "$LOCAL_VERSION_FILE"; then
39
+ if [ -z "$GLOBAL_DIR" ] || [ "$LOCAL_DIR" != "$GLOBAL_DIR" ]; then
40
+ IS_LOCAL=true
41
+ fi
42
+ fi
43
+
44
+ if [ "$IS_LOCAL" = true ]; then
45
+ cat "$LOCAL_VERSION_FILE"
19
46
  echo "LOCAL"
20
- elif [ -f ~/.config/opencode/get-shit-done/VERSION ]; then
21
- cat ~/.config/opencode/get-shit-done/VERSION
47
+ elif [ -n "$GLOBAL_VERSION_FILE" ] && [ -f "$GLOBAL_VERSION_FILE" ] && [ -f "$GLOBAL_MARKER_FILE" ] && grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+' "$GLOBAL_VERSION_FILE"; then
48
+ cat "$GLOBAL_VERSION_FILE"
22
49
  echo "GLOBAL"
23
50
  else
24
51
  echo "UNKNOWN"
@@ -26,8 +53,8 @@ fi
26
53
  ```
27
54
 
28
55
  Parse output:
29
- - If last line is "LOCAL": installed version is first line, use `--local` flag for update
30
- - If last line is "GLOBAL": installed version is first line, use `--global` flag for update
56
+ - If last line is "LOCAL": local install is valid; installed version is first line; use `--local`
57
+ - If last line is "GLOBAL": local missing/invalid, global install is valid; installed version is first line; use `--global`
31
58
  - If "UNKNOWN": proceed to install step (treat as version 0.0.0)
32
59
 
33
60
  **If VERSION file missing:**
@@ -122,7 +149,7 @@ Exit.
122
149
  - `get-shit-done/` will be wiped and replaced
123
150
  - `agents/gsd-*` files will be replaced
124
151
 
125
- (Paths are relative to your install location: `~/.config/opencode/` for global, `./.OpenCode/` for local)
152
+ (Paths are relative to your install location: `$HOME/.config/opencode/` for global, `./.OpenCode/` for local)
126
153
 
127
154
  Your custom files in other locations are preserved:
128
155
  - Custom commands not in `commands/gsd/` ✓
@@ -147,28 +174,27 @@ Run the update using the install type detected in step 1:
147
174
 
148
175
  **If LOCAL install:**
149
176
  ```bash
150
- npx gsd-opencode --local
177
+ npx -y gsd-opencode@latest --local
151
178
  ```
152
179
 
153
180
  **If GLOBAL install (or unknown):**
154
181
  ```bash
155
- npx gsd-opencode --global
182
+ npx -y gsd-opencode@latest --global
156
183
  ```
157
184
 
158
185
  Capture output. If install fails, show error and exit.
159
186
 
160
187
  Clear the update cache so statusline indicator disappears:
161
188
 
162
- **If LOCAL install:**
163
189
  ```bash
164
- rm -f ./.OpenCode/cache/gsd-update-check.json
190
+ # Clear update cache across all runtime directories
191
+ for dir in .OpenCode .config/opencode .opencode .gemini; do
192
+ rm -f "./$dir/cache/gsd-update-check.json"
193
+ rm -f "$HOME/$dir/cache/gsd-update-check.json"
194
+ done
165
195
  ```
166
196
 
167
- **If GLOBAL install:**
168
- ```bash
169
- rm -f ~/.config/opencode/cache/gsd-update-check.json
170
- ```
171
- (Paths are templated at install time for runtime compatibility)
197
+ The SessionStart hook (`gsd-check-update.js`) writes to the detected runtime's cache directory, so all paths must be cleared to prevent stale update indicators.
172
198
  </step>
173
199
 
174
200
  <step name="display_result">