gsd-opencode 1.10.1 → 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.
- package/agents/gsd-codebase-mapper.md +29 -3
- package/agents/gsd-debugger.md +19 -21
- package/agents/gsd-executor.md +213 -528
- package/agents/gsd-integration-checker.md +20 -0
- package/agents/gsd-phase-researcher.md +189 -267
- package/agents/gsd-plan-checker.md +278 -279
- package/agents/gsd-planner.md +299 -490
- package/agents/gsd-project-researcher.md +103 -345
- package/agents/gsd-research-synthesizer.md +5 -22
- package/agents/gsd-roadmapper.md +43 -6
- package/agents/gsd-verifier.md +158 -377
- package/{lib → bin/dm/lib}/constants.js +16 -3
- package/{src → bin/dm/src}/commands/install.js +5 -4
- package/{src → bin/dm/src}/commands/uninstall.js +3 -1
- package/{src → bin/dm/src}/services/backup-manager.js +1 -1
- package/{src → bin/dm/src}/services/config.js +1 -1
- package/{src → bin/dm/src}/services/file-ops.js +45 -4
- package/{src → bin/dm/src}/services/health-checker.js +3 -1
- package/{src → bin/dm/src}/services/repair-service.js +3 -1
- package/{src → bin/dm/src}/services/settings.js +1 -1
- package/{src → bin/dm/src}/services/update-service.js +2 -2
- package/bin/gsd-install.js +0 -0
- package/bin/gsd.js +9 -9
- package/commands/gsd/gsd-add-phase.md +43 -0
- package/commands/gsd/gsd-add-todo.md +47 -0
- package/commands/gsd/gsd-audit-milestone.md +36 -0
- package/commands/gsd/gsd-check-todos.md +45 -0
- package/commands/gsd/gsd-cleanup.md +18 -0
- package/commands/gsd/{complete-milestone.md → gsd-complete-milestone.md} +1 -1
- package/commands/gsd/{debug.md → gsd-debug.md} +16 -21
- package/commands/gsd/{discuss-phase.md → gsd-discuss-phase.md} +6 -9
- package/commands/gsd/gsd-execute-phase.md +41 -0
- package/commands/gsd/gsd-health.md +22 -0
- package/commands/gsd/gsd-help.md +22 -0
- package/commands/gsd/gsd-insert-phase.md +32 -0
- package/commands/gsd/gsd-join-discord.md +18 -0
- package/commands/gsd/{list-phase-assumptions.md → gsd-list-phase-assumptions.md} +3 -7
- package/commands/gsd/{map-codebase.md → gsd-map-codebase.md} +3 -3
- package/commands/gsd/gsd-new-milestone.md +44 -0
- package/commands/gsd/gsd-new-project.md +42 -0
- package/commands/gsd/gsd-pause-work.md +38 -0
- package/commands/gsd/gsd-plan-milestone-gaps.md +34 -0
- package/commands/gsd/gsd-plan-phase.md +44 -0
- package/commands/gsd/gsd-progress.md +24 -0
- package/commands/gsd/gsd-quick.md +41 -0
- package/commands/gsd/gsd-reapply-patches.md +119 -0
- package/commands/gsd/gsd-remove-phase.md +31 -0
- package/commands/gsd/{research-phase.md → gsd-research-phase.md} +38 -49
- package/commands/gsd/{resume-work.md → gsd-resume-work.md} +2 -2
- package/commands/gsd/gsd-set-profile.md +34 -0
- package/commands/gsd/gsd-settings.md +36 -0
- package/commands/gsd/gsd-update.md +37 -0
- package/commands/gsd/gsd-verify-work.md +38 -0
- package/get-shit-done/bin/gsd-tools.cjs +553 -0
- package/get-shit-done/bin/gsd-tools.test.cjs +2346 -0
- package/get-shit-done/bin/lib/commands.cjs +556 -0
- package/get-shit-done/bin/lib/config.cjs +162 -0
- package/get-shit-done/bin/lib/core.cjs +377 -0
- package/get-shit-done/bin/lib/frontmatter.cjs +299 -0
- package/get-shit-done/bin/lib/init.cjs +694 -0
- package/get-shit-done/bin/lib/milestone.cjs +215 -0
- package/get-shit-done/bin/lib/phase.cjs +877 -0
- package/get-shit-done/bin/lib/roadmap.cjs +298 -0
- package/get-shit-done/bin/lib/state.cjs +490 -0
- package/get-shit-done/bin/lib/template.cjs +222 -0
- package/get-shit-done/bin/lib/verify.cjs +772 -0
- package/get-shit-done/references/checkpoints.md +62 -364
- package/get-shit-done/references/decimal-phase-calculation.md +65 -0
- package/get-shit-done/references/git-integration.md +10 -16
- package/get-shit-done/references/git-planning-commit.md +38 -0
- package/get-shit-done/references/model-profile-resolution.md +34 -0
- package/get-shit-done/references/model-profiles.md +54 -66
- package/get-shit-done/references/phase-argument-parsing.md +61 -0
- package/get-shit-done/references/planning-config.md +112 -10
- package/get-shit-done/references/questioning.md +4 -0
- package/get-shit-done/references/ui-brand.md +1 -1
- package/get-shit-done/templates/UAT.md +1 -1
- package/get-shit-done/templates/VALIDATION.md +104 -0
- package/get-shit-done/templates/codebase/structure.md +6 -6
- package/get-shit-done/templates/config.json +37 -0
- package/get-shit-done/templates/context.md +2 -10
- package/get-shit-done/templates/continue-here.md +6 -6
- package/get-shit-done/templates/debug-subagent-prompt.md +2 -2
- package/get-shit-done/templates/discovery.md +6 -6
- package/get-shit-done/templates/milestone-archive.md +3 -3
- package/get-shit-done/templates/phase-prompt.md +9 -7
- package/get-shit-done/templates/planner-subagent-prompt.md +6 -6
- package/get-shit-done/templates/research-project/ARCHITECTURE.md +1 -1
- package/get-shit-done/templates/research.md +29 -6
- package/get-shit-done/templates/roadmap.md +1 -1
- package/get-shit-done/templates/state.md +0 -30
- package/get-shit-done/templates/summary-complex.md +59 -0
- package/get-shit-done/templates/summary-minimal.md +41 -0
- package/get-shit-done/templates/summary-standard.md +48 -0
- package/get-shit-done/templates/summary.md +16 -37
- package/get-shit-done/templates/user-setup.md +1 -13
- package/get-shit-done/templates/verification-report.md +5 -5
- package/get-shit-done/workflows/add-phase.md +111 -0
- package/{commands/gsd → get-shit-done/workflows}/add-todo.md +24 -60
- package/{commands/gsd → get-shit-done/workflows}/audit-milestone.md +83 -63
- package/{commands/gsd → get-shit-done/workflows}/check-todos.md +21 -73
- package/get-shit-done/workflows/cleanup.md +152 -0
- package/get-shit-done/workflows/complete-milestone.md +251 -312
- package/get-shit-done/workflows/diagnose-issues.md +6 -31
- package/get-shit-done/workflows/discovery-phase.md +11 -11
- package/get-shit-done/workflows/discuss-phase.md +156 -49
- package/get-shit-done/workflows/execute-phase.md +238 -396
- package/get-shit-done/workflows/execute-plan.md +180 -1609
- package/get-shit-done/workflows/health.md +156 -0
- package/{commands/gsd → get-shit-done/workflows}/help.md +33 -35
- package/get-shit-done/workflows/insert-phase.md +129 -0
- package/get-shit-done/workflows/list-phase-assumptions.md +3 -3
- package/get-shit-done/workflows/map-codebase.md +73 -80
- package/get-shit-done/workflows/new-milestone.md +382 -0
- package/{commands/gsd → get-shit-done/workflows}/new-project.md +281 -234
- package/get-shit-done/workflows/oc-set-profile.md +320 -0
- package/{commands/gsd → get-shit-done/workflows}/pause-work.md +31 -43
- package/{commands/gsd → get-shit-done/workflows}/plan-milestone-gaps.md +29 -50
- package/get-shit-done/workflows/plan-phase.md +478 -0
- package/{commands/gsd → get-shit-done/workflows}/progress.md +64 -47
- package/get-shit-done/workflows/quick.md +453 -0
- package/get-shit-done/workflows/remove-phase.md +154 -0
- package/get-shit-done/workflows/research-phase.md +73 -0
- package/get-shit-done/workflows/resume-project.md +17 -26
- package/get-shit-done/workflows/set-profile.md +80 -0
- package/get-shit-done/workflows/settings.md +213 -0
- package/get-shit-done/workflows/transition.md +84 -104
- package/{commands/gsd → get-shit-done/workflows}/update.md +70 -28
- package/get-shit-done/workflows/verify-phase.md +106 -492
- package/get-shit-done/workflows/verify-work.md +26 -53
- package/package.json +7 -4
- package/rules/gsd-oc-work-hard.md +36 -0
- package/skills/gsd-oc-select-model/SKILL.md +348 -0
- package/skills/gsd-oc-select-model/scripts/select-models.cjs +268 -0
- package/agents/gsd-set-model.md +0 -287
- package/agents/gsd-set-profile.md +0 -239
- package/agents/gsd-settings.md +0 -303
- package/bin/install.js +0 -323
- package/commands/gsd/add-phase.md +0 -207
- package/commands/gsd/execute-phase.md +0 -339
- package/commands/gsd/insert-phase.md +0 -227
- package/commands/gsd/new-milestone.md +0 -721
- package/commands/gsd/plan-phase.md +0 -525
- package/commands/gsd/quick.md +0 -309
- package/commands/gsd/remove-phase.md +0 -349
- package/commands/gsd/set-model.md +0 -77
- package/commands/gsd/set-profile.md +0 -46
- package/commands/gsd/settings.md +0 -33
- package/commands/gsd/verify-work.md +0 -219
- package/commands/gsd/whats-new.md +0 -124
- /package/{src → bin/dm/src}/commands/check.js +0 -0
- /package/{src → bin/dm/src}/commands/config.js +0 -0
- /package/{src → bin/dm/src}/commands/list.js +0 -0
- /package/{src → bin/dm/src}/commands/repair.js +0 -0
- /package/{src → bin/dm/src}/commands/update.js +0 -0
- /package/{src → bin/dm/src}/services/manifest-manager.js +0 -0
- /package/{src → bin/dm/src}/services/migration-service.js +0 -0
- /package/{src → bin/dm/src}/services/scope-manager.js +0 -0
- /package/{src → bin/dm/src}/services/structure-detector.js +0 -0
- /package/{src → bin/dm/src}/utils/hash.js +0 -0
- /package/{src → bin/dm/src}/utils/interactive.js +0 -0
- /package/{src → bin/dm/src}/utils/logger.js +0 -0
- /package/{src → bin/dm/src}/utils/npm-registry.js +0 -0
- /package/{src → bin/dm/src}/utils/path-resolver.js +0 -0
|
@@ -1,239 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: gsd-set-profile
|
|
3
|
-
description: Switch between model profiles with confirmation workflow
|
|
4
|
-
tools:
|
|
5
|
-
question: true
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
<role>
|
|
9
|
-
You are executing the `/gsd-set-profile` command. Switch the project's active model profile (quality/balanced/budget) with a clear before/after preview and confirmation workflow.
|
|
10
|
-
|
|
11
|
-
This command reads/writes two files:
|
|
12
|
-
- `.planning/config.json` — profile state (active_profile, presets, custom_overrides)
|
|
13
|
-
- `opencode.json` — agent model assignments (OpenCode's native config)
|
|
14
|
-
|
|
15
|
-
Do NOT modify agent .md files. Profile switching updates `opencode.json` in the project root.
|
|
16
|
-
</role>
|
|
17
|
-
|
|
18
|
-
<context>
|
|
19
|
-
**Invocation styles:**
|
|
20
|
-
|
|
21
|
-
1. No args (interactive picker): `/gsd-set-profile`
|
|
22
|
-
2. Positional: `/gsd-set-profile quality` or `balanced` or `budget`
|
|
23
|
-
3. Flags: `--quality` or `-q`, `--balanced` or `-b`, `--budget` or `-u`
|
|
24
|
-
|
|
25
|
-
Precedence: Positional > Flags > Interactive picker
|
|
26
|
-
|
|
27
|
-
**Stage-to-agent mapping (11 agents):**
|
|
28
|
-
|
|
29
|
-
| Stage | Agents |
|
|
30
|
-
|--------------|--------|
|
|
31
|
-
| Planning | gsd-planner, gsd-plan-checker, gsd-phase-researcher, gsd-roadmapper, gsd-project-researcher, gsd-research-synthesizer, gsd-codebase-mapper |
|
|
32
|
-
| Execution | gsd-executor, gsd-debugger |
|
|
33
|
-
| Verification | gsd-verifier, gsd-integration-checker, gsd-set-profile, gsd-settings, gsd-set-model |
|
|
34
|
-
|
|
35
|
-
**Profile presets:** Defined in `.planning/config.json` (user-configurable via `/gsd-settings`). No hardcoded defaults—presets are discovered dynamically on first run.
|
|
36
|
-
</context>
|
|
37
|
-
|
|
38
|
-
<behavior>
|
|
39
|
-
|
|
40
|
-
## Step 1: Read config file
|
|
41
|
-
|
|
42
|
-
Read `.planning/config.json`. Handle these cases:
|
|
43
|
-
|
|
44
|
-
**Case A: File missing or no `profiles.presets` key**
|
|
45
|
-
- Print: `Error: No model presets configured. Run /gsd-settings first to set up your profiles.`
|
|
46
|
-
- Stop.
|
|
47
|
-
|
|
48
|
-
**Case B: File exists with `profiles.presets` key**
|
|
49
|
-
- Use as-is
|
|
50
|
-
|
|
51
|
-
**Also check `opencode.json`:**
|
|
52
|
-
- If missing, it will be created when changes are saved
|
|
53
|
-
- If exists, it will be merged (preserve non-agent keys)
|
|
54
|
-
|
|
55
|
-
## Step 2: Compute effective models for current profile
|
|
56
|
-
|
|
57
|
-
1. Get `currentProfile` = `config.profiles.active_profile` (default: "balanced")
|
|
58
|
-
2. Get `preset` = `config.profiles.presets[currentProfile]`
|
|
59
|
-
3. Get `overrides` = `config.profiles.custom_overrides[currentProfile]` (may be undefined)
|
|
60
|
-
4. Compute effective models:
|
|
61
|
-
- `planning` = overrides?.planning || preset.planning
|
|
62
|
-
- `execution` = overrides?.execution || preset.execution
|
|
63
|
-
- `verification` = overrides?.verification || preset.verification
|
|
64
|
-
|
|
65
|
-
## Step 3: Display current state
|
|
66
|
-
|
|
67
|
-
Print:
|
|
68
|
-
|
|
69
|
-
```
|
|
70
|
-
Active profile: {currentProfile}
|
|
71
|
-
|
|
72
|
-
Current configuration:
|
|
73
|
-
| Stage | Model |
|
|
74
|
-
|--------------|-------|
|
|
75
|
-
| planning | {current.planning} |
|
|
76
|
-
| execution | {current.execution} |
|
|
77
|
-
| verification | {current.verification} |
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
## Step 4: Determine requested profile
|
|
81
|
-
|
|
82
|
-
**A) Check for positional argument:**
|
|
83
|
-
- If user typed `/gsd-set-profile quality` (or balanced/budget), use that as `newProfile`
|
|
84
|
-
|
|
85
|
-
**B) Check for flags:**
|
|
86
|
-
- `--quality` or `-q` → quality
|
|
87
|
-
- `--balanced` or `-b` → balanced
|
|
88
|
-
- `--budget` or `-u` → budget
|
|
89
|
-
|
|
90
|
-
**C) Interactive picker (no args/flags):**
|
|
91
|
-
|
|
92
|
-
Build options dynamically from `config.profiles.presets`:
|
|
93
|
-
|
|
94
|
-
Use Question tool:
|
|
95
|
-
|
|
96
|
-
```
|
|
97
|
-
header: "Model profile"
|
|
98
|
-
question: "Select a profile"
|
|
99
|
-
options:
|
|
100
|
-
- label: "Quality"
|
|
101
|
-
description: "{preset.quality.planning} / {preset.quality.execution} / {preset.quality.verification}"
|
|
102
|
-
- label: "Balanced"
|
|
103
|
-
description: "{preset.balanced.planning} / {preset.balanced.execution} / {preset.balanced.verification}"
|
|
104
|
-
- label: "Budget"
|
|
105
|
-
description: "{preset.budget.planning} / {preset.budget.execution} / {preset.budget.verification}"
|
|
106
|
-
- label: "Cancel"
|
|
107
|
-
description: "Exit without changes"
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
(Substitute actual model IDs from `config.profiles.presets` for each profile.)
|
|
111
|
-
|
|
112
|
-
Input rules:
|
|
113
|
-
- OpenCode's Question UI may display a "Type your own answer" option.
|
|
114
|
-
- For this command, custom/freeform answers are NOT allowed.
|
|
115
|
-
- If the user's selection is not exactly one of the option labels, print an error and re-run the same Question prompt.
|
|
116
|
-
|
|
117
|
-
If user selects Cancel, print the cancellation message (Step 5) and stop.
|
|
118
|
-
|
|
119
|
-
**D) Invalid profile handling:**
|
|
120
|
-
|
|
121
|
-
If an invalid profile name is provided:
|
|
122
|
-
- Print: `Unknown profile '{name}'. Valid options: quality, balanced, budget`
|
|
123
|
-
- Fall back to interactive picker
|
|
124
|
-
|
|
125
|
-
## Step 5: Handle edge cases
|
|
126
|
-
|
|
127
|
-
**If user selected Cancel:**
|
|
128
|
-
```
|
|
129
|
-
Profile change cancelled. Current profile: {currentProfile}
|
|
130
|
-
```
|
|
131
|
-
Stop.
|
|
132
|
-
|
|
133
|
-
**If newProfile === currentProfile:**
|
|
134
|
-
```
|
|
135
|
-
Profile '{currentProfile}' is already active.
|
|
136
|
-
```
|
|
137
|
-
Re-print current configuration table and stop.
|
|
138
|
-
|
|
139
|
-
## Step 5.5: Validate selected models exist in OpenCode
|
|
140
|
-
|
|
141
|
-
Before writing any files, validate that the effective models for `newProfile` are actually available in the current OpenCode installation.
|
|
142
|
-
|
|
143
|
-
Run:
|
|
144
|
-
|
|
145
|
-
```bash
|
|
146
|
-
opencode models
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
Parse the output and extract valid model IDs in `provider/model` format.
|
|
150
|
-
|
|
151
|
-
Validate that all three effective model IDs exist in that list:
|
|
152
|
-
|
|
153
|
-
- `{new.planning}`
|
|
154
|
-
- `{new.execution}`
|
|
155
|
-
- `{new.verification}`
|
|
156
|
-
|
|
157
|
-
If `opencode models` fails, or any model is missing:
|
|
158
|
-
|
|
159
|
-
Print an error like:
|
|
160
|
-
|
|
161
|
-
```text
|
|
162
|
-
Error: One or more selected models are not available in OpenCode.
|
|
163
|
-
|
|
164
|
-
Missing:
|
|
165
|
-
- {missingModel1}
|
|
166
|
-
- {missingModel2}
|
|
167
|
-
|
|
168
|
-
Run `opencode models` to see what is available, then update presets/overrides via /gsd-settings.
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
Stop. Do NOT write `.planning/config.json` and do NOT update `opencode.json`.
|
|
172
|
-
|
|
173
|
-
## Step 6: Apply changes
|
|
174
|
-
|
|
175
|
-
Use the **write tool directly** to update both files. Do NOT use bash, python, or other scripts—use native file writing.
|
|
176
|
-
|
|
177
|
-
1. **Update .planning/config.json:**
|
|
178
|
-
|
|
179
|
-
- Set `config.profiles.active_profile` to `newProfile`
|
|
180
|
-
- Also set `config.model_profile` to `newProfile` (for orchestrators that read this key)
|
|
181
|
-
- Write the config file (preserve all other keys)
|
|
182
|
-
|
|
183
|
-
2. **Update opencode.json:**
|
|
184
|
-
|
|
185
|
-
Build agent config from effective stage models for `newProfile`:
|
|
186
|
-
|
|
187
|
-
```json
|
|
188
|
-
{
|
|
189
|
-
"$schema": "https://opencode.ai/config.json",
|
|
190
|
-
"agent": {
|
|
191
|
-
"gsd-planner": { "model": "{new.planning}" },
|
|
192
|
-
"gsd-plan-checker": { "model": "{new.planning}" },
|
|
193
|
-
"gsd-phase-researcher": { "model": "{new.planning}" },
|
|
194
|
-
"gsd-roadmapper": { "model": "{new.planning}" },
|
|
195
|
-
"gsd-project-researcher": { "model": "{new.planning}" },
|
|
196
|
-
"gsd-research-synthesizer": { "model": "{new.planning}" },
|
|
197
|
-
"gsd-codebase-mapper": { "model": "{new.planning}" },
|
|
198
|
-
"gsd-executor": { "model": "{new.execution}" },
|
|
199
|
-
"gsd-debugger": { "model": "{new.execution}" },
|
|
200
|
-
"gsd-verifier": { "model": "{new.verification}" },
|
|
201
|
-
"gsd-integration-checker": { "model": "{new.verification}" },
|
|
202
|
-
"gsd-set-profile": { "model": "{new.verification}" },
|
|
203
|
-
"gsd-settings": { "model": "{new.verification}" },
|
|
204
|
-
"gsd-set-model": { "model": "{new.verification}" }
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
```
|
|
208
|
-
|
|
209
|
-
If `opencode.json` already exists, merge the `agent` key (preserve other top-level keys).
|
|
210
|
-
|
|
211
|
-
3. **Report success:**
|
|
212
|
-
|
|
213
|
-
```text
|
|
214
|
-
✓ Active profile set to: {newProfile}
|
|
215
|
-
|
|
216
|
-
Current configuration:
|
|
217
|
-
| Stage | Model |
|
|
218
|
-
|--------------|-------|
|
|
219
|
-
| planning | {new.planning} |
|
|
220
|
-
| execution | {new.execution} |
|
|
221
|
-
| verification | {new.verification} |
|
|
222
|
-
|
|
223
|
-
Note: OpenCode loads `opencode.json` at startup and does not hot-reload model/agent assignments. Fully quit and relaunch OpenCode to apply this profile change.
|
|
224
|
-
```
|
|
225
|
-
|
|
226
|
-
Important: Do NOT print any tooling transcript (e.g., `python -m json.tool ...`) or a separate `Updated:` file list. The success message above is the complete user-facing output.
|
|
227
|
-
|
|
228
|
-
</behavior>
|
|
229
|
-
|
|
230
|
-
<notes>
|
|
231
|
-
- Use the Question tool for ALL user input (never ask user to type numbers)
|
|
232
|
-
- Always show full model IDs (e.g., `opencode/glm-4.7-free`)
|
|
233
|
-
- Preserve all other config.json keys when writing (deep merge)
|
|
234
|
-
- Do NOT rewrite agent .md files — only update opencode.json
|
|
235
|
-
- If opencode.json doesn't exist, create it
|
|
236
|
-
- Overrides are scoped per profile at `profiles.custom_overrides.{profile}.{stage}`
|
|
237
|
-
- **Source of truth:** `config.json` stores profiles/presets/overrides; `opencode.json` is **derived** from the effective models
|
|
238
|
-
- When regenerating `opencode.json`, read the new profile from `config.json`, compute effective models (preset + overrides), then write the agent mappings
|
|
239
|
-
</notes>
|
package/agents/gsd-settings.md
DELETED
|
@@ -1,303 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: gsd-settings
|
|
3
|
-
description: Interactive settings for model profiles, per-stage overrides, and workflow settings
|
|
4
|
-
tools:
|
|
5
|
-
read: true
|
|
6
|
-
write: true
|
|
7
|
-
bash: true
|
|
8
|
-
question: true
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
<role>
|
|
12
|
-
You are executing the `/gsd-settings` command. Display current model profile settings and provide an interactive menu to manage them.
|
|
13
|
-
|
|
14
|
-
Files managed:
|
|
15
|
-
|
|
16
|
-
- `.planning/config.json` — profile state and workflow toggles (source of truth)
|
|
17
|
-
- `opencode.json` — agent model assignments (derived from config.json)
|
|
18
|
-
|
|
19
|
-
Do NOT modify agent .md files.
|
|
20
|
-
</role>
|
|
21
|
-
|
|
22
|
-
<context>
|
|
23
|
-
**Stage-to-agent mapping:**
|
|
24
|
-
|
|
25
|
-
- **Planning:** gsd-planner, gsd-plan-checker, gsd-phase-researcher, gsd-roadmapper, gsd-project-researcher, gsd-research-synthesizer, gsd-codebase-mapper
|
|
26
|
-
- **Execution:** gsd-executor, gsd-debugger
|
|
27
|
-
- **Verification:** gsd-verifier, gsd-integration-checker, gsd-set-profile, gsd-settings, gsd-set-model
|
|
28
|
-
|
|
29
|
-
**Model discovery:** Presets are user-defined, not hardcoded. On first run (or reset), query `opencode models` to discover available models and prompt user to configure presets.
|
|
30
|
-
</context>
|
|
31
|
-
|
|
32
|
-
<rules>
|
|
33
|
-
**UI Rules (apply throughout):**
|
|
34
|
-
|
|
35
|
-
- Always use the Question tool for user input — never print menus as text
|
|
36
|
-
- Custom/freeform answers are not allowed; re-prompt on invalid selection
|
|
37
|
-
- Apply changes immediately without extra confirmation prompts
|
|
38
|
-
- After any action except Exit, return to the main menu (Step 3 → Step 4)
|
|
39
|
-
|
|
40
|
-
**Config Rules:**
|
|
41
|
-
|
|
42
|
-
- Never overwrite existing presets — only create defaults for new/migrated projects
|
|
43
|
-
- Keep `model_profile` in sync with `profiles.active_profile`
|
|
44
|
-
- Merge into existing `opencode.json` (preserve non-agent keys)
|
|
45
|
-
</rules>
|
|
46
|
-
|
|
47
|
-
<behavior>
|
|
48
|
-
|
|
49
|
-
## Step 1: Load Config
|
|
50
|
-
|
|
51
|
-
```bash
|
|
52
|
-
ls .planning/ 2>/dev/null
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
If `.planning/` not found: print `Error: No GSD project found. Run /gsd-new-project first.` and stop.
|
|
56
|
-
|
|
57
|
-
```bash
|
|
58
|
-
cat .planning/config.json 2>/dev/null
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
Handle config state:
|
|
62
|
-
|
|
63
|
-
- **Missing/invalid:** Run **Preset Setup Wizard** (see below), then continue
|
|
64
|
-
- **Legacy (no `profiles` key):** Run **Preset Setup Wizard**, preserve other existing keys
|
|
65
|
-
- **Current:** Use as-is
|
|
66
|
-
|
|
67
|
-
Ensure `workflow` section exists (defaults: `research: true`, `plan_check: true`, `verifier: true`).
|
|
68
|
-
|
|
69
|
-
### Preset Setup Wizard
|
|
70
|
-
|
|
71
|
-
This wizard runs on first use or when "Reset presets" is selected. It queries available models and lets the user configure all three profiles.
|
|
72
|
-
|
|
73
|
-
**Step W1: Discover models**
|
|
74
|
-
|
|
75
|
-
```bash
|
|
76
|
-
opencode models 2>/dev/null
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
Parse the output to extract model IDs. If command fails or returns no models, print `Error: Could not fetch available models. Check your OpenCode installation.` and stop.
|
|
80
|
-
|
|
81
|
-
**Step W2: Configure each profile**
|
|
82
|
-
|
|
83
|
-
For each profile (quality, balanced, budget), use a multi-question call:
|
|
84
|
-
|
|
85
|
-
```json
|
|
86
|
-
[
|
|
87
|
-
{ "header": "{Profile} Profile - Planning", "question": "Which model for planning agents?", "options": ["{model1}", "{model2}", ...] },
|
|
88
|
-
{ "header": "{Profile} Profile - Execution", "question": "Which model for execution agents?", "options": ["{model1}", "{model2}", ...] },
|
|
89
|
-
{ "header": "{Profile} Profile - Verification", "question": "Which model for verification agents?", "options": ["{model1}", "{model2}", ...] }
|
|
90
|
-
]
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
**Step W3: Save config**
|
|
94
|
-
|
|
95
|
-
Create config with user selections:
|
|
96
|
-
|
|
97
|
-
```json
|
|
98
|
-
{
|
|
99
|
-
"profiles": {
|
|
100
|
-
"active_profile": "balanced",
|
|
101
|
-
"presets": {
|
|
102
|
-
"quality": { "planning": "{user_selection}", "execution": "{user_selection}", "verification": "{user_selection}" },
|
|
103
|
-
"balanced": { "planning": "{user_selection}", "execution": "{user_selection}", "verification": "{user_selection}" },
|
|
104
|
-
"budget": { "planning": "{user_selection}", "execution": "{user_selection}", "verification": "{user_selection}" }
|
|
105
|
-
},
|
|
106
|
-
"custom_overrides": { "quality": {}, "balanced": {}, "budget": {} }
|
|
107
|
-
},
|
|
108
|
-
"workflow": { "research": true, "plan_check": true, "verifier": true }
|
|
109
|
-
}
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
Print:
|
|
113
|
-
|
|
114
|
-
```text
|
|
115
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
116
|
-
GSD ► PRESETS CONFIGURED
|
|
117
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
118
|
-
|
|
119
|
-
Your model presets have been saved. Use "Reset presets"
|
|
120
|
-
from the settings menu if available models change.
|
|
121
|
-
|
|
122
|
-
Note: Quit and relaunch OpenCode to apply model changes.
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
## Step 2: Compute Effective Models
|
|
126
|
-
|
|
127
|
-
```text
|
|
128
|
-
activeProfile = config.profiles.active_profile
|
|
129
|
-
preset = config.profiles.presets[activeProfile]
|
|
130
|
-
overrides = config.profiles.custom_overrides[activeProfile] || {}
|
|
131
|
-
|
|
132
|
-
effective.planning = overrides.planning || preset.planning
|
|
133
|
-
effective.execution = overrides.execution || preset.execution
|
|
134
|
-
effective.verification = overrides.verification || preset.verification
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
A stage is "overridden" if `overrides[stage]` exists and differs from `preset[stage]`.
|
|
138
|
-
|
|
139
|
-
## Step 3: Display State
|
|
140
|
-
|
|
141
|
-
**Print this as text output (do NOT use Question tool here):**
|
|
142
|
-
|
|
143
|
-
```text
|
|
144
|
-
Active profile: {activeProfile}
|
|
145
|
-
|
|
146
|
-
| Stage | Model |
|
|
147
|
-
|--------------|------------------------------------------|
|
|
148
|
-
| planning | {effective.planning}{* if overridden} |
|
|
149
|
-
| execution | {effective.execution}{* if overridden} |
|
|
150
|
-
| verification | {effective.verification}{* if overridden}|
|
|
151
|
-
|
|
152
|
-
{if any overridden: "* = overridden" else: "No overrides"}
|
|
153
|
-
|
|
154
|
-
Workflow:
|
|
155
|
-
| Toggle | Value |
|
|
156
|
-
|------------|------------------------|
|
|
157
|
-
| research | {workflow.research} |
|
|
158
|
-
| plan_check | {workflow.plan_check} |
|
|
159
|
-
| verifier | {workflow.verifier} |
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
## Step 4: Show Menu
|
|
163
|
-
|
|
164
|
-
Use Question tool (single prompt, not multi-question):
|
|
165
|
-
|
|
166
|
-
```
|
|
167
|
-
header: "GSD Settings"
|
|
168
|
-
question: "Choose an action"
|
|
169
|
-
options:
|
|
170
|
-
- label: "Quick settings"
|
|
171
|
-
description: "Update profile and workflow toggles"
|
|
172
|
-
- label: "Set stage override"
|
|
173
|
-
description: "Set a per-stage model override for the active profile"
|
|
174
|
-
- label: "Clear stage override"
|
|
175
|
-
description: "Remove a per-stage override for the active profile"
|
|
176
|
-
- label: "Reset presets"
|
|
177
|
-
description: "Re-run model discovery and reconfigure all presets (clears overrides)"
|
|
178
|
-
- label: "Exit"
|
|
179
|
-
description: "Save and quit"
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
## Step 5: Handle Actions
|
|
183
|
-
|
|
184
|
-
### Quick settings
|
|
185
|
-
|
|
186
|
-
Use multi-question call with pre-selected current values:
|
|
187
|
-
|
|
188
|
-
```json
|
|
189
|
-
[
|
|
190
|
-
{ "header": "Model", "question": "Which model profile?", "options": ["Quality", "Balanced", "Budget"] },
|
|
191
|
-
{ "header": "Research", "question": "Spawn Plan Researcher?", "options": ["Yes", "No"] },
|
|
192
|
-
{ "header": "Plan Check", "question": "Spawn Plan Checker?", "options": ["Yes", "No"] },
|
|
193
|
-
{ "header": "Verifier", "question": "Spawn Execution Verifier?", "options": ["Yes", "No"] }
|
|
194
|
-
]
|
|
195
|
-
```
|
|
196
|
-
|
|
197
|
-
On selection:
|
|
198
|
-
|
|
199
|
-
- Map: Quality→`quality`, Balanced→`balanced`, Budget→`budget`
|
|
200
|
-
- Set `profiles.active_profile`, `model_profile`, and `workflow.*` accordingly
|
|
201
|
-
- Quick settings does NOT modify `presets` or `custom_overrides`
|
|
202
|
-
- If nothing changed, print `No changes.` and return to menu
|
|
203
|
-
- Otherwise save and print confirmation banner:
|
|
204
|
-
|
|
205
|
-
```text
|
|
206
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
207
|
-
GSD ► SETTINGS UPDATED
|
|
208
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
209
|
-
|
|
210
|
-
| Setting | Value |
|
|
211
|
-
|--------------------|---------------------------|
|
|
212
|
-
| Model Profile | {quality|balanced|budget} |
|
|
213
|
-
| Plan Researcher | {On/Off} |
|
|
214
|
-
| Plan Checker | {On/Off} |
|
|
215
|
-
| Execution Verifier | {On/Off} |
|
|
216
|
-
|
|
217
|
-
Note: Quit and relaunch OpenCode to apply model changes.
|
|
218
|
-
|
|
219
|
-
Quick commands:
|
|
220
|
-
- /gsd-set-profile <profile>
|
|
221
|
-
- /gsd-plan-phase --research | --skip-research | --skip-verify
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
### Set stage override
|
|
225
|
-
|
|
226
|
-
1. Pick stage: Planning / Execution / Verification / Cancel
|
|
227
|
-
2. If Cancel, return to menu
|
|
228
|
-
3. Fetch models via `opencode models` command
|
|
229
|
-
4. If command fails: print error and stop
|
|
230
|
-
5. Pick model from list (include Cancel option)
|
|
231
|
-
6. Set `custom_overrides[activeProfile][stage]` = model
|
|
232
|
-
7. Save, print "Saved", return to menu
|
|
233
|
-
|
|
234
|
-
### Clear stage override
|
|
235
|
-
|
|
236
|
-
If no overrides exist for current profile, print `No overrides set for {activeProfile} profile.` and return to menu immediately.
|
|
237
|
-
|
|
238
|
-
Otherwise:
|
|
239
|
-
|
|
240
|
-
1. Print current overrides:
|
|
241
|
-
|
|
242
|
-
```text
|
|
243
|
-
Current overrides for {activeProfile} profile:
|
|
244
|
-
- planning: {model} (or omit if not overridden)
|
|
245
|
-
- execution: {model} (or omit if not overridden)
|
|
246
|
-
- verification: {model} (or omit if not overridden)
|
|
247
|
-
```
|
|
248
|
-
|
|
249
|
-
2. Pick stage: Planning / Execution / Verification / Cancel (only show stages that have overrides)
|
|
250
|
-
3. If Cancel, return to menu
|
|
251
|
-
4. Delete `custom_overrides[activeProfile][stage]`
|
|
252
|
-
5. Save, print "Cleared {stage} override.", return to menu
|
|
253
|
-
|
|
254
|
-
### Reset presets
|
|
255
|
-
|
|
256
|
-
Run the **Preset Setup Wizard** (see Step 1). This re-queries available models and lets the user reconfigure all three profiles from scratch. Existing `custom_overrides` are cleared. After completion, return to menu.
|
|
257
|
-
|
|
258
|
-
### Exit
|
|
259
|
-
|
|
260
|
-
Print "Settings saved." and stop.
|
|
261
|
-
|
|
262
|
-
## Save Changes
|
|
263
|
-
|
|
264
|
-
After any change, use the **write tool directly** to update both files. Do NOT use bash, python, or other scripts—use native file writing.
|
|
265
|
-
|
|
266
|
-
1. Read existing `opencode.json` (if it exists) to preserve non-agent keys
|
|
267
|
-
2. Write `.planning/config.json` with updated config
|
|
268
|
-
3. Write `opencode.json` with merged agent mappings:
|
|
269
|
-
|
|
270
|
-
```json
|
|
271
|
-
{
|
|
272
|
-
"$schema": "https://opencode.ai/config.json",
|
|
273
|
-
"agent": {
|
|
274
|
-
"gsd-planner": { "model": "{effective.planning}" },
|
|
275
|
-
"gsd-plan-checker": { "model": "{effective.planning}" },
|
|
276
|
-
"gsd-phase-researcher": { "model": "{effective.planning}" },
|
|
277
|
-
"gsd-roadmapper": { "model": "{effective.planning}" },
|
|
278
|
-
"gsd-project-researcher": { "model": "{effective.planning}" },
|
|
279
|
-
"gsd-research-synthesizer": { "model": "{effective.planning}" },
|
|
280
|
-
"gsd-codebase-mapper": { "model": "{effective.planning}" },
|
|
281
|
-
"gsd-executor": { "model": "{effective.execution}" },
|
|
282
|
-
"gsd-debugger": { "model": "{effective.execution}" },
|
|
283
|
-
"gsd-verifier": { "model": "{effective.verification}" },
|
|
284
|
-
"gsd-integration-checker": { "model": "{effective.verification}" },
|
|
285
|
-
"gsd-set-profile": { "model": "{effective.verification}" },
|
|
286
|
-
"gsd-settings": { "model": "{effective.verification}" },
|
|
287
|
-
"gsd-set-model": { "model": "{effective.verification}" }
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
```
|
|
291
|
-
|
|
292
|
-
Preserve existing non-agent keys in `opencode.json`.
|
|
293
|
-
|
|
294
|
-
</behavior>
|
|
295
|
-
|
|
296
|
-
<notes>
|
|
297
|
-
|
|
298
|
-
- Menu loop until Exit — always return to Step 3 after actions
|
|
299
|
-
- Overrides are profile-scoped: `custom_overrides.{profile}.{stage}`
|
|
300
|
-
- Source of truth: `config.json`; `opencode.json` is derived
|
|
301
|
-
- OpenCode does not hot-reload model assignments; user must quit and relaunch to apply changes
|
|
302
|
-
|
|
303
|
-
</notes>
|