Do Agent Teams Workflow
Overview
This skill manages Agent Teams execution for Do workflows. When Team mode is active (via godo mode team or auto-escalation), Do operates as Team Lead coordinating persistent teammates with file ownership enforcement and checklist integration.
Prerequisites
Agent Teams requires:
- •
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1in settings.json env - •Claude Code v2.1.32 or later
- •Team mode activated:
godo mode team
Mode Selection
Team mode is selected when:
- •User explicitly switches:
godo mode teamor "team mode" keywords - •Auto-escalation from Do mode: 10+ files, 3+ domains
- •Plan phase determines parallel research is beneficial
Fallback: If Agent Teams unavailable, fall back to Do mode (sub-agent sequential/parallel).
Team Lifecycle
Phase 1: Team Creation
TeamCreate(team_name: "do-{workflow}-{timestamp}")
Team naming convention:
- •Plan phase:
do-plan-{title} - •Run phase:
do-run-{title} - •Debug:
do-debug-{issue}
Phase 2: Task Decomposition
Before spawning teammates, create complete shared task list from checklist:
TaskCreate(subject: "Task description", description: "Detailed requirements")
Rules for task decomposition:
- •Each task is self-contained (one clear deliverable)
- •Define dependencies between tasks (addBlockedBy)
- •Assign file ownership boundaries per teammate role
- •Tasks map to checklist items and sub-checklists
- •1 item = 1-3 file changes (Do's granularity rule)
Phase 3: Teammate Spawning
Spawn teammates using Task tool with team_name parameter:
Task(
subagent_type: "team-backend-dev",
team_name: "do-run-{title}",
name: "backend-dev",
prompt: "You are the backend developer. File ownership: {files}. Sub-checklist: {path}."
)
Spawning rules:
- •Include sub-checklist path in spawn prompt
- •Assign file ownership from Critical Files section
- •Include Docker environment info (container name, service, domain)
- •Include commit instructions: "git add specific files && git diff --cached && git commit in single Bash call"
- •Include checklist update instructions: "Update sub-checklist state with each progress step"
- •Include DO_JOBS_LANGUAGE for document language
Phase 4: Coordination
Team Lead monitors and coordinates:
- •Receive automatic messages from teammates
- •Use SendMessage for direct coordination
- •Broadcast critical updates (use sparingly -- expensive)
- •Resolve file ownership conflicts
- •Reassign tasks if teammate is blocked
Coordination patterns:
- •Backend completes API: notify frontend-dev of available endpoints
- •Implementation completes: assign quality validation
- •Quality finds issues: direct fix to responsible teammate
- •All tasks complete: begin shutdown
Phase 5: Shutdown
Graceful shutdown sequence:
- •Verify all tasks completed via TaskList
- •Verify all checklist items are
[o] - •Send shutdown_request to each teammate
- •Wait for shutdown approval
- •Clean up: TeamDelete()
File Ownership Strategy [HARD]
Prevent write conflicts by assigning exclusive file ownership.
One File = One Owner
- •No two teammates own the same file
- •Sub-checklist Critical Files section defines ownership boundary
- •
git add -A/git add .ABSOLUTELY PROHIBITED - •Each agent stages only their own files explicitly:
git add path/to/my-file.go
Git Staging Rules for Team Agents [CRITICAL]
- •File-specific staging:
git add file1.go file2.go(own files only) - •Broad staging prohibited:
git add -A,git add .,git add --allNEVER allowed - •Atomic commit required:
git add && git diff --cached && git commitin SINGLE Bash call - •
git reset HEADprohibited: Would unstage other agent's files, causing data loss - •Non-interference: Never touch other agent's files in staging area
- •On commit failure: Report error as-is, do NOT self-resolve (may destroy other agent's work)
Ownership Conflict Resolution
| Situation | Resolution |
|---|---|
| File A owned by agent 1 only | Normal -- no conflict |
| File A needed by agent 1 and 2 | PROHIBITED -- sequential via depends on: |
| Agent 2 references agent 1's file (read-only) | Allowed -- reading is not ownership |
| Unexpected file modification needed | Check owner in checklist; if owner is [~], declare [!] blocker |
Team Patterns
Plan Research Team
- •Roles: researcher (haiku), analyst (inherit), architect (inherit)
- •Use: Complex plan creation requiring multi-angle exploration
- •Duration: Short-lived (plan phase only)
- •All run in permissionMode: plan (read-only, Bash heredoc for .do/jobs/ output)
Implementation Team
- •Roles: backend-dev, frontend-dev, tester (all inherit)
- •Use: Cross-layer feature implementation
- •Duration: Medium (full run phase)
- •File ownership strictly enforced
Full-Stack Team
- •Roles: backend-dev, frontend-dev, data-layer, quality (all inherit)
- •Use: Large-scale full-stack features
- •Duration: Medium-long
Investigation Team
- •Roles: hypothesis-1, hypothesis-2, hypothesis-3 (all haiku)
- •Use: Complex debugging with competing theories
- •Duration: Short
Checklist Integration
Team mode integrates with Do's checklist system:
- •Main checklist (
checklist.md) defines all items with agent assignment - •Sub-checklists (
checklists/{order}_{agent-topic}.md) distributed to teammates - •Each teammate receives their sub-checklist path in spawn prompt
- •Teammate follows idempotent cycle: READ -> CLAIM -> WORK -> VERIFY -> RECORD -> COMMIT
- •Teammate commits code + checklist state together atomically
- •Team Lead monitors checklist states for progress
- •
[o]items with commit hash = completed;[~]items = in progress;[ ]= not started
Error Recovery
- •Teammate crash: Spawn replacement with same role; new agent reads checklist, resumes from first non-
[o]item - •Task stuck: Team Lead reassigns to different teammate
- •File conflict: Team Lead mediates via SendMessage, adjusts ownership
- •All teammates idle: Check if tasks remain; assign or shutdown
- •Token limit: Shutdown team gracefully, fall back to Do mode for remaining work
Version: 1.0.0 Last Updated: 2026-02-16