AGENT SKILL

setup-pstack

Configure which models pstack uses per role and at what reasoning budget. Detects your available models and writes an always-applied rule that overrides the skill defaults. Use for /pstack:setup-pstack, "configure pstack models", "pstack budget", or changing pstack's model choices.

License 许可
MIT
最近更新
2026-10-17
Stars
★ 0
Forks
0

01 前言 Front Matter

name
setup-pstack
description
Configure which models pstack uses per role and at what reasoning budget. Detects your available models and writes an always-applied rule that overrides the skill defaults. Use for /pstack:setup-pstack, "configure pstack models", "pstack budget", or changing pstack's model choices.

03 SKILL.md 正文

Setup pstack

Write ~/.claude/rules/pstack-models.md, an always-applied rule that sets pstack's model per role. Claude Code loads every user rule in ~/.claude/rules/ in every session.

Steps

1. Detect available models

Enumerate the model aliases you can pass as model to the Agent tool in this session (opus, sonnet, haiku, fable, as the tool's schema lists them). That is the dependable source. The aliases come from the Agent tool. Claude Code does not list which efforts each model supports, so each alias is a candidate at low, medium, high, xhigh, and max, one pstack agent per effort, as <alias>-<effort>, such as opus-xhigh. Before writing a role, confirm the chosen entry once with a one-turn probe, claude -p --model <alias> --effort <effort> "reply OK", or tell the user the effort is unconfirmed. If command -v codex succeeds, also run codex debug models and add codex:<slug>-<effort> for each model with "visibility": "list" and each effort in its supported_reasoning_levels. Those entries run through the local codex CLI. If you cannot detect any, ask the user to paste the models they have access to. Never write a real entry you have not confirmed is available. The aliases inherit-parent and auto are always valid even though they are not detected entries.

2. Load current state

The default role-to-model mapping is the rule shape shown in step 5 below. If ~/.claude/rules/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 rule records one. With no rule, say that large matches the skill defaults.

  • unlimited — max reasoning
  • large — xhigh reasoning
  • medium — high reasoning
  • small — medium reasoning

(b) Apply it. Build the working table from the skill defaults, and on a re-run keep any role you changed by family, list, or alias (inherit-parent, auto). unlimited, large, medium, and small set the effort token of every real entry, panel entries included, to max, xhigh, high, or medium. The effort token is the last - token, on the ladder max > xhigh > high > medium > low. If the result is not a detected entry, use the same family's detected entry with the highest effort at or below the target, else mark the role as needing a choice. inherit-parent and auto do not change. So unlimited turns opus-xhigh into opus-max and sonnet-xhigh into sonnet-max. A codex: slug that tops out below the target falls back the same way. large keeps both defaults. small turns them into opus-medium and sonnet-medium.

(c) Show the roles and confirm. Show every role with its model, marking any real entry not in the detected set as needing a choice. Also list each line step 2 dropped. Ask whether to accept as-is or change specific roles, offering the detected models plus inherit-parent and auto (both mean: this role runs on the parent chat model, which is how a session that switches models with /model keeps every role on its choice) as the options. Prefer AskUserQuestion over free text. For panel roles (arena runners, architect runners, interrogate reviewers) 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 whose model family differs from the parent's when possible. swarm workers is the default model for every worker unless a race or comparison assigns another model per arm. When step 1 detected codex, offer once to put a codex:<slug>-<effort> entry in Seat B of each panel role, so a panel mixes two vendors the way Claude-only defaults cannot. That seat runs through ${CLAUDE_PLUGIN_ROOT}/scripts/pstack-seat and falls back to Seat B's default when codex is missing.

4. Validate

Every real entry written must be in the detected set. inherit-parent and auto always pass. If a chosen real entry is not available, stop and ask again.

5. Write the rule

Write ~/.claude/rules/pstack-models.md with no paths frontmatter, so it applies to every session, a # budget line with the chosen label and its target effort, and one line per role, using the same labels poteto-mode uses. Overwrite the whole file so re-runs stay idempotent. Shape:

---
description: pstack per-role model choices (overrides skill defaults)
---
# 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` and use the base agent). Alias entries in a panel list still count toward its fan-out.
# budget: large (xhigh)
feature, refactoring: sonnet-xhigh
bug-fix: sonnet-xhigh
perf-issue: sonnet-xhigh
hillclimb: sonnet-xhigh
judgment and prose: opus-xhigh
hardest tasks: opus-xhigh
how explorer: sonnet-xhigh
how explainer: opus-xhigh
why investigators: sonnet-xhigh
why synthesizer: opus-xhigh
reflect tooling: sonnet-xhigh
reflect judgment, divergent, synthesizer: opus-xhigh
arena runners: opus-xhigh, sonnet-xhigh
arena cross-judge pool: opus-xhigh, sonnet-xhigh
swarm workers: sonnet-xhigh
architect runners: opus-xhigh, sonnet-xhigh
interrogate reviewers: opus-xhigh, sonnet-xhigh

6. Confirm

Tell the user the rule was written and that it applies to new sessions. Re-running this skill updates it.

7. 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 /pstack:create-verification-skill." On yes, invoke /pstack:create-verification-skill (resolves wherever pstack is installed: workspace, user, or plugin). On no, move on without pushing.

04 同仓库更多 Skills