/skill-router:skill-routerfrom Skill Router
Routes every prompt to the right installed skill using a route card, pairs domain and process skills, enforces tiers, and suggests uninstalled skills when nothing installed fits.
Ships in Skill Router. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Routing runs from hooks. A UserPromptSubmit hook classifies every prompt
and injects a route card before your first action. Your job is to
follow the card, not to compute one.
[skill-router] This is a BROKEN task — 2-step chain.
[skill-router] Chain: mac-doctor → superpowers:systematic-debugging
▶ mac-doctor (inherit, in-session)
▶ superpowers:systematic-debugging (inherit, in-session)
[skill-router] Gates before done: simulator screenshot
[skill-router] Memory: mac_crash_root_cause (read from your project's memory/ directory)
[skill-router] IRON RULE: call Skill(skill="mac-doctor") before any Edit/Write/Task.
▶ is the domain skill — one of yours, or a plugin's. Load it first.▶ is the process skill (debugging, planning, TDD). Load it next.| Line on the card | Meaning |
|---|---|
IRON RULE: … | hard — Edit/Write/Task are denied until the skill is loaded. BROKEN path, and project routes with gates. |
Soft route: … | soft — nothing is blocked. If you finish without loading it, the Stop hook asks once; answer by loading it or by one line [skill-router] skipped <skill>: <reason>. |
Wrong route either way: python3 ${CLAUDE_PLUGIN_ROOT}/scripts/router_override.py "<reason>" --session-id "<current session id>".
The user can also write [no-router] in their message.
SKILL.personal.md (@economicalai, capgo, …) — deterministic.jev_choose.py, ~0.4 s, cached) reads the whole enriched index (~/.claude/skill_index.json) in one call — no lexical pre-filter, so typos do not matter — and answers two Choice questions: domain skill, process skill. Confidence ≥ 0.8 routes; anything lower is silence (a 0.5–0.8 Possible fit: line exists behind SKILL_ROUTER_JEV_SUGGEST=1, off by default — it was right one time in three). When Jev answers, only Jev puts a skill on the card; a skill already loaded this session is never carded again.${CLAUDE_PLUGIN_ROOT}/references/routing-tables.md) supplies the process leg on the fallback path only.Questions, discussion and harness noise get no card. Silence is an answer.
The same Jev call answers a fourth question, work tier: light
(grep, list, summarise, rename, one fixed rule across files), standard
(routine work against a clear spec) or heavy (design, root cause, security,
anything ambiguous). Same 0.8 gate; below it, or heavy, nothing changes.
| Where | What happens |
|---|---|
| Sub-agent dispatch | The Task/Agent hook judges the sub-agent's own prompt and sets model: light → haiku, standard → sonnet, else inherits the session. An explicit model= in your call always wins. |
| Route card | Work: light (jev 0.91) → sub-agents dispatch on haiku — one line, only when the tier moves the model. Delegate the bulk part; it will come back on Haiku. |
| Quota strained | When the status line has reported a 5-hour or weekly window ≥ 80 % and the work is light/standard, the card adds one line pointing at Kimi: bash ${CLAUDE_PLUGIN_ROOT}/scripts/kimi_offload.sh [--tier light] "<task>" — a second claude -p on Moonshot (K2.7-code for light, K3 1M otherwise). Run it from Bash and use its output. Heavy work never goes to Kimi. Once per half hour per session; at ≥ 95 % the bar drops from 0.8 to 0.5. |
Knobs: SKILL_ROUTER_SUBAGENT_MODEL=0 (never set a dispatch model),
SKILL_ROUTER_KIMI=quota|always|off (default quota),
SKILL_ROUTER_QUOTA_HIGH=80, SKILL_ROUTER_QUOTA_CRITICAL=95.
${CLAUDE_PLUGIN_ROOT}/scripts/quota.py prints what the router currently believes.
The whole router stands down under SKILL_ROUTER_OFF=1 (the Kimi child sets it).
Every Agent(...) dispatch gets the parent's route appended to its prompt
(skill, gates, memory) and its model set from the work tier above, and
SubagentStart briefs the agent with the skills paired to its type.
Enforcement never reaches inside a sub-agent.
Non-trivial task, no [skill-router] line? Run the fallback yourself:
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/router.py <<< "the prompt".
If that is silent too, routing may be dead: python3 ${CLAUDE_PLUGIN_ROOT}/scripts/doctor.py.
Two layers feed one route card.
preference.py builds a usage store
(~/.claude/skill_router_usage.json) from every Skill call: the router log,
skill_usage.log and a one-time, incremental backfill of Claude Code
transcripts. Score = recency-weighted frequency (30-day half-life) × test
outcomes after the skill loaded, plus optional pins/demotions in
~/.claude/skill_router_prefs.json ({"pin": [...], "demote": [...]}). The
ranker uses it only to break near-ties: at most ±8 % of a skill's score, so a
clearly better match always wins.[skill-router] Consider installing `helm-charts` (online:antigravity): Create, manage, and deploy Helm charts… — <source URL>
[skill-router] install (review the source first): <install command>
When you see one: mention it to the user with the source link; do not install it yourself, and carry on with the best installed skill or none. Installing is the user's decision, after they review the source.
When the user asks to find a skill or extend capabilities, use the integrated manual discovery command with short public search terms:
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/find_skills.py --query 'react performance' --out /tmp/skill-search-new --rank
Search queries go to skills.sh; --rank additionally sends the query and source descriptions to the configured JEV provider. Never pass private conversation history automatically. The command checks the installed index, inspects pinned public SKILL.md sources, and returns candidates with provenance, popularity metadata and structured inspection failures. JEV ranks at the unchanged 0.8 threshold and can abstain. Results require source review and cannot invoke or install a skill. Installation is a separate user-directed action. See ${CLAUDE_PLUGIN_ROOT}/docs/find-skills.md for bounds, options and partial-result handling. This command does not change prompt hooks or the current installed-skill routing policy.
| Command | When |
|---|---|
${CLAUDE_PLUGIN_ROOT}/scripts/doctor.py | routing feels dead, or after a Claude Code upgrade |
${CLAUDE_PLUGIN_ROOT}/scripts/build_index.py --enrich | you installed or edited a skill |
${CLAUDE_PLUGIN_ROOT}/scripts/index_match.py --all "<prompt>" | a route looked wrong — see the ranking |
${CLAUDE_PLUGIN_ROOT}/scripts/learn.py --show | what has been learned |
${CLAUDE_PLUGIN_ROOT}/scripts/check.sh | after editing any routing logic |
${CLAUDE_PLUGIN_ROOT}/scripts/preference.py --show | which skills your usage ranks first |
${CLAUDE_PLUGIN_ROOT}/scripts/external_discovery.py "<prompt>" | what external skill would be suggested, and why |
${CLAUDE_PLUGIN_ROOT}/scripts/skill_safety.py --dupes | byte-identical skills installed under several names or agents |
${CLAUDE_PLUGIN_ROOT}/scripts/listing_plan.py | keep the skill listing inside Claude Code's budget |
Project routes, projects, gates: SKILL.personal.md (kept outside the plugin at ~/.claude/skill-router/SKILL.personal.md, so updates never touch it). Full tables and protocols: ${CLAUDE_PLUGIN_ROOT}/references/routing-tables.md.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub hussi9/skill-router --plugin skill-routerOther plugins' skills for the same job