gsd-opencode 1.9.0 → 1.9.2
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-set-model.md +287 -0
- package/agents/gsd-set-profile.md +239 -0
- package/agents/gsd-settings.md +303 -0
- package/bin/install.js +81 -1
- package/command/gsd/insert-phase.md +1 -1
- package/command/gsd/new-project.md +68 -3
- package/command/gsd/set-model.md +77 -0
- package/command/gsd/set-profile.md +19 -79
- package/command/gsd/settings.md +14 -117
- package/get-shit-done/references/model-profiles.md +67 -36
- package/package.json +1 -1
|
@@ -0,0 +1,303 @@
|
|
|
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>
|
package/bin/install.js
CHANGED
|
@@ -126,10 +126,25 @@ function copyWithPathReplacement(srcDir, destDir, pathPrefix) {
|
|
|
126
126
|
if (entry.isDirectory()) {
|
|
127
127
|
copyWithPathReplacement(srcPath, destPath, pathPrefix);
|
|
128
128
|
} else if (entry.name.endsWith(".md")) {
|
|
129
|
-
// Replace
|
|
129
|
+
// Replace repo-local prompt references so installed prompts work outside this repo.
|
|
130
|
+
// IMPORTANT: order matters to avoid double-rewrites.
|
|
130
131
|
let content = fs.readFileSync(srcPath, "utf8");
|
|
132
|
+
|
|
133
|
+
// 1) @-references to this repo → install-relative @-references
|
|
134
|
+
// @gsd-opencode/... → @~/.config/opencode/... (global)
|
|
135
|
+
// @gsd-opencode/... → @./.opencode/... (local)
|
|
136
|
+
content = content.replace(/@gsd-opencode\//g, `@${pathPrefix}`);
|
|
137
|
+
|
|
138
|
+
// 2) Plain (non-@) repo-local paths → install-relative paths
|
|
139
|
+
// gsd-opencode/... → ~/.config/opencode/... (global)
|
|
140
|
+
// gsd-opencode/... → ./.opencode/... (local)
|
|
141
|
+
content = content.replace(/\bgsd-opencode\//g, pathPrefix);
|
|
142
|
+
|
|
143
|
+
// 3) Back-compat: rewrite legacy Claude paths → OpenCode paths
|
|
144
|
+
// NOTE: keep these rewrites verbatim for backward compatibility.
|
|
131
145
|
content = content.replace(/~\/\.claude\//g, pathPrefix);
|
|
132
146
|
content = content.replace(/\.\/\.claude\//g, "./.opencode/");
|
|
147
|
+
|
|
133
148
|
fs.writeFileSync(destPath, content);
|
|
134
149
|
} else {
|
|
135
150
|
fs.copyFileSync(srcPath, destPath);
|
|
@@ -164,6 +179,68 @@ function install(isGlobal) {
|
|
|
164
179
|
: "~/.config/opencode/"
|
|
165
180
|
: "./.opencode/";
|
|
166
181
|
|
|
182
|
+
function scanForUnresolvedRepoLocalTokens(destRoot) {
|
|
183
|
+
const tokenRegex = /@gsd-opencode\/|\bgsd-opencode\//g;
|
|
184
|
+
const maxHits = 10;
|
|
185
|
+
const hits = [];
|
|
186
|
+
|
|
187
|
+
function walk(dir) {
|
|
188
|
+
const entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
189
|
+
for (const entry of entries) {
|
|
190
|
+
if (hits.length >= maxHits) return;
|
|
191
|
+
|
|
192
|
+
const filePath = path.join(dir, entry.name);
|
|
193
|
+
if (entry.isDirectory()) {
|
|
194
|
+
walk(filePath);
|
|
195
|
+
continue;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
if (!entry.name.endsWith(".md")) continue;
|
|
199
|
+
|
|
200
|
+
const content = fs.readFileSync(filePath, "utf8");
|
|
201
|
+
tokenRegex.lastIndex = 0;
|
|
202
|
+
if (!tokenRegex.test(content)) continue;
|
|
203
|
+
|
|
204
|
+
// Capture a readable snippet (first matching line)
|
|
205
|
+
const lines = content.split(/\r?\n/);
|
|
206
|
+
for (let i = 0; i < lines.length; i++) {
|
|
207
|
+
tokenRegex.lastIndex = 0;
|
|
208
|
+
if (tokenRegex.test(lines[i])) {
|
|
209
|
+
hits.push({
|
|
210
|
+
file: filePath,
|
|
211
|
+
line: i + 1,
|
|
212
|
+
snippet: lines[i].trim().slice(0, 200),
|
|
213
|
+
});
|
|
214
|
+
break;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
walk(destRoot);
|
|
221
|
+
|
|
222
|
+
if (hits.length > 0) {
|
|
223
|
+
console.log(
|
|
224
|
+
`\n ${yellow}⚠️ Install sanity check: unresolved repo-local tokens found${reset}`,
|
|
225
|
+
);
|
|
226
|
+
console.log(
|
|
227
|
+
` ${yellow}This may cause commands like /gsd-settings to fail in other repos (ENOENT).${reset}`,
|
|
228
|
+
);
|
|
229
|
+
console.log(` ${dim}Showing up to ${maxHits} matches:${reset}`);
|
|
230
|
+
|
|
231
|
+
for (const hit of hits) {
|
|
232
|
+
const displayPath = isGlobal
|
|
233
|
+
? hit.file.replace(os.homedir(), "~")
|
|
234
|
+
: hit.file.replace(process.cwd(), ".");
|
|
235
|
+
console.log(
|
|
236
|
+
` - ${displayPath}:${hit.line}\n ${dim}${hit.snippet}${reset}`,
|
|
237
|
+
);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
console.log("");
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
167
244
|
console.log(` Installing to ${cyan}${locationLabel}${reset}\n`);
|
|
168
245
|
|
|
169
246
|
// Create commands directory (singular "command" not "commands")
|
|
@@ -188,6 +265,9 @@ function install(isGlobal) {
|
|
|
188
265
|
copyWithPathReplacement(skillSrc, skillDest, pathPrefix);
|
|
189
266
|
console.log(` ${green}✓${reset} Installed get-shit-done`);
|
|
190
267
|
|
|
268
|
+
// Post-install diagnostic (do not fail install).
|
|
269
|
+
scanForUnresolvedRepoLocalTokens(opencodeDir);
|
|
270
|
+
|
|
191
271
|
// Create VERSION file
|
|
192
272
|
fs.writeFileSync(path.join(skillDest, "VERSION"), `v${pkg.version}`);
|
|
193
273
|
console.log(` ${green}✓${reset} Created VERSION file`);
|
|
@@ -327,9 +327,9 @@ questions: [
|
|
|
327
327
|
question: "Which AI models for planning agents?",
|
|
328
328
|
multiSelect: false,
|
|
329
329
|
options: [
|
|
330
|
-
{ label: "Balanced
|
|
331
|
-
{ label: "Quality", description: "
|
|
332
|
-
{ label: "Budget", description: "
|
|
330
|
+
{ label: "Balanced", description: "planning/verifier: opencode/glm-4.7-free, execution: opencode/minimax-m2.1-free" },
|
|
331
|
+
{ label: "Quality", description: "All stages: opencode/glm-4.7-free" },
|
|
332
|
+
{ label: "Budget", description: "planning/verifier: opencode/minimax-m2.1-free, execution: opencode/grok-code" }
|
|
333
333
|
]
|
|
334
334
|
}
|
|
335
335
|
]
|
|
@@ -344,6 +344,31 @@ Create `.planning/config.json` with all settings:
|
|
|
344
344
|
"parallelization": true|false,
|
|
345
345
|
"commit_docs": true|false,
|
|
346
346
|
"model_profile": "quality|balanced|budget",
|
|
347
|
+
"profiles": {
|
|
348
|
+
"active_profile": "balanced",
|
|
349
|
+
"presets": {
|
|
350
|
+
"quality": {
|
|
351
|
+
"planning": "opencode/glm-4.7-free",
|
|
352
|
+
"execution": "opencode/glm-4.7-free",
|
|
353
|
+
"verification": "opencode/glm-4.7-free"
|
|
354
|
+
},
|
|
355
|
+
"balanced": {
|
|
356
|
+
"planning": "opencode/glm-4.7-free",
|
|
357
|
+
"execution": "opencode/minimax-m2.1-free",
|
|
358
|
+
"verification": "opencode/glm-4.7-free"
|
|
359
|
+
},
|
|
360
|
+
"budget": {
|
|
361
|
+
"planning": "opencode/minimax-m2.1-free",
|
|
362
|
+
"execution": "opencode/grok-code",
|
|
363
|
+
"verification": "opencode/minimax-m2.1-free"
|
|
364
|
+
}
|
|
365
|
+
},
|
|
366
|
+
"custom_overrides": {
|
|
367
|
+
"quality": {},
|
|
368
|
+
"balanced": {},
|
|
369
|
+
"budget": {}
|
|
370
|
+
}
|
|
371
|
+
},
|
|
347
372
|
"workflow": {
|
|
348
373
|
"research": true|false,
|
|
349
374
|
"plan_check": true|false,
|
|
@@ -374,6 +399,46 @@ EOF
|
|
|
374
399
|
)"
|
|
375
400
|
```
|
|
376
401
|
|
|
402
|
+
**Generate opencode.json from active profile:**
|
|
403
|
+
|
|
404
|
+
Create `opencode.json` in the project root. This is a derived config that assigns a model to each GSD agent.
|
|
405
|
+
|
|
406
|
+
Use the effective stage models from `.planning/config.json`:
|
|
407
|
+
|
|
408
|
+
- planning model = `profiles.presets.{active_profile}.planning` (unless overridden)
|
|
409
|
+
- execution model = `profiles.presets.{active_profile}.execution` (unless overridden)
|
|
410
|
+
- verification model = `profiles.presets.{active_profile}.verification` (unless overridden)
|
|
411
|
+
|
|
412
|
+
Write `opencode.json`:
|
|
413
|
+
|
|
414
|
+
```json
|
|
415
|
+
{
|
|
416
|
+
"$schema": "https://opencode.ai/config.json",
|
|
417
|
+
"agent": {
|
|
418
|
+
"gsd-planner": { "model": "{planning model}" },
|
|
419
|
+
"gsd-plan-checker": { "model": "{planning model}" },
|
|
420
|
+
"gsd-phase-researcher": { "model": "{planning model}" },
|
|
421
|
+
"gsd-roadmapper": { "model": "{planning model}" },
|
|
422
|
+
"gsd-project-researcher": { "model": "{planning model}" },
|
|
423
|
+
"gsd-research-synthesizer": { "model": "{planning model}" },
|
|
424
|
+
"gsd-codebase-mapper": { "model": "{planning model}" },
|
|
425
|
+
"gsd-executor": { "model": "{execution model}" },
|
|
426
|
+
"gsd-debugger": { "model": "{execution model}" },
|
|
427
|
+
"gsd-verifier": { "model": "{verification model}" },
|
|
428
|
+
"gsd-integration-checker": { "model": "{verification model}" }
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
```
|
|
432
|
+
|
|
433
|
+
**Commit opencode.json:**
|
|
434
|
+
|
|
435
|
+
```bash
|
|
436
|
+
git add opencode.json
|
|
437
|
+
git commit -m "chore: configure opencode agent models"
|
|
438
|
+
```
|
|
439
|
+
|
|
440
|
+
**Important:** OpenCode loads `opencode.json` at session start and does not hot-reload. If you change profiles later via `/gsd-set-profile` or `/gsd-settings`, run `/new` (or restart OpenCode) for it to take effect.
|
|
441
|
+
|
|
377
442
|
**Note:** Run `/gsd-settings` anytime to update these preferences.
|
|
378
443
|
|
|
379
444
|
## Phase 5.5: Resolve Model Profile
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gsd-set-model
|
|
3
|
+
description: Configure models for a specific profile's stages (planning/execution/verification)
|
|
4
|
+
arguments:
|
|
5
|
+
- name: profile
|
|
6
|
+
description: "Profile name: quality, balanced, or budget (optional - will prompt if not provided)"
|
|
7
|
+
required: false
|
|
8
|
+
agent: gsd-set-model
|
|
9
|
+
tools:
|
|
10
|
+
- read
|
|
11
|
+
- write
|
|
12
|
+
- bash
|
|
13
|
+
- question
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
<objective>
|
|
17
|
+
Configure the models assigned to each stage (planning, execution, verification) for a specific profile.
|
|
18
|
+
|
|
19
|
+
Unlike `/gsd-set-profile` which switches between profiles, this command lets you define *what models* a profile uses. Implementation lives in the `gsd-set-model` agent.
|
|
20
|
+
</objective>
|
|
21
|
+
|
|
22
|
+
<process>
|
|
23
|
+
|
|
24
|
+
Run the model configuration flow using the `gsd-set-model` agent.
|
|
25
|
+
|
|
26
|
+
</process>
|
|
27
|
+
|
|
28
|
+
<examples>
|
|
29
|
+
|
|
30
|
+
**Configure the balanced profile:**
|
|
31
|
+
|
|
32
|
+
```text
|
|
33
|
+
/gsd-set-model balanced
|
|
34
|
+
|
|
35
|
+
Configuring models for: balanced
|
|
36
|
+
|
|
37
|
+
Select model for Planning stage:
|
|
38
|
+
> anthropic/claude-sonnet-4-20250514
|
|
39
|
+
|
|
40
|
+
Select model for Execution stage:
|
|
41
|
+
> anthropic/claude-sonnet-4-20250514
|
|
42
|
+
|
|
43
|
+
Select model for Verification stage:
|
|
44
|
+
> openai/gpt-4o-mini
|
|
45
|
+
|
|
46
|
+
✓ Updated balanced profile:
|
|
47
|
+
| Stage | Model |
|
|
48
|
+
|-------|-------|
|
|
49
|
+
| planning | anthropic/claude-sonnet-4-20250514 |
|
|
50
|
+
| execution | anthropic/claude-sonnet-4-20250514 |
|
|
51
|
+
| verification | openai/gpt-4o-mini |
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
**Interactive mode (no argument):**
|
|
55
|
+
|
|
56
|
+
```text
|
|
57
|
+
/gsd-set-model
|
|
58
|
+
|
|
59
|
+
Which profile do you want to configure?
|
|
60
|
+
> Balanced
|
|
61
|
+
|
|
62
|
+
Configuring models for: balanced
|
|
63
|
+
...
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
</examples>
|
|
67
|
+
|
|
68
|
+
<success_criteria>
|
|
69
|
+
|
|
70
|
+
- [ ] `.planning/config.json` exists (or clear error shown)
|
|
71
|
+
- [ ] User selects a profile (or provides via argument)
|
|
72
|
+
- [ ] User selects models for all three stages from available models
|
|
73
|
+
- [ ] Profile preset is updated in `.planning/config.json`
|
|
74
|
+
- [ ] `opencode.json` is regenerated if the modified profile is active
|
|
75
|
+
- [ ] Clear confirmation shown with updated model assignments
|
|
76
|
+
|
|
77
|
+
</success_criteria>
|