Skill Router — Universal Router
Output always: Skill + Agent + Model
THE 3-QUESTION TRIAGE (run now, takes 5 seconds)
Q1: Is something BROKEN / WRONG / FAILING?
Error, crash, test fail, unexpected output, user correction
YES → BROKEN PATH
Q2: Is this CREATE / BUILD / ADD something new?
New feature, file, component, integration, page, script
YES → BUILD PATH
Q3: Everything else (improve, ship, configure, automate, research)
→ OPERATE PATH
AMBIGUOUS? → Default to HIGHER-COMPLEXITY path
BROKEN PATH
| Signal | Skill | Agent | Model | Thinking |
|---|---|---|---|---|
| Error / crash / exception | superpowers:systematic-debugging | general-purpose | sonnet | think |
| Test failing | test-runner → superpowers:systematic-debugging | test-runner | sonnet | none |
| TypeScript errors | typescript-expert | general-purpose | sonnet | none |
| Performance regression | perf → superpowers:systematic-debugging | optimizer | sonnet | think |
| Security issue found | security | security-auditor | sonnet | think-hard |
| Deploy / build failed | superpowers:systematic-debugging | general-purpose | sonnet | think |
| User says "no" / "wrong" | STOP → superpowers:systematic-debugging | general-purpose | sonnet | think |
| Production incident | superpowers:systematic-debugging | general-purpose | opus | ultrathink |
BUILD PATH
Multi-file / new feature: brainstorming → writing-plans → domain skill
Single file / trivial add: go directly to domain skill
| What | Skill | Agent | Model | Thinking |
|---|---|---|---|---|
| UI component / page | frontend-design:frontend-design | feature-dev:code-architect | sonnet | none |
| API endpoint | feature-dev:feature-dev | feature-dev:code-architect | sonnet | think |
| Database schema | db-expert | db-expert | sonnet | think |
| Auth / permissions | brainstorming → security | security-auditor | opus | ultrathink |
| AI feature / agent | superpowers:brainstorming | feature-dev:code-architect | sonnet | think-hard |
| 3rd-party integration | connect-apps | integration-specialist | sonnet | none |
| Mobile screen | frontend-design:frontend-design | feature-dev:code-architect | sonnet | none |
| CLI / automation script | superpowers:writing-plans | general-purpose | sonnet | think |
| Skill / Claude skill file | superpowers:writing-skills | general-purpose | sonnet | think |
OPERATE PATH
| Signal | Skill | Agent | Model | Thinking |
|---|---|---|---|---|
| Refactor / clean up | refactor | code-simplifier:code-simplifier | sonnet | none |
| Add tests / coverage | superpowers:test-driven-development | test-runner | sonnet | none |
| Performance optimize | perf | optimizer | sonnet | think |
| Write docs | docs | general-purpose | sonnet | none |
| Code review | superpowers:requesting-code-review | superpowers:code-reviewer | sonnet | think-hard |
| Got review feedback | superpowers:receiving-code-review | general-purpose | sonnet | think |
| Deploy | superpowers:verification-before-completion → vercel:deploy | general-purpose | sonnet | none |
| Merge / PR / push | superpowers:finishing-a-development-branch | general-purpose | sonnet | none |
| DB migration | db-expert | db-expert | sonnet | think |
| 2+ independent tasks | superpowers:dispatching-parallel-agents | general-purpose | sonnet | none |
| Resume previous work | superpowers:executing-plans | general-purpose | sonnet | none |
| Research / docs lookup | context7 → brainstorming | general-purpose | sonnet | none |
| Architecture / scope decision | superpowers:brainstorming → superpowers:writing-plans | general-purpose | opus | ultrathink |
WHEN NO SKILL IS NEEDED
Single-line fix · reading code · one factual question · one command · under 3 trivial steps
Router precision contract: when no triage signal matches (BROKEN/BUILD/OPERATE), the
router emits nothing — silence is the correct output. A missing [skill-router] line
means the prompt was conversational, exploratory, or trivial. Do not interpret silence as
"OPERATE → refactor" by default; the router only suggests when it is confident.
Iron rule enforcement: when the router does announce a chain, the announcement
includes an IRON RULE block naming the next required Skill(skill="<X>") call. A
PreToolUse hook denies state-changing tools (Bash, Edit, Write, Task) until that
skill is invoked, and a Stop hook blocks turn end if it never was. Read/Glob/Grep/
TodoWrite remain allowed so context-gathering still works.
Escape hatch: the USER must include [no-router] in their next message to disable
enforcement for that turn. The router stays silent and clears pending state on UserPromptSubmit,
so all hooks pass through. Writing [no-router] in your own response text does NOT clear
pending state — only the user's prompt triggers the clear. If the Stop hook is blocking you
on a ghost skill, it will self-clear on the next user message regardless (ghost-skill guard).
Calibration: tests/calibration.py runs ~100 curated prompts through the router and
reports precision/recall/F1 by triage path. Run with --min-accuracy N for a CI gate.
Current baseline: 100% path accuracy, 95.2% skill accuracy.
Learning loop: scripts/learn-from-history.py joins announcement events
(~/.claude/skill_router_log.jsonl) with actual Skill invocations (~/.claude/ skill_usage.log) and surfaces tuning suggestions — which announced skills are ignored
most often, and which Skill invocations the router missed. Run periodically to keep
patterns calibrated to real usage.
COMPLETION GATE
Before any "done" claim → superpowers:verification-before-completion
□ Code actually runs correctly
□ TypeScript passes (tsc --noEmit)
□ Tests pass
□ Original request fully met (re-read it)
COMPLEXITY RULE
1 domain → 1 skill → single-domain announcement
2+ domains → announce chain → multi-domain announcement
Operators in the chain:
→sequential (B depends on A)+parallel (steps don't share state)
Full chain syntax + standard shapes: see references/multi-domain-chaining.md.
ANNOUNCEMENT FORMAT — Output VERBATIM (substitute only <vars>)
The announcement is the testable contract. Users will grep '\[skill-router\]'
their transcript to verify what fired matches what was announced. Format is
non-negotiable. Output it BEFORE any other tool call (Read, Edit, Bash, Agent).
Single-domain (one skill, no chain):
[skill-router] This is a <BROKEN|BUILD|OPERATE> task → <skill> → <agent>.
[skill-router] Model: <model> · Thinking: <thinking>
[skill-router] Invoke now:
▶ <skill> (<model>, <in-session | via Agent>)
Multi-domain (computed chain):
[skill-router] This touches <N> domains: <d1>, <d2>, <d3>.
[skill-router] Chain: <s1> → <s2> + <s3> → <s4>
[skill-router] Models: <m1> · <m2>+<m3> · <m4> · Thinking: <max-thinking>
[skill-router] Invoke step 1/<N> now:
▶ <s1> (<m1>, <in-session | via Agent>)
▶ <s2> + <s3> (<m2>, parallel via Agent)
▶ <s4> (<m4>, <in-session | via Agent>)
Multi-domain (saved chain wins):
[skill-router] Using your saved chain `<name>`: <s1> → <s2> + <s3>
[skill-router] Models: <m1> · <m2>+<m3> · Thinking: <max-thinking>
[skill-router] Invoke step 1/<N> now:
▶ <s1> (<m1>, <in-session | via Agent>)
▶ <s2> + <s3> (<m2>, parallel via Agent)
Rules:
Models:line uses·between sequential steps and+inside one parallel step.Thinking:is the highest depth of any step (none/think/think-hard/ultrathink). Omit the field when every step isnone.- Each
▶line ends with one of:in-session,via Agent, orparallel via Agent— matching the dispatch protocol decision below.