From flutter-ddd-builder
This skill should be used when working with "agent teams", "TaskList", "SendMessage", "teammate coordination", "blocking tasks", or managing multi-agent workflows with Claude Code's Teammate tool.
How this skill is triggered — by the user, by Claude, or both
Slash command
/flutter-ddd-builder:team-collaboration-patternsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Provides patterns for coordinating multiple agents using Claude Code's Teammate tool, TaskList, and SendMessage for parallel code generation workflows.
Provides patterns for coordinating multiple agents using Claude Code's Teammate tool, TaskList, and SendMessage for parallel code generation workflows.
Enable efficient multi-agent collaboration by:
Load this skill when:
1. Leader creates team (Teammate.spawnTeam)
2. Leader creates TaskList (TaskCreate for each unit of work)
3. Leader spawns teammates (Task tool with team_name)
4. Teammates claim tasks (TaskUpdate with owner)
5. Teammates work and communicate (SendMessage)
6. Teammates mark complete (TaskUpdate status: completed)
7. Leader integrates results
8. Leader cleans up team (Teammate.cleanup)
Teammate.spawnTeam:
operation: "spawnTeam"
team_name: "flutter-domain-team"
description: "Domain layer implementation team"
Team naming: {purpose}-team (e.g., flutter-domain-team, flutter-ui-team)
Team config is automatically created at ~/.claude/teams/{team-name}/config.json:
{
"name": "flutter-domain-team",
"description": "Domain layer implementation team",
"members": [
{
"name": "team-lead",
"agentId": "uuid-1",
"agentType": "logic-orchestrator"
},
{
"name": "auth-implementer",
"agentId": "uuid-2",
"agentType": "logic-implementer"
}
]
}
TaskCreate:
subject: "Implement auth domain"
description: "Create UserModel, AuthService, and router integration for auth domain"
activeForm: "Implementing auth domain"
Subject format: Imperative form ("Implement auth domain", not "Implementing...") ActiveForm: Present continuous ("-ing form") shown in progress spinner
# Create dependent tasks
TaskCreate:
subject: "Implement chat domain"
description: "Chat domain depends on auth.UserModel"
activeForm: "Implementing chat domain"
# Set up dependency
TaskUpdate:
taskId: "chat-task-id"
addBlockedBy: ["auth-task-id"]
Dependency strategy:
blockedBy when one task needs another's output# Teammate claims available task
TaskUpdate:
taskId: "auth-task-id"
owner: "auth-implementer"
status: "in_progress"
Claiming rules:
blockedBy or all dependencies completeowner to your teammate name (not agentId)status to in_progress when starting workTaskUpdate:
taskId: "auth-task-id"
status: "completed"
Completion checklist:
completedSendMessage:
type: "message"
recipient: "auth-implementer"
content: "Please prioritize UserModel creation, chat domain needs it"
summary: "Prioritize UserModel creation"
Message types:
# From chat-implementer to auth-implementer
SendMessage:
type: "message"
recipient: "auth-implementer"
content: "I need auth.UserModel for ChatMessageModel. Is it ready?"
summary: "Request UserModel availability"
# Response from auth-implementer
SendMessage:
type: "message"
recipient: "chat-implementer"
content: "UserModel is complete and committed. You can import it now."
summary: "UserModel ready"
Best practices:
# Only for critical issues
SendMessage:
type: "broadcast"
content: "STOP: Found breaking change in API client. Waiting for fix before proceeding."
summary: "Critical: API client breaking change"
When to broadcast:
When NOT to broadcast:
Use when: Dependencies are known upfront
# Create tasks with dependencies
TaskCreate:
subject: "Implement auth domain"
TaskCreate:
subject: "Implement post domain"
TaskCreate:
subject: "Implement chat domain"
TaskUpdate:
taskId: "chat-task-id"
addBlockedBy: ["auth-task-id"] # Chat waits for auth
Flow:
Use when: Dependencies discovered during work
# chat-implementer discovers need for auth.UserModel
SendMessage:
type: "message"
recipient: "auth-implementer"
content: "I need auth.UserModel. Can you prioritize it?"
summary: "Need UserModel"
# auth-implementer responds
SendMessage:
type: "message"
recipient: "chat-implementer"
content: "Working on UserModel now. Will notify when complete."
summary: "Working on UserModel"
# Later, auth-implementer notifies
SendMessage:
type: "message"
recipient: "chat-implementer"
content: "UserModel complete. Import from lib/apps/domain/auth/models/user_model.dart"
summary: "UserModel ready"
Use when: Dependencies are complex
# Teammate reports to orchestrator
SendMessage:
type: "message"
recipient: "team-lead"
content: "Blocked: chat domain needs auth.UserModel but auth task not started"
summary: "Blocked on auth.UserModel"
# Orchestrator adjusts priorities
# Reassigns tasks or updates dependencies
# From orchestrator
Task:
description: "Implement auth domain"
subagent_type: "logic-implementer"
team_name: "flutter-domain-team"
name: "auth-implementer"
prompt: "Implement auth domain in worktree at ../project-auth. Create models and services."
Naming:
auth-implementer, not teammate1){domain}-implementer or {screen}-builder# Teammate receives task assignment
1. Check TaskList for assigned task
2. Claim task (TaskUpdate with owner)
3. Work on task
4. Communicate issues (SendMessage)
5. Complete task (TaskUpdate status: completed)
6. Check TaskList for next task or wait
# Orchestrator requests shutdown
SendMessage:
type: "shutdown_request"
recipient: "auth-implementer"
content: "All tasks complete. Shutting down team."
# Teammate approves
SendMessage:
type: "shutdown_response"
request_id: "shutdown-request-id"
approve: true
# Teammate exits automatically after approval
# After all work complete
Teammate.cleanup:
operation: "cleanup"
# This removes:
# - Team directory (~/.claude/teams/{team-name}/)
# - Task list directory (~/.claude/tasks/{team-name}/)
Cleanup rules:
1. Orchestrator:
- spawnTeam("flutter-domain-team")
- TaskCreate for auth, post, chat domains
- Spawn 3 implementers
2. Implementers work in parallel:
- auth-implementer: claims auth task
- post-implementer: claims post task
- chat-implementer: blocked by auth, waits
3. auth-implementer completes:
- TaskUpdate status: completed
- SendMessage to chat-implementer: "auth ready"
4. chat-implementer unblocked:
- Claims chat task
- Proceeds with work
5. Orchestrator integrates:
- All tasks complete
- Merge results
- cleanup team
1. Orchestrator:
- spawnTeam("flutter-ui-team")
- TaskCreate for each screen
- Spawn implementers (one per screen)
2. Implementers work independently:
- No dependencies between screens
- Parallel implementation
3. Component conflicts detected:
- Implementer A: "I'm creating AuthGuard component"
- Implementer B: "I also need AuthGuard"
- SendMessage coordination: "You create it, I'll import"
4. Integration:
- Merge all screens
- Resolve component duplicates
- cleanup team
# Teammate reports failure after 3 retries
SendMessage:
type: "message"
recipient: "team-lead"
content: "Failed to implement auth domain after 3 attempts. Error: ..."
summary: "Auth domain failed"
# Orchestrator decides:
# Option 1: Skip domain (continue with others)
# Option 2: Retry with different approach
# Option 3: Stop entire workflow
Normal: Teammates go idle after every turn Not an error: Idle means waiting for input
# After teammate sends message
# System: "auth-implementer is now idle"
# This is NORMAL - teammate is waiting
# Send message to wake up if needed
SendMessage:
type: "message"
recipient: "auth-implementer"
content: "Next task: implement PostModel"
✅ Create TaskList before spawning teammates ✅ Use descriptive task subjects ✅ Set dependencies upfront when known ✅ Communicate proactively via SendMessage ✅ Mark tasks completed promptly ✅ Cleanup team after work complete ✅ Prefer tasks in ID order (lower ID first)
❌ Broadcast messages unnecessarily ❌ Leave teams running after work done ❌ Ignore teammate messages ❌ Create circular dependencies ❌ Skip TaskUpdate after completing work ❌ Send structured JSON status messages (use TaskUpdate instead)
For detailed patterns and examples:
references/tasklist-patterns.md - Advanced TaskList usagereferences/sendmessage-guide.md - Communication best practicesFor working examples:
examples/team-workflow-example.md - Complete team workflowspawnTeam → TaskCreate → spawn teammates → work → cleanup
pending → in_progress → completed
message: Direct to one teammate
broadcast: To all (use sparingly)
shutdown_request/response: Lifecycle management
TaskUpdate with addBlockedBy: ["task-id"]
Follow these patterns for effective multi-agent collaboration in Flutter DDD Builder workflows.
npx claudepluginhub ureca-corp/claude --plugin flutter-ddd-builderUse when a task benefits from multiple Claude instances collaborating with peer-to-peer messaging - parallel research, multi-module features, cross-layer changes, or competing hypothesis debugging. Not for simple independent tasks (use parallel-execution) or sequential tasks (use delegated-execution).
Coordinates multiple Claude Code instances as agent teams for workflows needing inter-agent communication. Covers TeamCreate, SendMessage types, task coordination, hooks, and orchestration patterns.
Orchestrates Claude Code agent teams: spawn teammates, assign tasks with dependencies, manage communication via messages or broadcasts, configure modes, and set quality gate hooks.