Swarm advanced

From frankxai/claude-skills-library · View interactive version

Swarm advanced is an AI agent skill from the GitHub repository frankxai/claude-skills-library. Advanced swarm-orchestration patterns for research, development, testing, and complex distributed workflows. Use when scaling beyond a few agents, designing dynamic swarm topologies, or coordinating large parallel agent workloads.

How to use this skill

Skill file

Advanced Swarm Orchestration

Master advanced swarm patterns for distributed research, development, and testing workflows. This skill covers comprehensive orchestration strategies using both MCP tools and CLI commands.

Quick Start

Prerequisites

# Ensure Claude Flow is installed
npm install -g claude-flow@alpha

# Add MCP server (if using MCP tools)
claude mcp add claude-flow npx claude-flow@alpha mcp start

Basic Pattern

// 1. Initialize swarm topology
mcp__claude-flow__swarm_init({ topology: "mesh", maxAgents: 6 })

// 2. Spawn specialized agents
mcp__claude-flow__agent_spawn({ type: "researcher", name: "Agent 1" })

// 3. Orchestrate tasks
mcp__claude-flow__task_orchestrate({ task: "...", strategy: "parallel" })

Core Concepts

Swarm Topologies

Mesh Topology - Peer-to-peer communication, best for research and analysis

Hierarchical Topology - Coordinator with subordinates, best for development

Star Topology - Central coordinator, best for testing

Ring Topology - Sequential processing chain

Agent Strategies

Adaptive - Dynamic adjustment based on task complexity

Balanced - Equal distribution of work across agents

Specialized - Task-specific agent assignment

Parallel - Maximum concurrent execution

Reference

The full detail lives in references/ and loads only when needed:


Best Practices

1. Choosing the Right Topology

2. Agent Specialization

3. Parallel Execution

4. Memory Management

5. Monitoring and Optimization

6. Error Recovery

Real-World Examples

Example 1: AI Research Project

// Research AI trends, analyze findings, generate report
mcp__claude-flow__swarm_init({ topology: "mesh", maxAgents: 6 })
// Spawn: 2 researchers, 2 analysts, 1 synthesizer, 1 documenter
// Parallel gather → Analyze patterns → Synthesize → Report

Example 2: Full-Stack Application

// Build complete web application with testing
mcp__claude-flow__swarm_init({ topology: "hierarchical", maxAgents: 8 })
// Spawn: 1 architect, 2 devs, 1 db engineer, 2 testers, 1 reviewer, 1 devops
// Design → Parallel implement → Test → Review → Deploy

Example 3: Security Audit

// Comprehensive security analysis
mcp__claude-flow__swarm_init({ topology: "star", maxAgents: 5 })
// Spawn: 1 coordinator, 1 code analyzer, 1 security scanner, 1 penetration tester, 1 reporter
// Parallel scan → Vulnerability analysis → Penetration test → Report

Example 4: Performance Optimization

// Identify and fix performance bottlenecks
mcp__claude-flow__swarm_init({ topology: "mesh", maxAgents: 4 })
// Spawn: 1 profiler, 1 bottleneck analyzer, 1 optimizer, 1 tester
// Profile → Identify bottlenecks → Optimize → Validate

Troubleshooting

Common Issues

Issue: Swarm agents not coordinating properly

Solution: Check topology selection, verify memory usage, enable monitoring

Issue: Parallel execution failing

Solution: Verify task dependencies, check resource limits, implement error handling

Issue: Memory persistence not working

Solution: Verify namespaces, check TTL settings, ensure backup configuration

Issue: Performance degradation

Solution: Optimize topology, reduce agent count, analyze bottlenecks

Related Skills

References


Version: 2.0.0

Last Updated: 2025-10-19

Skill Level: Advanced

Estimated Learning Time: 2-3 hours

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.