Skip to content
intelligent-router logo

Intelligent Router

intelligent-router

Analyzes user questions and automatically dispatches optimal agents/skills/plugins

mattnigh/skills_collection0installs24stars

SKILL.md

Full skill instructions

🎯 Intelligent Router - Smart Agent/​Skill/​Plugin Dispatch

Overview

The Intelligent Router is an automatic orchestration system that analyzes user questions and intelligently selects the optimal combination of:

  • 🤖 Agents (specialized subagents)
  • 🎯 Skills (knowledge bundles)
  • 🔌 Plugins (global tools)
  • 📚 Docs (project documentation)
  • 🛠️ Tools (native Claude tools)

Design Philosophy: B - Medium Router

  • ✅ Auto-loads relevant skills
  • ✅ Auto-dispatches primary agent
  • 💡 Suggests optional agents (you choose)
  • 📊 Transparent reporting (you see everything)

When This Skill Activates

Smart Auto-Detect triggers on:

  • ✅ Questions with 5+ words
  • ✅ Action verbs: "maak", "bouw", "fix", "deploy", "test", etc.
  • ✅ Complex requests (multiple domains)

Skips on:

  • ❌ Simple questions: "Wat is X?", "Hoe werkt Y?"
  • ❌ Short queries (< 5 words)
  • ❌ Informational requests

How It Works

Phase 1: Analysis

User Question
    ↓
Intent Detection (analyze-intent.js)
    ↓
Match Against Routing Matrix
    ↓
Calculate Match Scores
    ↓
Identify Domains & Complexity

Phase 2: Resource Collection

Collect ALL Matched Routes
    ↓
Primary Route = Highest Score
    ↓
Gather:
  - Skills from all matches
  - Plugins from all matches
  - Docs from all matches
  - Tools from primary route
  - Optional agents from secondary matches

Phase 3: Dispatch

Auto-Load:
  ✅ Skills (via skill-loader.js)
  ✅ Docs (loaded into context)
  ✅ Plugins (activated)

Auto-Dispatch:
  ✅ Primary Agent (Task tool)

Suggest:
  💡 Optional Agents (you choose to dispatch)
  💡 Additional tools
  💡 Memory check (episodic-memory)

Phase 4: Transparent Reporting

Display Formatted Analysis:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🎯 INTELLIGENT ROUTER ANALYSIS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

📊 Detected Intent: [...]
📁 Complexity: [SIMPLE|MEDIUM|HIGH|COMPLEX]
🎯 Domains: [...]

✅ AUTO-LOADED SKILLS: [...]
✅ AUTO-DISPATCHED: [agent] → [reason]
💡 OPTIONAL DISPATCH: [suggestions]

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Routing Matrix

The router uses routing-matrix.json with 20+ predefined routes:

Critical Routes (Always Priority)

  • memory_recall - Episodic memory search
  • security_review - OWASP compliance, vulnerability scanning
  • authentication - User auth, login systems
  • complex_feature - Multi-domain features → master-orchestrator

High Priority Routes

  • backend_api - REST/​GraphQL API development
  • backend_database - SQL, schema design, queries
  • frontend_ui - React/​Vue components, UI work
  • testing_unit - TDD, unit/​integration tests
  • architecture - System design, tech stack decisions
  • debugging - Bug fixes, error resolution

Medium Priority Routes

  • ux_design - UI/​UX, dashboards, premium interfaces
  • testing_e2e - Playwright, browser automation
  • data_engineering - ETL pipelines, data warehouses
  • deployment - CI/​CD, production deploys
  • ai_ml_integration - LLM, RAG, vector databases
  • accessibility - WCAG compliance, inclusive design

Specialized Routes

  • code_search - Finding code, codebase analysis
  • browser_automation - Web scraping, UI testing
  • git_operations - Worktrees, branching
  • documentation - Writing docs, README files

Complexity Assessment

Router automatically determines complexity:

Simple (1 domain, < 10 words)

  • Single file edit
  • Small bug fix
  • Quick query → Auto-dispatch: Direct to specialist agent

Medium (2 domains, 10-30 words)

  • New feature in one area
  • Moderate refactoring
  • Standard API endpoint → Auto-dispatch: Primary agent + suggest related agents

High (3 domains, 30-50 words)

  • Cross-cutting feature
  • Security + functionality
  • Multiple file changes → Auto-dispatch: Primary agent + optional specialists

Complex (3+ domains, complex requirements)

  • Complete new module
  • System redesign
  • Multi-domain integration → Requires: master-orchestrator with sub-agents

Progressive Context Loading

Router uses 3 levels for skills:

Level 1: Always Load

  • Core principles (2-5KB)
  • Quick reference
  • Essential patterns

Level 2: Load on Request

  • Detailed patterns (10-15KB)
  • Complete examples
  • Architecture guidance

Level 3: Full Context

  • All scripts
  • Templates
  • Automation tools

Default: Router loads Level 1 for all matched skills Escalation: Request Level 2/​3 if needed

Example Routing Scenarios

Example 1: Simple Bug Fix

User: "Fix deze error in login.ts"

Router Analysis:
  Intent: Bug fixing
  Complexity: SIMPLE
  Domains: debugging, backend

Auto-Loaded:
  - systematic-debugging skill
  - testing-fundamentals skill

Auto-Dispatched:
  - senior-fullstack-developer

Optional:
  - qa-testing-engineer (regression tests)

Example 2: Authentication System

User: "Maak een login systeem met registratie"

Router Analysis:
  Intent: User authentication
  Complexity: HIGH
  Domains: security, backend, frontend

Auto-Loaded:
  - security-essentials skill
  - backend-development-patterns skill
  - testing-fundamentals skill

Auto-Dispatched:
  - backend-specialist (primary)

Optional:
  - security-specialist (OWASP review)
  - frontend-specialist (login UI)
  - qa-testing-engineer (security tests)

Docs Loaded:
  - docs/​security.md
  - docs/​backend.md

Example 3: Complete Feature

User: "Bouw een dashboard met gebruikers, data visualisatie en export"

Router Analysis:
  Intent: Multi-domain feature
  Complexity: COMPLEX
  Domains: frontend, backend, data, ux

Auto-Loaded:
  - backend-development-patterns skill
  - testing-fundamentals skill
  - brainstorming skill

Auto-Dispatched:
  - master-orchestrator
    Sub-agents (parallel):
      - backend-specialist (API)
      - frontend-specialist (Dashboard UI)
      - data-engineer (Data pipeline)
      - ux-design-expert (Charts/​UX)
      - qa-testing-engineer (Test strategy)

Example 4: Database Query

User: "Optimaliseer deze SQL query die te langzaam is"

Router Analysis:
  Intent: Database optimization
  Complexity: MEDIUM
  Domains: data-engineering, backend

Auto-Loaded:
  - backend-development-patterns skill

Auto-Dispatched:
  - data-engineer

Tools Activated:
  - sql-universal-expert

Optional:
  - senior-fullstack-developer (code refactor)

Docs Loaded:
  - docs/​backend.md

Usage

Automatic (Recommended)

Router activates automatically when:

  1. User asks question with 5+ words
  2. Question contains action verbs
  3. Question seems like a task (not just info)

No manual activation needed!

Manual Testing

Test router analysis before dispatching:

# Analyze a question
node .claude/​skills/​intelligent-router/​scripts/​analyze-intent.js analyze "Maak een API"

# Get JSON output
node .claude/​skills/​intelligent-router/​scripts/​analyze-intent.js analyze "Fix bug" --json

Integration with Hooks

Router integrates via .claude/​hooks/​pre-prompt.sh (optional):

#!/​bin/​bash
# Activate intelligent-router for every question
# Router internally checks if it should activate

Configuration

Customize Routing Matrix

Edit routing-matrix.json to:

  • Add new routes
  • Modify trigger keywords
  • Adjust priorities
  • Add custom agents/​skills

Customize Auto-Detect

Edit auto_detect_config in routing-matrix.json:

{
  "min_word_count": 5,
  "action_verbs": ["maak", "bouw", "fix", ...],
  "skip_keywords": ["wat is", "hoe werkt", ...],
  "always_check_memory": true
}

Complexity Thresholds

Adjust in complexity_thresholds:

{
  "simple": {
    "max_words": 10,
    "max_domains": 1,
    "auto_dispatch": true
  },
  ...
}

Router Decision Tree

User Question
    ↓
[Should Activate?]
    ├─ No → Normal response (skip router)
    └─ Yes → Continue
         ↓
    [Find Matches]
         ↓
    [No Matches?]
         ├─ Yes → Normal response
         └─ No → Continue
              ↓
         [Analyze Complexity]
              ↓
         [Simple/​Medium/​High] → Auto-dispatch primary agent
         [Complex] → Dispatch master-orchestrator
              ↓
         [Display Analysis]
              ↓
         [Execute Dispatch]

Best Practices

For Users

  • ✅ Be specific in your questions (better matching)
  • ✅ Use action verbs when you want work done
  • ✅ Trust the router's suggestions
  • ✅ Dispatch optional agents if they make sense

For Developers

  • ✅ Keep routing-matrix.json updated
  • ✅ Add new routes for new capabilities
  • ✅ Test routes with analyze-intent.js
  • ✅ Monitor which routes get triggered most
  • ✅ Refine trigger keywords based on usage

Troubleshooting

Router Not Activating

# Check question meets criteria
node scripts/​analyze-intent.js analyze "your question"

# If "activate: false", question too simple
# Solution: Add more context or action verbs

Wrong Agent Dispatched

# Check routing matrix matches
cat routing-matrix.json | grep -A 5 "your_keyword"

# Update triggers if needed

Skills Not Loading

# Verify skills exist
node ../​skill-loader.js list

# Check skill names in routing-matrix.json match

Metrics & Improvement

Track router effectiveness:

  • Activation rate - How often it activates vs skips
  • Accuracy - Did it pick right agent/​skills?
  • User satisfaction - Did suggestions help?
  • Iteration count - How many back-and-forth needed?

Store in: .claude-memory/​router-metrics.md

Version History

v1.0.0 (Initial Release)

  • Smart auto-detect activation
  • 20+ predefined routes
  • Complexity assessment
  • Multi-level skill loading
  • Transparent reporting
  • Optional agent suggestions

Future Enhancements

Planned features:

  • Learning from past routing decisions
  • User preference tracking
  • Route effectiveness scoring
  • Dynamic route creation
  • Integration with episodic-memory for pattern learning
  • Web UI for route visualization

Resources

  • Routing Matrix: routing-matrix.json
  • Intent Analyzer: scripts/​analyze-intent.js
  • Examples: examples/​routing-scenarios.md
  • Tests: examples/​test-cases.md

Version: 1.0.0 Author: CLAUDE Framework Team License: MIT Compatibility: Claude Code 1.0+, Claude 3.5 Sonnet+

More skills from mattnigh

spring-framework-patterns logo
mattnigh/skills_collection

spring-framework-patterns

Comprehensive Spring Framework and Spring Boot best practices including dependency injection patterns, bean lifecycle and scopes, REST API development, Spring Data JPA, service layer design, Spring Security, testing strategies, caching, AOP, async processing, error handling, and common anti-patte...

24 0
View

TypeScript厳格モードによる型安全性設計を専門とするスキル。 📖 参照書籍: - 『Effective TypeScript』(Dan Vanderkam): 型設計 📚 リソース参照: - `resources/Level1_basics.md`: レベル1の基礎ガイド - `resources/Level2_intermediate.md`: レベル2の実務ガイド - `resources/Level3_advanced.md`: レベル3の応用ガイド - `resources/Level4_expert.md`: レベル4の専門ガイド - `resources/di...

24 0
View
deploying-cloud-k8s logo
mattnigh/skills_collection

deploying-cloud-k8s

Deploys applications to cloud Kubernetes (AKS/GKE/DOKS) with CI/CD pipelines. Use when deploying to production, setting up GitHub Actions, troubleshooting deployments. Covers build-time vs runtime vars, architecture matching, and battle-tested debugging.

24 0
View
moai-alfred-agent-guide logo
mattnigh/skills_collection

moai-alfred-agent-guide

19-agent team structure, decision trees for agent selection, Haiku vs Sonnet model selection, and agent collaboration principles. Use when deciding which sub-agent to invoke, understanding team responsibilities, or learning multi-agent orchestration.

24 0
View
mermaid-diagram-generator logo
mattnigh/skills_collection

mermaid-diagram-generator

Converts architecture descriptions, module specs, or workflow docs into Mermaid diagrams. Use when visualizing brick module relationships, workflows (DDD, investigation), or system architecture. Supports: flowcharts, sequence diagrams, class diagrams, state machines, entity relationship diagrams,...

24 0
View
pre-flight-check logo
mattnigh/skills_collection

pre-flight-check

INVOKE FIRST before any code work. Validates git workflow (branch, issue, worklog) and checks approach. Use at START of every task and END before completing. Prevents skipped steps.

24 0
View
browser-dev-tools logo
mattnigh/skills_collection

browser-dev-tools

This skill should be used when working with browser-rendered artifacts (i.e. Bun, React/React Native) to proactively validate that development work on localhost is being built appropriately and to support debugging browser-rendered content. Use this skill after making frontend changes to verify t...

24 0
View
lead-dev logo
mattnigh/skills_collection

lead-dev

Lead Développeur - Coordination technique opérationnelle, code review, mentoring et livraison. Pair de web-dev-process au niveau OPÉRATIONS.

24 0
View
worker-monitor logo
mattnigh/skills_collection

worker-monitor

Monitor Docker workers, RQ queue health, and auto-scale workers (max 4). Use when: checking job progress, monitoring queue depth, scaling workers up/down, diagnosing slow processing, or waiting for jobs to complete. Referenced by data-quality skill during reprocessing.

24 0
View
quality-advisor logo
mattnigh/skills_collection

quality-advisor

Proactive quality guidance system that monitors artifact creation and provides real-time feedback on documentation quality

24 0
View
bump-version logo
mattnigh/skills_collection

bump-version

This skill should be used when the user wants to bump the version number in the workspace. It updates versions across all pyproject.toml files (root, tde, and tda packages) and the CHANGELOG.md to keep them synchronized.

24 0
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View