--- name: setup-pstack description: Configure which models pstack uses per role and at what reasoning budget. Detects your available models and writes a user config file that overrides the skill defaults. Use for /setup-pstack, "configure pstack models", "pstack budget", or changing pstack's model choices. --- # Setup pstack Write `~/.claude/pstack-models.mdc`, a user-level config file that pstack skills read for model-per-role overrides. Canonical Claude Code defaults live under the plugin `claude/` directory (maintained by **tune-pstack-models**): | Profile | File | | ---------------- | ---------------------------------------------------------------------- | | `balanced` | `${CLAUDE_PLUGIN_ROOT}/claude/pstack-role-defaults.txt` | | `cost-efficient` | `${CLAUDE_PLUGIN_ROOT}/claude/pstack-role-defaults.cost-efficient.txt` | ## Steps ### 1. Detect available models Enumerate model identifiers you can assign to subagents (Agent tool `model` parameter, `/model`, or your environment's model list). If you cannot detect any, ask the user to paste the models they have access to. Never write a model id you have not confirmed is available. The aliases `inherit-parent` and `auto` are always valid even though they are not detected slugs. Prefer Claude Code aliases `opus`, `sonnet`, and `haiku` in role lines ([model configuration](https://code.claude.com/docs/en/model-config)). Treat them as available when the environment is first-party Claude Code. Otherwise map detected full slugs (`claude-opus-*`, `claude-sonnet-*`, `claude-haiku-*`) to the closest tier. ### 2. Load current state If `~/.claude/pstack-models.mdc` already exists, read its `# profile`, `# budget`, and role lines as the current choices. Otherwise start from the profile file for the budget the user will pick in step 3 (see profile table below). If the plugin is installed, read that file from `${CLAUDE_PLUGIN_ROOT}/claude/`; if not installed, use the balanced example in step 5. Drop retired roles such as `how critics`. **Budget → profile → defaults file** | Budget | Profile | Defaults file | | ----------- | ---------------- | ----------------------------------------- | | `unlimited` | `balanced` | `pstack-role-defaults.txt` | | `large` | `balanced` | `pstack-role-defaults.txt` | | `medium` | `cost-efficient` | `pstack-role-defaults.cost-efficient.txt` | | `small` | `cost-efficient` | `pstack-role-defaults.cost-efficient.txt` | ### 3. Budget, map, and confirm **(a) Ask for a budget.** Prefer structured multiple-choice when available. Offer these four options with these exact labels, and name the current budget when the file records one. With no file, say that `large` selects the **balanced** profile. - `unlimited — max reasoning` - `large — high reasoning` - `medium — medium reasoning` - `small — low reasoning` **(b) Apply profile and effort.** Load role lines from the defaults file for the chosen budget (table in step 2). On a re-run, keep any role the user changed manually. Write `# profile: balanced` or `# profile: cost-efficient` to match the file. Write `# budget: