swarm-init

Initializes a multi-agent swarm with configurable topology for coordinated parallel work.

70.1k|8.4k|Updated Jun 2, 2025
One-click install
npx skills add https://github.com/ruvnet/claude-flow --skill swarm-init
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: swarm-init
Source: https://github.com/ruvnet/claude-flow/tree/main/plugins/ruflo-swarm/skills/swarm-init
Command: npx skills add https://github.com/ruvnet/claude-flow --skill swarm-init

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Coordinating multiple AI agents on complex multi-file tasks often leads to drift, conflicting edits, and lost context. This Skill sets up a structured swarm with a defined topology so agents can work in parallel with clear coordination.

Core Features & Use Cases

  • Swarm Initialization: Start a swarm via MCP tool or CLI with configurable topology (hierarchical, mesh, hierarchical-mesh, ring, star, adaptive), agent count, and strategy.
  • Parallel Agent Spawning: Spawn named background agents through the Task tool with git worktree isolation and SendMessage-based inter-agent communication.
  • Use Case: When implementing a feature that touches many modules, initialize a hierarchical swarm with 8 specialized agents, then assign each agent a module so they edit in parallel without conflicts.

Quick Start

Ask the AI to initialize a hierarchical swarm with 8 agents using the swarm-init skill before starting your multi-file refactoring task.

Frequently Asked Questions about swarm-init

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I initialize a multi-agent swarm in Claude Code?▼

Call the MCP tool mcp__plugin_ruflo-core_ruflo__swarm_init with a topology, maxAgents, and strategy, or run npx @claude-flow/cli@latest swarm init with the same flags. Then spawn named agents with the Task tool using run_in_background for parallel execution.

Which swarm topology should I use for large agent teams?▼

For teams of 10 or more agents, use the hierarchical-mesh topology, which combines layered coordination with peer-to-peer messaging. Smaller teams of around 8 agents typically work well with the standard hierarchical topology.

When should I skip swarm initialization?▼

Skip swarm setup for single-file edits or quick questions, since coordination overhead outweighs the benefit. The skill is intended for complex multi-file tasks needing three or more coordinated agents, such as feature implementation or security audits.

How do swarm agents avoid git conflicts when editing in parallel?▼

Each agent uses EnterWorktree to work in an isolated git worktree, preventing conflicting edits to the same working tree. Agents coordinate through SendMessage, which requires spawning them with a name parameter for addressability.

Can I run swarm agents in parallel instead of sequentially?▼

Yes, spawn all agents in one message using the Task tool with run_in_background set to true. This launches them concurrently, and SendMessage handles inter-agent coordination while they execute.