[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7FB8BKXHTBF6KNFDB905EX2":3,"skill-same:01M7FB8BKXHTBF6KNFDB905EX2":46},{"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":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":6,"ownerDescription":30,"updatedAt":31,"install":32,"resources":45},"01M7FB8BKXHTBF6KNFDB905EX2","performance-analysis",null,"Comprehensive performance analysis, bottleneck detection, and optimization recommendations for Claude Flow swarms","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\u002F06-前端与设计\u002Fperformance-analysis-ruflo-main\u002FSKILL.md",[],[],"2026-11-16 10:05:34",false,"---\nname: performance-analysis\ndescription: |\n  Comprehensive performance analysis, bottleneck detection, and optimization recommendations for Claude Flow swarms\n---\n\n# Performance Analysis Skill\n\nComprehensive performance analysis suite for identifying bottlenecks, profiling swarm operations, generating detailed reports, and providing actionable optimization recommendations.\n\n## Overview\n\nThis skill consolidates all performance analysis capabilities:\n- **Bottleneck Detection**: Identify performance bottlenecks across communication, processing, memory, and network\n- **Performance Profiling**: Real-time monitoring and historical analysis of swarm operations\n- **Report Generation**: Create comprehensive performance reports in multiple formats\n- **Optimization Recommendations**: AI-powered suggestions for improving performance\n\n## Quick Start\n\n### Basic Bottleneck Detection\n```bash\nnpx claude-flow bottleneck detect\n```\n\n### Generate Performance Report\n```bash\nnpx claude-flow analysis performance-report --format html --include-metrics\n```\n\n### Analyze and Auto-Fix\n```bash\nnpx claude-flow bottleneck detect --fix --threshold 15\n```\n\n## Core Capabilities\n\n### 1. Bottleneck Detection\n\n#### Command Syntax\n```bash\nnpx claude-flow bottleneck detect [options]\n```\n\n#### Options\n- `--swarm-id, -s \u003Cid>` - Analyze specific swarm (default: current)\n- `--time-range, -t \u003Crange>` - Analysis period: 1h, 24h, 7d, all (default: 1h)\n- `--threshold \u003Cpercent>` - Bottleneck threshold percentage (default: 20)\n- `--export, -e \u003Cfile>` - Export analysis to file\n- `--fix` - Apply automatic optimizations\n\n#### Usage Examples\n```bash\n# Basic detection for current swarm\nnpx claude-flow bottleneck detect\n\n# Analyze specific swarm over 24 hours\nnpx claude-flow bottleneck detect --swarm-id swarm-123 -t 24h\n\n# Export detailed analysis\nnpx claude-flow bottleneck detect -t 24h -e bottlenecks.json\n\n# Auto-fix detected issues\nnpx claude-flow bottleneck detect --fix --threshold 15\n\n# Low threshold for sensitive detection\nnpx claude-flow bottleneck detect --threshold 10 --export critical-issues.json\n```\n\n#### Metrics Analyzed\n\n**Communication Bottlenecks:**\n- Message queue delays\n- Agent response times\n- Coordination overhead\n- Memory access patterns\n- Inter-agent communication latency\n\n**Processing Bottlenecks:**\n- Task completion times\n- Agent utilization rates\n- Parallel execution efficiency\n- Resource contention\n- CPU\u002Fmemory usage patterns\n\n**Memory Bottlenecks:**\n- Cache hit rates\n- Memory access patterns\n- Storage I\u002FO performance\n- Neural pattern loading times\n- Memory allocation efficiency\n\n**Network Bottlenecks:**\n- API call latency\n- MCP communication delays\n- External service timeouts\n- Concurrent request limits\n- Network throughput issues\n\n#### Output Format\n```\n🔍 Bottleneck Analysis Report\n━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\n📊 Summary\n├── Time Range: Last 1 hour\n├── Agents Analyzed: 6\n├── Tasks Processed: 42\n└── Critical Issues: 2\n\n🚨 Critical Bottlenecks\n1. Agent Communication (35% impact)\n   └── coordinator → coder-1 messages delayed by 2.3s avg\n\n2. Memory Access (28% impact)\n   └── Neural pattern loading taking 1.8s per access\n\n⚠️ Warning Bottlenecks\n1. Task Queue (18% impact)\n   └── 5 tasks waiting > 10s for assignment\n\n💡 Recommendations\n1. Switch to hierarchical topology (est. 40% improvement)\n2. Enable memory caching (est. 25% improvement)\n3. Increase agent concurrency to 8 (est. 20% improvement)\n\n✅ Quick Fixes Available\nRun with --fix to apply:\n- Enable smart caching\n- Optimize message routing\n- Adjust agent priorities\n```\n\n### 2. Performance Profiling\n\n#### Real-time Detection\nAutomatic analysis during task execution:\n- Execution time vs. complexity\n- Agent utilization rates\n- Resource constraints\n- Operation patterns\n\n#### Common Bottleneck Patterns\n\n**Time Bottlenecks:**\n- Tasks taking > 5 minutes\n- Sequential operations that could parallelize\n- Redundant file operations\n- Inefficient algorithm implementations\n\n**Coordination Bottlenecks:**\n- Single agent for complex tasks\n- Unbalanced agent workloads\n- Poor topology selection\n- Excessive synchronization points\n\n**Resource Bottlenecks:**\n- High operation count (> 100)\n- Memory constraints\n- I\u002FO limitations\n- Thread pool saturation\n\n#### MCP Integration\n```javascript\n\u002F\u002F Check for bottlenecks in Claude Code\nmcp__claude-flow__bottleneck_detect({\n  timeRange: \"1h\",\n  threshold: 20,\n  autoFix: false\n})\n\n\u002F\u002F Get detailed task results with bottleneck analysis\nmcp__claude-flow__task_results({\n  taskId: \"task-123\",\n  format: \"detailed\"\n})\n```\n\n**Result Format:**\n```json\n{\n  \"bottlenecks\": [\n    {\n      \"type\": \"coordination\",\n      \"severity\": \"high\",\n      \"description\": \"Single agent used for complex task\",\n      \"recommendation\": \"Spawn specialized agents for parallel work\",\n      \"impact\": \"35%\",\n      \"affectedComponents\": [\"coordinator\", \"coder-1\"]\n    }\n  ],\n  \"improvements\": [\n    {\n      \"area\": \"execution_time\",\n      \"suggestion\": \"Use parallel task execution\",\n      \"expectedImprovement\": \"30-50% time reduction\",\n      \"implementationSteps\": [\n        \"Split task into smaller units\",\n        \"Spawn 3-4 specialized agents\",\n        \"Use mesh topology for coordination\"\n      ]\n    }\n  ],\n  \"metrics\": {\n    \"avgExecutionTime\": \"142s\",\n    \"agentUtilization\": \"67%\",\n    \"cacheHitRate\": \"82%\",\n    \"parallelizationFactor\": 1.2\n  }\n}\n```\n\n### 3. Report Generation\n\n#### Command Syntax\n```bash\nnpx claude-flow analysis performance-report [options]\n```\n\n#### Options\n- `--format \u003Ctype>` - Report format: json, html, markdown (default: markdown)\n- `--include-metrics` - Include detailed metrics and charts\n- `--compare \u003Cid>` - Compare with previous swarm\n- `--time-range \u003Crange>` - Analysis period: 1h, 24h, 7d, 30d, all\n- `--output \u003Cfile>` - Output file path\n- `--sections \u003Clist>` - Comma-separated sections to include\n\n#### Report Sections\n1. **Executive Summary**\n   - Overall performance score\n   - Key metrics overview\n   - Critical findings\n\n2. **Swarm Overview**\n   - Topology configuration\n   - Agent distribution\n   - Task statistics\n\n3. **Performance Metrics**\n   - Execution times\n   - Throughput analysis\n   - Resource utilization\n   - Latency breakdown\n\n4. **Bottleneck Analysis**\n   - Identified bottlenecks\n   - Impact assessment\n   - Optimization priorities\n\n5. **Comparative Analysis** (when --compare used)\n   - Performance trends\n   - Improvement metrics\n   - Regression detection\n\n6. **Recommendations**\n   - Prioritized action items\n   - Expected improvements\n   - Implementation guidance\n\n#### Usage Examples\n```bash\n# Generate HTML report with all metrics\nnpx claude-flow analysis performance-report --format html --include-metrics\n\n# Compare current swarm with previous\nnpx claude-flow analysis performance-report --compare swarm-123 --format markdown\n\n# Custom output with specific sections\nnpx claude-flow analysis performance-report \\\n  --sections summary,metrics,recommendations \\\n  --output reports\u002Fperf-analysis.html \\\n  --format html\n\n# Weekly performance report\nnpx claude-flow analysis performance-report \\\n  --time-range 7d \\\n  --include-metrics \\\n  --format markdown \\\n  --output docs\u002Fweekly-performance.md\n\n# JSON format for CI\u002FCD integration\nnpx claude-flow analysis performance-report \\\n  --format json \\\n  --output build\u002Fperformance.json\n```\n\n#### Sample Markdown Report\n```markdown\n# Performance Analysis Report\n\n## Executive Summary\n- **Overall Score**: 87\u002F100\n- **Analysis Period**: Last 24 hours\n- **Swarms Analyzed**: 3\n- **Critical Issues**: 1\n\n## Key Metrics\n| Metric | Value | Trend | Target |\n|--------|-------|-------|--------|\n| Avg Task Time | 42s | ↓ 12% | 35s |\n| Agent Utilization | 78% | ↑ 5% | 85% |\n| Cache Hit Rate | 91% | → | 90% |\n| Parallel Efficiency | 2.3x | ↑ 0.4x | 2.5x |\n\n## Bottleneck Analysis\n### Critical\n1. **Agent Communication Delay** (Impact: 35%)\n   - Coordinator → Coder messages delayed by 2.3s avg\n   - **Fix**: Switch to hierarchical topology\n\n### Warnings\n1. **Memory Access Pattern** (Impact: 18%)\n   - Neural pattern loading: 1.8s per access\n   - **Fix**: Enable memory caching\n\n## Recommendations\n1. **High Priority**: Switch to hierarchical topology (40% improvement)\n2. **Medium Priority**: Enable memory caching (25% improvement)\n3. **Low Priority**: Increase agent concurrency to 8 (20% improvement)\n```\n\n### 4. Optimization Recommendations\n\n#### Automatic Fixes\nWhen using `--fix`, the following optimizations may be applied:\n\n**1. Topology Optimization**\n- Switch to more efficient topology (mesh → hierarchical)\n- Adjust communication patterns\n- Reduce coordination overhead\n- Optimize message routing\n\n**2. Caching Enhancement**\n- Enable memory caching\n- Optimize cache strategies\n- Preload common patterns\n- Implement cache warming\n\n**3. Concurrency Tuning**\n- Adjust agent counts\n- Optimize parallel execution\n- Balance workload distribution\n- Implement load balancing\n\n**4. Priority Adjustment**\n- Reorder task queues\n- Prioritize critical paths\n- Reduce wait times\n- Implement fair scheduling\n\n**5. Resource Optimization**\n- Optimize memory usage\n- Reduce I\u002FO operations\n- Batch API calls\n- Implement connection pooling\n\n#### Performance Impact\nTypical improvements after bottleneck resolution:\n\n- **Communication**: 30-50% faster message delivery\n- **Processing**: 20-40% reduced task completion time\n- **Memory**: 40-60% fewer cache misses\n- **Network**: 25-45% reduced API latency\n- **Overall**: 25-45% total performance improvement\n\n## Advanced Usage\n\n### Continuous Monitoring\n```bash\n# Monitor performance in real-time\nnpx claude-flow swarm monitor --interval 5\n\n# Generate hourly reports\nwhile true; do\n  npx claude-flow analysis performance-report \\\n    --format json \\\n    --output logs\u002Fperf-$(date +%Y%m%d-%H%M).json\n  sleep 3600\ndone\n```\n\n### CI\u002FCD Integration\n```yaml\n# .github\u002Fworkflows\u002Fperformance.yml\nname: Performance Analysis\non: [push, pull_request]\n\njobs:\n  analyze:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions\u002Fcheckout@v2\n      - name: Run Performance Analysis\n        run: |\n          npx claude-flow analysis performance-report \\\n            --format json \\\n            --output performance.json\n      - name: Check Performance Thresholds\n        run: |\n          npx claude-flow bottleneck detect \\\n            --threshold 15 \\\n            --export bottlenecks.json\n      - name: Upload Reports\n        uses: actions\u002Fupload-artifact@v2\n        with:\n          name: performance-reports\n          path: |\n            performance.json\n            bottlenecks.json\n```\n\n### Custom Analysis Scripts\n```javascript\n\u002F\u002F scripts\u002Fanalyze-performance.js\nconst { exec } = require('child_process');\nconst fs = require('fs');\n\nasync function analyzePerformance() {\n  \u002F\u002F Run bottleneck detection\n  const bottlenecks = await runCommand(\n    'npx claude-flow bottleneck detect --format json'\n  );\n\n  \u002F\u002F Generate performance report\n  const report = await runCommand(\n    'npx claude-flow analysis performance-report --format json'\n  );\n\n  \u002F\u002F Analyze results\n  const analysis = {\n    bottlenecks: JSON.parse(bottlenecks),\n    performance: JSON.parse(report),\n    timestamp: new Date().toISOString()\n  };\n\n  \u002F\u002F Save combined analysis\n  fs.writeFileSync(\n    'analysis\u002Fcombined-report.json',\n    JSON.stringify(analysis, null, 2)\n  );\n\n  \u002F\u002F Generate alerts if needed\n  if (analysis.bottlenecks.critical.length > 0) {\n    console.error('CRITICAL: Performance bottlenecks detected!');\n    process.exit(1);\n  }\n}\n\nfunction runCommand(cmd) {\n  return new Promise((resolve, reject) => {\n    exec(cmd, (error, stdout, stderr) => {\n      if (error) reject(error);\n      else resolve(stdout);\n    });\n  });\n}\n\nanalyzePerformance().catch(console.error);\n```\n\n## Best Practices\n\n### 1. Regular Analysis\n- Run bottleneck detection after major changes\n- Generate weekly performance reports\n- Monitor trends over time\n- Set up automated alerts\n\n### 2. Threshold Tuning\n- Start with default threshold (20%)\n- Lower for production systems (10-15%)\n- Higher for development (25-30%)\n- Adjust based on requirements\n\n### 3. Fix Strategy\n- Always review before applying --fix\n- Test fixes in development first\n- Apply fixes incrementally\n- Monitor impact after changes\n\n### 4. Report Integration\n- Include in documentation\n- Share with team regularly\n- Track improvements over time\n- Use for capacity planning\n\n### 5. Continuous Optimization\n- Learn from each analysis\n- Build performance budgets\n- Establish baselines\n- Set improvement goals\n\n## Troubleshooting\n\n### Common Issues\n\n**High Memory Usage**\n```bash\n# Analyze memory bottlenecks\nnpx claude-flow bottleneck detect --threshold 10\n\n# Check cache performance\nnpx claude-flow cache manage --action stats\n\n# Review memory metrics\nnpx claude-flow memory usage\n```\n\n**Slow Task Execution**\n```bash\n# Identify slow tasks\nnpx claude-flow task status --detailed\n\n# Analyze coordination overhead\nnpx claude-flow bottleneck detect --time-range 1h\n\n# Check agent utilization\nnpx claude-flow agent metrics\n```\n\n**Poor Cache Performance**\n```bash\n# Analyze cache hit rates\nnpx claude-flow analysis performance-report --sections metrics\n\n# Review cache strategy\nnpx claude-flow cache manage --action analyze\n\n# Enable cache warming\nnpx claude-flow bottleneck detect --fix\n```\n\n## Integration with Other Skills\n\n- **swarm-orchestration**: Use performance data to optimize topology\n- **memory-management**: Improve cache strategies based on analysis\n- **task-coordination**: Adjust scheduling based on bottlenecks\n- **neural-training**: Train patterns from performance data\n\n## Related Commands\n\n- `npx claude-flow swarm monitor` - Real-time monitoring\n- `npx claude-flow token usage` - Token optimization analysis\n- `npx claude-flow cache manage` - Cache optimization\n- `npx claude-flow agent metrics` - Agent performance metrics\n- `npx claude-flow task status` - Task execution analysis\n\n## See Also\n\n- [Bottleneck Detection Guide](\u002Fworkspaces\u002Fclaude-code-flow\u002F.claude\u002Fcommands\u002Fanalysis\u002Fbottleneck-detect.md)\n- [Performance Report Guide](\u002Fworkspaces\u002Fclaude-code-flow\u002F.claude\u002Fcommands\u002Fanalysis\u002Fperformance-report.md)\n- [Performance Bottlenecks Overview](\u002Fworkspaces\u002Fclaude-code-flow\u002F.claude\u002Fcommands\u002Fanalysis\u002Fperformance-bottlenecks.md)\n- [Swarm Monitoring Documentation](..\u002Fswarm-orchestration\u002FSKILL.md)\n- [Memory Management Documentation](..\u002Fmemory-management\u002FSKILL.md)\n\n---\n\n**Version**: 1.0.0\n**Last Updated**: 2025-10-19\n**Maintainer**: Claude Flow Team\n","# Performance Analysis Skill\n\nComprehensive performance analysis suite for identifying bottlenecks, profiling swarm operations, generating detailed reports, and providing actionable optimization recommendations.\n\n## Overview\n\nThis skill consolidates all performance analysis capabilities:\n- **Bottleneck Detection**: Identify performance bottlenecks across communication, processing, memory, and network\n- **Performance Profiling**: Real-time monitoring and historical analysis of swarm operations\n- **Report Generation**: Create comprehensive performance reports in multiple formats\n- **Optimization Recommendations**: AI-powered suggestions for improving performance\n\n## Quick Start\n\n### Basic Bottleneck Detection\n```bash\nnpx claude-flow bottleneck detect\n```\n\n### Generate Performance Report\n```bash\nnpx claude-flow analysis performance-report --format html --include-metrics\n```\n\n### Analyze and Auto-Fix\n```bash\nnpx claude-flow bottleneck detect --fix --threshold 15\n```\n\n## Core Capabilities\n\n### 1. Bottleneck Detection\n\n#### Command Syntax\n```bash\nnpx claude-flow bottleneck detect [options]\n```\n\n#### Options\n- `--swarm-id, -s \u003Cid>` - Analyze specific swarm (default: current)\n- `--time-range, -t \u003Crange>` - Analysis period: 1h, 24h, 7d, all (default: 1h)\n- `--threshold \u003Cpercent>` - Bottleneck threshold percentage (default: 20)\n- `--export, -e \u003Cfile>` - Export analysis to file\n- `--fix` - Apply automatic optimizations\n\n#### Usage Examples\n```bash\n# Basic detection for current swarm\nnpx claude-flow bottleneck detect\n\n# Analyze specific swarm over 24 hours\nnpx claude-flow bottleneck detect --swarm-id swarm-123 -t 24h\n\n# Export detailed analysis\nnpx claude-flow bottleneck detect -t 24h -e bottlenecks.json\n\n# Auto-fix detected issues\nnpx claude-flow bottleneck detect --fix --threshold 15\n\n# Low threshold for sensitive detection\nnpx claude-flow bottleneck detect --threshold 10 --export critical-issues.json\n```\n\n#### Metrics Analyzed\n\n**Communication Bottlenecks:**\n- Message queue delays\n- Agent response times\n- Coordination overhead\n- Memory access patterns\n- Inter-agent communication latency\n\n**Processing Bottlenecks:**\n- Task completion times\n- Agent utilization rates\n- Parallel execution efficiency\n- Resource contention\n- CPU\u002Fmemory usage patterns\n\n**Memory Bottlenecks:**\n- Cache hit rates\n- Memory access patterns\n- Storage I\u002FO performance\n- Neural pattern loading times\n- Memory allocation efficiency\n\n**Network Bottlenecks:**\n- API call latency\n- MCP communication delays\n- External service timeouts\n- Concurrent request limits\n- Network throughput issues\n\n#### Output Format\n```\n🔍 Bottleneck Analysis Report\n━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\n📊 Summary\n├── Time Range: Last 1 hour\n├── Agents Analyzed: 6\n├── Tasks Processed: 42\n└── Critical Issues: 2\n\n🚨 Critical Bottlenecks\n1. Agent Communication (35% impact)\n   └── coordinator → coder-1 messages delayed by 2.3s avg\n\n2. Memory Access (28% impact)\n   └── Neural pattern loading taking 1.8s per access\n\n⚠️ Warning Bottlenecks\n1. Task Queue (18% impact)\n   └── 5 tasks waiting > 10s for assignment\n\n💡 Recommendations\n1. Switch to hierarchical topology (est. 40% improvement)\n2. Enable memory caching (est. 25% improvement)\n3. Increase agent concurrency to 8 (est. 20% improvement)\n\n✅ Quick Fixes Available\nRun with --fix to apply:\n- Enable smart caching\n- Optimize message routing\n- Adjust agent priorities\n```\n\n### 2. Performance Profiling\n\n#### Real-time Detection\nAutomatic analysis during task execution:\n- Execution time vs. complexity\n- Agent utilization rates\n- Resource constraints\n- Operation patterns\n\n#### Common Bottleneck Patterns\n\n**Time Bottlenecks:**\n- Tasks taking > 5 minutes\n- Sequential operations that could parallelize\n- Redundant file operations\n- Inefficient algorithm implementations\n\n**Coordination Bottlenecks:**\n- Single agent for complex tasks\n- Unbalanced agent workloads\n- Poor topology selection\n- Excessive synchronization points\n\n**Resource Bottlenecks:**\n- High operation count (> 100)\n- Memory constraints\n- I\u002FO limitations\n- Thread pool saturation\n\n#### MCP Integration\n```javascript\n\u002F\u002F Check for bottlenecks in Claude Code\nmcp__claude-flow__bottleneck_detect({\n  timeRange: \"1h\",\n  threshold: 20,\n  autoFix: false\n})\n\n\u002F\u002F Get detailed task results with bottleneck analysis\nmcp__claude-flow__task_results({\n  taskId: \"task-123\",\n  format: \"detailed\"\n})\n```\n\n**Result Format:**\n```json\n{\n  \"bottlenecks\": [\n    {\n      \"type\": \"coordination\",\n      \"severity\": \"high\",\n      \"description\": \"Single agent used for complex task\",\n      \"recommendation\": \"Spawn specialized agents for parallel work\",\n      \"impact\": \"35%\",\n      \"affectedComponents\": [\"coordinator\", \"coder-1\"]\n    }\n  ],\n  \"improvements\": [\n    {\n      \"area\": \"execution_time\",\n      \"suggestion\": \"Use parallel task execution\",\n      \"expectedImprovement\": \"30-50% time reduction\",\n      \"implementationSteps\": [\n        \"Split task into smaller units\",\n        \"Spawn 3-4 specialized agents\",\n        \"Use mesh topology for coordination\"\n      ]\n    }\n  ],\n  \"metrics\": {\n    \"avgExecutionTime\": \"142s\",\n    \"agentUtilization\": \"67%\",\n    \"cacheHitRate\": \"82%\",\n    \"parallelizationFactor\": 1.2\n  }\n}\n```\n\n### 3. Report Generation\n\n#### Command Syntax\n```bash\nnpx claude-flow analysis performance-report [options]\n```\n\n#### Options\n- `--format \u003Ctype>` - Report format: json, html, markdown (default: markdown)\n- `--include-metrics` - Include detailed metrics and charts\n- `--compare \u003Cid>` - Compare with previous swarm\n- `--time-range \u003Crange>` - Analysis period: 1h, 24h, 7d, 30d, all\n- `--output \u003Cfile>` - Output file path\n- `--sections \u003Clist>` - Comma-separated sections to include\n\n#### Report Sections\n1. **Executive Summary**\n   - Overall performance score\n   - Key metrics overview\n   - Critical findings\n\n2. **Swarm Overview**\n   - Topology configuration\n   - Agent distribution\n   - Task statistics\n\n3. **Performance Metrics**\n   - Execution times\n   - Throughput analysis\n   - Resource utilization\n   - Latency breakdown\n\n4. **Bottleneck Analysis**\n   - Identified bottlenecks\n   - Impact assessment\n   - Optimization priorities\n\n5. **Comparative Analysis** (when --compare used)\n   - Performance trends\n   - Improvement metrics\n   - Regression detection\n\n6. **Recommendations**\n   - Prioritized action items\n   - Expected improvements\n   - Implementation guidance\n\n#### Usage Examples\n```bash\n# Generate HTML report with all metrics\nnpx claude-flow analysis performance-report --format html --include-metrics\n\n# Compare current swarm with previous\nnpx claude-flow analysis performance-report --compare swarm-123 --format markdown\n\n# Custom output with specific sections\nnpx claude-flow analysis performance-report \\\n  --sections summary,metrics,recommendations \\\n  --output reports\u002Fperf-analysis.html \\\n  --format html\n\n# Weekly performance report\nnpx claude-flow analysis performance-report \\\n  --time-range 7d \\\n  --include-metrics \\\n  --format markdown \\\n  --output docs\u002Fweekly-performance.md\n\n# JSON format for CI\u002FCD integration\nnpx claude-flow analysis performance-report \\\n  --format json \\\n  --output build\u002Fperformance.json\n```\n\n#### Sample Markdown Report\n```markdown\n# Performance Analysis Report\n\n## Executive Summary\n- **Overall Score**: 87\u002F100\n- **Analysis Period**: Last 24 hours\n- **Swarms Analyzed**: 3\n- **Critical Issues**: 1\n\n## Key Metrics\n| Metric | Value | Trend | Target |\n|--------|-------|-------|--------|\n| Avg Task Time | 42s | ↓ 12% | 35s |\n| Agent Utilization | 78% | ↑ 5% | 85% |\n| Cache Hit Rate | 91% | → | 90% |\n| Parallel Efficiency | 2.3x | ↑ 0.4x | 2.5x |\n\n## Bottleneck Analysis\n### Critical\n1. **Agent Communication Delay** (Impact: 35%)\n   - Coordinator → Coder messages delayed by 2.3s avg\n   - **Fix**: Switch to hierarchical topology\n\n### Warnings\n1. **Memory Access Pattern** (Impact: 18%)\n   - Neural pattern loading: 1.8s per access\n   - **Fix**: Enable memory caching\n\n## Recommendations\n1. **High Priority**: Switch to hierarchical topology (40% improvement)\n2. **Medium Priority**: Enable memory caching (25% improvement)\n3. **Low Priority**: Increase agent concurrency to 8 (20% improvement)\n```\n\n### 4. Optimization Recommendations\n\n#### Automatic Fixes\nWhen using `--fix`, the following optimizations may be applied:\n\n**1. Topology Optimization**\n- Switch to more efficient topology (mesh → hierarchical)\n- Adjust communication patterns\n- Reduce coordination overhead\n- Optimize message routing\n\n**2. Caching Enhancement**\n- Enable memory caching\n- Optimize cache strategies\n- Preload common patterns\n- Implement cache warming\n\n**3. Concurrency Tuning**\n- Adjust agent counts\n- Optimize parallel execution\n- Balance workload distribution\n- Implement load balancing\n\n**4. Priority Adjustment**\n- Reorder task queues\n- Prioritize critical paths\n- Reduce wait times\n- Implement fair scheduling\n\n**5. Resource Optimization**\n- Optimize memory usage\n- Reduce I\u002FO operations\n- Batch API calls\n- Implement connection pooling\n\n#### Performance Impact\nTypical improvements after bottleneck resolution:\n\n- **Communication**: 30-50% faster message delivery\n- **Processing**: 20-40% reduced task completion time\n- **Memory**: 40-60% fewer cache misses\n- **Network**: 25-45% reduced API latency\n- **Overall**: 25-45% total performance improvement\n\n## Advanced Usage\n\n### Continuous Monitoring\n```bash\n# Monitor performance in real-time\nnpx claude-flow swarm monitor --interval 5\n\n# Generate hourly reports\nwhile true; do\n  npx claude-flow analysis performance-report \\\n    --format json \\\n    --output logs\u002Fperf-$(date +%Y%m%d-%H%M).json\n  sleep 3600\ndone\n```\n\n### CI\u002FCD Integration\n```yaml\n# .github\u002Fworkflows\u002Fperformance.yml\nname: Performance Analysis\non: [push, pull_request]\n\njobs:\n  analyze:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions\u002Fcheckout@v2\n      - name: Run Performance Analysis\n        run: |\n          npx claude-flow analysis performance-report \\\n            --format json \\\n            --output performance.json\n      - name: Check Performance Thresholds\n        run: |\n          npx claude-flow bottleneck detect \\\n            --threshold 15 \\\n            --export bottlenecks.json\n      - name: Upload Reports\n        uses: actions\u002Fupload-artifact@v2\n        with:\n          name: performance-reports\n          path: |\n            performance.json\n            bottlenecks.json\n```\n\n### Custom Analysis Scripts\n```javascript\n\u002F\u002F scripts\u002Fanalyze-performance.js\nconst { exec } = require('child_process');\nconst fs = require('fs');\n\nasync function analyzePerformance() {\n  \u002F\u002F Run bottleneck detection\n  const bottlenecks = await runCommand(\n    'npx claude-flow bottleneck detect --format json'\n  );\n\n  \u002F\u002F Generate performance report\n  const report = await runCommand(\n    'npx claude-flow analysis performance-report --format json'\n  );\n\n  \u002F\u002F Analyze results\n  const analysis = {\n    bottlenecks: JSON.parse(bottlenecks),\n    performance: JSON.parse(report),\n    timestamp: new Date().toISOString()\n  };\n\n  \u002F\u002F Save combined analysis\n  fs.writeFileSync(\n    'analysis\u002Fcombined-report.json',\n    JSON.stringify(analysis, null, 2)\n  );\n\n  \u002F\u002F Generate alerts if needed\n  if (analysis.bottlenecks.critical.length > 0) {\n    console.error('CRITICAL: Performance bottlenecks detected!');\n    process.exit(1);\n  }\n}\n\nfunction runCommand(cmd) {\n  return new Promise((resolve, reject) => {\n    exec(cmd, (error, stdout, stderr) => {\n      if (error) reject(error);\n      else resolve(stdout);\n    });\n  });\n}\n\nanalyzePerformance().catch(console.error);\n```\n\n## Best Practices\n\n### 1. Regular Analysis\n- Run bottleneck detection after major changes\n- Generate weekly performance reports\n- Monitor trends over time\n- Set up automated alerts\n\n### 2. Threshold Tuning\n- Start with default threshold (20%)\n- Lower for production systems (10-15%)\n- Higher for development (25-30%)\n- Adjust based on requirements\n\n### 3. Fix Strategy\n- Always review before applying --fix\n- Test fixes in development first\n- Apply fixes incrementally\n- Monitor impact after changes\n\n### 4. Report Integration\n- Include in documentation\n- Share with team regularly\n- Track improvements over time\n- Use for capacity planning\n\n### 5. Continuous Optimization\n- Learn from each analysis\n- Build performance budgets\n- Establish baselines\n- Set improvement goals\n\n## Troubleshooting\n\n### Common Issues\n\n**High Memory Usage**\n```bash\n# Analyze memory bottlenecks\nnpx claude-flow bottleneck detect --threshold 10\n\n# Check cache performance\nnpx claude-flow cache manage --action stats\n\n# Review memory metrics\nnpx claude-flow memory usage\n```\n\n**Slow Task Execution**\n```bash\n# Identify slow tasks\nnpx claude-flow task status --detailed\n\n# Analyze coordination overhead\nnpx claude-flow bottleneck detect --time-range 1h\n\n# Check agent utilization\nnpx claude-flow agent metrics\n```\n\n**Poor Cache Performance**\n```bash\n# Analyze cache hit rates\nnpx claude-flow analysis performance-report --sections metrics\n\n# Review cache strategy\nnpx claude-flow cache manage --action analyze\n\n# Enable cache warming\nnpx claude-flow bottleneck detect --fix\n```\n\n## Integration with Other Skills\n\n- **swarm-orchestration**: Use performance data to optimize topology\n- **memory-management**: Improve cache strategies based on analysis\n- **task-coordination**: Adjust scheduling based on bottlenecks\n- **neural-training**: Train patterns from performance data\n\n## Related Commands\n\n- `npx claude-flow swarm monitor` - Real-time monitoring\n- `npx claude-flow token usage` - Token optimization analysis\n- `npx claude-flow cache manage` - Cache optimization\n- `npx claude-flow agent metrics` - Agent performance metrics\n- `npx claude-flow task status` - Task execution analysis\n\n## See Also\n\n- [Bottleneck Detection Guide](\u002Fworkspaces\u002Fclaude-code-flow\u002F.claude\u002Fcommands\u002Fanalysis\u002Fbottleneck-detect.md)\n- [Performance Report Guide](\u002Fworkspaces\u002Fclaude-code-flow\u002F.claude\u002Fcommands\u002Fanalysis\u002Fperformance-report.md)\n- [Performance Bottlenecks Overview](\u002Fworkspaces\u002Fclaude-code-flow\u002F.claude\u002Fcommands\u002Fanalysis\u002Fperformance-bottlenecks.md)\n- [Swarm Monitoring Documentation](..\u002Fswarm-orchestration\u002FSKILL.md)\n- [Memory Management Documentation](..\u002Fmemory-management\u002FSKILL.md)\n\n---\n\n**Version**: 1.0.0\n**Last Updated**: 2025-10-19\n**Maintainer**: Claude Flow Team\n",{"name":5,"description":7},"main","d69096e239f2a89aabc2cd078c47664a9d3b1e11","06-前端与设计\u002Fperformance-analysis-ruflo-main",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":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add lza6\u002FArmor-piercing-system-prompts --skill performance-analysis",{"tool":38,"command":39},"bunx","bunx skills add lza6\u002FArmor-piercing-system-prompts --skill performance-analysis",{"tool":41,"command":42},"pnpm","pnpm dlx skills add lza6\u002FArmor-piercing-system-prompts --skill performance-analysis","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F06-前端与设计\u002Fperformance-analysis-ruflo-main\u002FSKILL.md",true,[],[47,54,59,66,73,80],{"skillNo":48,"name":49,"nameZh":6,"description":50,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":51,"categories":52,"keywords":53,"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":55,"name":49,"nameZh":6,"description":50,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":56,"categories":57,"keywords":58,"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":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},"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":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},"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":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},"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":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},"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",[],[]]