ワンクリックで
swarm-advanced
Advanced swarm orchestration patterns for research, development, testing, and complex distributed workflows
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Advanced swarm orchestration patterns for research, development, testing, and complex distributed workflows
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Create a new Architecture Decision Record with auto-numbering, dependency impact analysis, and validation gates. Use when the user asks to "create ADR", "write ADR", "new ADR", or "architecture decision".
Start feature development with hex decomposition and worktree isolation. Use when the user asks to "develop a feature", "new feature", "implement feature", "feature dev", "start feature", or "add feature".
Guide SpacetimeDB WASM module development for hex. Use when the user asks to "create module", "spacetimedb", "wasm module", "new reducer", "spacetime table", "add spacetime module", or works in spacetime-modules/.
Review code changes against existing Architecture Decision Records
Search Architecture Decision Records by keyword, status, or date
Check ADR lifecycle -- find stale, abandoned, or conflicting decisions
| name | swarm-advanced |
| description | Advanced swarm orchestration patterns for research, development, testing, and complex distributed workflows |
| version | 2.0.0 |
| category | orchestration |
| tags | ["swarm","distributed","parallel","research","testing","development","coordination"] |
| author | Claude Flow Team |
Master advanced swarm patterns for distributed research, development, and testing workflows. This skill covers comprehensive orchestration strategies using both MCP tools and CLI commands.
# 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
// 1. Initialize swarm topology
mcp__hex__hex_hexflo_swarm_init({ topology: "mesh", maxAgents: 6 })
// 2. Spawn specialized agents
mcp__hex__hex_hexflo_swarm_status({ type: "researcher", name: "Agent 1" })
// 3. Orchestrate tasks
mcp__hex__hex_hexflo_task_create({ task: "...", strategy: "parallel" })
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
Adaptive - Dynamic adjustment based on task complexity Balanced - Equal distribution of work across agents Specialized - Task-specific agent assignment Parallel - Maximum concurrent execution
Deep research through parallel information gathering, analysis, and synthesis.
// Initialize research swarm
mcp__hex__hex_hexflo_swarm_init({
"topology": "mesh",
"maxAgents": 6,
"strategy": "adaptive"
})
// Spawn research team
const researchAgents = [
{
type: "researcher",
name: "Web Researcher",
capabilities: ["web-search", "content-extraction", "source-validation"]
},
{
type: "researcher",
name: "Academic Researcher",
capabilities: ["paper-analysis", "citation-tracking", "literature-review"]
},
{
type: "analyst",
name: "Data Analyst",
capabilities: ["data-processing", "statistical-analysis", "visualization"]
},
{
type: "analyst",
name: "Pattern Analyzer",
capabilities: ["trend-detection", "correlation-analysis", "outlier-detection"]
},
{
type: "documenter",
name: "Report Writer",
capabilities: ["synthesis", "technical-writing", "formatting"]
}
]
// Spawn all agents
researchAgents.forEach(agent => {
mcp__hex__hex_hexflo_swarm_status({
type: agent.type,
name: agent.name,
capabilities: agent.capabilities
})
})
// Parallel information collection
mcp__hex__hex_hexflo_task_create({
"tasks": [
{
"id": "web-search",
"command": "search recent publications and articles"
},
{
"id": "academic-search",
"command": "search academic databases and papers"
},
{
"id": "data-collection",
"command": "gather relevant datasets and statistics"
},
{
"id": "expert-search",
"command": "identify domain experts and thought leaders"
}
]
})
// Store research findings in memory
mcp__hex__hex_hexflo_swarm_status({
"action": "store",
"key": "research-findings-" + Date.now(),
"value": JSON.stringify(findings),
"namespace": "research",
"ttl": 604800 // 7 days
})
// Pattern recognition in findings
mcp__hex__hex_hexflo_pattern_recognize({
"data": researchData,
"patterns": ["trend", "correlation", "outlier", "emerging-pattern"]
})
// Cognitive analysis
mcp__hex__hex_hexflo_cognitive_analyze({
"behavior": "research-synthesis"
})
// Quality assessment
mcp__hex__hex_hexflo_quality_assess({
"target": "research-sources",
"criteria": ["credibility", "relevance", "recency", "authority"]
})
// Cross-reference validation
mcp__hex__hex_hexflo_neural_patterns({
"action": "analyze",
"operation": "fact-checking",
"metadata": { "sources": sourcesArray }
})
// Search existing knowledge base
mcp__hex__hex_hexflo_memory_search({
"pattern": "topic X",
"namespace": "research",
"limit": 20
})
// Create knowledge graph connections
mcp__hex__hex_hexflo_neural_patterns({
"action": "learn",
"operation": "knowledge-graph",
"metadata": {
"topic": "X",
"connections": relatedTopics,
"depth": 3
}
})
// Store connections for future use
mcp__hex__hex_hexflo_swarm_status({
"action": "store",
"key": "knowledge-graph-X",
"value": JSON.stringify(knowledgeGraph),
"namespace": "research/graphs",
"ttl": 2592000 // 30 days
})
// Orchestrate report generation
mcp__hex__hex_hexflo_task_create({
"task": "generate comprehensive research report",
"strategy": "sequential",
"priority": "high",
"dependencies": ["gather", "analyze", "validate", "synthesize"]
})
// Monitor research progress
mcp__hex__hex_hexflo_swarm_status({
"swarmId": "research-swarm"
})
// Generate final report
mcp__hex__hex_hexflo_task_create({
"workflowId": "research-report-generation",
"params": {
"findings": findings,
"format": "comprehensive",
"sections": ["executive-summary", "methodology", "findings", "analysis", "conclusions", "references"]
}
})
# Quick research swarm
npx claude-flow swarm "research AI trends in 2025" \
--strategy research \
--mode distributed \
--max-agents 6 \
--parallel \
--output research-report.md
Full-stack development through coordinated specialist agents.
// Initialize development swarm with hierarchy
mcp__hex__hex_hexflo_swarm_init({
"topology": "hierarchical",
"maxAgents": 8,
"strategy": "balanced"
})
// Spawn development team
const devTeam = [
{ type: "architect", name: "System Architect", role: "coordinator" },
{ type: "coder", name: "Backend Developer", capabilities: ["node", "api", "database"] },
{ type: "coder", name: "Frontend Developer", capabilities: ["react", "ui", "ux"] },
{ type: "coder", name: "Database Engineer", capabilities: ["sql", "nosql", "optimization"] },
{ type: "tester", name: "QA Engineer", capabilities: ["unit", "integration", "e2e"] },
{ type: "reviewer", name: "Code Reviewer", capabilities: ["security", "performance", "best-practices"] },
{ type: "documenter", name: "Technical Writer", capabilities: ["api-docs", "guides", "tutorials"] },
{ type: "monitor", name: "DevOps Engineer", capabilities: ["ci-cd", "deployment", "monitoring"] }
]
// Spawn all team members
devTeam.forEach(member => {
mcp__hex__hex_hexflo_swarm_status({
type: member.type,
name: member.name,
capabilities: member.capabilities,
swarmId: "dev-swarm"
})
})
// System architecture design
mcp__hex__hex_hexflo_task_create({
"task": "design system architecture for REST API",
"strategy": "sequential",
"priority": "critical",
"assignTo": "System Architect"
})
// Store architecture decisions
mcp__hex__hex_hexflo_swarm_status({
"action": "store",
"key": "architecture-decisions",
"value": JSON.stringify(architectureDoc),
"namespace": "development/design"
})
// Parallel development tasks
mcp__hex__hex_hexflo_task_create({
"tasks": [
{
"id": "backend-api",
"command": "implement REST API endpoints",
"assignTo": "Backend Developer"
},
{
"id": "frontend-ui",
"command": "build user interface components",
"assignTo": "Frontend Developer"
},
{
"id": "database-schema",
"command": "design and implement database schema",
"assignTo": "Database Engineer"
},
{
"id": "api-documentation",
"command": "create API documentation",
"assignTo": "Technical Writer"
}
]
})
// Monitor development progress
mcp__hex__hex_hexflo_swarm_monitor({
"swarmId": "dev-swarm",
"interval": 5000
})
// Comprehensive testing
mcp__hex__hex_hexflo_batch_process({
"items": [
{ type: "unit", target: "all-modules" },
{ type: "integration", target: "api-endpoints" },
{ type: "e2e", target: "user-flows" },
{ type: "performance", target: "critical-paths" }
],
"operation": "execute-tests"
})
// Quality assessment
mcp__hex__hex_hexflo_quality_assess({
"target": "codebase",
"criteria": ["coverage", "complexity", "maintainability", "security"]
})
// Code review workflow
mcp__hex__hex_hexflo_task_create({
"workflowId": "code-review-process",
"params": {
"reviewers": ["Code Reviewer"],
"criteria": ["security", "performance", "best-practices"]
}
})
// CI/CD pipeline
mcp__hex__hex_hexflo_pipeline_create({
"config": {
"stages": ["build", "test", "security-scan", "deploy"],
"environment": "production"
}
})
# Quick development swarm
npx claude-flow swarm "build REST API with authentication" \
--strategy development \
--mode hierarchical \
--monitor \
--output sqlite
Comprehensive quality assurance through distributed testing.
// Initialize testing swarm with star topology
mcp__hex__hex_hexflo_swarm_init({
"topology": "star",
"maxAgents": 7,
"strategy": "parallel"
})
// Spawn testing team
const testingTeam = [
{
type: "tester",
name: "Unit Test Coordinator",
capabilities: ["unit-testing", "mocking", "coverage", "tdd"]
},
{
type: "tester",
name: "Integration Tester",
capabilities: ["integration", "api-testing", "contract-testing"]
},
{
type: "tester",
name: "E2E Tester",
capabilities: ["e2e", "ui-testing", "user-flows", "selenium"]
},
{
type: "tester",
name: "Performance Tester",
capabilities: ["load-testing", "stress-testing", "benchmarking"]
},
{
type: "monitor",
name: "Security Tester",
capabilities: ["security-testing", "penetration-testing", "vulnerability-scanning"]
},
{
type: "analyst",
name: "Test Analyst",
capabilities: ["coverage-analysis", "test-optimization", "reporting"]
},
{
type: "documenter",
name: "Test Documenter",
capabilities: ["test-documentation", "test-plans", "reports"]
}
]
// Spawn all testers
testingTeam.forEach(tester => {
mcp__hex__hex_hexflo_swarm_status({
type: tester.type,
name: tester.name,
capabilities: tester.capabilities,
swarmId: "testing-swarm"
})
})
// Analyze test coverage requirements
mcp__hex__hex_hexflo_quality_assess({
"target": "test-coverage",
"criteria": [
"line-coverage",
"branch-coverage",
"function-coverage",
"edge-cases"
]
})
// Identify test scenarios
mcp__hex__hex_hexflo_pattern_recognize({
"data": testScenarios,
"patterns": [
"edge-case",
"boundary-condition",
"error-path",
"happy-path"
]
})
// Store test plan
mcp__hex__hex_hexflo_swarm_status({
"action": "store",
"key": "test-plan-" + Date.now(),
"value": JSON.stringify(testPlan),
"namespace": "testing/plans"
})
// Execute all test suites in parallel
mcp__hex__hex_hexflo_task_create({
"tasks": [
{
"id": "unit-tests",
"command": "npm run test:unit",
"assignTo": "Unit Test Coordinator"
},
{
"id": "integration-tests",
"command": "npm run test:integration",
"assignTo": "Integration Tester"
},
{
"id": "e2e-tests",
"command": "npm run test:e2e",
"assignTo": "E2E Tester"
},
{
"id": "performance-tests",
"command": "npm run test:performance",
"assignTo": "Performance Tester"
},
{
"id": "security-tests",
"command": "npm run test:security",
"assignTo": "Security Tester"
}
]
})
// Batch process test suites
mcp__hex__hex_hexflo_batch_process({
"items": testSuites,
"operation": "execute-test-suite"
})
// Run performance benchmarks
mcp__hex__hex_hexflo_benchmark_run({
"suite": "comprehensive-performance"
})
// Bottleneck analysis
mcp__hex__hex_hexflo_swarm_status({
"component": "application",
"metrics": ["response-time", "throughput", "memory", "cpu"]
})
// Security scanning
mcp__hex__hex_hexflo_security_scan({
"target": "application",
"depth": "comprehensive"
})
// Vulnerability analysis
mcp__hex__hex_hexflo_error_analysis({
"logs": securityScanLogs
})
// Real-time test monitoring
mcp__hex__hex_hexflo_swarm_monitor({
"swarmId": "testing-swarm",
"interval": 2000
})
// Generate comprehensive test report
mcp__hex__hex_hexflo_swarm_status({
"format": "detailed",
"timeframe": "current-run"
})
// Get test results
mcp__hex__hex_hexflo_task_results({
"taskId": "test-execution-001"
})
// Trend analysis
mcp__hex__hex_hexflo_trend_analysis({
"metric": "test-coverage",
"period": "30d"
})
# Quick testing swarm
npx claude-flow swarm "test application comprehensively" \
--strategy testing \
--mode star \
--parallel \
--timeout 600
Deep code and system analysis through specialized analyzers.
// Initialize analysis swarm
mcp__hex__hex_hexflo_swarm_init({
"topology": "mesh",
"maxAgents": 5,
"strategy": "adaptive"
})
// Spawn analysis specialists
const analysisTeam = [
{
type: "analyst",
name: "Code Analyzer",
capabilities: ["static-analysis", "complexity-analysis", "dead-code-detection"]
},
{
type: "analyst",
name: "Security Analyzer",
capabilities: ["security-scan", "vulnerability-detection", "dependency-audit"]
},
{
type: "analyst",
name: "Performance Analyzer",
capabilities: ["profiling", "bottleneck-detection", "optimization"]
},
{
type: "analyst",
name: "Architecture Analyzer",
capabilities: ["dependency-analysis", "coupling-detection", "modularity-assessment"]
},
{
type: "documenter",
name: "Analysis Reporter",
capabilities: ["reporting", "visualization", "recommendations"]
}
]
// Spawn all analysts
analysisTeam.forEach(analyst => {
mcp__hex__hex_hexflo_swarm_status({
type: analyst.type,
name: analyst.name,
capabilities: analyst.capabilities
})
})
// Parallel analysis execution
mcp__hex__hex_hexflo_task_create({
"tasks": [
{ "id": "analyze-code", "command": "analyze codebase structure and quality" },
{ "id": "analyze-security", "command": "scan for security vulnerabilities" },
{ "id": "analyze-performance", "command": "identify performance bottlenecks" },
{ "id": "analyze-architecture", "command": "assess architectural patterns" }
]
})
// Generate comprehensive analysis report
mcp__hex__hex_hexflo_swarm_status({
"format": "detailed",
"timeframe": "current"
})
// Cost analysis
mcp__hex__hex_hexflo_cost_analysis({
"timeframe": "30d"
})
// Setup fault tolerance for all agents
mcp__hex__hex_hexflo_daa_fault_tolerance({
"agentId": "all",
"strategy": "auto-recovery"
})
// Error handling pattern
try {
await mcp__hex__hex_hexflo_task_create({
"task": "complex operation",
"strategy": "parallel",
"priority": "high"
})
} catch (error) {
// Check swarm health
const status = await mcp__hex__hex_hexflo_swarm_status({})
// Analyze error patterns
await mcp__hex__hex_hexflo_error_analysis({
"logs": [error.message]
})
// Auto-recovery attempt
if (status.healthy) {
await mcp__hex__hex_hexflo_task_create({
"task": "retry failed operation",
"strategy": "sequential"
})
}
}
// Cross-session persistence
mcp__hex__hex_hexflo_memory_persist({
"sessionId": "swarm-session-001"
})
// Namespace management for different swarms
mcp__hex__hex_hexflo_memory_namespace({
"namespace": "research-swarm",
"action": "create"
})
// Create state snapshot
mcp__hex__hex_hexflo_state_snapshot({
"name": "development-checkpoint-1"
})
// Restore from snapshot if needed
mcp__hex__hex_hexflo_context_restore({
"snapshotId": "development-checkpoint-1"
})
// Backup memory stores
mcp__hex__hex_hexflo_memory_backup({
"path": "/workspaces/claude-code-flow/backups/swarm-memory.json"
})
// Train neural patterns from successful workflows
mcp__hex__hex_hexflo_neural_train({
"pattern_type": "coordination",
"training_data": JSON.stringify(successfulWorkflows),
"epochs": 50
})
// Adaptive learning from experience
mcp__hex__hex_hexflo_learning_adapt({
"experience": {
"workflow": "research-to-report",
"success": true,
"duration": 3600,
"quality": 0.95
}
})
// Pattern recognition for optimization
mcp__hex__hex_hexflo_pattern_recognize({
"data": workflowMetrics,
"patterns": ["bottleneck", "optimization-opportunity", "efficiency-gain"]
})
// Create reusable workflow
mcp__hex__hex_hexflo_task_create({
"name": "full-stack-development",
"steps": [
{ "phase": "design", "agents": ["architect"] },
{ "phase": "implement", "agents": ["backend-dev", "frontend-dev"], "parallel": true },
{ "phase": "test", "agents": ["tester", "security-tester"], "parallel": true },
{ "phase": "review", "agents": ["reviewer"] },
{ "phase": "deploy", "agents": ["devops"] }
],
"triggers": ["on-commit", "scheduled-daily"]
})
// Setup automation rules
mcp__hex__hex_hexflo_swarm_init({
"rules": [
{
"trigger": "file-changed",
"pattern": "*.js",
"action": "run-tests"
},
{
"trigger": "PR-created",
"action": "code-review-swarm"
}
]
})
// Event-driven triggers
mcp__hex__hex_hexflo_trigger_setup({
"events": ["code-commit", "PR-merge", "deployment"],
"actions": ["test", "analyze", "document"]
})
// Topology optimization
mcp__hex__hex_hexflo_topology_optimize({
"swarmId": "current-swarm"
})
// Load balancing
mcp__hex__hex_hexflo_swarm_status({
"swarmId": "development-swarm",
"tasks": taskQueue
})
// Agent coordination sync
mcp__hex__hex_hexflo_swarm_status({
"swarmId": "development-swarm"
})
// Auto-scaling
mcp__hex__hex_hexflo_swarm_scale({
"swarmId": "development-swarm",
"targetSize": 12
})
// Real-time swarm monitoring
mcp__hex__hex_hexflo_swarm_monitor({
"swarmId": "active-swarm",
"interval": 3000
})
// Collect comprehensive metrics
mcp__hex__hex_hexflo_metrics_collect({
"components": ["agents", "tasks", "memory", "performance"]
})
// Health monitoring
mcp__hex__hex_hexflo_health_check({
"components": ["swarm", "agents", "neural", "memory"]
})
// Usage statistics
mcp__hex__hex_hexflo_usage_stats({
"component": "swarm-orchestration"
})
// Trend analysis
mcp__hex__hex_hexflo_trend_analysis({
"metric": "agent-performance",
"period": "7d"
})
// Research AI trends, analyze findings, generate report
mcp__hex__hex_hexflo_swarm_init({ topology: "mesh", maxAgents: 6 })
// Spawn: 2 researchers, 2 analysts, 1 synthesizer, 1 documenter
// Parallel gather → Analyze patterns → Synthesize → Report
// Build complete web application with testing
mcp__hex__hex_hexflo_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
// Comprehensive security analysis
mcp__hex__hex_hexflo_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
// Identify and fix performance bottlenecks
mcp__hex__hex_hexflo_swarm_init({ topology: "mesh", maxAgents: 4 })
// Spawn: 1 profiler, 1 bottleneck analyzer, 1 optimizer, 1 tester
// Profile → Identify bottlenecks → Optimize → Validate
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
sparc-methodology - Systematic development workflowgithub-integration - Repository management and automationneural-patterns - AI-powered coordination optimizationmemory-management - Cross-session state persistenceVersion: 2.0.0 Last Updated: 2025-10-19 Skill Level: Advanced Estimated Learning Time: 2-3 hours