--- name: setup-pstack description: Configure which models pstack uses per role and at what budget. Writes ~/.claude/pstack-models.md, a config file that overrides the skill defaults, and wires it into your Claude Code memory so it applies to new sessions. Use for /setup-pstack, "configure pstack models", "pstack budget", or changing pstack's model choices. --- # Setup pstack Write `~/.claude/pstack-models.md`, a config file that sets pstack's model per role, and import it from `~/.claude/CLAUDE.md` so every session sees it. ## Steps ### 1. Know the available models Claude Code's Agent tool accepts the aliases `opus`, `sonnet`, and `haiku`, or a full model ID such as `claude-opus-4-1`. There is no API to list entitled models, so treat the three aliases as always valid and ask the user before writing any full model ID. A full ID is pinned and may stop resolving when the model is retired. The aliases `inherit-parent` and `auto` are always valid too, and mean the role runs on the parent chat model (omit the Agent `model`). Never write a model value the user did not choose or that is not one of these. ### 2. Load current state The default role-to-model mapping is the file shape shown in step 5 below. If `~/.claude/pstack-models.md` already exists, read it and treat its `# budget` line and its role values as the current choices. Otherwise start from those defaults. A line whose role is not in step 5, such as `how critics`, is from a retired role. Drop it. ### 3. Budget, map, and confirm **(a) Ask for a budget.** Prefer `AskUserQuestion` over free text. Offer these four options with these exact labels, and name the current budget when the file records one. With no file, say that `large` matches the skill defaults. - `unlimited — opus everywhere` - `large — opus for judgment, sonnet for code` - `medium — sonnet everywhere` - `small — sonnet for judgment, haiku for exploration and routine code` **(b) Apply it.** Build the working table from the skill defaults, and on a re-run keep any role you changed by hand to a list, a pinned ID, or an alias (`inherit-parent`, `auto`). Tier the real model values like this: | Budget | Judgment, prose, hardest tasks, reviewers | Code, explorers, workers | |---|---|---| | `unlimited` | `opus` | `opus` | | `large` | `opus` | `sonnet` | | `medium` | `sonnet` | `sonnet` | | `small` | `sonnet` | `haiku` | Panel roles (arena runners, architect runners, interrogate reviewers, arena cross-judge pool) are lists, one subagent per entry. Under `large` they are `opus, sonnet`. Under `unlimited` they are `opus, opus`. Under `medium` they are `sonnet, sonnet`. Under `small` they are `sonnet, haiku`. `inherit-parent` and `auto` do not change. Claude Code has no per-spawn reasoning effort or fast-mode setting, so the budget picks the model tier only. Use `/effort` and `/fast` for the session itself. **(c) Show the roles and confirm.** Show every role with its model. Also list each line step 2 dropped. Ask whether to accept as-is or change specific roles, offering `opus`, `sonnet`, `haiku`, `inherit-parent`, and `auto` as the options. Prefer `AskUserQuestion` over free text. For panel roles the value is a list, and one subagent runs per entry, alias entries included, so the list length sets the count. `arena cross-judge pool` is also a list, but Arena selects one value from it that differs from the parent's tier when possible. `swarm workers` is the default model for every worker unless a race or comparison assigns another model per arm. ### 4. Validate Every value written must be `opus`, `sonnet`, `haiku`, `inherit-parent`, `auto`, or a full model ID the user chose. If the user chose a full ID, say it is pinned. If anything else was chosen, stop and ask again. ### 5. Write the config file Write `~/.claude/pstack-models.md` with a `# budget` line with the chosen label, and one line per role, using the same labels poteto-mode uses. Overwrite the whole file so re-runs stay idempotent. Shape: ``` # pstack model configuration. One line per role. Delete a line to fall back to the skill default. # `inherit-parent` or `auto` as a value: the role runs on the parent chat model (omit Agent `model`). Alias entries in a panel list still count toward its fan-out. # budget: large (opus judgment, sonnet code) feature, refactoring: sonnet bug-fix: sonnet perf-issue: sonnet hillclimb: sonnet judgment and prose: opus hardest tasks: opus how explorer: sonnet how explainer: opus why investigators: sonnet why synthesizer: opus reflect tooling: sonnet reflect judgment, divergent, synthesizer: opus arena runners: opus, sonnet arena cross-judge pool: opus, sonnet swarm workers: sonnet architect runners: opus, sonnet interrogate reviewers: opus, sonnet ``` ### 6. Import it into Claude Code memory Claude Code has no always-applied rules directory, so a file under `~/.claude/` is only read when something loads it. Check `~/.claude/CLAUDE.md` for the line `@pstack-models.md`. If it is missing, show the user the one line to add and, on yes, append it (create the file if needed, keep the rest untouched). Imports resolve relative to the importing file, so `@pstack-models.md` finds `~/.claude/pstack-models.md`. On no, tell the user the skills still read `~/.claude/pstack-models.md` directly when they spawn a role, so the file works either way, but poteto-mode's defaults only see it if it is in context. ### 7. Confirm Tell the user the file was written and that it applies to new sessions. Re-running this skill updates it. ### 8. Offer a verification skill (optional) Check whether the project has a way to drive the real app for proof (a `verify-*` skill, or an existing harness). If not, offer once: "want a project-local verification skill, so agents can drive the app the way a user does and prove changes work? I can generate one with /create-verification-skill." On yes, invoke `/create-verification-skill` (resolves wherever pstack is installed: workspace, user, or plugin). On no, move on without pushing.