
Swarm Orchestration
Coordinate a hierarchical multi-agent swarm when a feature or refactor touches many files and modules.
Overview
Swarm Orchestration is an agent skill most often used in Build (also Ship) that coordinates hierarchical multi-agent swarms for complex cross-module coding tasks via Claude Flow CLI.
Install
npx skills add https://github.com/ruvnet/ruflo --skill swarm-orchestrationWhat is this skill?
- Initializes hierarchical swarms with configurable max agents and specialized strategy
- Targets 3+ file changes, cross-module refactors, and API changes with tests
- Includes monitor workflow with watch-mode swarm status polling
- Explicit skip rules for single-file edits, tiny fixes, and doc-only updates
- Default max-agents setting of 8 in bundled init script
- Monitor script polls swarm status on a 5-second interval
Adoption & trust: 525 installs on skills.sh; 58.5k GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You need to implement or refactor a feature across many files but a single agent session keeps missing dependencies, tests, or module boundaries.
Who is it for?
Indie devs shipping agent-assisted features that touch APIs, data layers, and tests in one pass.
Skip if: One-file bugfixes, documentation-only edits, or tasks with no need for multi-agent parallelism.
When should I use this skill?
3+ files need changes, new feature implementation, cross-module refactoring, API changes with tests, security-related changes, performance optimization across codebase, or database schema changes.
What do I get? / Deliverables
You initialize a monitored hierarchical swarm with specialized agents suited to multi-file features, refactors, and API-plus-test changes.
- Initialized hierarchical swarm configuration
- Live swarm status monitoring during execution
- Coordinated multi-file implementation or refactor attempt
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Build is canonical because swarm orchestration exists to execute cross-file implementation and refactors with specialized agents. Agent-tooling matches @claude-flow/cli swarm init, status, and hierarchical coordination primitives.
Where it fits
Spin up an 8-agent hierarchical swarm before a new module spans API, worker, and client files.
Coordinate schema and service layers when database models and handlers must change together.
Keep agents aligned on API contract changes that require parallel test updates.
Watch swarm status while security-sensitive diffs land across multiple packages.
How it compares
Multi-agent CLI orchestration—not a lightweight single-file edit or static code-review checklist.
Common Questions / FAQ
Who is swarm orchestration for?
Builders using Claude Flow who routinely land multi-file features or refactors and want hierarchical agent coordination instead of one monolithic session.
When should I use swarm orchestration?
During Build for cross-module features and agent tooling setup; during Ship when security-related or performance changes need coordinated edits and test coverage across the codebase.
Is swarm orchestration safe to install?
It can drive shell and multi-agent edits; review the Security Audits panel on this Prism page, constrain repo access, and inspect diffs before merge.
SKILL.md
READMESKILL.md - Swarm Orchestration
#!/bin/bash # Swarm Orchestration - Monitor Script # Real-time swarm monitoring set -e echo "Starting swarm monitor..." npx @claude-flow/cli swarm status --watch --interval 5 #!/bin/bash # Swarm Orchestration - Start Script # Initialize swarm with default anti-drift settings set -e echo "Initializing hierarchical swarm..." npx @claude-flow/cli swarm init \ --topology hierarchical \ --max-agents 8 \ --strategy specialized echo "Swarm initialized successfully" npx @claude-flow/cli swarm status --- name: swarm-orchestration description: > Multi-agent swarm coordination for complex tasks. Uses hierarchical topology with specialized agents to break down and execute complex work across multiple files and modules. Use when: 3+ files need changes, new feature implementation, cross-module refactoring, API changes with tests, security-related changes, performance optimization across codebase, database schema changes. Skip when: single file edits, simple bug fixes (1-2 lines), documentation updates, configuration changes, quick exploration. --- # Swarm Orchestration Skill ## Purpose Multi-agent swarm coordination for complex tasks. Uses hierarchical topology with specialized agents to break down and execute complex work across multiple files and modules. ## When to Trigger - 3+ files need changes - new feature implementation - cross-module refactoring - API changes with tests - security-related changes - performance optimization across codebase - database schema changes ## When to Skip - single file edits - simple bug fixes (1-2 lines) - documentation updates - configuration changes - quick exploration ## Commands ### Initialize Swarm Start a new swarm with hierarchical topology (anti-drift) ```bash npx @claude-flow/cli swarm init --topology hierarchical --max-agents 8 --strategy specialized ``` **Example:** ```bash npx @claude-flow/cli swarm init --topology hierarchical --max-agents 6 --strategy specialized ``` ### Route Task Route a task to the appropriate agents based on task type ```bash npx @claude-flow/cli hooks route --task "[task description]" ``` **Example:** ```bash npx @claude-flow/cli hooks route --task "implement OAuth2 authentication flow" ``` ### Spawn Agent Spawn a specific agent type ```bash npx @claude-flow/cli agent spawn --type [type] --name [name] ``` **Example:** ```bash npx @claude-flow/cli agent spawn --type coder --name impl-auth ``` ### Monitor Status Check the current swarm status ```bash npx @claude-flow/cli swarm status --verbose ``` ### Orchestrate Task Orchestrate a task across multiple agents ```bash npx @claude-flow/cli task orchestrate --task "[task]" --strategy adaptive ``` **Example:** ```bash npx @claude-flow/cli task orchestrate --task "refactor auth module" --strategy parallel --max-agents 4 ``` ### List Agents List all active agents ```bash npx @claude-flow/cli agent list --filter active ``` ## Scripts | Script | Path | Description | |--------|------|-------------| | `swarm-start` | `.agents/scripts/swarm-start.sh` | Initialize swarm with default settings | | `swarm-monitor` | `.agents/scripts/swarm-monitor.sh` | Real-time swarm monitoring dashboard | ## References | Document | Path | Description | |----------|------|-------------| | `Agent Types` | `docs/agents.md` | Complete list of agent types and capabilities | | `Topology Guide` | `docs/topology.md` | Swarm topology configuration guide | ## Best Practices 1. Check memory for existing patterns before starting 2. Use hierarchical topology for coordination 3. Store successful patterns after completion 4. Document any new learnings