[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7F5P56KNWSW7192X19JX2WF":3,"skill-same:01M7F5P56KNWSW7192X19JX2WF":57},{"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":6,"ownerHtmlUrl":40,"ownerBlogUrl":6,"ownerDescription":41,"updatedAt":42,"install":43,"resources":56},"01M7F5P56KNWSW7192X19JX2WF","swarm-advanced",null,"Advanced swarm orchestration patterns for research, development, testing, and complex distributed workflows","lza6\u002FArmor-piercing-system-prompts","lza6","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F128880206?v=4","01M7EB3K7WPX5T28EJ2NVHE6EG","Chinese-tingfeng","01M7EB3K97E1KQ16QWKJMFNGX8",11,"MIT","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F05-技能与代理开发\u002Fswarm-advanced-RuView\u002FSKILL.md",[],[],"2026-11-16 10:05:34",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","d69096e239f2a89aabc2cd078c47664a9d3b1e11","05-技能与代理开发\u002Fswarm-advanced-RuView",3,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts","https:\u002F\u002Fgithub.com\u002Flza6","个人vx：Tf00798\r\n个人✈：@TFGY999","2026-10-08 14:29:22",{"source":8,"skillName":5,"commands":44,"prompt":54,"zipAvailable":55},[45,48,51],{"tool":46,"command":47},"npx","npx skills add lza6\u002FArmor-piercing-system-prompts --skill swarm-advanced",{"tool":49,"command":50},"bunx","bunx skills add lza6\u002FArmor-piercing-system-prompts --skill swarm-advanced",{"tool":52,"command":53},"pnpm","pnpm dlx skills add lza6\u002FArmor-piercing-system-prompts --skill swarm-advanced","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F05-技能与代理开发\u002Fswarm-advanced-RuView\u002FSKILL.md",true,[],[58,65,70,77,84,91],{"skillNo":59,"name":60,"nameZh":6,"description":61,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":19},"01M7FFG485KY83TD6HSC4YPCMC","obsidian-clipper-template-creator","Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator\u002FSKILL.md",[],[],{"skillNo":66,"name":60,"nameZh":6,"description":61,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":19},"01M7FFG0T6AZ0STEJPSB3CX84K","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator-antigravity-awesome-skills-main\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M7FFFY0QEM14SKWPDYGMXM2P","python-api","Programmatic Object-Detection-Metrics API guidance for BoundingBox, BoundingBoxes, Evaluator, enums, coordinate conversion, AP\u002FmAP semantics, and source-style import diagnostics.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Fpython-api\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M7FFFVZQZ2GJ0C0TGP7JHD20","file-evaluation","Folder-based PASCAL VOC AP\u002FmAP evaluation from ground-truth and detection text files.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Ffile-evaluation\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M7FFFSFNYSE77SJ6PE1CK2DA","object-detection-metrics","Guides legacy Object-Detection-Metrics PASCAL VOC AP\u002FmAP evaluation from detection text folders and direct Python API classes.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002FSKILL.md",[],[],{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":19},"01M7FFFP0GCK1RVXBCPQ8APBMT","nx-workspace-patterns","Configure and optimize Nx monorepo workspaces. Use when setting up Nx, configuring project boundaries, optimizing build caching, or implementing affected commands.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fnx-workspace-patterns\u002FSKILL.md",[],[]]