[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7BP6SFA54CDREF97K6B3KGJ":3,"skill-same:01M7BP6SFA54CDREF97K6B3KGJ":58},{"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":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":35,"commitSha":36,"skillDirectory":37,"forksCount":38,"repositoryHtmlUrl":39,"repositoryHomepageUrl":40,"ownerHtmlUrl":41,"ownerBlogUrl":6,"ownerDescription":42,"updatedAt":43,"install":44,"resources":57},"01M7BP6SFA54CDREF97K6B3KGJ","swarm-advanced",null,"Advanced swarm orchestration patterns for research, development, testing, and complex distributed workflows","YYC-Cube\u002FYYC3-Knowledge-Base","YYC-Cube","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F235006543?v=4","01M79J2PH4SWD2X0825X6PN748","yyc3","01M79J2PHVK3F6ZBYT8K2SCZCW",1,"MIT","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-Agent-智能体\u002FYYC3-Agent-智能体-ruflo\u002Fv3\u002F@claude-flow\u002Fcli\u002F.claude\u002Fskills\u002Fswarm-advanced\u002FSKILL.md",[],[],"2026-11-15 14:19:17",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":24,"author":32,"version":33,"category":34,"description":7},[25,26,27,28,29,30,31],"swarm","distributed","parallel","research","testing","development","coordination","Claude Flow Team","2.0.0","orchestration","main","87afe6ce96220accf50a345dea46784c8c9f210e","YYC3-Agent-智能体\u002FYYC3-Agent-智能体-ruflo\u002Fv3\u002F@claude-flow\u002Fcli\u002F.claude\u002Fskills\u002Fswarm-advanced",0,"https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base","https:\u002F\u002Fkb.yyc3.top\u002F","https:\u002F\u002Fgithub.com\u002FYYC-Cube","万象归元于云枢 | 深栈智启新纪元","2026-11-10 10:37:32",{"source":8,"skillName":5,"commands":45,"prompt":55,"zipAvailable":56},[46,49,52],{"tool":47,"command":48},"npx","npx skills add YYC-Cube\u002FYYC3-Knowledge-Base --skill swarm-advanced",{"tool":50,"command":51},"bunx","bunx skills add YYC-Cube\u002FYYC3-Knowledge-Base --skill swarm-advanced",{"tool":53,"command":54},"pnpm","pnpm dlx skills add YYC-Cube\u002FYYC3-Knowledge-Base --skill swarm-advanced","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-Agent-智能体\u002FYYC3-Agent-智能体-ruflo\u002Fv3\u002F@claude-flow\u002Fcli\u002F.claude\u002Fskills\u002Fswarm-advanced\u002FSKILL.md",true,[],[59,66,73,80,87,94],{"skillNo":60,"name":61,"nameZh":6,"description":62,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":19},"01M7CTDWHERCXPQCP0K03A86AS","vercel-sandbox","Run agent-browser + Chrome inside Vercel Sandbox microVMs for browser automation from any Vercel-deployed app. Use when the user needs browser automation in a Vercel app (Next.js, SvelteKit, Nuxt, Remix, Astro, etc.), wants to run headless Chrome without binary size limits, needs persistent browser sessions across commands, or wants ephemeral isolated browser environments. Triggers include \"Vercel Sandbox browser\", \"microVM Chrome\", \"agent-browser in sandbox\", \"browser automation on Vercel\", or any task requiring Chrome in a Vercel Sandbox.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-WebSpec-Web标准\u002FYYC3-WebSpec-Web标准-standards\u002Fbrowser-agent\u002Fskills\u002Fvercel-sandbox\u002FSKILL.md",[],[],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":19},"01M7CTD8D2BNJY54S65M47HEJA","slack","Interact with Slack workspaces using browser automation. Use when the user needs to check unread channels, navigate Slack, send messages, extract data, find information, search conversations, or automate any Slack task. Triggers include \"check my Slack\", \"what channels have unreads\", \"send a message to\", \"search Slack for\", \"extract from Slack\", \"find who said\", or any task requiring programmatic Slack interaction.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-WebSpec-Web标准\u002FYYC3-WebSpec-Web标准-standards\u002Fbrowser-agent\u002Fskills\u002Fslack\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":19},"01M7CTCSSB8ZP3Q58C3YZDZK1W","electron","Automate Electron desktop apps (VS Code, Slack, Discord, Figma, Notion, Spotify, etc.) using agent-browser via Chrome DevTools Protocol. Use when the user needs to interact with an Electron app, automate a desktop app, connect to a running app, control a native app, or test an Electron application. Triggers include \"automate Slack app\", \"control VS Code\", \"interact with Discord app\", \"test this Electron app\", \"connect to desktop app\", or any task requiring automation of a native Electron application.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-WebSpec-Web标准\u002FYYC3-WebSpec-Web标准-standards\u002Fbrowser-agent\u002Fskills\u002Felectron\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":19},"01M7CTCBJY76688V4DCZGWFHGQ","dogfood","Systematically explore and test a web application to find bugs, UX issues, and other problems. Use when asked to \"dogfood\", \"QA\", \"exploratory test\", \"find issues\", \"bug hunt\", \"test this app\u002Fsite\u002Fplatform\", or review the quality of a web application. Produces a structured report with full reproduction evidence -- step-by-step screenshots, repro videos, and detailed repro steps for every issue -- so findings can be handed directly to the responsible teams.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-WebSpec-Web标准\u002FYYC3-WebSpec-Web标准-standards\u002Fbrowser-agent\u002Fskills\u002Fdogfood\u002FSKILL.md",[],[],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":19},"01M7CTC4H0FFGVEAQR9PA4GA1A","agent-browser","Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to \"open a website\", \"fill out a form\", \"click a button\", \"take a screenshot\", \"scrape data from a page\", \"test this web app\", \"login to a site\", \"automate browser actions\", or any task requiring programmatic web interaction.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-WebSpec-Web标准\u002FYYC3-WebSpec-Web标准-standards\u002Fbrowser-agent\u002Fskills\u002Fagent-browser\u002FSKILL.md",[],[],{"skillNo":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":19},"01M7CTBKVFYBG78FDSABSDJTTQ","shadcn","Manages shadcn components and projects — adding, searching, fixing, debugging, styling, and composing UI, including chat interfaces. Provides project context, component docs, and usage examples. Applies when working with shadcn\u002Fui, component registries, presets, --preset codes, or any project with a components.json file. Also triggers for \"shadcn init\", \"create an app with --preset\", \"switch to --preset\", and for building a design system or applying a DESIGN.md or brand spec to shadcn\u002Fui.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-UI-界面组件\u002FYYC3-UI-界面组件-ui\u002Fskills\u002Fshadcn\u002FSKILL.md",[],[]]