From rune
Enforces routing of every agent action through correct skills before code, files, or technical decisions. Checks adaptive overrides from metrics, defaults to rune:cook for code tasks.
npx claudepluginhub rune-kit/rune --plugin @rune/analyticsThis skill uses the workspace's default tool permissions.
Routing overrides (if available): !`cat .rune/metrics/routing-overrides.json 2>/dev/null || echo "No adaptive routing rules active."`
Creates, edits, and verifies Rune skills using TDD: pressure tests first, baseline agent failures without skill, iterate to bulletproof. For Claude Code.
Routes natural language requests to skills and workflows by parsing intent and matching patterns for SDLC phases, gate checks, artifacts, security reviews, and marketing tasks.
Share bugs, ideas, or general feedback.
Routing overrides (if available): !cat .rune/metrics/routing-overrides.json 2>/dev/null || echo "No adaptive routing rules active."
Recent skill usage: !cat .rune/metrics/skills.json 2>/dev/null | head -20 || echo "No metrics collected yet."
The missing enforcement layer for Rune. While individual skills have HARD-GATEs and constraints, nothing forces the agent to check for the right skill before acting. skill-router fixes this by intercepting every user request and routing it through the correct skill(s) before any code is written, any file is read, or any clarifying question is asked.
This is L0 — it sits above L1 orchestrators. It doesn't do work itself; it ensures the right skill does the work.
Before standard routing, check if adaptive routing rules exist:
Read on .rune/metrics/routing-overrides.jsoncondition against the current user intentOverride constraints:
Model hint support (Adaptive Model Re-balancing):
"model_hint": "opus" — this signals that a skill previously failed at sonnet-level and needed opus reasoning depthSkill-router's routing table above IS the trigger table — it maps keywords to skill paths without loading any skill content. Skills are loaded on-demand via the Skill tool only when routed. This keeps baseline context usage minimal.
Rules for context efficiency:
Before intent classification, categorize the request into one of 5 types. This determines the enforcement level — how strictly routing must be followed.
| Request Type | Keywords / Signals | Enforcement | Action |
|---|---|---|---|
CODE_CHANGE | "build", "implement", "add", "create", "fix", "refactor", "update code" | FULL | cook mandatory, no exceptions |
QUESTION | "what is", "how does", "explain", "why" | LITE | Check if a skill has domain knowledge first; answer directly if no skill matches |
DEBUG_REQUEST | "error", "bug", "not working", "broken", "crash", "fails" | FULL | debug skill mandatory |
REVIEW_REQUEST | "review", "check", "audit", "look at this code" | FULL | review skill mandatory |
EXPLORE | "find", "search", "where is", "show me", "list" | LITE | scout if codebase-related; answer directly if general |
Enforcement levels:
Escape hatch: If request is clearly trivial (< 5 LOC change, single-line fix, user says "just do it"), classify as CODE_CHANGE but cook activates Fast Mode automatically.
/rune list)If user says /rune list, "what skills do I have", "show all skills", "available skills", or "what can rune do":
Glob for skills/*/skill.md (core L0-L3) and extensions/*/PACK.md (L4 packs)Glob for extensions/pro-*/PACK.md (Pro/Business packs — only present if purchased)## Rune Skills Catalog
### Core Skills (L0-L3) — Always Available
| Skill | Layer | Description |
|-------|-------|-------------|
(list each skill from skills/*/skill.md — read name + description from frontmatter)
### Extension Packs (L4) — Domain Knowledge
| Pack | Skills | Trigger |
|------|--------|---------|
(list each pack from extensions/*/PACK.md — read name + skill count + trigger commands)
### Pro/Business Packs (if installed)
| Pack | Skills | Trigger |
|------|--------|---------|
(list each pack from extensions/pro-*/PACK.md)
/rune <pack> <skill> to invoke any skill directly. Use /rune <pack> for the full pack workflow."Filtering: /rune list <query> filters by name or domain keyword (e.g., /rune list finance shows only finance-related skills).
Before generating ANY response (including clarifying questions), the agent MUST:
Skills are organized into 3 tiers for discoverability. Tier 1 skills handle 90% of user requests.
These 5 skills are the main interface. Most user intents route here first:
| User Intent | Route To | When |
|---|---|---|
| Build / implement / add feature / fix bug | rune:cook | Any code change request |
| Large multi-part task / parallel work | rune:team | 5+ files or 3+ modules |
| Deploy + launch + marketing | rune:launch | Ship to production |
| Legacy code / rescue / modernize | rune:rescue | Old/messy codebase |
| Check project health / full audit | rune:audit | Quality assessment |
| New project / bootstrap / scaffold | rune:scaffold | Greenfield project creation |
| Auto / autopilot / autonomous / "do it all" / "làm hết" / "đi ngủ" | rune:autopilot ⚡Pro | Autonomous multi-session execution (requires approved plan + Pro tier installed) |
Default route: If unclear, route to rune:cook. Cook handles 70% of all requests.
Pro skill note:
rune:autopilotrequires@rune-proinstalled. If not available, fall back torune:cookwith the approved plan and inform user that autopilot is a Pro feature.
For users who know exactly what they want:
| User Intent | Route To | Priority |
|---|---|---|
| Plan / design / architect | rune:plan | L2 — requires opus |
| Brainstorm / explore ideas | rune:brainstorm | L2 — before plan |
| Review code / check quality | rune:review | L2 |
| Write tests | rune:test | L2 — TDD |
| Refactor | rune:surgeon | L2 — incremental |
| Deploy (without marketing) | rune:deploy | L2 |
| Security concern | rune:sentinel | L2 — opus for critical |
| Performance issue | rune:perf | L2 |
| Database change | rune:db | L2 |
| Received code review / PR feedback | rune:review-intake | L2 |
| Protect / audit / document business logic | rune:logic-guardian | L2 |
| Create / edit a Rune skill | rune:skill-forge | L2 — requires opus |
| Incident / outage | rune:incident | L2 |
| UI/UX design | rune:design | L2 |
| Fix bug / debug only (no fix) | rune:debug → rune:fix | L2 chain |
| Marketing assets only | rune:marketing | L2 |
| Gather requirements / BA / elicit needs | rune:ba | L2 — requires opus |
| Generate / update docs | rune:docs | L2 |
| Build MCP server | rune:mcp-builder | L2 |
| Red-team / challenge a plan / stress-test | rune:adversary | L2 — requires opus |
These are rarely invoked directly — they're called by Tier 1/2 skills:
| Skill | Called By | Purpose |
|---|---|---|
rune:scout | cook, plan, team | Codebase scanning |
rune:fix | debug, cook | Apply code changes |
rune:preflight | cook | Quality gate |
rune:verification | cook, fix | Run lint/test/build |
rune:hallucination-guard | cook, fix | Verify imports |
rune:completion-gate | cook | Validate claims |
rune:sentinel-env | cook, scaffold, onboard | Environment pre-flight |
rune:research / rune:docs-seeker | any | Look up docs |
rune:session-bridge | cook, team | Save context (in-session state handoff) |
rune:journal | cook, team | Persistent work log within a session |
rune:neural-memory | cook, team, any L1/L2 | Cross-session cognitive persistence via Neural Memory MCP — semantic complement to session-bridge and journal |
rune:git | cook, scaffold, team, launch | Semantic commits, PRs, branches |
rune:doc-processor | docs, marketing | PDF/DOCX/XLSX/PPTX generation |
| "Done" / "ship it" / "xong" | — | rune:verification → commit |
| "recall", "remember", "brain", "nmem", "cross-project memory" | rune:neural-memory | Retrieve or persist cross-session context |
When user intent matches a domain-specific pattern or user explicitly invokes an L4 trigger command, route to the L4 pack.
Split pack loading (context-efficient): First Read the pack's PACK.md index. If the index contains format: split in its frontmatter metadata, it is a split pack — the index lists skills in a table but skill content lives in separate files under skills/. Match user intent to the specific skill name in the table, then Read only that skill file (e.g., extensions/backend/skills/api-design.md). This loads ~100-200 lines instead of ~1000+.
Monolith pack loading (legacy): If no format: split marker, the PACK.md contains all skills inline — read it fully and extract the matching ### skill-name section.
| User Intent / Domain Signal | Route To | Pack File |
|---|---|---|
| Frontend UI, design system, a11y, animation | @rune/ui | extensions/ui/PACK.md |
| API design, auth, middleware, rate limiting | @rune/backend | extensions/backend/PACK.md |
| Docker, CI/CD, monitoring, server setup | @rune/devops | extensions/devops/PACK.md |
| React Native, Flutter, mobile app, app store | @rune/mobile | extensions/mobile/PACK.md |
| OWASP, pentest, secrets, compliance | @rune/security | extensions/security/PACK.md |
| Trading, fintech, charts, market data | @rune/trading | extensions/trading/PACK.md |
| Multi-tenant, billing, SaaS subscription | @rune/saas | extensions/saas/PACK.md |
| Shopify, payments, cart, inventory | @rune/ecommerce | extensions/ecommerce/PACK.md |
| LLM, RAG, embeddings, fine-tuning | @rune/ai-ml | extensions/ai-ml/PACK.md |
| Three.js, WebGL, game loop, physics | @rune/gamedev | extensions/gamedev/PACK.md |
| Blog, CMS, MDX, i18n, SEO | @rune/content | extensions/content/PACK.md |
| Analytics, A/B testing, funnels, dashboards | @rune/analytics | extensions/analytics/PACK.md |
| Chrome extension, manifest, service worker | @rune/chrome-ext | extensions/chrome-ext/PACK.md |
| PRD, roadmap, KPI, release notes, product spec | @rune-pro/product | extensions/pro-product/PACK.md |
| Sales outreach, pipeline, call prep, prospecting | @rune-pro/sales | extensions/pro-sales/PACK.md |
| Data science, SQL, dashboards, statistical analysis | @rune-pro/data-science | extensions/pro-data-science/PACK.md |
| Support tickets, KB, escalation, SLA tracking | @rune-pro/support | extensions/pro-support/PACK.md |
| Budget, expense, revenue forecast, P&L, cash flow | @rune-pro/finance | extensions/pro-finance/PACK.md |
| Contract review, NDA, compliance, GDPR, IP audit | @rune-pro/legal | extensions/pro-legal/PACK.md |
L4 routing rules:
/rune rag-patterns), read the PACK.md index first, then load only the matching skill file (split packs) or extract the matching section (monolith packs)cook (L1) first — cook will detect L4 context in Phase 1.5When the routed skill produces file changes, the owner skill's constraints apply to those files — even if a different skill (e.g., cook) is the orchestrator.
| File Pattern | Owner Skill | Constraints Applied |
|---|---|---|
*.test.*, *.spec.*, __tests__/ | rune:test | Test patterns, assertions, no test.skip, coverage rules |
migrations/, schema.*, *.prisma | rune:db | Migration safety, rollback script, parameterized queries |
Dockerfile, *.yml (CI/CD), terraform/ | rune:deploy | Deployment checklist, no hardcoded secrets |
docs/*.md, README.md, CHANGELOG.md | rune:docs | Documentation patterns, no stale references |
SKILL.md, PACK.md | rune:skill-forge | Skill template compliance, frontmatter validation |
.env*, *secret*, *credential* | rune:sentinel | Security scan mandatory, never commit secrets |
*.css, *.scss, tailwind.config.* | @rune/ui | Design system patterns (if L4 pack installed) |
Ownership rules:
Many requests combine intents. Route to the HIGHEST-PRIORITY skill first:
Priority: L1 > L2 > L3
Within same layer: process skills > implementation skills
Example: "Add auth and deploy it"
→ rune:cook (add auth) FIRST
→ rune:deploy SECOND (after cook completes)
Example: "Fix the login bug and add tests"
→ rune:debug (diagnose) FIRST
→ rune:fix (apply fix) SECOND
→ rune:test (add tests) THIRD
L4 integration: If cook is the primary route AND a domain pack matches,
cook handles orchestration while the L4 pack provides domain patterns.
Both are active — cook for workflow, L4 for domain knowledge.
The agent MUST NOT bypass routing with these excuses:
| Thought | Reality | Action |
|---|---|---|
| "This is too simple for a skill" | Simple tasks still benefit from structure | Route it |
| "I already know how to do this" | Skills have constraints you'll miss | Route it |
| "Let me just read the file first" | Skills tell you HOW to read | Route first |
| "I need more context before routing" | Route first, skill will gather context | Route it |
| "The user just wants a quick answer" | Quick answers can still be wrong | Check routing table |
| "No skill matches exactly" | Pick closest match, or use scout + plan | Route it |
| "I'll apply the skill patterns mentally" | Mental application misses constraints | Actually invoke it |
| "This is just a follow-up" | Follow-ups can change intent | Re-check routing |
Once routed:
rune:<skill> to [purpose]"After ANY L1 or L2 workflow completes (cook, team, launch, rescue, scaffold, plan, design, debug, fix, review, deploy, sentinel, perf, db, ba, docs, mcp-builder, etc.):
rune:neural-memory in Capture Mode automaticallyCapture Mode trigger phrase: "Session artifact — capturing to Neural Memory."
These DO NOT need skill routing:
At the end of a skill's workflow, skill-router MAY suggest a complementary skill — limited to ONE recommendation to prevent infinite referral chains.
When a previous skill's output contains a chain_metadata block in the conversation context, skill-router MUST use it as the PRIMARY source for next-skill suggestions:
chain_metadata.suggested_next — these are data-driven recommendations from the skill that just ran. They have MORE context than the hardcoded table below.chain_metadata.status — override suggestion logic based on outcome:
BLOCKED → suggest debug or fix regardless of what the hardcoded table saysNEEDS_CONTEXT → suggest scout or researchDONE_WITH_CONCERNS → suggest review or sentinelchain_metadata.domain — trigger L4 pack auto-suggest (see below)chain_metadata.exports — when announcing the suggestion, mention what data is available: "Review can use the 5 changed files and test results from cook."Conflict resolution: If chain_metadata.suggested_next recommends skill A but the hardcoded table below recommends skill B, prefer chain_metadata — it was generated from actual output data, not generic rules.
Announcement format with chain_metadata:
Suggested next: `rune:<skill>` — <chain_metadata.suggested_next.reason>
Available data: <list of export keys the suggested skill would consume>
Run it? (skip to continue)
When NO chain_metadata is present (skill didn't emit one, or legacy invocation), fall back to this static table:
| After This Skill | Suggest | Rationale |
|---|---|---|
debug | fix | Root cause found — apply the fix |
fix | test | Code changed — verify with tests |
plan | adversary | Plan created — stress-test before implementation |
test (GREEN) | preflight | Tests pass — check for edge cases and completeness |
review (issues found) | fix | Issues identified — apply fixes |
sentinel (findings) | fix | Security issues — remediate |
When routing a request through L1/L2 skills, skill-router SHOULD detect domain signals and suggest relevant L4 packs the user may not know they have:
| Domain Signal Detected | Suggest Pack | Announcement |
|---|---|---|
| Financial terms (budget, revenue, P&L, runway, cash flow) | @rune-pro/finance | "You have @rune-pro/finance with 7 specialized skills. Use /rune finance to access." |
| Legal terms (contract, NDA, compliance, GDPR, IP) | @rune-pro/legal | "You have @rune-pro/legal with 6 specialized skills. Use /rune legal to access." |
| HR terms (hiring, JD, interview, onboarding, comp) | @rune-pro/hr | "You have @rune-pro/hr with 7 specialized skills. Use /rune hr to access." |
| Product terms (PRD, roadmap, KPI, release notes) | @rune-pro/product | "You have @rune-pro/product with 6 specialized skills. Use /rune product to access." |
| Sales terms (pipeline, outreach, prospecting) | @rune-pro/sales | "You have @rune-pro/sales with 6 specialized skills. Use /rune sales to access." |
| Data terms (SQL, dashboard, statistical, ML eval) | @rune-pro/data-science | "You have @rune-pro/data-science with 7 specialized skills. Use /rune data to access." |
| Support terms (ticket, KB, escalation, SLA) | @rune-pro/support | "You have @rune-pro/support with 6 specialized skills. Use /rune support to access." |
| Search terms (enterprise search, knowledge graph) | @rune-pro/enterprise-search | "You have @rune-pro/enterprise-search with 6 specialized skills. Use /rune search to access." |
Auto-suggest rules:
Glob for the pack path first. If not installed, skip silently.Rules:
rune:<skill> — [1-line reason]. Run it? (skip to continue)"cook orchestration: skip recommendations — cook already manages transitionsEvery response that involves code changes MUST begin with a routing proof line:
> Routed: rune:<skill> | Type: CODE_CHANGE | Confidence: HIGH
This is NOT optional formatting. It is evidence that routing occurred. If this line is missing from a code response, the response violated skill-router compliance. For LITE enforcement (QUESTION, EXPLORE), the proof line is optional.
## Routing Decision
- **Intent**: [classified user intent]
- **Type**: CODE_CHANGE | QUESTION | DEBUG_REQUEST | REVIEW_REQUEST | EXPLORE
- **Skill**: rune:[skill-name]
- **Confidence**: HIGH | MEDIUM | LOW
- **Override**: [routing override applied, if any]
- **Reason**: [one-line justification for skill selection]
For multi-skill chains:
## Routing Chain
1. rune:[skill-1] — [purpose]
2. rune:[skill-2] — [purpose]
3. rune:[skill-3] — [purpose]
| Failure Mode | Severity | Mitigation |
|---|---|---|
| Agent writes code without invoking any skill | CRITICAL | Constraint 3: code REQUIRES skill routing. No exceptions. |
| Agent "mentally applies" skill without invoking | HIGH | Constraint 2: must use Skill tool for full content |
| Routes to wrong skill, wastes a full workflow | MEDIUM | Step 2 compound resolution + re-route on mismatch |
| Over-routing trivial tasks (e.g., "what time is it") | LOW | Routing Exceptions section covers non-technical queries |
| Skill invocation adds latency to simple tasks | LOW | Acceptable trade-off: correctness > speed |
If the request type is CODE_CHANGE or DEBUG_REQUEST (FULL enforcement) and ANY answer is "no":
→ DO NOT RESPOND. Complete routing first.
If the request type is QUESTION or EXPLORE (LITE enforcement):
→ Check if a skill has relevant domain knowledge. If yes, route. If no, respond directly.
User override: If user explicitly says "skip routing", "just write it", "no process" → respect the override. Log: "User override: routing skipped per explicit request."
~0 tokens (routing logic is internalized from this document). Cost comes from the skills it routes to, not from skill-router itself. The routing table is loaded once and cached in context.