Agent Orchestration

Available Agents

Located in ~/.claude/agents/:

AgentPurposeWhen to Use
plannerImplementation planningComplex features, refactoring
architectSystem designArchitectural decisions
tdd-guideTest-driven developmentNew features, bug fixes
code-reviewerCode reviewAfter writing code
security-reviewerSecurity analysisBefore commits
build-error-resolverFix build errorsWhen build fails
e2e-runnerE2E testingCritical user flows
refactor-cleanerDead code cleanupCode maintenance
doc-updaterDocumentationUpdating docs

Immediate Agent Usage

No user prompt needed:

  1. Complex feature requests - Use planner agent
  2. Code just written/modified - Use code-reviewer agent
  3. Bug fix or new feature - Use tdd-guide agent
  4. Architectural decision - Use architect agent

Cost-Efficient Exploration (Haiku 모델 활용)

코드베이스 탐색, 파일 구조 파악 등 사전 조사 단계에서는 저비용 모델을 활용한다:

1# 탐색 작업 → Haiku 모델로 비용 절감
2Agent(
3  subagent_type: "Explore",
4  model: "haiku",
5  prompt: "prototypes/sokind-admin의 라우트 구조를 파악해줘"
6)
7
8# 구현/분석 작업 → Opus 모델 유지
9Agent(
10  subagent_type: "general-purpose",
11  prompt: "이 컴포넌트를 리팩토링해줘"
12)

Haiku 사용이 적합한 경우:

  • 파일/폴더 구조 파악
  • 특정 패턴/함수 검색
  • 의존성 그래프 추적
  • 코드 통계 수집

Opus가 필요한 경우:

  • 아키텍처 의사결정
  • 복잡한 코드 리뷰
  • 보안 분석
  • 구현 계획 수립

Parallel Task Execution

ALWAYS use parallel Task execution for independent operations:

1# GOOD: Parallel execution
2Launch 3 agents in parallel:
31. Agent 1: Security analysis of auth module
42. Agent 2: Performance review of cache system
53. Agent 3: Type checking of utilities
6
7# BAD: Sequential when unnecessary
8First agent 1, then agent 2, then agent 3

Multi-Perspective Analysis

For complex problems, use split role sub-agents:

  • Factual reviewer
  • Senior engineer
  • Security expert
  • Consistency reviewer
  • Redundancy checker