Skip to content

Commit 550bb92

Browse files
feat: Add Claude Code agent team support to execution skills
Add team mode as an optional execution path for all three execution skills, gated behind TeamCreate detection and user choice: - writing-plans: Third execution handoff option (team-based) - subagent-driven-development: Full team mode with parallel implementers, sequential review gates, team lifecycle management - dispatching-parallel-agents: Team mode alternative with inter-agent messaging and shared task tracking - executing-plans: Within-batch parallelism via teams All changes are additive and cross-platform safe - team features only activate on Claude Code with teams enabled, existing behavior is preserved on Codex, OpenCode, and Claude Code without teams. Relates to: #469 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a8c48ad commit 550bb92

File tree

4 files changed

+168
-4
lines changed

4 files changed

+168
-4
lines changed

skills/dispatching-parallel-agents/SKILL.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,37 @@ When agents return:
7979
- Run full test suite
8080
- Integrate all changes
8181

82+
## Team Mode (Claude Code Only)
83+
84+
If `TeamCreate` is available and the user opts in, use a coordinated team instead of individual `Task` calls.
85+
86+
### Standard Mode vs Team Mode
87+
88+
| Aspect | Standard (Task calls) | Team Mode |
89+
|--------|----------------------|-----------|
90+
| Dispatch | Individual `Task` tool calls | `TeamCreate` + team members |
91+
| Communication | None between agents | `SendMessage` for sharing findings |
92+
| Progress tracking | Wait for Task return | Shared `TaskList` with live status |
93+
| Result collection | Read each Task result | Agents report via messages + `TaskUpdate` |
94+
| Best for | Quick independent investigations | Longer investigations needing coordination |
95+
96+
### When to Prefer Team Mode
97+
98+
- Investigations may need to share context mid-flight (e.g., "I found the root cause is in module X, check if it affects your area too")
99+
- More than 3 parallel agents (better lifecycle management)
100+
- Agents may discover dependencies during investigation
101+
102+
### Team Mode Pattern
103+
104+
1. **Create team:** `TeamCreate` with descriptive name
105+
2. **Spawn investigators:** One team member per independent domain
106+
3. **Let them work:** Agents investigate, can message each other if relevant findings
107+
4. **Collect results:** Team lead monitors `TaskList`, reads agent messages
108+
5. **Integrate:** Same as standard - verify fixes don't conflict, run full suite
109+
6. **Shutdown:** `shutdown_request` to all members, then `TeamDelete`
110+
111+
**Cross-platform note:** Team mode requires Claude Code with teams enabled (beta). On Codex, OpenCode, or Claude Code without teams, use the standard parallel `Task` dispatch. Always detect capability before offering team mode.
112+
82113
## Agent Prompt Structure
83114

84115
Good agent prompts are:

skills/executing-plans/SKILL.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,30 @@ After all tasks complete and verified:
4949
- **REQUIRED SUB-SKILL:** Use superpowers:finishing-a-development-branch
5050
- Follow that skill to verify tests, present options, execute choice
5151

52+
### Team Mode (Claude Code Only)
53+
54+
If `TeamCreate` is available and the user opted in during the writing-plans handoff, parallelize tasks within each batch.
55+
56+
**What changes:**
57+
- Step 2 (Execute Batch): Instead of executing 3 tasks sequentially, spawn a team and assign batch tasks to team members working in parallel
58+
- Step 3 (Report): Wait for all batch members to complete, then report combined results
59+
- Steps 1, 4, 5: Unchanged (plan review, feedback loop, and completion stay the same)
60+
61+
**What doesn't change:**
62+
- Batch boundaries and human review checkpoints remain
63+
- Default batch size is still 3 tasks
64+
- "Ready for feedback" checkpoint after each batch
65+
- The human-in-the-loop approval between batches is preserved
66+
67+
**Team lifecycle per batch:**
68+
1. `TeamCreate` for the batch (or reuse existing team)
69+
2. Assign batch tasks to team members
70+
3. Wait for all to complete
71+
4. Report results, wait for feedback
72+
5. `TeamDelete` when all work is done (or reuse for next batch)
73+
74+
**Cross-platform note:** Team mode requires Claude Code with teams enabled (beta). On Codex, OpenCode, or Claude Code without teams, use the standard sequential batch execution. Always detect capability before offering team mode.
75+
5276
## When to Stop and Ask for Help
5377

5478
**STOP executing immediately when:**

skills/subagent-driven-development/SKILL.md

Lines changed: 101 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,20 @@ digraph when_to_use {
1616
"Have implementation plan?" [shape=diamond];
1717
"Tasks mostly independent?" [shape=diamond];
1818
"Stay in this session?" [shape=diamond];
19-
"subagent-driven-development" [shape=box];
19+
"TeamCreate available and user opted in?" [shape=diamond];
20+
"subagent-driven-development (team mode)" [shape=box];
21+
"subagent-driven-development (standard)" [shape=box];
2022
"executing-plans" [shape=box];
2123
"Manual execution or brainstorm first" [shape=box];
2224
2325
"Have implementation plan?" -> "Tasks mostly independent?" [label="yes"];
2426
"Have implementation plan?" -> "Manual execution or brainstorm first" [label="no"];
2527
"Tasks mostly independent?" -> "Stay in this session?" [label="yes"];
2628
"Tasks mostly independent?" -> "Manual execution or brainstorm first" [label="no - tightly coupled"];
27-
"Stay in this session?" -> "subagent-driven-development" [label="yes"];
29+
"Stay in this session?" -> "TeamCreate available and user opted in?" [label="yes"];
2830
"Stay in this session?" -> "executing-plans" [label="no - parallel session"];
31+
"TeamCreate available and user opted in?" -> "subagent-driven-development (team mode)" [label="yes"];
32+
"TeamCreate available and user opted in?" -> "subagent-driven-development (standard)" [label="no"];
2933
}
3034
```
3135

@@ -35,6 +39,12 @@ digraph when_to_use {
3539
- Two-stage review after each task: spec compliance first, then code quality
3640
- Faster iteration (no human-in-loop between tasks)
3741

42+
**Team mode vs. Standard mode:**
43+
- True parallelism (multiple implementers working simultaneously on independent tasks)
44+
- Persistent coordination via `SendMessage` and shared `TaskList`
45+
- Review gates remain sequential per task (spec then quality)
46+
- Requires Claude Code with teams feature enabled (beta)
47+
3848
## The Process
3949

4050
```dot
@@ -82,6 +92,88 @@ digraph process {
8292
}
8393
```
8494

95+
## Team Mode (Claude Code Only)
96+
97+
When the user opts into team mode and `TeamCreate` is available, use this alternative flow instead of the standard sequential process above.
98+
99+
**Core difference:** Independent tasks run in parallel via team members. Review gates remain sequential per task.
100+
101+
### Team Composition
102+
103+
- **Team Lead (you):** Orchestrates work, assigns tasks, reviews results
104+
- **Implementer agents:** One per independent task, spawned as team members
105+
- **Reviewer agents:** Dispatched per task after implementation completes (spec then quality)
106+
107+
### Team Mode Process
108+
109+
```dot
110+
digraph team_process {
111+
rankdir=TB;
112+
113+
"Read plan, extract tasks, identify independent groups" [shape=box];
114+
"TeamCreate with implementer agents" [shape=box];
115+
"Assign independent tasks to implementers via TaskCreate" [shape=box];
116+
"Implementers work in parallel" [shape=box];
117+
"As each implementer completes:" [shape=box];
118+
119+
subgraph cluster_per_task {
120+
label="Per Completed Task (sequential)";
121+
"Dispatch spec reviewer for task" [shape=box];
122+
"Spec passes?" [shape=diamond];
123+
"Send fix instructions to implementer" [shape=box];
124+
"Dispatch code quality reviewer" [shape=box];
125+
"Quality passes?" [shape=diamond];
126+
"Send quality fix instructions" [shape=box];
127+
"Mark task complete" [shape=box];
128+
}
129+
130+
"More tasks to assign?" [shape=diamond];
131+
"Assign next batch to idle implementers" [shape=box];
132+
"All tasks complete" [shape=box];
133+
"Shutdown team" [shape=box];
134+
"Final code review + finishing-a-development-branch" [shape=box];
135+
136+
"Read plan, extract tasks, identify independent groups" -> "TeamCreate with implementer agents";
137+
"TeamCreate with implementer agents" -> "Assign independent tasks to implementers via TaskCreate";
138+
"Assign independent tasks to implementers via TaskCreate" -> "Implementers work in parallel";
139+
"Implementers work in parallel" -> "As each implementer completes:";
140+
"As each implementer completes:" -> "Dispatch spec reviewer for task";
141+
"Dispatch spec reviewer for task" -> "Spec passes?";
142+
"Spec passes?" -> "Send fix instructions to implementer" [label="no"];
143+
"Send fix instructions to implementer" -> "Dispatch spec reviewer for task";
144+
"Spec passes?" -> "Dispatch code quality reviewer" [label="yes"];
145+
"Dispatch code quality reviewer" -> "Quality passes?";
146+
"Quality passes?" -> "Send quality fix instructions" [label="no"];
147+
"Send quality fix instructions" -> "Dispatch code quality reviewer";
148+
"Quality passes?" -> "Mark task complete" [label="yes"];
149+
"Mark task complete" -> "More tasks to assign?";
150+
"More tasks to assign?" -> "Assign next batch to idle implementers" [label="yes"];
151+
"Assign next batch to idle implementers" -> "Implementers work in parallel";
152+
"More tasks to assign?" -> "All tasks complete" [label="no"];
153+
"All tasks complete" -> "Shutdown team";
154+
"Shutdown team" -> "Final code review + finishing-a-development-branch";
155+
}
156+
```
157+
158+
### Key Constraints in Team Mode
159+
160+
- **Review gates are still sequential per task:** spec review must pass before code quality review
161+
- **Dependent tasks must wait:** only dispatch tasks whose dependencies are complete
162+
- **Implementers on different tasks in parallel is OK:** they work on separate files
163+
- **Implementers on the same task is NOT OK:** one implementer per task
164+
- **Team lead handles review dispatch:** don't delegate review scheduling to implementers
165+
- **Use SendMessage for fix instructions:** when a reviewer finds issues, message the implementer with specific fixes needed
166+
- **Use shared TaskList for tracking:** all task state lives in the team's task list
167+
168+
### Team Lifecycle
169+
170+
1. **Create:** `TeamCreate` at start of execution
171+
2. **Staff:** Spawn implementer agents as team members via `Task` with `team_name`
172+
3. **Assign:** Create tasks via `TaskCreate`, assign via `TaskUpdate` with `owner`
173+
4. **Coordinate:** Use `SendMessage` for review feedback, fix instructions
174+
5. **Shutdown:** Send `shutdown_request` to all team members when complete
175+
6. **Cleanup:** `TeamDelete` after all members shut down
176+
85177
## Prompt Templates
86178

87179
- `./implementer-prompt.md` - Dispatch implementer subagent
@@ -212,6 +304,13 @@ Done!
212304
- **Start code quality review before spec compliance is ✅** (wrong order)
213305
- Move to next task while either review has open issues
214306

307+
**Team mode specific - Never:**
308+
- Use team mode when `TeamCreate` is not available (fall back to standard mode)
309+
- Assume team mode works on non-Claude-Code environments (Codex, OpenCode)
310+
- Skip the user choice - always ask before spawning a team
311+
- Let implementers self-assign tasks (team lead assigns via `TaskUpdate`)
312+
- Forget to shutdown the team (always send `shutdown_request` + `TeamDelete`)
313+
215314
**If subagent asks questions:**
216315
- Answer clearly and completely
217316
- Provide additional context if needed

skills/writing-plans/SKILL.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,18 @@ git commit -m "feat: add specific feature"
9696

9797
## Execution Handoff
9898

99-
After saving the plan, offer execution choice:
99+
After saving the plan, check for team support and offer execution choice:
100100

101-
**"Plan complete and saved to `docs/plans/<filename>.md`. Two execution options:**
101+
**Detection:** Before presenting options, check if the `TeamCreate` tool is available in this environment. If it is, include Option 3 below. If not, only show Options 1 and 2.
102+
103+
**"Plan complete and saved to `docs/plans/<filename>.md`. Execution options:**
102104

103105
**1. Subagent-Driven (this session)** - I dispatch fresh subagent per task, review between tasks, fast iteration
104106

105107
**2. Parallel Session (separate)** - Open new session with executing-plans, batch execution with checkpoints
106108

109+
**3. Team-Based (parallel, this session)** *(only if TeamCreate is available)* - Spawn an agent team with parallel implementers and reviewers, coordinated via shared task list
110+
107111
**Which approach?"**
108112

109113
**If Subagent-Driven chosen:**
@@ -114,3 +118,9 @@ After saving the plan, offer execution choice:
114118
**If Parallel Session chosen:**
115119
- Guide them to open new session in worktree
116120
- **REQUIRED SUB-SKILL:** New session uses superpowers:executing-plans
121+
122+
**If Team-Based chosen:**
123+
- **REQUIRED SUB-SKILL:** Use superpowers:subagent-driven-development (team mode)
124+
- Stay in this session
125+
- `TeamCreate` to spawn parallel implementers
126+
- Shared `TaskList` for coordination

0 commit comments

Comments
 (0)