Intelligent request routing for /toh command. Analyzes user intent, assesses confidence, detects IDE environment, and routes to the appropriate agent(s). Memory-first approach ensures context awareness. Triggers: /toh command, natural language requests, ambiguous inputs.
⭐49stars🔀11forks📁View on GitHub🕐Updated Dec 26, 2025⬇️2downloads
The Smart Routing skill is an advanced orchestration engine designed to streamline multi-agent workflows within development environments. By utilizing a memory-first approach and a sophisticated intent classification matrix, it intelligently directs natural language commands to the most qualified specialized agents (such as UI, Dev, or Fix agents). It enhances efficiency through automated confidence scoring and IDE-aware execution strategies, ensuring that complex tasks are handled with high precision and contextual relevance.
Use Cases
Multi-Agent Task Delegation: Automatically analyzing complex user prompts to dispatch tasks to specialized sub-agents like the UI Builder, Backend Engineer, or Test Agent based on detected intent.
Context-Aware Project Resumption: Leveraging persistent memory files (.toh/memory/) to understand the current state of a project, allowing users to use 'continue' commands without repeating previous instructions.
Environment-Specific Optimization: Detecting whether the user is in Claude Code or other IDEs to toggle between parallel execution for speed or sequential execution for safety.
Automated Ambiguity Resolution: Calculating confidence scores for incoming requests and proactively triggering clarification dialogues when user intent is vague, preventing incorrect automated actions.
name
smart-routing
description
>
Triggers
/toh command, natural language requests, ambiguous inputs.
Smart Routing Skill
Intelligent routing engine for the /toh smart command. Routes any natural language request to the right agent(s).
Note:response-format skill is ALWAYS loaded for proper output formatting.
💾 Memory Integration
Pre-Routing Memory Check
Before routing, ALWAYS:
1. Read .toh/memory/active.md
- Current task context
- In-progress work
- Blockers
2. Read .toh/memory/summary.md
- Project overview
- Completed features
- Tech stack used
3. Read .toh/memory/decisions.md
- Past architectural decisions
- Design choices
- Naming conventions
Use memory to:
- Boost confidence (if request matches active work)
- Provide context (for ambiguous "it" references)
- Maintain consistency (follow established patterns)
Post-Execution Memory Save
After routing completes, ALWAYS:
1. Update .toh/memory/active.md
- Mark completed items
- Update current focus
- Set next steps
2. Add to .toh/memory/decisions.md
- If new decisions were made
3. Update .toh/memory/summary.md
- If feature was completed
⚠️ NEVER finish without saving memory!
📌 Examples
Example 1: High Confidence → Direct
Request: "/toh สร้างหน้า dashboard"
Analysis:
- Keyword match: "สร้าง" + "หน้า" = Create UI (40 pts)
- Context clarity: "dashboard" = specific page (30 pts)
- Memory: Project has other pages (15 pts)
- Scope: Single page (10 pts)
Total: 95 pts = HIGH
Route: UI Agent (direct)
Example 2: Medium Confidence → Plan First
Request: "/toh build e-commerce"
Analysis:
- Keyword match: "build" = Create (40 pts)
- Context clarity: "e-commerce" = general concept (10 pts)
- Memory: New project (0 pts)
- Scope: Multiple features (0 pts)
Total: 50 pts = MEDIUM
Route: Plan Agent first → then execute plan
Example 3: Low Confidence → Ask
Request: "/toh fix it"
Analysis:
- Keyword match: "fix" (20 pts)
- Context clarity: "it" = unclear (0 pts)
- Memory: No recent bugs (0 pts)
- Scope: Unknown (0 pts)
Total: 20 pts = LOW
Action: Ask "What would you like me to fix? Please describe the issue."
⚠️ Critical Rules
Memory ALWAYS first - Never route without checking context
Confidence drives action - Trust the scoring system
Plan Agent is your friend - When in doubt, route to Plan
IDE awareness matters - Parallel only in Claude Code
response-format always loaded - Every response needs 3 sections