[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M73BWPT5HHAMN39JFNY3CHWD":3,"skill-same:01M73BWPT5HHAMN39JFNY3CHWD":70},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":8,"repositoryNo":11,"starsCount":12,"licenseSpdxId":13,"licenseFileUrl":6,"sourceHtmlUrl":14,"categories":15,"keywords":16,"publishedAt":17,"linkOnly":18,"markdownContent":19,"markdownBody":20,"frontMatter":21,"refName":30,"commitSha":31,"skillDirectory":32,"forksCount":12,"repositoryHtmlUrl":33,"repositoryHomepageUrl":6,"ownerHtmlUrl":34,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":35,"install":36,"resources":49},"01M73BWPT5HHAMN39JFNY3CHWD","performance-analysis",null,"ngdletrung\u002FJKAI-Zenith","ngdletrung","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F88302940?v=4","01M73BJVV5QJ87R3MC4BXJMWDN","01M73BJVWAAM03TM18QHKRDAMH",0,"MIT","https:\u002F\u002Fgithub.com\u002Fngdletrung\u002FJKAI-Zenith\u002Fblob\u002Fmain\u002Fintelligence\u002Fskills\u002FCORE\u002Fperformance-analysis\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nid: performance-analysis\nname_vn: performance-analysis\nversion: 1.0.0\nauthor: Zenith Legacy\ndomain: UNKNOWN\nintent_pairs: []\naliases_vn: []\nschema: {}\npriority: NORMAL\nrelated_skills: []\n\n---\n\n# performance-analysis (performance-analysis)\n\n## 🌟 TỔNG QUAN\n---\nname: performance-analysis\nversion: 1.0.0\ndescription: Comprehensive performance analysis, bottleneck detection, and optimization recommendations for Claude Flow swarms\ncategory: monitoring\ntags: [performance, bottleneck, optimization, profiling, metrics, analysis]\nauthor: Claude Flow Team\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$memory 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$perf-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$weekly-performance.md\n\n# JSON format for CI\u002FCD integration\nnpx claude-flow analysis performance-report \\\n  --format json \\\n  --output build$performance.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$perf-$(date +%Y%m%d-%H%M).json\n  sleep 3600\ndone\n```\n\n### CI\u002FCD Integration\n```yaml\n# .github$workflows$performance.yml\nname: Performance Analysis\non: [push, pull_request]\n\njobs:\n  analyze:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions$checkout@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$upload-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$analyze-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$combined-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]($workspaces$claude-code-flow\u002F.claude$commands$analysis$bottleneck-detect.md)\n- [Performance Report Guide]($workspaces$claude-code-flow\u002F.claude$commands$analysis$performance-report.md)\n- [Performance Bottlenecks Overview]($workspaces$claude-code-flow\u002F.claude$commands$analysis$performance-bottlenecks.md)\n- [Swarm Monitoring Documentation](..$swarm-orchestration\u002FSKILL.md)\n- [Memory Management Documentation](..$memory-management\u002FSKILL.md)\n\n---\n\n**Version**: 1.0.0\n**Last Updated**: 2025-10-19\n**Maintainer**: Claude Flow Team\n\n\n## 🛠️ PHÁC ĐỒ VẬN HÀNH (OPERATIONAL PROTOCOL)\n### 🔍 Phase 1: Investigation (Thẩm định)\n- Xác minh tham số đầu vào dựa trên Schema.\n- Kiểm tra bối cảnh hệ thống liên quan.\n\n### 🚀 Phase 2: Action (Thực thi)\n- Triệu hồi logic thực thi trong `logic.py`.\n- Trả về kết quả và chắt lọc kinh nghiệm.\n\n---\n## ⚠️ SAI LẦM THƯỜNG GẶP (COMMON PITFALLS)\n- Chưa ghi nhận.\n\n---\n*TRUNG THÀNH - CHÍNH XÁC - TỐI THƯỢNG* 💎🦾\n","# performance-analysis (performance-analysis)\n\n## 🌟 TỔNG QUAN\n---\nname: performance-analysis\nversion: 1.0.0\ndescription: Comprehensive performance analysis, bottleneck detection, and optimization recommendations for Claude Flow swarms\ncategory: monitoring\ntags: [performance, bottleneck, optimization, profiling, metrics, analysis]\nauthor: Claude Flow Team\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$memory 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$perf-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$weekly-performance.md\n\n# JSON format for CI\u002FCD integration\nnpx claude-flow analysis performance-report \\\n  --format json \\\n  --output build$performance.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$perf-$(date +%Y%m%d-%H%M).json\n  sleep 3600\ndone\n```\n\n### CI\u002FCD Integration\n```yaml\n# .github$workflows$performance.yml\nname: Performance Analysis\non: [push, pull_request]\n\njobs:\n  analyze:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions$checkout@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$upload-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$analyze-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$combined-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]($workspaces$claude-code-flow\u002F.claude$commands$analysis$bottleneck-detect.md)\n- [Performance Report Guide]($workspaces$claude-code-flow\u002F.claude$commands$analysis$performance-report.md)\n- [Performance Bottlenecks Overview]($workspaces$claude-code-flow\u002F.claude$commands$analysis$performance-bottlenecks.md)\n- [Swarm Monitoring Documentation](..$swarm-orchestration\u002FSKILL.md)\n- [Memory Management Documentation](..$memory-management\u002FSKILL.md)\n\n---\n\n**Version**: 1.0.0\n**Last Updated**: 2025-10-19\n**Maintainer**: Claude Flow Team\n\n\n## 🛠️ PHÁC ĐỒ VẬN HÀNH (OPERATIONAL PROTOCOL)\n### 🔍 Phase 1: Investigation (Thẩm định)\n- Xác minh tham số đầu vào dựa trên Schema.\n- Kiểm tra bối cảnh hệ thống liên quan.\n\n### 🚀 Phase 2: Action (Thực thi)\n- Triệu hồi logic thực thi trong `logic.py`.\n- Trả về kết quả và chắt lọc kinh nghiệm.\n\n---\n## ⚠️ SAI LẦM THƯỜNG GẶP (COMMON PITFALLS)\n- Chưa ghi nhận.\n\n---\n*TRUNG THÀNH - CHÍNH XÁC - TỐI THƯỢNG* 💎🦾\n",{"id":5,"author":22,"domain":23,"schema":24,"name_vn":5,"version":25,"priority":26,"aliases_vn":27,"intent_pairs":28,"related_skills":29},"Zenith Legacy","UNKNOWN",{},"1.0.0","NORMAL",[],[],[],"main","571327a911ec45873180fd5628525b6d4504ed79","intelligence\u002Fskills\u002FCORE\u002Fperformance-analysis","https:\u002F\u002Fgithub.com\u002Fngdletrung\u002FJKAI-Zenith","https:\u002F\u002Fgithub.com\u002Fngdletrung","2026-11-08 11:23:33",{"source":7,"skillName":5,"commands":37,"prompt":47,"zipAvailable":48},[38,41,44],{"tool":39,"command":40},"npx","npx skills add ngdletrung\u002FJKAI-Zenith --skill performance-analysis",{"tool":42,"command":43},"bunx","bunx skills add ngdletrung\u002FJKAI-Zenith --skill performance-analysis",{"tool":45,"command":46},"pnpm","pnpm dlx skills add ngdletrung\u002FJKAI-Zenith --skill performance-analysis","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fngdletrung\u002FJKAI-Zenith\u002Fblob\u002Fmain\u002Fintelligence\u002Fskills\u002FCORE\u002Fperformance-analysis\u002FSKILL.md",true,[50,56,62,66],{"path":51,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":54,"sourceHtmlUrl":55},"__init__.py","SCRIPT","脚本",69,"https:\u002F\u002Fgithub.com\u002Fngdletrung\u002FJKAI-Zenith\u002Fblob\u002Fmain\u002Fintelligence\u002Fskills\u002FCORE\u002Fperformance-analysis\u002F__init__.py",{"path":57,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":60,"sourceHtmlUrl":61},"dossier.md","REFERENCE","参考文档",2135,"https:\u002F\u002Fgithub.com\u002Fngdletrung\u002FJKAI-Zenith\u002Fblob\u002Fmain\u002Fintelligence\u002Fskills\u002FCORE\u002Fperformance-analysis\u002Fdossier.md",{"path":63,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":64,"sourceHtmlUrl":65},"logic.py",410,"https:\u002F\u002Fgithub.com\u002Fngdletrung\u002FJKAI-Zenith\u002Fblob\u002Fmain\u002Fintelligence\u002Fskills\u002FCORE\u002Fperformance-analysis\u002Flogic.py",{"path":67,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":68,"sourceHtmlUrl":69},"manifest.json",947,"https:\u002F\u002Fgithub.com\u002Fngdletrung\u002FJKAI-Zenith\u002Fblob\u002Fmain\u002Fintelligence\u002Fskills\u002FCORE\u002Fperformance-analysis\u002Fmanifest.json",[71,78,84,91,97,103],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":8,"repositoryNo":11,"starsCount":12,"licenseSpdxId":13,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":17},"01M73C2NC1W5P3A0V3GQAJ0SJB","standard_plugin","Hướng dẫn kích hoạt và vận hành cho kỹ năng standard_plugin.","https:\u002F\u002Fgithub.com\u002Fngdletrung\u002FJKAI-Zenith\u002Fblob\u002Fmain\u002Fintelligence\u002Fskills\u002Ftemplates\u002Fstandard_plugin\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":8,"repositoryNo":11,"starsCount":12,"licenseSpdxId":13,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":17},"01M73C2KAN3Q7D5XEBKB3KZW1B","_STANDARD","https:\u002F\u002Fgithub.com\u002Fngdletrung\u002FJKAI-Zenith\u002Fblob\u002Fmain\u002Fintelligence\u002Fskills\u002F_STANDARD\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":8,"repositoryNo":11,"starsCount":12,"licenseSpdxId":13,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":17},"01M73C2HV7KDJQTA6ACCR10HZB","test_dynamic_audit","Thao tác kiểm toán động","https:\u002F\u002Fgithub.com\u002Fngdletrung\u002FJKAI-Zenith\u002Fblob\u002Fmain\u002Fintelligence\u002Fskills\u002FTEST\u002Ftest_dynamic_audit\u002FSKILL.md",[],[],{"skillNo":92,"name":93,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":8,"repositoryNo":11,"starsCount":12,"licenseSpdxId":13,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":17},"01M73C2FRG0JHZ6W155V1KCHRP","security-audit","https:\u002F\u002Fgithub.com\u002Fngdletrung\u002FJKAI-Zenith\u002Fblob\u002Fmain\u002Fintelligence\u002Fskills\u002FSECURITY\u002Fsecurity-audit\u002FSKILL.md",[],[],{"skillNo":98,"name":99,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":8,"repositoryNo":11,"starsCount":12,"licenseSpdxId":13,"licenseFileUrl":6,"sourceHtmlUrl":100,"categories":101,"keywords":102,"publishedAt":17},"01M73C2EMWYHFTAR9RSZ41TBGP","security-and-hardening","https:\u002F\u002Fgithub.com\u002Fngdletrung\u002FJKAI-Zenith\u002Fblob\u002Fmain\u002Fintelligence\u002Fskills\u002FSECURITY\u002Fsecurity-and-hardening\u002FSKILL.md",[],[],{"skillNo":104,"name":105,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":8,"repositoryNo":11,"starsCount":12,"licenseSpdxId":13,"licenseFileUrl":6,"sourceHtmlUrl":106,"categories":107,"keywords":108,"publishedAt":17},"01M73C2CV0BQ59NAEWXKBQ370Z","performance-optimization","https:\u002F\u002Fgithub.com\u002Fngdletrung\u002FJKAI-Zenith\u002Fblob\u002Fmain\u002Fintelligence\u002Fskills\u002FSECURITY\u002Fperformance-optimization\u002FSKILL.md",[],[]]