A skill that analyzes a task to dynamically assemble an expert team and execute immediately based on TeamCreate.
When to Use
- Complex tasks that can be decomposed into two or more independent subtasks
- Tasks with clear role separation, such as research + implementation + verification
- Tasks where time can be saved through parallel execution
Do not use: Single-file edits, simple questions, tasks that can only be done sequentially
Workflow
digraph team_assemble {
rankdir=TB;
"사용자 입력" [shape=doublecircle];
"Phase 1:\n작업 분석 & 팀 설계" [shape=box];
"사용자 승인?" [shape=diamond];
"Phase 2:\nTeamCreate & TaskCreate" [shape=box];
"Phase 3:\nTeammate 실행" [shape=box];
"Phase 4:\n결과 종합 & 정리" [shape=box];
"완료" [shape=doublecircle];
"사용자 입력" -> "Phase 1:\n작업 분석 & 팀 설계";
"Phase 1:\n작업 분석 & 팀 설계" -> "사용자 승인?";
"사용자 승인?" -> "Phase 1:\n작업 분석 & 팀 설계" [label="수정"];
"사용자 승인?" -> "Phase 2:\nTeamCreate & TaskCreate" [label="승인"];
"Phase 2:\nTeamCreate & TaskCreate" -> "Phase 3:\nTeammate 실행";
"Phase 3:\nTeammate 실행" -> "Phase 4:\n결과 종합 & 정리";
"Phase 4:\n결과 종합 & 정리" -> "완료";
}
Phase 1: Task Analysis & Team Design
Analyze the task to determine the following:
- Role decomposition — Decompose into independent subtasks and assign expert roles
- Model selection — Assign the optimal model per role
- Dependency graph — Determine precedence relationships
Role-model mapping
| Role type | Model | Example |
|---|---|---|
| Planning/design/decision-making | opus | architect, planner, lead |
| Analysis/research/complex judgment | opus | analyzer, researcher, code-reviewer |
| Implementation/execution/collection | sonnet | implementer, collector, writer |
| Verification/cleanup/formatting | sonnet | validator, formatter, tester |
Boundary role judgment: "Does it require making a new judgment?" → opus. "Does it execute according to given criteria?" → sonnet.
Team composition proposal
Must obtain approval via AskUserQuestion before proceeding:
팀 구성 제안: {team-name}
| # | 역할 | 모델 | 담당 작업 | 의존성 |
|---|------|------|----------|--------|
| 1 | role-name | opus | 작업 설명 | - |
| 2 | role-name | sonnet | 작업 설명 | #1 |
Options: "Okay, please proceed" / "I need to modify the roles"
If "역할 수정" is selected, ask specifically what to change. If revision is requested two or more times, switch to free-text input.
Phase 2: Team Creation & Task Distribution
After approval, execute in order:
TeamCreate(team_name: "{keyword}-team", description: "작업 설명")
team_name rule: task core keyword + -team (예: migration-team, research-team)
After calling TaskCreate for each role, set blockedBy dependencies with TaskUpdate:
TaskCreate(subject: "#1 {역할}: {작업 요약}", description: "상세 설명", activeForm: "{작업} 진행 중")
TaskUpdate(taskId: "2", addBlockedBy: ["1"])
Phase 3: Teammate Execution
Core mechanism: The Task tool in foreground (default) blocking — waits until the teammate finishes and returns the result text. This return value is the teammate's work result.
Parallel execution
For tasks without blockedBy, simultaneously in a single message Task calls:
Task(name: "analyst", team_name: "...", subagent_type: "general-purpose", model: "opus", prompt: "...", mode: "bypassPermissions")
Task(name: "collector", team_name: "...", subagent_type: "general-purpose", model: "sonnet", prompt: "...", mode: "bypassPermissions")
// 두 Task 완료 후 각각의 결과 텍스트 수신
Sequential execution (dependencies)
The preceding Task's return valueinto the next teammate prompt:
Task(name: "writer", prompt: "선행 작업 결과:\n{result_1}\n\n이 결과를 바탕으로...")
Required elements of a Teammate prompt
- Context — The relationship between the overall project and this task
- Specific goal — Exactly what must be achieved
- Constraints — What must not be done, limits on the scope of changes
- Output format — Form of the deliverable (text/file/table)
- Team information — team_name, task ID → instruction to mark completion with TaskUpdate
For the detailed prompt template, see references/prompt-templates.md .
Phase 4: Result Synthesis & Cleanup
Result Collection
Synthesize all teammate results and report to the user:
## 팀 실행 결과: {team-name}
### 1. {역할}: {작업} → {결과 요약}
### 최종 산출물
- {파일 경로 또는 결과물 목록}
Team Cleanup
After the foreground Task completes, teammates are in idle state. Cleanup order:
SendMessage(type: "shutdown_request", recipient: "{name}", content: "작업 완료")
TeamDelete() // 모든 teammate 종료 확인 후
If there is no response to shutdown_request, it has already terminated — ignore it and proceed with TeamDelete.
Common Mistakes
| Mistake | Correct Method |
|---|---|
| Creating a team without user approval | Always get approval via AskUserQuestion in Phase 1 |
| Executing all tasks sequentially | Call parallel Tasks in a single message for independent tasks |
| Teammate prompts are ambiguous | Must include context + goal + constraints + output format |
| Missing TeamDelete | Always clean up in the order shutdown_request → TeamDelete |
| Using opus for all roles | Use sonnet for execution/collection roles to save cost |
Quick Reference
Phase 1: 분석 → AskUserQuestion (팀 구성 승인)
Phase 2: TeamCreate → TaskCreate × N → TaskUpdate (의존성)
Phase 3: Task × N (병렬) → 결과 전달 → Task × N (후속)
Phase 4: 결과 종합 → shutdown_request × N → TeamDelete
Additional Resources
Reference Files
references/examples.md— 3 worked examples (full Phase 1–3 flow) such as DB migration, competitor analysis, full-stack implementationreferences/prompt-templates.md— Teammate prompt templates per role (analyst, implementer, validator) and writing tips