โ† Back to list
wasintoh

smart-routing

by wasintoh

๐ŸŽฏ "Type Once, Have it all!" AI-Orchestration Driven Development framework for Solo Developers & Solopreneurs. Build production-ready SaaS with natural language commands. Supports Claude Code, Cursor, Gemini CLI, Codex CLI. No questions asked, just results.

โญ 71๐Ÿด 14๐Ÿ“… Jan 18, 2026

SKILL.md


name: smart-routing description: > 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.

Smart Routing Skill

Intelligent routing engine for the /toh smart command. Routes any natural language request to the right agent(s).


๐Ÿง  Routing Pipeline

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    USER REQUEST                                 โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                                 โ”‚
โ”‚  STEP 0: MEMORY CHECK (ALWAYS FIRST!)                          โ”‚
โ”‚  โ”œโ”€โ”€ Read .toh/memory/active.md                                โ”‚
โ”‚  โ”œโ”€โ”€ Read .toh/memory/summary.md                               โ”‚
โ”‚  โ”œโ”€โ”€ Read .toh/memory/decisions.md                             โ”‚
โ”‚  โ””โ”€โ”€ Build context understanding                               โ”‚
โ”‚                                                                 โ”‚
โ”‚  STEP 1: INTENT CLASSIFICATION                                 โ”‚
โ”‚  โ”œโ”€โ”€ Pattern matching (keywords, phrases)                      โ”‚
โ”‚  โ”œโ”€โ”€ Context inference (from memory)                           โ”‚
โ”‚  โ””โ”€โ”€ Scope detection (simple/complex)                          โ”‚
โ”‚                                                                 โ”‚
โ”‚  STEP 2: CONFIDENCE SCORING                                    โ”‚
โ”‚  โ”œโ”€โ”€ HIGH (80%+) โ†’ Direct execution                            โ”‚
โ”‚  โ”œโ”€โ”€ MEDIUM (50-80%) โ†’ Plan Agent first                        โ”‚
โ”‚  โ””โ”€โ”€ LOW (<50%) โ†’ Ask for clarification                        โ”‚
โ”‚                                                                 โ”‚
โ”‚  STEP 3: IDE DETECTION                                         โ”‚
โ”‚  โ”œโ”€โ”€ Claude Code โ†’ Parallel execution enabled                  โ”‚
โ”‚  โ””โ”€โ”€ Other IDEs โ†’ Sequential execution only                    โ”‚
โ”‚                                                                 โ”‚
โ”‚  STEP 4: AGENT SELECTION & EXECUTION                           โ”‚
โ”‚  โ””โ”€โ”€ Route to appropriate agent(s)                             โ”‚
โ”‚                                                                 โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ“Š Intent Classification Matrix

Primary Patterns โ†’ Agent Mapping

Pattern CategoryKeywords (EN)Keywords (TH)Primary AgentConfidence
Create UIcreate, add, make, build + page/component/UIเธชเธฃเน‰เธฒเธ‡, เน€เธžเธดเนˆเธก, เธ—เธณ + เธซเธ™เน‰เธฒ/componentUI AgentHIGH
Add Logiclogic, state, function, hook, validationlogic, state, function, เน€เธžเธดเนˆเธก logicDev AgentHIGH
Fix Bugbug, error, broken, fix, not workingbug, error, เธžเธฑเธ‡, เน„เธกเนˆเธ—เธณเธ‡เธฒเธ™, เนเธเน‰Fix AgentHIGH
Improve Designprettier, beautiful, design, polish, styleเธชเธงเธข, design, เธ›เธฃเธฑเธš designDesign AgentHIGH
Testingtest, check, verifytest, เธ—เธ”เธชเธญเธš, เน€เธŠเน‡เธ„Test AgentHIGH
Connect Backendconnect, database, Supabase, API, backendเน€เธŠเธทเนˆเธญเธก, database, SupabaseConnect AgentHIGH
Deploydeploy, ship, production, publishdeploy, ship, เธ‚เธถเน‰เธ™ productionShip AgentHIGH
LINE PlatformLINE, LIFF, Mini AppLINE, LIFFLINE AgentHIGH
Mobile Platformmobile, iOS, Android, Expo, React Nativemobile, เธกเธทเธญเธ–เธทเธญMobile AgentHIGH
New Projectnew project, start, build app, create systemproject เนƒเธซเธกเนˆ, เธชเธฃเน‰เธฒเธ‡ appVibe AgentHIGH
Planningplan, analyze, PRD, architectureเธงเธฒเธ‡เนเธœเธ™, เธงเธดเน€เธ„เธฃเธฒเธฐเธซเนŒPlan AgentHIGH
AI/Promptprompt, AI, chatbot, system promptprompt, AI, chatbotDev Agent + prompt-optimizerHIGH
Continuecontinue, resume, go onเธ—เธณเธ•เนˆเธญ, เธ•เนˆเธญMemory โ†’ Last AgentMEDIUM
Complex RequestMultiple features, system, e-commerce, etc.เธฃเธฐเธšเธš + เธซเธฅเธฒเธข featuresPlan AgentMEDIUM
Vague Requesthelp, fix it, make better (without context)เธŠเนˆเธงเธขเธ”เน‰เธงเธข, เนเธเน‰เธ—เธตAsk ClarificationLOW

๐ŸŽฏ Confidence Scoring Algorithm

interface ConfidenceFactors {
  keywordMatch: number;      // 0-40 points
  contextClarity: number;    // 0-30 points
  memorySupport: number;     // 0-20 points
  scopeDefinition: number;   // 0-10 points
}

function calculateConfidence(request: string, memory: Memory): number {
  let score = 0;
  
  // Keyword matching (0-40 points)
  // Strong match with primary patterns = 40
  // Partial match = 20
  // No match = 0
  score += keywordMatchScore(request);
  
  // Context clarity (0-30 points)
  // Specific page/component mentioned = 30
  // General area mentioned = 15
  // No specifics = 0
  score += contextClarityScore(request);
  
  // Memory support (0-20 points)
  // Request relates to active task = 20
  // Request relates to project = 10
  // No memory context = 0
  score += memorySupportScore(request, memory);
  
  // Scope definition (0-10 points)
  // Single clear task = 10
  // Multiple related tasks = 5
  // Unclear scope = 0
  score += scopeDefinitionScore(request);
  
  return score; // 0-100
}

// Thresholds
const HIGH_CONFIDENCE = 80;    // Execute directly
const MEDIUM_CONFIDENCE = 50;  // Route to Plan Agent
// Below 50 = Ask for clarification

๐Ÿ–ฅ๏ธ IDE Detection

Detection Method

function detectIDE(): 'claude-code' | 'cursor' | 'gemini' | 'codex' | 'unknown' {
  // Check for IDE-specific markers
  
  // Claude Code detection
  if (hasClaudeCodeMarkers()) {
    return 'claude-code';
  }
  
  // Cursor detection
  if (hasCursorRules()) {
    return 'cursor';
  }
  
  // Gemini CLI detection
  if (hasGeminiConfig()) {
    return 'gemini';
  }
  
  // Codex CLI detection
  if (hasCodexConfig()) {
    return 'codex';
  }
  
  return 'unknown';
}

Execution Strategy by IDE

IDEMulti-Agent StrategyReason
Claude CodeParallel (spawn sub-agents)Native support for parallel tool calls
CursorSequentialMore predictable, follows diff flow
Gemini CLISequentialSafer execution model
Codex CLISequentialLinear task processing
UnknownSequential (default)Safe fallback

๐Ÿ”„ Routing Decision Tree

Request arrives
      โ”‚
      โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ 1. Load Memory Context              โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
      โ”‚
      โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ 2. Is request "continue"/"เธ—เธณเธ•เนˆเธญ"?   โ”‚
โ”œโ”€โ”€ YES โ†’ Read memory, resume task   โ”‚
โ””โ”€โ”€ NO โ†’ Continue analysis           โ”‚
      โ”‚
      โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ 3. Calculate Confidence Score       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
      โ”‚
      โ”œโ”€โ”€ Score >= 80 (HIGH)
      โ”‚   โ””โ”€โ†’ Select agent based on intent
      โ”‚       โ””โ”€โ†’ Execute directly
      โ”‚
      โ”œโ”€โ”€ Score 50-79 (MEDIUM)
      โ”‚   โ””โ”€โ†’ Route to Plan Agent
      โ”‚       โ””โ”€โ†’ Plan Agent analyzes & routes
      โ”‚
      โ””โ”€โ”€ Score < 50 (LOW)
          โ””โ”€โ†’ Ask clarifying question
              โ””โ”€โ†’ Wait for user response

๐Ÿ“‹ Clarification Patterns

When to Ask

SituationExampleAction
No verb/action"the login"Ask: "What would you like to do with login?"
No target"make it work"Ask: "Which page/component should I fix?"
Multiple interpretations"improve it"Ask: "Design, performance, or features?"
Missing context + no memory"fix it"Ask: "What's broken? Describe the issue."

When NOT to Ask

SituationExampleAction
Clear intent"create login page"Execute directly
Memory provides context"continue" + active task existsResume from memory
Reasonable default exists"add a button"Add to current page context

๐ŸŽจ Skill Loading by Intent

Detected IntentSkills to Load
New Projectvibe-orchestrator, design-mastery, business-context, response-format
Create UIui-first-builder, design-excellence, response-format
Add Logicdev-engineer, error-handling, response-format
Fix Bugdebug-protocol, error-handling, response-format
Connect Backendbackend-engineer, integrations, response-format
Improve Designdesign-excellence, design-mastery, response-format
AI/Chatbotprompt-optimizer, dev-engineer, response-format
Testingtest-engineer, error-handling, response-format
Planningplan-orchestrator, business-context, response-format

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

  1. Memory ALWAYS first - Never route without checking context
  2. Confidence drives action - Trust the scoring system
  3. Plan Agent is your friend - When in doubt, route to Plan
  4. IDE awareness matters - Parallel only in Claude Code
  5. response-format always loaded - Every response needs 3 sections

Smart Routing Skill v1.0.0 - Intelligent Request Routing Engine

Score

Total Score

75/100

Based on repository quality metrics

โœ“SKILL.md

SKILL.mdใƒ•ใ‚กใ‚คใƒซใŒๅซใพใ‚Œใฆใ„ใ‚‹

+20
โœ“LICENSE

ใƒฉใ‚คใ‚ปใƒณใ‚นใŒ่จญๅฎšใ•ใ‚Œใฆใ„ใ‚‹

+10
โœ“่ชฌๆ˜Žๆ–‡

100ๆ–‡ๅญ—ไปฅไธŠใฎ่ชฌๆ˜ŽใŒใ‚ใ‚‹

+10
โ—‹ไบบๆฐ—

GitHub Stars 100ไปฅไธŠ

0/15
โ—‹ๆœ€่ฟ‘ใฎๆดปๅ‹•

3ใƒถๆœˆไปฅๅ†…ใซๆ›ดๆ–ฐใŒใ‚ใ‚‹

0/10
โœ“ใƒ•ใ‚ฉใƒผใ‚ฏ

10ๅ›žไปฅไธŠใƒ•ใ‚ฉใƒผใ‚ฏใ•ใ‚Œใฆใ„ใ‚‹

+5
โœ“Issue็ฎก็†

ใ‚ชใƒผใƒ—ใƒณIssueใŒ50ๆœชๆบ€

+5
โœ“่จ€่ชž

ใƒ—ใƒญใ‚ฐใƒฉใƒŸใƒณใ‚ฐ่จ€่ชžใŒ่จญๅฎšใ•ใ‚Œใฆใ„ใ‚‹

+5
โ—‹ใ‚ฟใ‚ฐ

1ใคไปฅไธŠใฎใ‚ฟใ‚ฐใŒ่จญๅฎšใ•ใ‚Œใฆใ„ใ‚‹

0/5

Reviews

๐Ÿ’ฌ

Reviews coming soon