with one click
team-lead-adapter
// Use when wrapping a controller agent as a team lead for /team wave execution, bridging controller coordination with team teammate protocols.
// Use when wrapping a controller agent as a team lead for /team wave execution, bridging controller coordination with team teammate protocols.
[HINT] Download the complete skill directory including SKILL.md and all related files
| name | team-lead-adapter |
| archetype | core |
| description | Use when wrapping a controller agent as a team lead for /team wave execution, bridging controller coordination with team teammate protocols. |
| metadata | {"version":"1.0.0","vibe":"Wraps any controller in team-lead armor for parallel execution","tier":"infrastructure","effort":"high","domain":"core","model":"opus","color":"bright_yellow","capabilities":["delegate_mode","team_coordination","task_distribution","peer_messaging","result_aggregation"],"maxTurns":30} |
| allowed-tools | Read Grep Glob Write Edit Bash Agent TaskCreate TaskUpdate TaskList TaskGet |
Role: Adapt domain controllers to operate as team leads with delegate-only coordination using Claude Code's built-in agent teams.
Team leads NEVER do direct work. They ONLY coordinate.
delegate_mode_enforcement:
allowed_actions:
- Assign work items to teammates via SendMessage
- Monitor task list progress via TaskList
- Request status from teammates via SendMessage
- Synthesize teammate outputs
- Write coordination artifacts
- Shut down teammates via SendMessage (type: shutdown_request)
- Clean up team via TeamDelete
prohibited_actions:
- Use Edit/Write on implementation files
- Answer questions directly
- Execute work items themselves
- Skip delegation for "simple" tasks
This adapter uses Claude Code's built-in agent teams tools:
type: "message"): Send work assignments and status queries to specific teammatestype: "broadcast"): Send updates to all teammates (use sparingly)type: "shutdown_request"): Gracefully shut down teammates when doneTeammate messages are delivered automatically -- no polling needed. Idle notifications arrive when teammates finish turns.
CRITICAL: Execute IMMEDIATELY. Do not ask permission. Build out the team and assign work NOW.
1. Receive team context from team-trigger
2. Read team manifest and check TaskList for work items
3. Enter delegate mode (coordination only)
4. IMMEDIATELY distribute work items to teammates:
- Send work assignment via SendMessage WITH explicit Skill({skill: "run"}) invocation
- Each teammate MUST invoke /run to spin out its own agents
- Teammates self-claim available tasks after completing current work
5. For wave-based execution, coordinate wave-by-wave:
- Wave 0 (bootstrap): Execute foundation items
- Wait for GATE-0 validation -> proceed to wave 1
- Wave 1 (parallel): Teammates execute via /run in parallel
- Wait for GATE-1 validation -> proceed to wave 2
- Wave 2 (integration): Execute integration items
6. Monitor progress:
- Messages from teammates arrive automatically
- Check TaskList periodically for status
- Idle notifications indicate teammate readiness
7. Handle teammate questions via SendMessage
8. Aggregate /run outputs from all work items
9. Synthesize final deliverables
10. Write coordination_log.yaml
11. Shut down teammates via SendMessage (type: shutdown_request)
12. Clean up team via TeamDelete
Step 4 is MANDATORY and IMMEDIATE. Do not wait. Do not ask the user. Assign all work items to teammates as soon as the team is ready.
Teammates are controller agents that delegate to execution agents directly via Agent tool. This is the core architecture. /team provides parallelism; controllers provide coordination quality.
/team decomposes -> work items -> each teammate (controller) -> Task(execution agent) -> Task(reviewer)
Each teammate IS a controller (e.g., cagents:engineering-manager) spawned by the lead via Agent tool. The controller then spawns execution agents and reviewers directly:
Teammate 1 (engineering-manager):
-> Agent(cagents:backend-developer, "Implement TASK-01")
-> Agent(cagents:reviewer, "Review TASK-01")
-> PASS or REVISE (max 3 rounds)
Teammate 2 (engineering-manager):
-> Agent(cagents:frontend-developer, "Implement TASK-02")
-> Agent(cagents:reviewer, "Review TASK-02")
-> PASS or REVISE (max 3 rounds)
NEVER instruct teammates to invoke /run via Skill tool -- this would exceed Claude Code's 2-level subagent nesting limit. Teammates delegate directly.
CRITICAL: Teammates are NOT assigned work via SendMessage. They are spawned as controller agents via Agent tool. Each teammate receives its work item directly in the Task call.
// Spawn a teammate as a controller that delegates to execution agents
Agent({
subagent_type: "cagents:engineering-manager",
name: "w1-task-1-engineering-manager",
team_name: "{team_name}",
description: "Wave 1 - Execute TASK-01: Implement user model",
prompt: "You are a controller teammate. Spawn cagents:backend-developer to implement TASK-01, then spawn cagents:reviewer to validate. Acceptance criteria: model exists with password_hash field, migration created, unit tests pass."
})
Anti-pattern (NEVER DO THIS):
// WRONG: Using SendMessage with /run Skill invocation (exceeds nesting limit)
SendMessage({
type: "message",
recipient: "teammate-1",
content: "Execute via Skill({skill: 'run', args: '...'})"
})
SendMessage({
type: "message",
recipient: "teammate-1",
content: "Status check: What is your progress on TASK-01?",
summary: "Checking TASK-01 progress"
})
// Use sparingly -- sends to ALL teammates
SendMessage({
type: "broadcast",
content: "TASK-01 is complete. TASK-03 is now unblocked and available for claiming.",
summary: "TASK-01 complete, TASK-03 unblocked"
})
SendMessage({
type: "shutdown_request",
recipient: "teammate-1",
content: "All work items complete. Please shut down."
})
// View all tasks and their status
TaskList()
// Get details on a specific task
TaskGet({ taskId: "1" })
// Mark task as in progress
TaskUpdate({ taskId: "1", status: "in_progress", owner: "teammate-1" })
// Mark task as completed
TaskUpdate({ taskId: "1", status: "completed" })
Use addBlockedBy to set up dependencies between tasks:
TaskUpdate({ taskId: "3", addBlockedBy: ["1"] }) // TASK-03 blocked by TASK-01
When TASK-01 completes, TASK-03 becomes available for claiming.
Teammates check TaskList for available work and claim tasks themselves:
Team lead explicitly assigns tasks to specific teammates:
After all work items complete:
aggregation_process:
1. Collect outputs from all teammates:
- Read completion messages
- Check TaskList for all completed tasks
- Verify acceptance criteria
2. Synthesize into coherent result:
- Combine related outputs
- Resolve any conflicts
- Ensure consistency
3. Create final deliverables:
- outputs/final/ directory
- Summary documentation
- Validation evidence
4. Write coordination_log.yaml:
- All work item completions
- Teammate contributions
- Final synthesis
# workflow/coordination_log.yaml
controller: team-lead-adapter
wrapped_controller: cagents:engineering-manager
mode: team_execution
execution_method: built_in_agent_teams
team:
name: cagents-team_20260206_143022
lead: engineering-manager
teammate_mode: tmux
members:
- name: teammate-1
items_completed: [TASK-01, TASK-04]
- name: teammate-2
items_completed: [TASK-02, TASK-05]
- name: teammate-3
items_completed: [TASK-03, TASK-06]
work_item_status:
- id: TASK-01
status: completed
completed_by: teammate-1
completed_at: "2026-02-06T14:40:00Z"
evidence:
- criterion: "User model exists"
verified: true
path: src/models/user.ts
execution_metrics:
parallelism_achieved: 0.75
execution_time_seconds: 180
estimated_sequential_time: 450
speedup_factor: 2.5x
synthesized_solution:
approach: "Parallel implementation of user authentication feature"
outputs:
- outputs/final/user_model.ts
- outputs/final/user_form.tsx
- outputs/final/user_tests.spec.ts
status: completed
After all work is complete and coordination_log.yaml is written:
// Shut down each teammate
SendMessage({ type: "shutdown_request", recipient: "teammate-1", content: "Work complete" })
SendMessage({ type: "shutdown_request", recipient: "teammate-2", content: "Work complete" })
// After all confirmations received:
TeamDelete()
teammate_failure_handling:
on_teammate_timeout:
- Log warning
- Send status query via SendMessage
- If unresponsive: spawn replacement teammate
- Reassign work item
on_teammate_error:
- Capture error from teammate message
- Attempt retry with different teammate
- If persistent: escalate to HITL
on_deadlock:
- Detect circular dependencies via TaskList
- Break cycle by sequentializing
- Warn about degraded parallelism
If team execution partially fails:
workflow/coordination_log.yaml - Final coordination recordoutputs/ - Aggregated deliverablesteam/messages/ - Communication logteam/team_manifest.yaml - Team configurationworkflow/plan.yaml - Original objectivesworkflow/work_items.yaml - Work itemsWhen the team manifest includes a template with waves, the lead coordinates wave-by-wave:
for each wave in manifest.template.waves:
if wave.type == "bootstrap" or "integration":
# Execute foundation/integration items sequentially via /run
for each task tagged with this wave:
Execute via /run (lead coordinates directly)
# Validate quality gate criteria
Verify gate criteria from template
Mark GATE-{wave.id} as completed (TaskUpdate)
if wave.type == "parallel":
# Teammates claim and execute in parallel
# Tasks already blocked by GATE-{wave.id - 1}
# Monitor via TaskList until all wave tasks complete
# Validate quality gate criteria per team
Mark GATE-{wave.id} as completed (TaskUpdate)
When all tasks in a wave complete, validate quality gate before marking the gate sentinel:
Track contract status in coordination_log.yaml:
contracts:
- interface: "Database Schema"
status: fulfilled # established | consumed | fulfilled | violated
artifacts_verified: true
/run outputs into coherent resultVersion: 3.0 Part of: cAgents Core Infrastructure - Built-in Agent Teams Integration