From agentic-skills
A control flow pattern where a central component classifies an input request and directs it to the most appropriate specialized agent or tool. Use when user asks to "route between agents", "agent routing", "task dispatch", or mentions classifier routing, intent detection, or agent selection.
npx claudepluginhub lauraflorentin/skills-marketplace --plugin agentic-skillsThis skill uses the workspace's default tool permissions.
Routing acts as the traffic controller for an agentic system. Instead of a single generalist agent trying to handle every type of user request, a "Router" (often a fast, lightweight LLM or a classifier) analyzes the intent of the incoming message and delegates it to a specialized handler. This creates a system that is modular, scalable, and easier to maintain.
Guides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Migrates code, prompts, and API calls from Claude Sonnet 4.0/4.5 or Opus 4.1 to Opus 4.5, updating model strings on Anthropic, AWS, GCP, Azure platforms.
Analyzes BMad project state from catalog CSV, configs, artifacts, and query to recommend next skills or answer questions. Useful for help requests, 'what next', or starting BMad.
Routing acts as the traffic controller for an agentic system. Instead of a single generalist agent trying to handle every type of user request, a "Router" (often a fast, lightweight LLM or a classifier) analyzes the intent of the incoming message and delegates it to a specialized handler. This creates a system that is modular, scalable, and easier to maintain.
def routing_workflow(user_query):
# Step 1: Classification
# The router's only job is to pick the right path.
intent = classify_intent(
prompt="Classify this query into: [SALES, SUPPORT, BILLING]",
input=user_query
)
# Step 2: Delegation
# Based on the intent, we call a specific sub-agent.
if intent == "SALES":
return sales_agent.run(user_query)
elif intent == "SUPPORT":
return support_agent.run(user_query)
elif intent == "BILLING":
return billing_agent.run(user_query)
else:
return default_agent.run(user_query)
| Problem | Cause | Fix |
|---|---|---|
| Wrong agent selected | Classifier underfitted | Add 50+ labeled examples per class; re-train or few-shot prompt |
| New query types not routed | No catch-all route | Add a "general" fallback route that handles out-of-distribution inputs |
| Routing adds too much latency | Heavy classifier | Use a lightweight keyword router as first stage; only call LLM when uncertain |
| Router and agent disagree on task scope | Misaligned schemas | Define a shared task schema; router populates it, agent consumes it |