AgentSkillsCN

agents-router

将任务路由至合适的Task工具智能代理(子代理)。当面对复杂的多步骤任务、研究工作、代码审查、探索任务,或任何需要专业代理执行的任务时,此技能可助你精准匹配任务意图与代理类型。

SKILL.md
--- frontmatter
name: agents-router
description: Routes tasks to appropriate Task tool agents (subagents). Triggers on complex multi-step tasks, research, code review, exploration, or any task benefiting from specialized agent execution. Matches intent to agent types.

Agents Router

Routes tasks to appropriate Task tool subagent types for parallel or specialized execution.

Available Agent Types

AgentPurposeBest For
general-purposeMulti-step researchComplex questions, code search
ExploreCodebase explorationFind files, understand patterns
PlanImplementation planningArchitecture, strategy
claude-code-guideClaude Code helpFeature questions, how-to
orchestratorMulti-domain coordinationComplex multi-agent workflows
strategy-analyzerDeep strategic analysisRefactoring, optimization
architectRecursive decompositionComplex system design
geminiLong context analysisLarge codebases, multi-file bugs
researcherWeb researchFinding answers, investigating
engineerProfessional implementationPRD execution, debugging

Trigger Conditions

Activate when task involves:

  • Complex multi-step operations
  • Research requiring web/documentation search
  • Code review or analysis
  • Codebase exploration (files > 20)
  • Multi-domain tasks (domains > 2)
  • Long-running background operations

Routing Logic

yaml
# Complexity scoring
complexity_factors:
  files_affected: weight 0.3
  domains_involved: weight 0.25
  steps_required: weight 0.25
  research_needed: weight 0.2

# Thresholds
spawn_agent_if:
  complexity >= 0.7 OR
  files > 20 OR
  domains > 2 OR
  explicit_request

Decision Tree

code
Task Complexity Assessment
    │
    ├── Exploration needed?
    │   ├── Quick search? → Explore (quick)
    │   ├── Pattern finding? → Explore (medium)
    │   └── Deep analysis? → Explore (very thorough)
    │
    ├── Implementation?
    │   ├── From PRD? → engineer
    │   ├── Architecture? → architect
    │   └── Strategy? → strategy-analyzer
    │
    ├── Research?
    │   ├── Web search? → researcher
    │   ├── Claude Code docs? → claude-code-guide
    │   └── Codebase context? → gemini
    │
    ├── Multi-domain?
    │   └── orchestrator
    │
    └── Code review?
        └── superpowers:code-reviewer (via skill)

Agent Selection Matrix

Task TypePrimary AgentAlternatives
Find files by patternExploregeneral-purpose
Search code for keywordExploregemini
Plan implementationPlanarchitect
Deep strategic analysisstrategy-analyzerarchitect
Large codebase analysisgeminiExplore
Web researchresearchergeneral-purpose
Multi-agent coordinationorchestratorgeneral-purpose
PRD implementationengineergeneral-purpose
Claude Code helpclaude-code-guide-

Usage Patterns

Parallel Agents

When tasks are independent:

code
Task tool (agent1) + Task tool (agent2) in parallel

Sequential Agents

When tasks depend on each other:

code
Task tool (research) → Task tool (implement)

Background Agents

For long-running tasks:

code
Task tool with run_in_background=true
→ TaskOutput to retrieve results

Integration

  • Task tool: Primary agent spawning
  • TaskOutput: Result retrieval
  • orchestrator agent: Multi-agent coordination
  • meta-router: Parent routing

Quick Reference

yaml
# Quick codebase search
agent: Explore
thoroughness: quick

# Deep implementation planning
agent: Plan
complexity: high

# Large codebase bug
agent: gemini
context: 2M tokens

# Professional implementation
agent: engineer
from: PRD

# Multi-domain coordination
agent: orchestrator
domains: [frontend, backend, database]