packages/opencode-swarm-plugin/examples/skill/swarm-coordination/SKILL.md
Multi-agent coordination patterns for OpenCode swarm workflows. Use when working on complex tasks that benefit from parallelization, when coordinating multiple agents, or when managing task decomposition. Do NOT use for simple single-agent tasks.
npx skillsauth add joelhooks/swarm-tools swarm-coordinationInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill provides guidance for effective multi-agent coordination in OpenCode swarm workflows.
IMPORTANT: This skill references global skills in global-skills/. Workers should load domain-specific skills based on their subtask type.
ALL coordination MUST use swarmmail_* tools. This is non-negotiable.
Swarm Mail is embedded (no external server needed) and provides:
Use swarm coordination when:
Do NOT use swarm coordination when:
Before decomposing, understand:
Parallel Strategy - For independent subtasks:
Parent Task: "Add user authentication"
├── Subtask 1: "Create auth API endpoints" (backend)
├── Subtask 2: "Build login/signup forms" (frontend)
├── Subtask 3: "Write auth integration tests" (testing)
└── Subtask 4: "Add auth documentation" (docs)
Sequential Strategy - When order matters:
Parent Task: "Migrate database schema"
├── Step 1: "Create migration files"
├── Step 2: "Update model definitions"
├── Step 3: "Run migrations"
└── Step 4: "Verify data integrity"
Hybrid Strategy - Mixed dependencies:
Parent Task: "Add feature X"
├── Phase 1 (parallel):
│ ├── Subtask A: "Design API"
│ └── Subtask B: "Design UI mockups"
├── Phase 2 (sequential, after Phase 1):
│ └── Subtask C: "Implement based on designs"
└── Phase 3 (parallel):
├── Subtask D: "Write tests"
└── Subtask E: "Update docs"
When multiple agents work on the same codebase:
swarmmail_init before any workswarmmail_reserve to claim filesswarmmail_release or let swarm_complete handle it// Initialize first
await swarmmail_init({
project_path: "$PWD",
task_description: "Working on auth feature",
});
// Reserve files
await swarmmail_reserve({
paths: ["src/auth/**"],
reason: "bd-123: Auth implementation",
ttl_seconds: 3600,
});
// Work...
// Release when done
await swarmmail_release();
swarmmail_send({
to: ["*"],
subject: "API Complete",
body: "Completed API endpoints, ready for frontend integration",
thread_id: epic_id,
});
swarmmail_send({
to: ["frontend-agent"],
subject: "Auth API Spec",
body: "Auth API is at /api/auth/*, here's the spec...",
thread_id: epic_id,
});
// Check inbox (max 5, no bodies for context safety)
const inbox = await swarmmail_inbox();
// Read specific message body
const message = await swarmmail_read_message({ message_id: N });
swarmmail_send({
to: ["coordinator"],
subject: "BLOCKED: Need DB schema",
body: "Can't proceed without users table",
thread_id: epic_id,
importance: "urgent",
});
swarmmail_init before any workskills_use() based on their task type:
skills_use(name="testing-patterns")skills_use(name="system-design")skills_use(name="cli-builder")skills_use(name="swarm-coordination")decomposition:
strategy: hybrid
skills: [system-design, swarm-coordination]
phases:
- name: design
parallel: true
subtasks: [api-design, ui-design]
recommended_skills: [system-design]
- name: implement
parallel: true
subtasks: [backend, frontend]
recommended_skills: [system-design]
- name: validate
parallel: true
subtasks: [tests, docs, review]
recommended_skills: [testing-patterns]
decomposition:
strategy: sequential
skills: [testing-patterns]
subtasks:
- reproduce-bug
- identify-root-cause
- implement-fix
- add-regression-test
recommended_skills: [testing-patterns]
decomposition:
strategy: parallel
skills: [testing-patterns, system-design]
subtasks:
- refactor-module-a
- refactor-module-b
- update-imports
- run-full-test-suite
recommended_skills: [testing-patterns, system-design]
For Coordinators:
swarmmail_initswarm-coordination skillshared_context for workersFor Workers:
swarmmail_initshared_context from coordinatorskills_use(name="skill-name")swarmmail_sendswarm_completeExample shared_context:
## Context from Coordinator
Past similar tasks: [CASS results]
Project learnings: [semantic-memory results]
## Recommended Skills
- skills_use(name="testing-patterns") - for test creation
- skills_use(name="system-design") - for module boundaries
## Task-Specific Notes
[Domain knowledge from coordinator]
| Tool | Purpose |
| ------------------------ | ----------------------------------- |
| swarmmail_init | Initialize session (REQUIRED FIRST) |
| swarmmail_send | Send message to agents |
| swarmmail_inbox | Check inbox (max 5, no bodies) |
| swarmmail_read_message | Read specific message body |
| swarmmail_reserve | Reserve files for exclusive editing |
| swarmmail_release | Release file reservations |
| swarmmail_ack | Acknowledge message |
| swarmmail_health | Check database health |
development
Patterns for testing code effectively. Use when breaking dependencies for testability, adding tests to existing code, understanding unfamiliar code through characterization tests, or deciding how to structure tests. Covers seams, dependency injection, test doubles, and safe refactoring techniques from Michael Feathers.
tools
Principles for building reusable coding systems. Use when designing modules, APIs, CLIs, or any code meant to be used by others. Based on "A Philosophy of Software Design" by John Ousterhout. Covers deep modules, complexity management, and design red flags.
development
Multi-agent coordination patterns for OpenCode swarm workflows. Use when working on complex tasks that benefit from parallelization, when coordinating multiple agents, or when managing task decomposition. Do NOT use for simple single-agent tasks.
development
Meta-skill for generating new skills with proper format and structure. Use when creating new skills for the swarm system or when agents need to generate skill scaffolds. Ensures skills follow conventions (frontmatter format, directory structure, bundled resources).