swarm-init — Claude Code skill: setup and use
Initializes a coordinated agent swarm for complex changes across multiple files. Use it when agents need parallel tasks, named roles and direct messaging.
npx skills add ruvnet/ruflo --skill swarm-init -a claude-codeWhat swarm-init does
This skill initializes a hierarchical agent swarm for coordinated work across multiple files. It uses a specialized strategy and an anti-drift configuration to keep agents focused on the shared task.
After initialization, agents are created in one Task message with names and background execution. SendMessage handles communication between named agents, while EnterWorktree gives each agent a separate Git worktree for parallel changes.
Available topologies include hierarchical, mesh, hierarchical-mesh, ring, star and adaptive. For a single-file edit, this setup adds unnecessary overhead because the skill is built for coordinated agent work.
What it helps with
- initialize agents for a multi-file change
- assign specialized work to separate agents
- run parallel changes in separate Git worktrees
- coordinate named agents with direct messages
Example prompts for the agent
- Run swarm-init for a refactor across several modules.
- Initialize swarm-init with the
hierarchical-meshtopology. - Create an agent swarm with swarm-init and give each agent its own worktree.
How to install swarm-init
1Skills CLI (Vercel)
npx skills add ruvnet/ruflo --skill swarm-init -a claude-code2Manually: put the files in place
~/.claude/skills/swarm-init/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/swarm-init/
1Skills CLI (Vercel)
npx skills add ruvnet/ruflo --skill swarm-init -a codex2Manually: put the files in place
.agents/skills/swarm-init/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add ruvnet/ruflo --skill swarm-init -a cursor2Manually: put the files in place
.cursor/skills/swarm-init/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install ruvnet/ruflo swarm-init2Manually: put the files in place
.github/skills/swarm-init/SKILL.md1Skills CLI (Vercel)
npx skills add ruvnet/ruflo --skill swarm-init -a gemini-cli2Platform CLI
gemini skills install https://github.com/ruvnet/ruflo --path plugins/ruflo-swarm/skills/swarm-initManually: put the files in place
.devin/skills/swarm-init/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add ruvnet/ruflo --skill swarm-init -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about swarm-init
How do I install swarm-init in Claude Code?
Run npx skills add ruvnet/ruflo --skill swarm-init -a claude-code, then run npx skills add ruvnet/ruflo --skill swarm-init -a claude-code again. The skill file is at ~/.claude/skills/swarm-init/SKILL.md.
What does swarm-init do?
It initializes a hierarchical swarm for coordinated agent work. Agents can be named and launched through Task, communicate with SendMessage, and work in separate worktrees.
Which swarm topologies does swarm-init support?
It supports hierarchical, mesh, hierarchical-mesh, ring, star and adaptive. The description suggests hierarchical-mesh for a larger team.
Source text
SKILL.md · MIT
---
name: swarm-init
description: Initialize a multi-agent swarm with anti-drift configuration. Use when starting a complex multi-file task that needs 3+ coordinated agents (feature implementation, refactor across modules, security audit). Skip for single-file edits or quick questions.
argument-hint: "[--topology hierarchical|mesh|hierarchical-mesh|ring|star|adaptive]"
allowed-tools: Bash(npx *) mcp__plugin_ruflo-core_ruflo__swarm_init mcp__plugin_ruflo-core_ruflo__swarm_status Task SendMessage
---
Initialize a hierarchical swarm for coordinated multi-agent work.
Via MCP: `mcp__plugin_ruflo-core_ruflo__swarm_init({ topology: "hierarchical", maxAgents: 8, strategy: "specialized" })`
Or via CLI:
```bash
npx @claude-flow/cli@latest swarm init --topology hierarchical --max-agents 8 --strategy specialized
```
Then spawn named agents in ONE message via Claude Code's `Task` tool with `name:` (for `SendMessage` addressability) and `run_in_background: true` (for parallel execution). Use `EnterWorktree` per agent for git-safe parallel work, and `SendMessage` for inter-agent coordination.
For larger teams (10+), use hierarchical-mesh topology:
```bash
npx @claude-flow/cli@latest swarm init --topology hierarchical-mesh --max-agents 15 --strategy specialized
```
© ruvnet · MIT · ruvnet/ruflo