feat: Programmatic implementation of /gsd:set-profile command (#1007)
* perf: make `/gsd:set-profile`'s implementation more programmatic * perf: run the set-profile script without Claude needing to invoke it - inject the script's output as dynamic context into the set-profile skill, so that Claude doesn't need to invoke it and can simply read + print the output to the user - reference: https://code.claude.com/docs/en/skills#inject-dynamic-context * feat: improve output message for case where model profile wasn't changed * feat: specify haiku model for set-profile command since it's so simple * fix: remove ' (default)' from previousProfile to avoid false negative for didChange * chore: add docstring to MODEL_PROFILES with note about the analogous markdown reference table * chore: delete set-profile workflow file that's no longer needed
This commit is contained in:
@@ -1,82 +0,0 @@
|
||||
<purpose>
|
||||
Switch the model profile used by GSD agents. Controls which Claude model each agent uses, balancing quality vs token spend.
|
||||
</purpose>
|
||||
|
||||
<required_reading>
|
||||
Read all files referenced by the invoking prompt's execution_context before starting.
|
||||
</required_reading>
|
||||
|
||||
<process>
|
||||
|
||||
<step name="validate">
|
||||
Validate argument:
|
||||
|
||||
```
|
||||
if $ARGUMENTS.profile not in ["quality", "balanced", "budget", "inherit"]:
|
||||
Error: Invalid profile "$ARGUMENTS.profile"
|
||||
Valid profiles: quality, balanced, budget, inherit
|
||||
EXIT
|
||||
```
|
||||
</step>
|
||||
|
||||
<step name="ensure_and_load_config">
|
||||
Ensure config exists and load current state:
|
||||
|
||||
```bash
|
||||
node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" config-ensure-section
|
||||
INIT=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" state load)
|
||||
if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
|
||||
```
|
||||
|
||||
This creates `.planning/config.json` with defaults if missing and loads current config.
|
||||
</step>
|
||||
|
||||
<step name="update_config">
|
||||
Read current config from state load or directly:
|
||||
|
||||
Update `model_profile` field:
|
||||
```json
|
||||
{
|
||||
"model_profile": "$ARGUMENTS.profile"
|
||||
}
|
||||
```
|
||||
|
||||
Write updated config back to `.planning/config.json`.
|
||||
</step>
|
||||
|
||||
<step name="confirm">
|
||||
Display confirmation with model table for selected profile:
|
||||
|
||||
```
|
||||
✓ Model profile set to: $ARGUMENTS.profile
|
||||
|
||||
Agents will now use:
|
||||
|
||||
[Show table from MODEL_PROFILES in gsd-tools.cjs for selected profile]
|
||||
|
||||
Example:
|
||||
| Agent | Model |
|
||||
|-------|-------|
|
||||
| gsd-planner | opus |
|
||||
| gsd-executor | sonnet |
|
||||
| gsd-verifier | haiku |
|
||||
| ... | ... |
|
||||
|
||||
Next spawned agents will use the new profile.
|
||||
```
|
||||
|
||||
Map profile names:
|
||||
- quality: use "quality" column from MODEL_PROFILES
|
||||
- balanced: use "balanced" column from MODEL_PROFILES
|
||||
- budget: use "budget" column from MODEL_PROFILES
|
||||
- inherit: use "inherit" for all agents
|
||||
</step>
|
||||
|
||||
</process>
|
||||
|
||||
<success_criteria>
|
||||
- [ ] Argument validated
|
||||
- [ ] Config file ensured
|
||||
- [ ] Config updated with new model_profile
|
||||
- [ ] Confirmation displayed with model table
|
||||
</success_criteria>
|
||||
Reference in New Issue
Block a user