[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6EX5BAVZ2702JA22MPGKQAW":3,"skill-same:01M6EX5BAVZ2702JA22MPGKQAW":83},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":29,"publishedAt":46,"linkOnly":47,"markdownContent":48,"markdownBody":49,"frontMatter":50,"refName":54,"commitSha":55,"skillDirectory":56,"forksCount":57,"repositoryHtmlUrl":58,"repositoryHomepageUrl":59,"ownerHtmlUrl":60,"ownerBlogUrl":6,"ownerDescription":61,"updatedAt":62,"install":63,"resources":76},"01M6EX5BAVZ2702JA22MPGKQAW","swarm-advanced",null,"Advanced swarm orchestration patterns for research, development, testing, and complex distributed workflows","ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",67,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Fruvnet\u002Fswarm-advanced\u002FSKILL.md",[18,23,26],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000008","测试与质量","SCENARIO","使用场景",{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000021","资料检索与研究",{"categoryNo":27,"categoryName":28,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发",[30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],"swarm","swarm advanced","advanced","testing","research","orchestration","workflows","distributed","development","flow","team","coordination","parallel","Swarm Orchestration","patterns","orchestration patterns","2026-11-10 10:12:30",false,"---\nname: swarm-advanced\ndescription: Advanced swarm orchestration patterns for research, development, testing, and complex distributed workflows\nversion: 2.0.0\ncategory: orchestration\ntags: [swarm, distributed, parallel, research, testing, development, coordination]\nauthor: Claude Flow Team\n---\n\n# Advanced Swarm Orchestration\n\nMaster advanced swarm patterns for distributed research, development, and testing workflows. This skill covers comprehensive orchestration strategies using both MCP tools and CLI commands.\n\n## Quick Start\n\n### Prerequisites\n```bash\n# Ensure Claude Flow is installed\nnpm install -g claude-flow@alpha\n\n# Add MCP server (if using MCP tools)\nclaude mcp add claude-flow npx claude-flow@alpha mcp start\n```\n\n### Basic Pattern\n```javascript\n\u002F\u002F 1. Initialize swarm topology\nmcp__claude-flow__swarm_init({ topology: \"mesh\", maxAgents: 6 })\n\n\u002F\u002F 2. Spawn specialized agents\nmcp__claude-flow__agent_spawn({ type: \"researcher\", name: \"Agent 1\" })\n\n\u002F\u002F 3. Orchestrate tasks\nmcp__claude-flow__task_orchestrate({ task: \"...\", strategy: \"parallel\" })\n```\n\n## Core Concepts\n\n### Swarm Topologies\n\n**Mesh Topology** - Peer-to-peer communication, best for research and analysis\n- All agents communicate directly\n- High flexibility and resilience\n- Use for: Research, analysis, brainstorming\n\n**Hierarchical Topology** - Coordinator with subordinates, best for development\n- Clear command structure\n- Sequential workflow support\n- Use for: Development, structured workflows\n\n**Star Topology** - Central coordinator, best for testing\n- Centralized control and monitoring\n- Parallel execution with coordination\n- Use for: Testing, validation, quality assurance\n\n**Ring Topology** - Sequential processing chain\n- Step-by-step processing\n- Pipeline workflows\n- Use for: Multi-stage processing, data pipelines\n\n### Agent Strategies\n\n**Adaptive** - Dynamic adjustment based on task complexity\n**Balanced** - Equal distribution of work across agents\n**Specialized** - Task-specific agent assignment\n**Parallel** - Maximum concurrent execution\n\n## Pattern 1: Research Swarm\n\n### Purpose\nDeep research through parallel information gathering, analysis, and synthesis.\n\n### Architecture\n```javascript\n\u002F\u002F Initialize research swarm\nmcp__claude-flow__swarm_init({\n  \"topology\": \"mesh\",\n  \"maxAgents\": 6,\n  \"strategy\": \"adaptive\"\n})\n\n\u002F\u002F Spawn research team\nconst researchAgents = [\n  {\n    type: \"researcher\",\n    name: \"Web Researcher\",\n    capabilities: [\"web-search\", \"content-extraction\", \"source-validation\"]\n  },\n  {\n    type: \"researcher\",\n    name: \"Academic Researcher\",\n    capabilities: [\"paper-analysis\", \"citation-tracking\", \"literature-review\"]\n  },\n  {\n    type: \"analyst\",\n    name: \"Data Analyst\",\n    capabilities: [\"data-processing\", \"statistical-analysis\", \"visualization\"]\n  },\n  {\n    type: \"analyst\",\n    name: \"Pattern Analyzer\",\n    capabilities: [\"trend-detection\", \"correlation-analysis\", \"outlier-detection\"]\n  },\n  {\n    type: \"documenter\",\n    name: \"Report Writer\",\n    capabilities: [\"synthesis\", \"technical-writing\", \"formatting\"]\n  }\n]\n\n\u002F\u002F Spawn all agents\nresearchAgents.forEach(agent => {\n  mcp__claude-flow__agent_spawn({\n    type: agent.type,\n    name: agent.name,\n    capabilities: agent.capabilities\n  })\n})\n```\n\n### Research Workflow\n\n#### Phase 1: Information Gathering\n```javascript\n\u002F\u002F Parallel information collection\nmcp__claude-flow__parallel_execute({\n  \"tasks\": [\n    {\n      \"id\": \"web-search\",\n      \"command\": \"search recent publications and articles\"\n    },\n    {\n      \"id\": \"academic-search\",\n      \"command\": \"search academic databases and papers\"\n    },\n    {\n      \"id\": \"data-collection\",\n      \"command\": \"gather relevant datasets and statistics\"\n    },\n    {\n      \"id\": \"expert-search\",\n      \"command\": \"identify domain experts and thought leaders\"\n    }\n  ]\n})\n\n\u002F\u002F Store research findings in memory\nmcp__claude-flow__memory_usage({\n  \"action\": \"store\",\n  \"key\": \"research-findings-\" + Date.now(),\n  \"value\": JSON.stringify(findings),\n  \"namespace\": \"research\",\n  \"ttl\": 604800 \u002F\u002F 7 days\n})\n```\n\n#### Phase 2: Analysis and Validation\n```javascript\n\u002F\u002F Pattern recognition in findings\nmcp__claude-flow__pattern_recognize({\n  \"data\": researchData,\n  \"patterns\": [\"trend\", \"correlation\", \"outlier\", \"emerging-pattern\"]\n})\n\n\u002F\u002F Cognitive analysis\nmcp__claude-flow__cognitive_analyze({\n  \"behavior\": \"research-synthesis\"\n})\n\n\u002F\u002F Quality assessment\nmcp__claude-flow__quality_assess({\n  \"target\": \"research-sources\",\n  \"criteria\": [\"credibility\", \"relevance\", \"recency\", \"authority\"]\n})\n\n\u002F\u002F Cross-reference validation\nmcp__claude-flow__neural_patterns({\n  \"action\": \"analyze\",\n  \"operation\": \"fact-checking\",\n  \"metadata\": { \"sources\": sourcesArray }\n})\n```\n\n#### Phase 3: Knowledge Management\n```javascript\n\u002F\u002F Search existing knowledge base\nmcp__claude-flow__memory_search({\n  \"pattern\": \"topic X\",\n  \"namespace\": \"research\",\n  \"limit\": 20\n})\n\n\u002F\u002F Create knowledge graph connections\nmcp__claude-flow__neural_patterns({\n  \"action\": \"learn\",\n  \"operation\": \"knowledge-graph\",\n  \"metadata\": {\n    \"topic\": \"X\",\n    \"connections\": relatedTopics,\n    \"depth\": 3\n  }\n})\n\n\u002F\u002F Store connections for future use\nmcp__claude-flow__memory_usage({\n  \"action\": \"store\",\n  \"key\": \"knowledge-graph-X\",\n  \"value\": JSON.stringify(knowledgeGraph),\n  \"namespace\": \"research\u002Fgraphs\",\n  \"ttl\": 2592000 \u002F\u002F 30 days\n})\n```\n\n#### Phase 4: Report Generation\n```javascript\n\u002F\u002F Orchestrate report generation\nmcp__claude-flow__task_orchestrate({\n  \"task\": \"generate comprehensive research report\",\n  \"strategy\": \"sequential\",\n  \"priority\": \"high\",\n  \"dependencies\": [\"gather\", \"analyze\", \"validate\", \"synthesize\"]\n})\n\n\u002F\u002F Monitor research progress\nmcp__claude-flow__swarm_status({\n  \"swarmId\": \"research-swarm\"\n})\n\n\u002F\u002F Generate final report\nmcp__claude-flow__workflow_execute({\n  \"workflowId\": \"research-report-generation\",\n  \"params\": {\n    \"findings\": findings,\n    \"format\": \"comprehensive\",\n    \"sections\": [\"executive-summary\", \"methodology\", \"findings\", \"analysis\", \"conclusions\", \"references\"]\n  }\n})\n```\n\n### CLI Fallback\n```bash\n# Quick research swarm\nnpx claude-flow swarm \"research AI trends in 2025\" \\\n  --strategy research \\\n  --mode distributed \\\n  --max-agents 6 \\\n  --parallel \\\n  --output research-report.md\n```\n\n## Pattern 2: Development Swarm\n\n### Purpose\nFull-stack development through coordinated specialist agents.\n\n### Architecture\n```javascript\n\u002F\u002F Initialize development swarm with hierarchy\nmcp__claude-flow__swarm_init({\n  \"topology\": \"hierarchical\",\n  \"maxAgents\": 8,\n  \"strategy\": \"balanced\"\n})\n\n\u002F\u002F Spawn development team\nconst devTeam = [\n  { type: \"architect\", name: \"System Architect\", role: \"coordinator\" },\n  { type: \"coder\", name: \"Backend Developer\", capabilities: [\"node\", \"api\", \"database\"] },\n  { type: \"coder\", name: \"Frontend Developer\", capabilities: [\"react\", \"ui\", \"ux\"] },\n  { type: \"coder\", name: \"Database Engineer\", capabilities: [\"sql\", \"nosql\", \"optimization\"] },\n  { type: \"tester\", name: \"QA Engineer\", capabilities: [\"unit\", \"integration\", \"e2e\"] },\n  { type: \"reviewer\", name: \"Code Reviewer\", capabilities: [\"security\", \"performance\", \"best-practices\"] },\n  { type: \"documenter\", name: \"Technical Writer\", capabilities: [\"api-docs\", \"guides\", \"tutorials\"] },\n  { type: \"monitor\", name: \"DevOps Engineer\", capabilities: [\"ci-cd\", \"deployment\", \"monitoring\"] }\n]\n\n\u002F\u002F Spawn all team members\ndevTeam.forEach(member => {\n  mcp__claude-flow__agent_spawn({\n    type: member.type,\n    name: member.name,\n    capabilities: member.capabilities,\n    swarmId: \"dev-swarm\"\n  })\n})\n```\n\n### Development Workflow\n\n#### Phase 1: Architecture and Design\n```javascript\n\u002F\u002F System architecture design\nmcp__claude-flow__task_orchestrate({\n  \"task\": \"design system architecture for REST API\",\n  \"strategy\": \"sequential\",\n  \"priority\": \"critical\",\n  \"assignTo\": \"System Architect\"\n})\n\n\u002F\u002F Store architecture decisions\nmcp__claude-flow__memory_usage({\n  \"action\": \"store\",\n  \"key\": \"architecture-decisions\",\n  \"value\": JSON.stringify(architectureDoc),\n  \"namespace\": \"development\u002Fdesign\"\n})\n```\n\n#### Phase 2: Parallel Implementation\n```javascript\n\u002F\u002F Parallel development tasks\nmcp__claude-flow__parallel_execute({\n  \"tasks\": [\n    {\n      \"id\": \"backend-api\",\n      \"command\": \"implement REST API endpoints\",\n      \"assignTo\": \"Backend Developer\"\n    },\n    {\n      \"id\": \"frontend-ui\",\n      \"command\": \"build user interface components\",\n      \"assignTo\": \"Frontend Developer\"\n    },\n    {\n      \"id\": \"database-schema\",\n      \"command\": \"design and implement database schema\",\n      \"assignTo\": \"Database Engineer\"\n    },\n    {\n      \"id\": \"api-documentation\",\n      \"command\": \"create API documentation\",\n      \"assignTo\": \"Technical Writer\"\n    }\n  ]\n})\n\n\u002F\u002F Monitor development progress\nmcp__claude-flow__swarm_monitor({\n  \"swarmId\": \"dev-swarm\",\n  \"interval\": 5000\n})\n```\n\n#### Phase 3: Testing and Validation\n```javascript\n\u002F\u002F Comprehensive testing\nmcp__claude-flow__batch_process({\n  \"items\": [\n    { type: \"unit\", target: \"all-modules\" },\n    { type: \"integration\", target: \"api-endpoints\" },\n    { type: \"e2e\", target: \"user-flows\" },\n    { type: \"performance\", target: \"critical-paths\" }\n  ],\n  \"operation\": \"execute-tests\"\n})\n\n\u002F\u002F Quality assessment\nmcp__claude-flow__quality_assess({\n  \"target\": \"codebase\",\n  \"criteria\": [\"coverage\", \"complexity\", \"maintainability\", \"security\"]\n})\n```\n\n#### Phase 4: Review and Deployment\n```javascript\n\u002F\u002F Code review workflow\nmcp__claude-flow__workflow_execute({\n  \"workflowId\": \"code-review-process\",\n  \"params\": {\n    \"reviewers\": [\"Code Reviewer\"],\n    \"criteria\": [\"security\", \"performance\", \"best-practices\"]\n  }\n})\n\n\u002F\u002F CI\u002FCD pipeline\nmcp__claude-flow__pipeline_create({\n  \"config\": {\n    \"stages\": [\"build\", \"test\", \"security-scan\", \"deploy\"],\n    \"environment\": \"production\"\n  }\n})\n```\n\n### CLI Fallback\n```bash\n# Quick development swarm\nnpx claude-flow swarm \"build REST API with authentication\" \\\n  --strategy development \\\n  --mode hierarchical \\\n  --monitor \\\n  --output sqlite\n```\n\n## Pattern 3: Testing Swarm\n\n### Purpose\nComprehensive quality assurance through distributed testing.\n\n### Architecture\n```javascript\n\u002F\u002F Initialize testing swarm with star topology\nmcp__claude-flow__swarm_init({\n  \"topology\": \"star\",\n  \"maxAgents\": 7,\n  \"strategy\": \"parallel\"\n})\n\n\u002F\u002F Spawn testing team\nconst testingTeam = [\n  {\n    type: \"tester\",\n    name: \"Unit Test Coordinator\",\n    capabilities: [\"unit-testing\", \"mocking\", \"coverage\", \"tdd\"]\n  },\n  {\n    type: \"tester\",\n    name: \"Integration Tester\",\n    capabilities: [\"integration\", \"api-testing\", \"contract-testing\"]\n  },\n  {\n    type: \"tester\",\n    name: \"E2E Tester\",\n    capabilities: [\"e2e\", \"ui-testing\", \"user-flows\", \"selenium\"]\n  },\n  {\n    type: \"tester\",\n    name: \"Performance Tester\",\n    capabilities: [\"load-testing\", \"stress-testing\", \"benchmarking\"]\n  },\n  {\n    type: \"monitor\",\n    name: \"Security Tester\",\n    capabilities: [\"security-testing\", \"penetration-testing\", \"vulnerability-scanning\"]\n  },\n  {\n    type: \"analyst\",\n    name: \"Test Analyst\",\n    capabilities: [\"coverage-analysis\", \"test-optimization\", \"reporting\"]\n  },\n  {\n    type: \"documenter\",\n    name: \"Test Documenter\",\n    capabilities: [\"test-documentation\", \"test-plans\", \"reports\"]\n  }\n]\n\n\u002F\u002F Spawn all testers\ntestingTeam.forEach(tester => {\n  mcp__claude-flow__agent_spawn({\n    type: tester.type,\n    name: tester.name,\n    capabilities: tester.capabilities,\n    swarmId: \"testing-swarm\"\n  })\n})\n```\n\n### Testing Workflow\n\n#### Phase 1: Test Planning\n```javascript\n\u002F\u002F Analyze test coverage requirements\nmcp__claude-flow__quality_assess({\n  \"target\": \"test-coverage\",\n  \"criteria\": [\n    \"line-coverage\",\n    \"branch-coverage\",\n    \"function-coverage\",\n    \"edge-cases\"\n  ]\n})\n\n\u002F\u002F Identify test scenarios\nmcp__claude-flow__pattern_recognize({\n  \"data\": testScenarios,\n  \"patterns\": [\n    \"edge-case\",\n    \"boundary-condition\",\n    \"error-path\",\n    \"happy-path\"\n  ]\n})\n\n\u002F\u002F Store test plan\nmcp__claude-flow__memory_usage({\n  \"action\": \"store\",\n  \"key\": \"test-plan-\" + Date.now(),\n  \"value\": JSON.stringify(testPlan),\n  \"namespace\": \"testing\u002Fplans\"\n})\n```\n\n#### Phase 2: Parallel Test Execution\n```javascript\n\u002F\u002F Execute all test suites in parallel\nmcp__claude-flow__parallel_execute({\n  \"tasks\": [\n    {\n      \"id\": \"unit-tests\",\n      \"command\": \"npm run test:unit\",\n      \"assignTo\": \"Unit Test Coordinator\"\n    },\n    {\n      \"id\": \"integration-tests\",\n      \"command\": \"npm run test:integration\",\n      \"assignTo\": \"Integration Tester\"\n    },\n    {\n      \"id\": \"e2e-tests\",\n      \"command\": \"npm run test:e2e\",\n      \"assignTo\": \"E2E Tester\"\n    },\n    {\n      \"id\": \"performance-tests\",\n      \"command\": \"npm run test:performance\",\n      \"assignTo\": \"Performance Tester\"\n    },\n    {\n      \"id\": \"security-tests\",\n      \"command\": \"npm run test:security\",\n      \"assignTo\": \"Security Tester\"\n    }\n  ]\n})\n\n\u002F\u002F Batch process test suites\nmcp__claude-flow__batch_process({\n  \"items\": testSuites,\n  \"operation\": \"execute-test-suite\"\n})\n```\n\n#### Phase 3: Performance and Security\n```javascript\n\u002F\u002F Run performance benchmarks\nmcp__claude-flow__benchmark_run({\n  \"suite\": \"comprehensive-performance\"\n})\n\n\u002F\u002F Bottleneck analysis\nmcp__claude-flow__bottleneck_analyze({\n  \"component\": \"application\",\n  \"metrics\": [\"response-time\", \"throughput\", \"memory\", \"cpu\"]\n})\n\n\u002F\u002F Security scanning\nmcp__claude-flow__security_scan({\n  \"target\": \"application\",\n  \"depth\": \"comprehensive\"\n})\n\n\u002F\u002F Vulnerability analysis\nmcp__claude-flow__error_analysis({\n  \"logs\": securityScanLogs\n})\n```\n\n#### Phase 4: Monitoring and Reporting\n```javascript\n\u002F\u002F Real-time test monitoring\nmcp__claude-flow__swarm_monitor({\n  \"swarmId\": \"testing-swarm\",\n  \"interval\": 2000\n})\n\n\u002F\u002F Generate comprehensive test report\nmcp__claude-flow__performance_report({\n  \"format\": \"detailed\",\n  \"timeframe\": \"current-run\"\n})\n\n\u002F\u002F Get test results\nmcp__claude-flow__task_results({\n  \"taskId\": \"test-execution-001\"\n})\n\n\u002F\u002F Trend analysis\nmcp__claude-flow__trend_analysis({\n  \"metric\": \"test-coverage\",\n  \"period\": \"30d\"\n})\n```\n\n### CLI Fallback\n```bash\n# Quick testing swarm\nnpx claude-flow swarm \"test application comprehensively\" \\\n  --strategy testing \\\n  --mode star \\\n  --parallel \\\n  --timeout 600\n```\n\n## Pattern 4: Analysis Swarm\n\n### Purpose\nDeep code and system analysis through specialized analyzers.\n\n### Architecture\n```javascript\n\u002F\u002F Initialize analysis swarm\nmcp__claude-flow__swarm_init({\n  \"topology\": \"mesh\",\n  \"maxAgents\": 5,\n  \"strategy\": \"adaptive\"\n})\n\n\u002F\u002F Spawn analysis specialists\nconst analysisTeam = [\n  {\n    type: \"analyst\",\n    name: \"Code Analyzer\",\n    capabilities: [\"static-analysis\", \"complexity-analysis\", \"dead-code-detection\"]\n  },\n  {\n    type: \"analyst\",\n    name: \"Security Analyzer\",\n    capabilities: [\"security-scan\", \"vulnerability-detection\", \"dependency-audit\"]\n  },\n  {\n    type: \"analyst\",\n    name: \"Performance Analyzer\",\n    capabilities: [\"profiling\", \"bottleneck-detection\", \"optimization\"]\n  },\n  {\n    type: \"analyst\",\n    name: \"Architecture Analyzer\",\n    capabilities: [\"dependency-analysis\", \"coupling-detection\", \"modularity-assessment\"]\n  },\n  {\n    type: \"documenter\",\n    name: \"Analysis Reporter\",\n    capabilities: [\"reporting\", \"visualization\", \"recommendations\"]\n  }\n]\n\n\u002F\u002F Spawn all analysts\nanalysisTeam.forEach(analyst => {\n  mcp__claude-flow__agent_spawn({\n    type: analyst.type,\n    name: analyst.name,\n    capabilities: analyst.capabilities\n  })\n})\n```\n\n### Analysis Workflow\n```javascript\n\u002F\u002F Parallel analysis execution\nmcp__claude-flow__parallel_execute({\n  \"tasks\": [\n    { \"id\": \"analyze-code\", \"command\": \"analyze codebase structure and quality\" },\n    { \"id\": \"analyze-security\", \"command\": \"scan for security vulnerabilities\" },\n    { \"id\": \"analyze-performance\", \"command\": \"identify performance bottlenecks\" },\n    { \"id\": \"analyze-architecture\", \"command\": \"assess architectural patterns\" }\n  ]\n})\n\n\u002F\u002F Generate comprehensive analysis report\nmcp__claude-flow__performance_report({\n  \"format\": \"detailed\",\n  \"timeframe\": \"current\"\n})\n\n\u002F\u002F Cost analysis\nmcp__claude-flow__cost_analysis({\n  \"timeframe\": \"30d\"\n})\n```\n\n## Advanced Techniques\n\n### Error Handling and Fault Tolerance\n\n```javascript\n\u002F\u002F Setup fault tolerance for all agents\nmcp__claude-flow__daa_fault_tolerance({\n  \"agentId\": \"all\",\n  \"strategy\": \"auto-recovery\"\n})\n\n\u002F\u002F Error handling pattern\ntry {\n  await mcp__claude-flow__task_orchestrate({\n    \"task\": \"complex operation\",\n    \"strategy\": \"parallel\",\n    \"priority\": \"high\"\n  })\n} catch (error) {\n  \u002F\u002F Check swarm health\n  const status = await mcp__claude-flow__swarm_status({})\n\n  \u002F\u002F Analyze error patterns\n  await mcp__claude-flow__error_analysis({\n    \"logs\": [error.message]\n  })\n\n  \u002F\u002F Auto-recovery attempt\n  if (status.healthy) {\n    await mcp__claude-flow__task_orchestrate({\n      \"task\": \"retry failed operation\",\n      \"strategy\": \"sequential\"\n    })\n  }\n}\n```\n\n### Memory and State Management\n\n```javascript\n\u002F\u002F Cross-session persistence\nmcp__claude-flow__memory_persist({\n  \"sessionId\": \"swarm-session-001\"\n})\n\n\u002F\u002F Namespace management for different swarms\nmcp__claude-flow__memory_namespace({\n  \"namespace\": \"research-swarm\",\n  \"action\": \"create\"\n})\n\n\u002F\u002F Create state snapshot\nmcp__claude-flow__state_snapshot({\n  \"name\": \"development-checkpoint-1\"\n})\n\n\u002F\u002F Restore from snapshot if needed\nmcp__claude-flow__context_restore({\n  \"snapshotId\": \"development-checkpoint-1\"\n})\n\n\u002F\u002F Backup memory stores\nmcp__claude-flow__memory_backup({\n  \"path\": \"\u002Fworkspaces\u002Fclaude-code-flow\u002Fbackups\u002Fswarm-memory.json\"\n})\n```\n\n### Neural Pattern Learning\n\n```javascript\n\u002F\u002F Train neural patterns from successful workflows\nmcp__claude-flow__neural_train({\n  \"pattern_type\": \"coordination\",\n  \"training_data\": JSON.stringify(successfulWorkflows),\n  \"epochs\": 50\n})\n\n\u002F\u002F Adaptive learning from experience\nmcp__claude-flow__learning_adapt({\n  \"experience\": {\n    \"workflow\": \"research-to-report\",\n    \"success\": true,\n    \"duration\": 3600,\n    \"quality\": 0.95\n  }\n})\n\n\u002F\u002F Pattern recognition for optimization\nmcp__claude-flow__pattern_recognize({\n  \"data\": workflowMetrics,\n  \"patterns\": [\"bottleneck\", \"optimization-opportunity\", \"efficiency-gain\"]\n})\n```\n\n### Workflow Automation\n\n```javascript\n\u002F\u002F Create reusable workflow\nmcp__claude-flow__workflow_create({\n  \"name\": \"full-stack-development\",\n  \"steps\": [\n    { \"phase\": \"design\", \"agents\": [\"architect\"] },\n    { \"phase\": \"implement\", \"agents\": [\"backend-dev\", \"frontend-dev\"], \"parallel\": true },\n    { \"phase\": \"test\", \"agents\": [\"tester\", \"security-tester\"], \"parallel\": true },\n    { \"phase\": \"review\", \"agents\": [\"reviewer\"] },\n    { \"phase\": \"deploy\", \"agents\": [\"devops\"] }\n  ],\n  \"triggers\": [\"on-commit\", \"scheduled-daily\"]\n})\n\n\u002F\u002F Setup automation rules\nmcp__claude-flow__automation_setup({\n  \"rules\": [\n    {\n      \"trigger\": \"file-changed\",\n      \"pattern\": \"*.js\",\n      \"action\": \"run-tests\"\n    },\n    {\n      \"trigger\": \"PR-created\",\n      \"action\": \"code-review-swarm\"\n    }\n  ]\n})\n\n\u002F\u002F Event-driven triggers\nmcp__claude-flow__trigger_setup({\n  \"events\": [\"code-commit\", \"PR-merge\", \"deployment\"],\n  \"actions\": [\"test\", \"analyze\", \"document\"]\n})\n```\n\n### Performance Optimization\n\n```javascript\n\u002F\u002F Topology optimization\nmcp__claude-flow__topology_optimize({\n  \"swarmId\": \"current-swarm\"\n})\n\n\u002F\u002F Load balancing\nmcp__claude-flow__load_balance({\n  \"swarmId\": \"development-swarm\",\n  \"tasks\": taskQueue\n})\n\n\u002F\u002F Agent coordination sync\nmcp__claude-flow__coordination_sync({\n  \"swarmId\": \"development-swarm\"\n})\n\n\u002F\u002F Auto-scaling\nmcp__claude-flow__swarm_scale({\n  \"swarmId\": \"development-swarm\",\n  \"targetSize\": 12\n})\n```\n\n### Monitoring and Metrics\n\n```javascript\n\u002F\u002F Real-time swarm monitoring\nmcp__claude-flow__swarm_monitor({\n  \"swarmId\": \"active-swarm\",\n  \"interval\": 3000\n})\n\n\u002F\u002F Collect comprehensive metrics\nmcp__claude-flow__metrics_collect({\n  \"components\": [\"agents\", \"tasks\", \"memory\", \"performance\"]\n})\n\n\u002F\u002F Health monitoring\nmcp__claude-flow__health_check({\n  \"components\": [\"swarm\", \"agents\", \"neural\", \"memory\"]\n})\n\n\u002F\u002F Usage statistics\nmcp__claude-flow__usage_stats({\n  \"component\": \"swarm-orchestration\"\n})\n\n\u002F\u002F Trend analysis\nmcp__claude-flow__trend_analysis({\n  \"metric\": \"agent-performance\",\n  \"period\": \"7d\"\n})\n```\n\n## Best Practices\n\n### 1. Choosing the Right Topology\n\n- **Mesh**: Research, brainstorming, collaborative analysis\n- **Hierarchical**: Structured development, sequential workflows\n- **Star**: Testing, validation, centralized coordination\n- **Ring**: Pipeline processing, staged workflows\n\n### 2. Agent Specialization\n\n- Assign specific capabilities to each agent\n- Avoid overlapping responsibilities\n- Use coordination agents for complex workflows\n- Leverage memory for agent communication\n\n### 3. Parallel Execution\n\n- Identify independent tasks for parallelization\n- Use sequential execution for dependent tasks\n- Monitor resource usage during parallel execution\n- Implement proper error handling\n\n### 4. Memory Management\n\n- Use namespaces to organize memory\n- Set appropriate TTL values\n- Create regular backups\n- Implement state snapshots for checkpoints\n\n### 5. Monitoring and Optimization\n\n- Monitor swarm health regularly\n- Collect and analyze metrics\n- Optimize topology based on performance\n- Use neural patterns to learn from success\n\n### 6. Error Recovery\n\n- Implement fault tolerance strategies\n- Use auto-recovery mechanisms\n- Analyze error patterns\n- Create fallback workflows\n\n## Real-World Examples\n\n### Example 1: AI Research Project\n```javascript\n\u002F\u002F Research AI trends, analyze findings, generate report\nmcp__claude-flow__swarm_init({ topology: \"mesh\", maxAgents: 6 })\n\u002F\u002F Spawn: 2 researchers, 2 analysts, 1 synthesizer, 1 documenter\n\u002F\u002F Parallel gather → Analyze patterns → Synthesize → Report\n```\n\n### Example 2: Full-Stack Application\n```javascript\n\u002F\u002F Build complete web application with testing\nmcp__claude-flow__swarm_init({ topology: \"hierarchical\", maxAgents: 8 })\n\u002F\u002F Spawn: 1 architect, 2 devs, 1 db engineer, 2 testers, 1 reviewer, 1 devops\n\u002F\u002F Design → Parallel implement → Test → Review → Deploy\n```\n\n### Example 3: Security Audit\n```javascript\n\u002F\u002F Comprehensive security analysis\nmcp__claude-flow__swarm_init({ topology: \"star\", maxAgents: 5 })\n\u002F\u002F Spawn: 1 coordinator, 1 code analyzer, 1 security scanner, 1 penetration tester, 1 reporter\n\u002F\u002F Parallel scan → Vulnerability analysis → Penetration test → Report\n```\n\n### Example 4: Performance Optimization\n```javascript\n\u002F\u002F Identify and fix performance bottlenecks\nmcp__claude-flow__swarm_init({ topology: \"mesh\", maxAgents: 4 })\n\u002F\u002F Spawn: 1 profiler, 1 bottleneck analyzer, 1 optimizer, 1 tester\n\u002F\u002F Profile → Identify bottlenecks → Optimize → Validate\n```\n\n## Troubleshooting\n\n### Common Issues\n\n**Issue**: Swarm agents not coordinating properly\n**Solution**: Check topology selection, verify memory usage, enable monitoring\n\n**Issue**: Parallel execution failing\n**Solution**: Verify task dependencies, check resource limits, implement error handling\n\n**Issue**: Memory persistence not working\n**Solution**: Verify namespaces, check TTL settings, ensure backup configuration\n\n**Issue**: Performance degradation\n**Solution**: Optimize topology, reduce agent count, analyze bottlenecks\n\n## Related Skills\n\n- `sparc-methodology` - Systematic development workflow\n- `github-integration` - Repository management and automation\n- `neural-patterns` - AI-powered coordination optimization\n- `memory-management` - Cross-session state persistence\n\n## References\n\n- [Claude Flow Documentation](https:\u002F\u002Fgithub.com\u002Fruvnet\u002Fclaude-flow)\n- [Swarm Orchestration Guide](https:\u002F\u002Fgithub.com\u002Fruvnet\u002Fclaude-flow\u002Fwiki\u002Fswarm)\n- [MCP Tools Reference](https:\u002F\u002Fgithub.com\u002Fruvnet\u002Fclaude-flow\u002Fwiki\u002Fmcp)\n- [Performance Optimization](https:\u002F\u002Fgithub.com\u002Fruvnet\u002Fclaude-flow\u002Fwiki\u002Fperformance)\n\n---\n\n**Version**: 2.0.0\n**Last Updated**: 2025-10-19\n**Skill Level**: Advanced\n**Estimated Learning Time**: 2-3 hours\n","# Advanced Swarm Orchestration\n\nMaster advanced swarm patterns for distributed research, development, and testing workflows. This skill covers comprehensive orchestration strategies using both MCP tools and CLI commands.\n\n## Quick Start\n\n### Prerequisites\n```bash\n# Ensure Claude Flow is installed\nnpm install -g claude-flow@alpha\n\n# Add MCP server (if using MCP tools)\nclaude mcp add claude-flow npx claude-flow@alpha mcp start\n```\n\n### Basic Pattern\n```javascript\n\u002F\u002F 1. Initialize swarm topology\nmcp__claude-flow__swarm_init({ topology: \"mesh\", maxAgents: 6 })\n\n\u002F\u002F 2. Spawn specialized agents\nmcp__claude-flow__agent_spawn({ type: \"researcher\", name: \"Agent 1\" })\n\n\u002F\u002F 3. Orchestrate tasks\nmcp__claude-flow__task_orchestrate({ task: \"...\", strategy: \"parallel\" })\n```\n\n## Core Concepts\n\n### Swarm Topologies\n\n**Mesh Topology** - Peer-to-peer communication, best for research and analysis\n- All agents communicate directly\n- High flexibility and resilience\n- Use for: Research, analysis, brainstorming\n\n**Hierarchical Topology** - Coordinator with subordinates, best for development\n- Clear command structure\n- Sequential workflow support\n- Use for: Development, structured workflows\n\n**Star Topology** - Central coordinator, best for testing\n- Centralized control and monitoring\n- Parallel execution with coordination\n- Use for: Testing, validation, quality assurance\n\n**Ring Topology** - Sequential processing chain\n- Step-by-step processing\n- Pipeline workflows\n- Use for: Multi-stage processing, data pipelines\n\n### Agent Strategies\n\n**Adaptive** - Dynamic adjustment based on task complexity\n**Balanced** - Equal distribution of work across agents\n**Specialized** - Task-specific agent assignment\n**Parallel** - Maximum concurrent execution\n\n## Pattern 1: Research Swarm\n\n### Purpose\nDeep research through parallel information gathering, analysis, and synthesis.\n\n### Architecture\n```javascript\n\u002F\u002F Initialize research swarm\nmcp__claude-flow__swarm_init({\n  \"topology\": \"mesh\",\n  \"maxAgents\": 6,\n  \"strategy\": \"adaptive\"\n})\n\n\u002F\u002F Spawn research team\nconst researchAgents = [\n  {\n    type: \"researcher\",\n    name: \"Web Researcher\",\n    capabilities: [\"web-search\", \"content-extraction\", \"source-validation\"]\n  },\n  {\n    type: \"researcher\",\n    name: \"Academic Researcher\",\n    capabilities: [\"paper-analysis\", \"citation-tracking\", \"literature-review\"]\n  },\n  {\n    type: \"analyst\",\n    name: \"Data Analyst\",\n    capabilities: [\"data-processing\", \"statistical-analysis\", \"visualization\"]\n  },\n  {\n    type: \"analyst\",\n    name: \"Pattern Analyzer\",\n    capabilities: [\"trend-detection\", \"correlation-analysis\", \"outlier-detection\"]\n  },\n  {\n    type: \"documenter\",\n    name: \"Report Writer\",\n    capabilities: [\"synthesis\", \"technical-writing\", \"formatting\"]\n  }\n]\n\n\u002F\u002F Spawn all agents\nresearchAgents.forEach(agent => {\n  mcp__claude-flow__agent_spawn({\n    type: agent.type,\n    name: agent.name,\n    capabilities: agent.capabilities\n  })\n})\n```\n\n### Research Workflow\n\n#### Phase 1: Information Gathering\n```javascript\n\u002F\u002F Parallel information collection\nmcp__claude-flow__parallel_execute({\n  \"tasks\": [\n    {\n      \"id\": \"web-search\",\n      \"command\": \"search recent publications and articles\"\n    },\n    {\n      \"id\": \"academic-search\",\n      \"command\": \"search academic databases and papers\"\n    },\n    {\n      \"id\": \"data-collection\",\n      \"command\": \"gather relevant datasets and statistics\"\n    },\n    {\n      \"id\": \"expert-search\",\n      \"command\": \"identify domain experts and thought leaders\"\n    }\n  ]\n})\n\n\u002F\u002F Store research findings in memory\nmcp__claude-flow__memory_usage({\n  \"action\": \"store\",\n  \"key\": \"research-findings-\" + Date.now(),\n  \"value\": JSON.stringify(findings),\n  \"namespace\": \"research\",\n  \"ttl\": 604800 \u002F\u002F 7 days\n})\n```\n\n#### Phase 2: Analysis and Validation\n```javascript\n\u002F\u002F Pattern recognition in findings\nmcp__claude-flow__pattern_recognize({\n  \"data\": researchData,\n  \"patterns\": [\"trend\", \"correlation\", \"outlier\", \"emerging-pattern\"]\n})\n\n\u002F\u002F Cognitive analysis\nmcp__claude-flow__cognitive_analyze({\n  \"behavior\": \"research-synthesis\"\n})\n\n\u002F\u002F Quality assessment\nmcp__claude-flow__quality_assess({\n  \"target\": \"research-sources\",\n  \"criteria\": [\"credibility\", \"relevance\", \"recency\", \"authority\"]\n})\n\n\u002F\u002F Cross-reference validation\nmcp__claude-flow__neural_patterns({\n  \"action\": \"analyze\",\n  \"operation\": \"fact-checking\",\n  \"metadata\": { \"sources\": sourcesArray }\n})\n```\n\n#### Phase 3: Knowledge Management\n```javascript\n\u002F\u002F Search existing knowledge base\nmcp__claude-flow__memory_search({\n  \"pattern\": \"topic X\",\n  \"namespace\": \"research\",\n  \"limit\": 20\n})\n\n\u002F\u002F Create knowledge graph connections\nmcp__claude-flow__neural_patterns({\n  \"action\": \"learn\",\n  \"operation\": \"knowledge-graph\",\n  \"metadata\": {\n    \"topic\": \"X\",\n    \"connections\": relatedTopics,\n    \"depth\": 3\n  }\n})\n\n\u002F\u002F Store connections for future use\nmcp__claude-flow__memory_usage({\n  \"action\": \"store\",\n  \"key\": \"knowledge-graph-X\",\n  \"value\": JSON.stringify(knowledgeGraph),\n  \"namespace\": \"research\u002Fgraphs\",\n  \"ttl\": 2592000 \u002F\u002F 30 days\n})\n```\n\n#### Phase 4: Report Generation\n```javascript\n\u002F\u002F Orchestrate report generation\nmcp__claude-flow__task_orchestrate({\n  \"task\": \"generate comprehensive research report\",\n  \"strategy\": \"sequential\",\n  \"priority\": \"high\",\n  \"dependencies\": [\"gather\", \"analyze\", \"validate\", \"synthesize\"]\n})\n\n\u002F\u002F Monitor research progress\nmcp__claude-flow__swarm_status({\n  \"swarmId\": \"research-swarm\"\n})\n\n\u002F\u002F Generate final report\nmcp__claude-flow__workflow_execute({\n  \"workflowId\": \"research-report-generation\",\n  \"params\": {\n    \"findings\": findings,\n    \"format\": \"comprehensive\",\n    \"sections\": [\"executive-summary\", \"methodology\", \"findings\", \"analysis\", \"conclusions\", \"references\"]\n  }\n})\n```\n\n### CLI Fallback\n```bash\n# Quick research swarm\nnpx claude-flow swarm \"research AI trends in 2025\" \\\n  --strategy research \\\n  --mode distributed \\\n  --max-agents 6 \\\n  --parallel \\\n  --output research-report.md\n```\n\n## Pattern 2: Development Swarm\n\n### Purpose\nFull-stack development through coordinated specialist agents.\n\n### Architecture\n```javascript\n\u002F\u002F Initialize development swarm with hierarchy\nmcp__claude-flow__swarm_init({\n  \"topology\": \"hierarchical\",\n  \"maxAgents\": 8,\n  \"strategy\": \"balanced\"\n})\n\n\u002F\u002F Spawn development team\nconst devTeam = [\n  { type: \"architect\", name: \"System Architect\", role: \"coordinator\" },\n  { type: \"coder\", name: \"Backend Developer\", capabilities: [\"node\", \"api\", \"database\"] },\n  { type: \"coder\", name: \"Frontend Developer\", capabilities: [\"react\", \"ui\", \"ux\"] },\n  { type: \"coder\", name: \"Database Engineer\", capabilities: [\"sql\", \"nosql\", \"optimization\"] },\n  { type: \"tester\", name: \"QA Engineer\", capabilities: [\"unit\", \"integration\", \"e2e\"] },\n  { type: \"reviewer\", name: \"Code Reviewer\", capabilities: [\"security\", \"performance\", \"best-practices\"] },\n  { type: \"documenter\", name: \"Technical Writer\", capabilities: [\"api-docs\", \"guides\", \"tutorials\"] },\n  { type: \"monitor\", name: \"DevOps Engineer\", capabilities: [\"ci-cd\", \"deployment\", \"monitoring\"] }\n]\n\n\u002F\u002F Spawn all team members\ndevTeam.forEach(member => {\n  mcp__claude-flow__agent_spawn({\n    type: member.type,\n    name: member.name,\n    capabilities: member.capabilities,\n    swarmId: \"dev-swarm\"\n  })\n})\n```\n\n### Development Workflow\n\n#### Phase 1: Architecture and Design\n```javascript\n\u002F\u002F System architecture design\nmcp__claude-flow__task_orchestrate({\n  \"task\": \"design system architecture for REST API\",\n  \"strategy\": \"sequential\",\n  \"priority\": \"critical\",\n  \"assignTo\": \"System Architect\"\n})\n\n\u002F\u002F Store architecture decisions\nmcp__claude-flow__memory_usage({\n  \"action\": \"store\",\n  \"key\": \"architecture-decisions\",\n  \"value\": JSON.stringify(architectureDoc),\n  \"namespace\": \"development\u002Fdesign\"\n})\n```\n\n#### Phase 2: Parallel Implementation\n```javascript\n\u002F\u002F Parallel development tasks\nmcp__claude-flow__parallel_execute({\n  \"tasks\": [\n    {\n      \"id\": \"backend-api\",\n      \"command\": \"implement REST API endpoints\",\n      \"assignTo\": \"Backend Developer\"\n    },\n    {\n      \"id\": \"frontend-ui\",\n      \"command\": \"build user interface components\",\n      \"assignTo\": \"Frontend Developer\"\n    },\n    {\n      \"id\": \"database-schema\",\n      \"command\": \"design and implement database schema\",\n      \"assignTo\": \"Database Engineer\"\n    },\n    {\n      \"id\": \"api-documentation\",\n      \"command\": \"create API documentation\",\n      \"assignTo\": \"Technical Writer\"\n    }\n  ]\n})\n\n\u002F\u002F Monitor development progress\nmcp__claude-flow__swarm_monitor({\n  \"swarmId\": \"dev-swarm\",\n  \"interval\": 5000\n})\n```\n\n#### Phase 3: Testing and Validation\n```javascript\n\u002F\u002F Comprehensive testing\nmcp__claude-flow__batch_process({\n  \"items\": [\n    { type: \"unit\", target: \"all-modules\" },\n    { type: \"integration\", target: \"api-endpoints\" },\n    { type: \"e2e\", target: \"user-flows\" },\n    { type: \"performance\", target: \"critical-paths\" }\n  ],\n  \"operation\": \"execute-tests\"\n})\n\n\u002F\u002F Quality assessment\nmcp__claude-flow__quality_assess({\n  \"target\": \"codebase\",\n  \"criteria\": [\"coverage\", \"complexity\", \"maintainability\", \"security\"]\n})\n```\n\n#### Phase 4: Review and Deployment\n```javascript\n\u002F\u002F Code review workflow\nmcp__claude-flow__workflow_execute({\n  \"workflowId\": \"code-review-process\",\n  \"params\": {\n    \"reviewers\": [\"Code Reviewer\"],\n    \"criteria\": [\"security\", \"performance\", \"best-practices\"]\n  }\n})\n\n\u002F\u002F CI\u002FCD pipeline\nmcp__claude-flow__pipeline_create({\n  \"config\": {\n    \"stages\": [\"build\", \"test\", \"security-scan\", \"deploy\"],\n    \"environment\": \"production\"\n  }\n})\n```\n\n### CLI Fallback\n```bash\n# Quick development swarm\nnpx claude-flow swarm \"build REST API with authentication\" \\\n  --strategy development \\\n  --mode hierarchical \\\n  --monitor \\\n  --output sqlite\n```\n\n## Pattern 3: Testing Swarm\n\n### Purpose\nComprehensive quality assurance through distributed testing.\n\n### Architecture\n```javascript\n\u002F\u002F Initialize testing swarm with star topology\nmcp__claude-flow__swarm_init({\n  \"topology\": \"star\",\n  \"maxAgents\": 7,\n  \"strategy\": \"parallel\"\n})\n\n\u002F\u002F Spawn testing team\nconst testingTeam = [\n  {\n    type: \"tester\",\n    name: \"Unit Test Coordinator\",\n    capabilities: [\"unit-testing\", \"mocking\", \"coverage\", \"tdd\"]\n  },\n  {\n    type: \"tester\",\n    name: \"Integration Tester\",\n    capabilities: [\"integration\", \"api-testing\", \"contract-testing\"]\n  },\n  {\n    type: \"tester\",\n    name: \"E2E Tester\",\n    capabilities: [\"e2e\", \"ui-testing\", \"user-flows\", \"selenium\"]\n  },\n  {\n    type: \"tester\",\n    name: \"Performance Tester\",\n    capabilities: [\"load-testing\", \"stress-testing\", \"benchmarking\"]\n  },\n  {\n    type: \"monitor\",\n    name: \"Security Tester\",\n    capabilities: [\"security-testing\", \"penetration-testing\", \"vulnerability-scanning\"]\n  },\n  {\n    type: \"analyst\",\n    name: \"Test Analyst\",\n    capabilities: [\"coverage-analysis\", \"test-optimization\", \"reporting\"]\n  },\n  {\n    type: \"documenter\",\n    name: \"Test Documenter\",\n    capabilities: [\"test-documentation\", \"test-plans\", \"reports\"]\n  }\n]\n\n\u002F\u002F Spawn all testers\ntestingTeam.forEach(tester => {\n  mcp__claude-flow__agent_spawn({\n    type: tester.type,\n    name: tester.name,\n    capabilities: tester.capabilities,\n    swarmId: \"testing-swarm\"\n  })\n})\n```\n\n### Testing Workflow\n\n#### Phase 1: Test Planning\n```javascript\n\u002F\u002F Analyze test coverage requirements\nmcp__claude-flow__quality_assess({\n  \"target\": \"test-coverage\",\n  \"criteria\": [\n    \"line-coverage\",\n    \"branch-coverage\",\n    \"function-coverage\",\n    \"edge-cases\"\n  ]\n})\n\n\u002F\u002F Identify test scenarios\nmcp__claude-flow__pattern_recognize({\n  \"data\": testScenarios,\n  \"patterns\": [\n    \"edge-case\",\n    \"boundary-condition\",\n    \"error-path\",\n    \"happy-path\"\n  ]\n})\n\n\u002F\u002F Store test plan\nmcp__claude-flow__memory_usage({\n  \"action\": \"store\",\n  \"key\": \"test-plan-\" + Date.now(),\n  \"value\": JSON.stringify(testPlan),\n  \"namespace\": \"testing\u002Fplans\"\n})\n```\n\n#### Phase 2: Parallel Test Execution\n```javascript\n\u002F\u002F Execute all test suites in parallel\nmcp__claude-flow__parallel_execute({\n  \"tasks\": [\n    {\n      \"id\": \"unit-tests\",\n      \"command\": \"npm run test:unit\",\n      \"assignTo\": \"Unit Test Coordinator\"\n    },\n    {\n      \"id\": \"integration-tests\",\n      \"command\": \"npm run test:integration\",\n      \"assignTo\": \"Integration Tester\"\n    },\n    {\n      \"id\": \"e2e-tests\",\n      \"command\": \"npm run test:e2e\",\n      \"assignTo\": \"E2E Tester\"\n    },\n    {\n      \"id\": \"performance-tests\",\n      \"command\": \"npm run test:performance\",\n      \"assignTo\": \"Performance Tester\"\n    },\n    {\n      \"id\": \"security-tests\",\n      \"command\": \"npm run test:security\",\n      \"assignTo\": \"Security Tester\"\n    }\n  ]\n})\n\n\u002F\u002F Batch process test suites\nmcp__claude-flow__batch_process({\n  \"items\": testSuites,\n  \"operation\": \"execute-test-suite\"\n})\n```\n\n#### Phase 3: Performance and Security\n```javascript\n\u002F\u002F Run performance benchmarks\nmcp__claude-flow__benchmark_run({\n  \"suite\": \"comprehensive-performance\"\n})\n\n\u002F\u002F Bottleneck analysis\nmcp__claude-flow__bottleneck_analyze({\n  \"component\": \"application\",\n  \"metrics\": [\"response-time\", \"throughput\", \"memory\", \"cpu\"]\n})\n\n\u002F\u002F Security scanning\nmcp__claude-flow__security_scan({\n  \"target\": \"application\",\n  \"depth\": \"comprehensive\"\n})\n\n\u002F\u002F Vulnerability analysis\nmcp__claude-flow__error_analysis({\n  \"logs\": securityScanLogs\n})\n```\n\n#### Phase 4: Monitoring and Reporting\n```javascript\n\u002F\u002F Real-time test monitoring\nmcp__claude-flow__swarm_monitor({\n  \"swarmId\": \"testing-swarm\",\n  \"interval\": 2000\n})\n\n\u002F\u002F Generate comprehensive test report\nmcp__claude-flow__performance_report({\n  \"format\": \"detailed\",\n  \"timeframe\": \"current-run\"\n})\n\n\u002F\u002F Get test results\nmcp__claude-flow__task_results({\n  \"taskId\": \"test-execution-001\"\n})\n\n\u002F\u002F Trend analysis\nmcp__claude-flow__trend_analysis({\n  \"metric\": \"test-coverage\",\n  \"period\": \"30d\"\n})\n```\n\n### CLI Fallback\n```bash\n# Quick testing swarm\nnpx claude-flow swarm \"test application comprehensively\" \\\n  --strategy testing \\\n  --mode star \\\n  --parallel \\\n  --timeout 600\n```\n\n## Pattern 4: Analysis Swarm\n\n### Purpose\nDeep code and system analysis through specialized analyzers.\n\n### Architecture\n```javascript\n\u002F\u002F Initialize analysis swarm\nmcp__claude-flow__swarm_init({\n  \"topology\": \"mesh\",\n  \"maxAgents\": 5,\n  \"strategy\": \"adaptive\"\n})\n\n\u002F\u002F Spawn analysis specialists\nconst analysisTeam = [\n  {\n    type: \"analyst\",\n    name: \"Code Analyzer\",\n    capabilities: [\"static-analysis\", \"complexity-analysis\", \"dead-code-detection\"]\n  },\n  {\n    type: \"analyst\",\n    name: \"Security Analyzer\",\n    capabilities: [\"security-scan\", \"vulnerability-detection\", \"dependency-audit\"]\n  },\n  {\n    type: \"analyst\",\n    name: \"Performance Analyzer\",\n    capabilities: [\"profiling\", \"bottleneck-detection\", \"optimization\"]\n  },\n  {\n    type: \"analyst\",\n    name: \"Architecture Analyzer\",\n    capabilities: [\"dependency-analysis\", \"coupling-detection\", \"modularity-assessment\"]\n  },\n  {\n    type: \"documenter\",\n    name: \"Analysis Reporter\",\n    capabilities: [\"reporting\", \"visualization\", \"recommendations\"]\n  }\n]\n\n\u002F\u002F Spawn all analysts\nanalysisTeam.forEach(analyst => {\n  mcp__claude-flow__agent_spawn({\n    type: analyst.type,\n    name: analyst.name,\n    capabilities: analyst.capabilities\n  })\n})\n```\n\n### Analysis Workflow\n```javascript\n\u002F\u002F Parallel analysis execution\nmcp__claude-flow__parallel_execute({\n  \"tasks\": [\n    { \"id\": \"analyze-code\", \"command\": \"analyze codebase structure and quality\" },\n    { \"id\": \"analyze-security\", \"command\": \"scan for security vulnerabilities\" },\n    { \"id\": \"analyze-performance\", \"command\": \"identify performance bottlenecks\" },\n    { \"id\": \"analyze-architecture\", \"command\": \"assess architectural patterns\" }\n  ]\n})\n\n\u002F\u002F Generate comprehensive analysis report\nmcp__claude-flow__performance_report({\n  \"format\": \"detailed\",\n  \"timeframe\": \"current\"\n})\n\n\u002F\u002F Cost analysis\nmcp__claude-flow__cost_analysis({\n  \"timeframe\": \"30d\"\n})\n```\n\n## Advanced Techniques\n\n### Error Handling and Fault Tolerance\n\n```javascript\n\u002F\u002F Setup fault tolerance for all agents\nmcp__claude-flow__daa_fault_tolerance({\n  \"agentId\": \"all\",\n  \"strategy\": \"auto-recovery\"\n})\n\n\u002F\u002F Error handling pattern\ntry {\n  await mcp__claude-flow__task_orchestrate({\n    \"task\": \"complex operation\",\n    \"strategy\": \"parallel\",\n    \"priority\": \"high\"\n  })\n} catch (error) {\n  \u002F\u002F Check swarm health\n  const status = await mcp__claude-flow__swarm_status({})\n\n  \u002F\u002F Analyze error patterns\n  await mcp__claude-flow__error_analysis({\n    \"logs\": [error.message]\n  })\n\n  \u002F\u002F Auto-recovery attempt\n  if (status.healthy) {\n    await mcp__claude-flow__task_orchestrate({\n      \"task\": \"retry failed operation\",\n      \"strategy\": \"sequential\"\n    })\n  }\n}\n```\n\n### Memory and State Management\n\n```javascript\n\u002F\u002F Cross-session persistence\nmcp__claude-flow__memory_persist({\n  \"sessionId\": \"swarm-session-001\"\n})\n\n\u002F\u002F Namespace management for different swarms\nmcp__claude-flow__memory_namespace({\n  \"namespace\": \"research-swarm\",\n  \"action\": \"create\"\n})\n\n\u002F\u002F Create state snapshot\nmcp__claude-flow__state_snapshot({\n  \"name\": \"development-checkpoint-1\"\n})\n\n\u002F\u002F Restore from snapshot if needed\nmcp__claude-flow__context_restore({\n  \"snapshotId\": \"development-checkpoint-1\"\n})\n\n\u002F\u002F Backup memory stores\nmcp__claude-flow__memory_backup({\n  \"path\": \"\u002Fworkspaces\u002Fclaude-code-flow\u002Fbackups\u002Fswarm-memory.json\"\n})\n```\n\n### Neural Pattern Learning\n\n```javascript\n\u002F\u002F Train neural patterns from successful workflows\nmcp__claude-flow__neural_train({\n  \"pattern_type\": \"coordination\",\n  \"training_data\": JSON.stringify(successfulWorkflows),\n  \"epochs\": 50\n})\n\n\u002F\u002F Adaptive learning from experience\nmcp__claude-flow__learning_adapt({\n  \"experience\": {\n    \"workflow\": \"research-to-report\",\n    \"success\": true,\n    \"duration\": 3600,\n    \"quality\": 0.95\n  }\n})\n\n\u002F\u002F Pattern recognition for optimization\nmcp__claude-flow__pattern_recognize({\n  \"data\": workflowMetrics,\n  \"patterns\": [\"bottleneck\", \"optimization-opportunity\", \"efficiency-gain\"]\n})\n```\n\n### Workflow Automation\n\n```javascript\n\u002F\u002F Create reusable workflow\nmcp__claude-flow__workflow_create({\n  \"name\": \"full-stack-development\",\n  \"steps\": [\n    { \"phase\": \"design\", \"agents\": [\"architect\"] },\n    { \"phase\": \"implement\", \"agents\": [\"backend-dev\", \"frontend-dev\"], \"parallel\": true },\n    { \"phase\": \"test\", \"agents\": [\"tester\", \"security-tester\"], \"parallel\": true },\n    { \"phase\": \"review\", \"agents\": [\"reviewer\"] },\n    { \"phase\": \"deploy\", \"agents\": [\"devops\"] }\n  ],\n  \"triggers\": [\"on-commit\", \"scheduled-daily\"]\n})\n\n\u002F\u002F Setup automation rules\nmcp__claude-flow__automation_setup({\n  \"rules\": [\n    {\n      \"trigger\": \"file-changed\",\n      \"pattern\": \"*.js\",\n      \"action\": \"run-tests\"\n    },\n    {\n      \"trigger\": \"PR-created\",\n      \"action\": \"code-review-swarm\"\n    }\n  ]\n})\n\n\u002F\u002F Event-driven triggers\nmcp__claude-flow__trigger_setup({\n  \"events\": [\"code-commit\", \"PR-merge\", \"deployment\"],\n  \"actions\": [\"test\", \"analyze\", \"document\"]\n})\n```\n\n### Performance Optimization\n\n```javascript\n\u002F\u002F Topology optimization\nmcp__claude-flow__topology_optimize({\n  \"swarmId\": \"current-swarm\"\n})\n\n\u002F\u002F Load balancing\nmcp__claude-flow__load_balance({\n  \"swarmId\": \"development-swarm\",\n  \"tasks\": taskQueue\n})\n\n\u002F\u002F Agent coordination sync\nmcp__claude-flow__coordination_sync({\n  \"swarmId\": \"development-swarm\"\n})\n\n\u002F\u002F Auto-scaling\nmcp__claude-flow__swarm_scale({\n  \"swarmId\": \"development-swarm\",\n  \"targetSize\": 12\n})\n```\n\n### Monitoring and Metrics\n\n```javascript\n\u002F\u002F Real-time swarm monitoring\nmcp__claude-flow__swarm_monitor({\n  \"swarmId\": \"active-swarm\",\n  \"interval\": 3000\n})\n\n\u002F\u002F Collect comprehensive metrics\nmcp__claude-flow__metrics_collect({\n  \"components\": [\"agents\", \"tasks\", \"memory\", \"performance\"]\n})\n\n\u002F\u002F Health monitoring\nmcp__claude-flow__health_check({\n  \"components\": [\"swarm\", \"agents\", \"neural\", \"memory\"]\n})\n\n\u002F\u002F Usage statistics\nmcp__claude-flow__usage_stats({\n  \"component\": \"swarm-orchestration\"\n})\n\n\u002F\u002F Trend analysis\nmcp__claude-flow__trend_analysis({\n  \"metric\": \"agent-performance\",\n  \"period\": \"7d\"\n})\n```\n\n## Best Practices\n\n### 1. Choosing the Right Topology\n\n- **Mesh**: Research, brainstorming, collaborative analysis\n- **Hierarchical**: Structured development, sequential workflows\n- **Star**: Testing, validation, centralized coordination\n- **Ring**: Pipeline processing, staged workflows\n\n### 2. Agent Specialization\n\n- Assign specific capabilities to each agent\n- Avoid overlapping responsibilities\n- Use coordination agents for complex workflows\n- Leverage memory for agent communication\n\n### 3. Parallel Execution\n\n- Identify independent tasks for parallelization\n- Use sequential execution for dependent tasks\n- Monitor resource usage during parallel execution\n- Implement proper error handling\n\n### 4. Memory Management\n\n- Use namespaces to organize memory\n- Set appropriate TTL values\n- Create regular backups\n- Implement state snapshots for checkpoints\n\n### 5. Monitoring and Optimization\n\n- Monitor swarm health regularly\n- Collect and analyze metrics\n- Optimize topology based on performance\n- Use neural patterns to learn from success\n\n### 6. Error Recovery\n\n- Implement fault tolerance strategies\n- Use auto-recovery mechanisms\n- Analyze error patterns\n- Create fallback workflows\n\n## Real-World Examples\n\n### Example 1: AI Research Project\n```javascript\n\u002F\u002F Research AI trends, analyze findings, generate report\nmcp__claude-flow__swarm_init({ topology: \"mesh\", maxAgents: 6 })\n\u002F\u002F Spawn: 2 researchers, 2 analysts, 1 synthesizer, 1 documenter\n\u002F\u002F Parallel gather → Analyze patterns → Synthesize → Report\n```\n\n### Example 2: Full-Stack Application\n```javascript\n\u002F\u002F Build complete web application with testing\nmcp__claude-flow__swarm_init({ topology: \"hierarchical\", maxAgents: 8 })\n\u002F\u002F Spawn: 1 architect, 2 devs, 1 db engineer, 2 testers, 1 reviewer, 1 devops\n\u002F\u002F Design → Parallel implement → Test → Review → Deploy\n```\n\n### Example 3: Security Audit\n```javascript\n\u002F\u002F Comprehensive security analysis\nmcp__claude-flow__swarm_init({ topology: \"star\", maxAgents: 5 })\n\u002F\u002F Spawn: 1 coordinator, 1 code analyzer, 1 security scanner, 1 penetration tester, 1 reporter\n\u002F\u002F Parallel scan → Vulnerability analysis → Penetration test → Report\n```\n\n### Example 4: Performance Optimization\n```javascript\n\u002F\u002F Identify and fix performance bottlenecks\nmcp__claude-flow__swarm_init({ topology: \"mesh\", maxAgents: 4 })\n\u002F\u002F Spawn: 1 profiler, 1 bottleneck analyzer, 1 optimizer, 1 tester\n\u002F\u002F Profile → Identify bottlenecks → Optimize → Validate\n```\n\n## Troubleshooting\n\n### Common Issues\n\n**Issue**: Swarm agents not coordinating properly\n**Solution**: Check topology selection, verify memory usage, enable monitoring\n\n**Issue**: Parallel execution failing\n**Solution**: Verify task dependencies, check resource limits, implement error handling\n\n**Issue**: Memory persistence not working\n**Solution**: Verify namespaces, check TTL settings, ensure backup configuration\n\n**Issue**: Performance degradation\n**Solution**: Optimize topology, reduce agent count, analyze bottlenecks\n\n## Related Skills\n\n- `sparc-methodology` - Systematic development workflow\n- `github-integration` - Repository management and automation\n- `neural-patterns` - AI-powered coordination optimization\n- `memory-management` - Cross-session state persistence\n\n## References\n\n- [Claude Flow Documentation](https:\u002F\u002Fgithub.com\u002Fruvnet\u002Fclaude-flow)\n- [Swarm Orchestration Guide](https:\u002F\u002Fgithub.com\u002Fruvnet\u002Fclaude-flow\u002Fwiki\u002Fswarm)\n- [MCP Tools Reference](https:\u002F\u002Fgithub.com\u002Fruvnet\u002Fclaude-flow\u002Fwiki\u002Fmcp)\n- [Performance Optimization](https:\u002F\u002Fgithub.com\u002Fruvnet\u002Fclaude-flow\u002Fwiki\u002Fperformance)\n\n---\n\n**Version**: 2.0.0\n**Last Updated**: 2025-10-19\n**Skill Level**: Advanced\n**Estimated Learning Time**: 2-3 hours\n",{"name":5,"tags":51,"author":52,"version":53,"category":35,"description":7},[30,37,42,34,33,38,41],"Claude Flow Team","2.0.0","main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002Faiskillstore\u002Fmarketplace\u002Fruvnet\u002Fswarm-advanced",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":8,"skillName":5,"commands":64,"prompt":74,"zipAvailable":75},[65,68,71],{"tool":66,"command":67},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill swarm-advanced",{"tool":69,"command":70},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill swarm-advanced",{"tool":72,"command":73},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill swarm-advanced","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Fruvnet\u002Fswarm-advanced\u002FSKILL.md",true,[77],{"path":78,"resourceType":79,"resourceTypeDesc":80,"sizeBytes":81,"sourceHtmlUrl":82},"skill-report.json","REFERENCE","参考文档",18033,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Fruvnet\u002Fswarm-advanced\u002Fskill-report.json",[84,94,104,113,119,126],{"skillNo":85,"name":86,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":90,"publishedAt":46},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[89],{"categoryNo":27,"categoryName":28,"taxonomyType":21,"taxonomyTypeDesc":22},[91,92,93],"model","model hierarchy","model hierarchy skill",{"skillNo":95,"name":96,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":100,"publishedAt":46},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[99],{"categoryNo":27,"categoryName":28,"taxonomyType":21,"taxonomyTypeDesc":22},[101,102,103],"MCP","zoom","zoom mcp",{"skillNo":105,"name":106,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":107,"categories":108,"keywords":109,"publishedAt":46},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[110,111,112,102],"sdk","zoom apps sdk","apps",{"skillNo":114,"name":115,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":116,"categories":117,"keywords":118,"publishedAt":46},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[115],{"skillNo":120,"name":121,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":122,"categories":123,"keywords":125,"publishedAt":46},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[124],{"categoryNo":27,"categoryName":28,"taxonomyType":21,"taxonomyTypeDesc":22},[121],{"skillNo":127,"name":128,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":129,"categories":130,"keywords":131,"publishedAt":46},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[128]]