ybbms777/compound-engineering/orchestrating-swarms

Claude Code and agent skill by ybbms777/compound-engineering

Trust tier 3
  • community
  • ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Source check pending

Checking that the SKILL.md file is still in the repository.

This skill should be used when orchestrating multi-agent swarms using Claude Code's TeammateTool and Task system. It applies when coordinating multiple agents, running parallel code reviews, creating pipeline workflows with dependencies, building self-organizing task queues, or any task benefiting from divide-and-conquer patterns.

Install

npx vskill@latest install ybbms777/compound-engineering/orchestrating-swarms

Semi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard

SKILL.md

The same SKILL.md was published earlier as ybbms777/compound-engineering/orchestrating-swarms.

Claude Code Swarm Orchestration

Master multi-agent orchestration using Claude Code's TeammateTool and Task system.


Primitives

PrimitiveWhat It IsFile Location
AgentA Claude instance that can use tools. You are an agent. Subagents are agents you spawn.N/A (process)
TeamA named group of agents working together. One leader, multiple teammates.~/.openclaw/teams/{name}/config.json
TeammateAn agent that joined a team. Has a name, color, inbox. Spawned via Task with team_name + name.Listed in team config
LeaderThe agent that created the team. Receives teammate messages, approves plans/shutdowns.First member in config
TaskA work item with subject, description, status, owner, and dependencies.~/.openclaw/tasks/{team}/N.json
InboxJSON file where an agent receives messages from teammates.~/.openclaw/teams/{name}/inboxes/{agent}.json
MessageA JSON object sent between agents. Can be text or structured (shutdown_request, idle_notification, etc).Stored in inbox files
BackendHow teammates run. Auto-detected: in-process (same Node.js, invisible), tmux (separate panes, visible), iterm2 (split panes in iTerm2). See Spawn Backends.Auto-detected based on environment
How They Connect
mermaid
flowchart TB
subgraph TEAM[TEAM]
Leader[Leader - you]
T1[Teammate 1]
T2[Teammate 2]
Leader <-->|messages via inbox| T1
Leader <-->|messages via inbox| T2
T1 <-.->|can message| T2
end
subgraph TASKS[TASK LIST]
Task1["#1 completed: Research<br/>owner: teammate1"]
Task2["#2 in_progress: Implement<br/>owner: teammate2"]
Task3["#3 pending: Test<br/>blocked by #2"]
end
T1 --> Task1
T2 --> Task2
Task2 -.->|unblocks| Task3
Lifecycle
mermaid
flowchart LR
A[1. Create Team] --> B[2. Create Tasks]
B --> C[3. Spawn Teammates]
C --> D[4. Work]
D --> E[5. Coordinate]
E --> F[6. Shutdown]
F --> G[7. Cleanup]
Message Flow
mermaid
sequenceDiagram
participant L as Leader
participant T1 as Teammate 1
participant T2 as Teammate 2
participant Tasks as Task List
L->>Tasks: TaskCreate (3 tasks)
L->>T1: spawn with prompt
L->>T2: spawn with prompt
T1->>Tasks: claim task #1
T2->>Tasks: claim task #2
T1->>Tasks: complete #1
T1->>L: send findings (inbox)
Note over Tasks: #3 auto-unblocks
T2->>Tasks: complete #2
T2->>L: send findings (inbox)
L->>T1: requestShutdown
T1->>L: approveShutdown
L->>T2: requestShutdown
T2->>L: approveShutdown
L->>L: cleanup

Table of Contents

  1. Core Architecture
  2. Two Ways to Spawn Agents
  3. Built-in Agent Types
  4. Plugin Agent Types
  5. TeammateTool Operations
  6. Task System Integration
  7. Message Formats
  8. Orchestration Patterns
  9. Environment Variables
  10. Spawn Backends
  11. Error Handling
  12. Complete Workflows

Core Architecture

How Swarms Work

A swarm consists of:

  • Leader (you) - Creates team, spawns workers, coordinates work
  • Teammates (spawned agents) - Execute tasks, report back
  • Task List - Shared work queue with dependencies
  • Inboxes - JSON files for inter-agent messaging
File Structure
~/.openclaw/teams/{team-name}/
├── config.json # Team metadata and member list
└── inboxes/
├── team-lead.json # Leader's inbox
├── worker-1.json # Worker 1's inbox
└── worker-2.json # Worker 2's inbox
~/.openclaw/tasks/{team-name}/
├── 1.json # Task #1
├── 2.json # Task #2
└── 3.json # Task #3
Team Config Structure
json
{
"name": "my-project",
"description": "Working on feature X",
"leadAgentId": "team-lead@my-project",
"createdAt": 1706000000000,
"members": [
{
"agentId": "team-lead@my-project",
"name": "team-lead",
"agentType": "team-lead",
"color": "#4A90D9",
"joinedAt": 1706000000000,
"backendType": "in-process"
},
{
"agentId": "worker-1@my-project",
"name": "worker-1",
"agentType": "Explore",
"model": "haiku",
"prompt": "Analyze the codebase structure...",
"color": "#D94A4A",
"planModeRequired": false,
"joinedAt": 1706000001000,
"tmuxPaneId": "in-process",
"cwd": "/Users/me/project",
"backendType": "in-process"
}
]
}

Two Ways to Spawn Agents

Method 1: Task Tool (Subagents)

Use Task for short-lived, focused work that returns a result:

javascript
Task({
subagent_type: "Explore",
description: "Find auth files",
prompt: "Find all authentication-related files in this codebase",
model: "haiku" // Optional: haiku, sonnet, opus
})

Characteristics:

  • Runs synchronously (blocks until complete) or async with run_in_background: true
  • Returns result directly to you
  • No team membership required
  • Best for: searches, analysis, focused research
Method 2: Task Tool + team_name + name (Teammates)

Use Task with team_name and name to spawn persistent teammates:

javascript
// First create a team
Teammate({ operation: "spawnTeam", team_name: "my-project" })
// Then spawn a teammate into that team
Task({
team_name: "my-project", // Required: which team to join
name: "security-reviewer", // Required: teammate's name
subagent_type: "security-sentinel",
prompt: "Review all authentication code for vulnerabilities. Send findings to team-lead via Teammate write.",
run_in_background: true // Teammates usually run in background
})

Characteristics:

  • Joins team, appears in config.json
  • Communicates via inbox messages
  • Can claim tasks from shared task list
  • Persists until shutdown
  • Best for: parallel work, ongoing collaboration, pipeline stages
Key Difference
AspectTask (subagent)Task + team_name + name (teammate)
LifespanUntil task completeUntil shutdown requested
CommunicationReturn valueInbox messages
Task accessNoneShared task list
Team membershipNoYes
CoordinationOne-offOngoing

Built-in Agent Types

These are always available without plugins:

Bash
javascript
Task({
subagent_type: "Bash",
description: "Run git commands",
prompt: "Check git status and show recent commits"
})
  • Tools: Bash only
  • Model: Inherits from parent
  • Best for: Git operations, command execution, system tasks
Explore
javascript
Task({
subagent_type: "Explore",
description: "Find API endpoints",
prompt: "Find all API endpoints in this codebase. Be very thorough.",
model: "haiku" // Fast and cheap
})
  • Tools: All read-only tools (no Edit, Write, NotebookEdit, Task)
  • Model: Haiku (optimized for speed)
  • Best for: Codebase exploration, file searches, code understanding
  • Thoroughness levels: "quick", "medium", "very thorough"
Plan
javascript
Task({
subagent_type: "Plan",
description: "Design auth system",
prompt: "Create an implementation plan for adding OAuth2 authentication"
})
  • Tools: All read-only tools
  • Model: Inherits from parent
  • Best for: Architecture planning, implementation strategies
general-purpose
javascript
Task({
subagent_type: "general-purpose",
description: "Research and implement",
prompt: "Research React Query best practices and implement caching for the user API"
})
  • Tools: All tools (*)
  • Model: Inherits from parent
  • Best for: Multi-step tasks, research + action combinations
claude-code-guide
javascript
Task({
subagent_type: "claude-code-guide",
description: "Help with Claude Code",
prompt: "How do I configure MCP servers?"
})
  • Tools: Read-only + WebFetch + WebSearch
  • Best for: Questions about Claude Code, Agent SDK, Anthropic API
statusline-setup
javascript
Task({
subagent_type: "statusline-setup",
description: "Configure status line",
prompt: "Set up a status line showing git branch and node version"
})
  • Tools: Read, Edit only
  • Model: Sonnet
  • Best for: Configuring Claude Code status line

Plugin Agent Types

From the compound-engineering plugin (examples):

Review Agents
javascript
// Security review
Task({
subagent_type: "compound-engineering:review:security-sentinel",
description: "Security audit",
prompt: "Audit this PR for security vulnerabilities"
})
// Performance review
Task({
subagent_type: "compound-engineering:review:performance-oracle",
description: "Performance check",
prompt: "Analyze this code for performance bottlenecks"
})
// Rails code review
Task({
subagent_type: "compound-engineering:review:kieran-rails-reviewer",
description: "Rails review",
prompt: "Review this Rails code for best practices"
})
// Architecture review
Task({
subagent_type: "compound-engineering:review:architecture-strategist",
description: "Architecture review",
prompt: "Review the system architecture of the authentication module"
})
// Code simplicity
Task({
subagent_type: "compound-engineering:review:code-simplicity-reviewer",
description: "Simplicity check",
prompt: "Check if this implementation can be simplified"
})

All review agents from compound-engineering:

  • agent-native-reviewer - Ensures features work for agents too
  • architecture-strategist - Architectural compliance
  • code-simplicity-reviewer - YAGNI and minimalism
  • data-integrity-guardian - Database and data safety
  • data-migration-expert - Migration validation
  • deployment-verification-agent - Pre-deploy checklists
  • dhh-rails-reviewer - DHH/37signals Rails style
  • julik-frontend-races-reviewer - JavaScript race conditions
  • kieran-python-reviewer - Python best practices
  • kieran-rails-reviewer - Rails best practices
  • kieran-typescript-reviewer - TypeScript best practices
  • pattern-recognition-specialist - Design patterns and anti-patterns
  • performance-oracle - Performance analysis
  • security-sentinel - Security vulnerabilities
Research Agents
javascript
// Best practices research
Task({
subagent_type: "compound-engineering:research:best-practices-researcher",
description: "Research auth best practices",
prompt: "Research current best practices for JWT authentication in Rails 2024-2026"
})
// Framework documentation
Task({
subagent_type: "compound-engineering:research:framework-docs-researcher",
description: "Research Active Storage",
prompt: "Gather comprehensive documentation about Active Storage file uploads"
})
// Git history analysis
Task({
subagent_type: "compound-engineering:research:git-history-analyzer",
description: "Analyze auth history",
prompt: "Analyze the git history of the authentication module to understand its evolution"
})

All research agents:

  • best-practices-researcher - External best practices
  • framework-docs-researcher - Framework documentation
  • git-history-analyzer - Code archaeology
  • learnings-researcher - Search docs/solutions/
  • repo-research-analyst - Repository patterns
Design Agents
javascript
Task({
subagent_type: "compound-engineering:design:figma-design-sync",
description: "Sync with Figma",
prompt: "Compare implementation with Figma design at [URL]"
})

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
5

Not refreshed yet.

Extension points

  • hookPre/post lifecycle hooks

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/ybbms777/compound-engineering/orchestrating-swarms/badge)](https://verified-skill.com/skills/ybbms777/compound-engineering/orchestrating-swarms)

Something wrong with this skill or its page? Tell us.