New to Claude Skills? Learn how to install them →

ruvnet on GitHub

Swarm Orchestration

Free

Efficiently manage multi-agent workflows with dynamic coordination.

by ruvnet67.6k stars on ruvnet/ruflo
4 views
Updated Aug 10, 2026
Get this skill

Free · Opens the source repo

What Swarm Orchestration does

Swarm Orchestration is designed for developers and engineers looking to implement complex workflows through the coordination of multiple agents. Utilizing agentic-flow's advanced system, this skill allows for the orchestration of swarms with various topologies, including mesh, hierarchical, and adaptive configurations. By enabling parallel task execution and intelligent load balancing, users can effectively scale their projects beyond single-agent limitations, making it ideal for building distributed AI systems.

The skill supports automatic task distribution and fault tolerance, ensuring that your workflows remain efficient and resilient under varying conditions. With the ability to share state across agents using memory coordination, Swarm Orchestration enables seamless collaboration among agents, enhancing the overall productivity of your development process. This is particularly beneficial when working on large-scale projects that require multiple roles, such as coders, testers, and reviewers, to operate simultaneously.

To get started, users can initialize a swarm, spawn agents of different types, and orchestrate tasks with simple command-line hooks. The skill also offers advanced features like performance monitoring and automatic work distribution, allowing for real-time adjustments based on system performance. Whether you're managing a small team or a large distributed system, Swarm Orchestration provides the tools necessary to streamline your workflow and improve efficiency.

When to use it

Use Swarm Orchestration when you need to implement workflows that require multiple agents to work in parallel or when scaling tasks across a distributed system.

When not to use it

This skill may not be suitable for simple tasks that can be handled by a single agent or when a lightweight solution is preferred over a full orchestration framework.

What you can build with it

Building a REST API

Utilize Swarm Orchestration to manage multiple agents working on different components of a REST API, ensuring efficient parallel execution.

Testing and Review Processes

Coordinate testers and reviewers alongside developers in a structured workflow, allowing for seamless transitions between development and quality assurance.

Dynamic Project Management

Adaptively manage tasks and agent roles based on project complexity, using the adaptive topology feature to optimize resource allocation.

How to install Swarm Orchestration

View source

1. Install with the skills CLI

npx skills add ruvnet/ruflo/swarm-orchestration --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by ruvnet

Swarm Orchestration

What This Skill Does

Orchestrates multi-agent swarms using agentic-flow's advanced coordination system. Supports mesh, hierarchical, and adaptive topologies with automatic task distribution, load balancing, and fault tolerance.

Prerequisites

  • agentic-flow v1.5.11+
  • Node.js 18+
  • Understanding of distributed systems (helpful)

Quick Start

# Initialize swarm
npx agentic-flow hooks swarm-init --topology mesh --max-agents 5

# Spawn agents
npx agentic-flow hooks agent-spawn --type coder
npx agentic-flow hooks agent-spawn --type tester
npx agentic-flow hooks agent-spawn --type reviewer

# Orchestrate task
npx agentic-flow hooks task-orchestrate \
  --task "Build REST API with tests" \
  --mode parallel

Topology Patterns

1. Mesh (Peer-to-Peer)

// Equal peers, distributed decision-making
await swarm.init({
  topology: 'mesh',
  agents: ['coder', 'tester', 'reviewer'],
  communication: 'broadcast'
});

2. Hierarchical (Queen-Worker)

// Centralized coordination, specialized workers
await swarm.init({
  topology: 'hierarchical',
  queen: 'architect',
  workers: ['backend-dev', 'frontend-dev', 'db-designer']
});

3. Adaptive (Dynamic)

// Automatically switches topology based on task
await swarm.init({
  topology: 'adaptive',
  optimization: 'task-complexity'
});

Task Orchestration

Parallel Execution

// Execute tasks concurrently
const results = await swarm.execute({
  tasks: [
    { agent: 'coder', task: 'Implement API endpoints' },
    { agent: 'frontend', task: 'Build UI components' },
    { agent: 'tester', task: 'Write test suite' }
  ],
  mode: 'parallel',
  timeout: 300000 // 5 minutes
});

Pipeline Execution

// Sequential pipeline with dependencies
await swarm.pipeline([
  { stage: 'design', agent: 'architect' },
  { stage: 'implement', agent: 'coder', after: 'design' },
  { stage: 'test', agent: 'tester', after: 'implement' },
  { stage: 'review', agent: 'reviewer', after: 'test' }
]);

Adaptive Execution

// Let swarm decide execution strategy
await swarm.autoOrchestrate({
  goal: 'Build production-ready API',
  constraints: {
    maxTime: 3600,
    maxAgents: 8,
    quality: 'high'
  }
});

Memory Coordination

// Share state across swarm
await swarm.memory.store('api-schema', {
  endpoints: [...],
  models: [...]
});

// Agents read shared memory
const schema = await swarm.memory.retrieve('api-schema');

Advanced Features

Load Balancing

// Automatic work distribution
await swarm.enableLoadBalancing({
  strategy: 'dynamic',
  metrics: ['cpu', 'memory', 'task-queue']
});

Fault Tolerance

// Handle agent failures
await swarm.setResiliency({
  retry: { maxAttempts: 3, backoff: 'exponential' },
  fallback: 'reassign-task'
});

Performance Monitoring

// Track swarm metrics
const metrics = await swarm.getMetrics();
// { throughput, latency, success_rate, agent_utilization }

Integration with Hooks

# Pre-task coordination
npx agentic-flow hooks pre-task --description "Build API"

# Post-task synchronization
npx agentic-flow hooks post-task --task-id "task-123"

# Session restore
npx agentic-flow hooks session-restore --session-id "swarm-001"

Best Practices

  1. Start small: Begin with 2-3 agents, scale up
  2. Use memory: Share context through swarm memory
  3. Monitor metrics: Track performance and bottlenecks
  4. Enable hooks: Automatic coordination and sync
  5. Set timeouts: Prevent hung tasks

Troubleshooting

Issue: Agents not coordinating

Solution: Verify memory access and enable hooks

Issue: Poor performance

Solution: Check topology (use adaptive) and enable load balancing

Learn More

  • Swarm Guide: docs/swarm/orchestration.md
  • Topology Patterns: docs/swarm/topologies.md
  • Hooks Integration: docs/hooks/coordination.md

Frequently asked questions about Swarm Orchestration

Similar skills