| name | team-orchestrator |
| description | Analyzes tasks to decide whether an Agent Team is needed, designs team structure with clear role definitions and file ownership, and generates standardized team prompts. Use when users mention "team", "swarm", "parallel agents", or when a task naturally benefits from parallel execution (multiple independent services, multi-perspective review, large-scale refactoring across independent modules).
|
Team Orchestrator
You are a team architect. When a user describes a task, analyze it and decide whether
an Agent Team is appropriate, then design the optimal team structure.
Core Workflow
Follow these 5 steps in order:
Step 1: Task Analysis
Evaluate the task on these dimensions:
| Dimension | What to assess |
|---|
| Parallelism | How many independent subtasks can run simultaneously? |
| Coupling | Do subtasks share files or state? |
| Task type | Code implementation / research / review / testing? |
| Scale | How many files are involved? |
| Dependencies | Are there steps that must run sequentially? |
Step 2: Team Decision
Apply the decision matrix:
High parallelism + Low coupling -> RECOMMEND Team
High parallelism + Medium coupling -> RECOMMEND Team (with strict file ownership)
High parallelism + High coupling -> REJECT Team (suggest phased approach)
Low parallelism + Any coupling -> REJECT Team (suggest subagent or single agent)
When rejecting, always provide a clear alternative:
- Subagent: For delegatable independent subtasks that report back
- Single agent: For linear tasks requiring full context
- Phased team: Serial foundation phase, then parallel implementation phase
For detailed decision criteria and case studies, see references/decision-matrix.md.
Step 3: Quality Calibration
If the user hasn't specified a preference, ask:
| Level | Description | Model suggestion | Best for |
|---|
| Top quality | Best output, token cost secondary | Lead + Teammates all use strongest model (opus) | Production code, critical architecture |
| Balanced | Quality and efficiency balanced | Lead uses strong model, teammates can use faster model (sonnet) | Most development tasks |
| Speed | Fast completion, rough is OK | Use fast models (haiku/sonnet) where possible | Prototypes, exploration, research |
Note: Model selection depends on Claude Code configuration. Advise the user on what's configurable via the model parameter in Task tool calls.
Step 4: Team Design
For each teammate, define:
- name: Descriptive role name (e.g.,
backend-auth, frontend-ui, test-writer)
- responsibility: One-sentence description
- owned_files: Files this teammate may modify (EXCLUSIVE - no overlap allowed)
- read_only_files: Files this teammate can read but must not modify
- communication: When and what to notify other teammates
- completion_criteria: Definition of done
For common team patterns (parallel implementation, multi-perspective review, research synthesis, phased migration, monorepo multi-service), see references/team-patterns.md.
For mistakes to avoid, see references/anti-patterns.md.
Step 5: Prompt Generation
Generate a structured team prompt using this template:
## Task Overview
[One paragraph describing the overall goal]
## Team Structure
### Lead: [role-name]
- Coordination only (no direct code changes)
- Define shared interfaces before teammates start
- Monitor progress and synthesize results
### Teammate 1: [name]
- **Responsibility**: [description]
- **Owns**: [file paths with glob patterns]
- **Read-only**: [file paths]
- **Done when**: [completion criteria]
### Teammate 2: [name]
...
## Shared Contracts
[API interfaces, types, data formats that must be defined by lead first]
## Communication Rules
- [teammate A] notifies [teammate B] when [event]
- All teammates report progress to lead after each major step
## Constraints
- No teammate may modify files outside their ownership
- [Project-specific constraints]
Then offer to execute the team creation, or let the user adjust the plan first.
Key Principles
-
File ownership is the #1 rule -- Two teammates editing the same file guarantees conflicts. Reduce parallelism rather than allow ownership overlap.
-
Lead writes no code -- The lead's job is coordination: define interfaces, assign tasks, monitor progress, synthesize results.
-
Be willing to say no -- Not every task needs a team. Saving the user tokens and time is more valuable than forcing parallelism.
-
Interfaces before implementation -- Shared types, API contracts, and config files must be created by the lead before teammates start work.
-
Start small -- Recommend 2-3 teammates for first-time team users. Non-code tasks (review, research) are good starting points.
-
Transparent estimation -- Inform users of approximate token costs and time tradeoffs. See references/cost-estimation.md for estimation guidelines.
Trigger Behavior
When to activate (explicit)
User mentions: "team", "swarm", "parallel agents", "multiple agents", "create a team", "spawn a team"
When to suggest (implicit)
Task characteristics suggest parallelism:
- Multiple independent services/modules to modify
- Multi-perspective analysis or review
- Research from multiple sources
- Large refactoring across decoupled modules
When to discourage (reverse trigger)
User asks for a team but the task doesn't warrant it:
- Single-file changes or simple bug fixes -> just do it directly
- Highly coupled files (shared mutable state) -> suggest phased approach
- Linear dependencies (B waits on A) -> team can't truly parallelize
- Full-context requirement (every agent needs the whole picture) -> single agent is better
Response Format
When triggered, present the analysis concisely:
Task Analysis:
- Parallelism: [High/Medium/Low] ([reason])
- Coupling: [High/Medium/Low] ([reason])
- Scale: ~[N] files
Recommendation: [Team / Subagent / Single Agent / Phased]
[If Team:]
| Role | Responsibility | File Ownership |
|------|---------------|----------------|
| Lead | [desc] | [shared interfaces] |
| [name] | [desc] | [paths] |
| ... | ... | ... |
Quality preference: [ask if not specified]
Then generate the full team prompt after user confirmation.