From claude-dev-toolkit
Analyzes user questions and automatically dispatches optimal agents/skills/plugins
npx claudepluginhub Primadetaautomation/primadata-marketplace --plugin claude-dev-toolkitThis skill uses the workspace's default tool permissions.
The Intelligent Router is an **automatic orchestration system** that analyzes user questions and intelligently selects the optimal combination of:
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.
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.
The Intelligent Router is an automatic orchestration system that analyzes user questions and intelligently selects the optimal combination of:
Design Philosophy: B - Medium Router
Smart Auto-Detect triggers on:
Skips on:
User Question
โ
Intent Detection (analyze-intent.js)
โ
Match Against Routing Matrix
โ
Calculate Match Scores
โ
Identify Domains & Complexity
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
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)
Display Formatted Analysis:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ฏ INTELLIGENT ROUTER ANALYSIS
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ Detected Intent: [...]
๐ Complexity: [SIMPLE|MEDIUM|HIGH|COMPLEX]
๐ฏ Domains: [...]
โ
AUTO-LOADED SKILLS: [...]
โ
AUTO-DISPATCHED: [agent] โ [reason]
๐ก OPTIONAL DISPATCH: [suggestions]
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
The router uses routing-matrix.json with 20+ predefined routes:
Router automatically determines complexity:
Router uses 3 levels for skills:
Default: Router loads Level 1 for all matched skills Escalation: Request Level 2/3 if needed
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)
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
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)
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
Router activates automatically when:
No manual activation needed!
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
Router integrates via .claude/hooks/pre-prompt.sh (optional):
#!/bin/bash
# Activate intelligent-router for every question
# Router internally checks if it should activate
Edit routing-matrix.json to:
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
}
Adjust in complexity_thresholds:
{
"simple": {
"max_words": 10,
"max_domains": 1,
"auto_dispatch": true
},
...
}
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]
# 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
# Check routing matrix matches
cat routing-matrix.json | grep -A 5 "your_keyword"
# Update triggers if needed
# Verify skills exist
node ../skill-loader.js list
# Check skill names in routing-matrix.json match
Every routing recommendation includes a confidence score (0-100).
User Question โ Analyze โ Score Each Match โ Filter โ Report
| Factor | Weight | Description |
|---|---|---|
| Keyword Match | 40% | How many trigger keywords matched |
| Intent Clarity | 25% | How clear is the user's intent |
| Domain Overlap | 20% | Match between question domains and route domains |
| Complexity Fit | 15% | Route complexity matches question complexity |
function calculateConfidence(match, question) {
const keywordScore = (match.matchedKeywords / match.totalKeywords) * 40;
const intentScore = match.intentClarity * 25; // 0.0 - 1.0
const domainScore = (match.domainOverlap / match.totalDomains) * 20;
const complexityScore = match.complexityFit * 15; // 0.0 - 1.0
return Math.round(keywordScore + intentScore + domainScore + complexityScore);
}
| Score | Classification | Action |
|---|---|---|
| 90-100 | Very High | Auto-dispatch immediately |
| 80-89 | High | Auto-dispatch with brief reasoning |
| 60-79 | Medium | Suggest but ask for confirmation |
| 40-59 | Low | Show as alternative option only |
| 0-39 | Very Low | Filter out (don't show) |
In routing-matrix.json:
{
"confidence_config": {
"auto_dispatch_threshold": 80,
"suggest_threshold": 60,
"show_threshold": 40,
"filter_threshold": 40,
"show_reasoning": true,
"show_score": true
}
}
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ฏ INTELLIGENT ROUTER ANALYSIS
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ Detected Intent: Create authentication system
๐ Complexity: HIGH
๐ฏ Domains: security, backend, frontend
โ
AUTO-DISPATCHED:
โโ backend-specialist [92% confidence]
โโ Reason: Strong keyword match (auth, login, register)
๐ก SUGGESTED (confirm to dispatch):
โโ security-specialist [75% confidence]
โโ Reason: Security domain detected but not primary
โโ frontend-specialist [68% confidence]
โโ Reason: UI work likely needed
๐ FILTERED (below threshold):
โโ data-engineer [35%] - No data pipeline keywords
โโ ml-ai-integration [28%] - No AI/ML indicators
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Before: Router dispatched based on first match
After: Router shows confidence levels
If scores seem off, adjust in routing-matrix.json:
{
"routes": {
"authentication": {
"triggers": ["login", "auth", "register", "password"],
"weight_multiplier": 1.2, // Boost this route's scores
"strict_mode": true, // Require more keyword matches
"min_keywords": 2 // At least 2 keywords must match
}
}
}
Track routing confidence over time:
<!-- .claude-memory/router-confidence.md -->
| Date | Question | Agent | Score | Correct? |
|------|----------|-------|-------|----------|
| 2024-01-15 | "Add auth" | backend-specialist | 92% | โ
|
| 2024-01-15 | "Fix CSS" | frontend-specialist | 88% | โ
|
| 2024-01-14 | "Deploy app" | devops-engineer | 67% | โ
(but slow) |
Track router effectiveness:
Store in: .claude-memory/router-metrics.md
Planned features:
routing-matrix.jsonscripts/analyze-intent.jsexamples/routing-scenarios.mdexamples/test-cases.mdVersion: 1.0.0 Author: CLAUDE Framework Team License: MIT Compatibility: Claude Code 1.0+, Claude 3.5 Sonnet+