jpskill.com
📦 その他 コミュニティ

when-analyzing-performance-use-performance-analysis

Claude Flow swarmsのパフォーマンスを分析し、ボトルネックを特定して改善策を提案することで、システム全体の効率を向上させるSkill。

📜 元の英語説明(参考)

Comprehensive performance analysis, bottleneck detection, and optimization recommendations for Claude Flow swarms

🇯🇵 日本人クリエイター向け解説

一言でいうと

Claude Flow swarmsのパフォーマンスを分析し、ボトルネックを特定して改善策を提案することで、システム全体の効率を向上させるSkill。

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o when-analyzing-performance-use-performance-analysis.zip https://jpskill.com/download/18786.zip && unzip -o when-analyzing-performance-use-performance-analysis.zip && rm when-analyzing-performance-use-performance-analysis.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/18786.zip -OutFile "$d\when-analyzing-performance-use-performance-analysis.zip"; Expand-Archive "$d\when-analyzing-performance-use-performance-analysis.zip" -DestinationPath $d -Force; ri "$d\when-analyzing-performance-use-performance-analysis.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して when-analyzing-performance-use-performance-analysis.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → when-analyzing-performance-use-performance-analysis フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
2

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

パフォーマンス分析SOP

概要

Claude Flow スウォームの包括的なパフォーマンス分析です。ボトルネック検出、プロファイリング、ベンチマーク、および実用的な最適化推奨事項を含みます。

エージェントと責任

performance-analyzer

役割: システムパフォーマンスを分析し、問題を特定します。 責任:

  • パフォーマンスメトリクスを収集します。
  • リソース使用率を分析します。
  • ボトルネックを特定します。
  • 分析レポートを生成します。

performance-benchmarker

役割: パフォーマンスベンチマークと比較を実行します。 責任:

  • ベンチマークスイートを実行します。
  • 構成間のパフォーマンスを比較します。
  • パフォーマンスのベースラインを確立します。
  • 改善を検証します。

perf-analyzer

役割: 詳細なパフォーマンスプロファイリングと最適化を行います。 責任:

  • コード実行をプロファイルします。
  • メモリ使用量を分析します。
  • クリティカルパスを最適化します。
  • 改善を推奨します。

フェーズ1: ベースラインの確立

目的

現在のパフォーマンスを測定し、ベースラインメトリクスを確立します。

スクリプト

# Collect baseline metrics
npx claude-flow@alpha performance baseline \
  --duration 300 \
  --interval 5 \
  --output baseline-metrics.json

# Run benchmark suite
npx claude-flow@alpha benchmark run \
  --type swarm \
  --iterations 10 \
  --output benchmark-results.json

# Profile system resources
npx claude-flow@alpha performance profile \
  --include-cpu \
  --include-memory \
  --include-network \
  --output resource-profile.json

# Collect agent metrics
npx claude-flow@alpha agent metrics --all --format json > agent-metrics.json

# Store baseline
npx claude-flow@alpha memory store \
  --key "performance/baseline" \
  --file baseline-metrics.json

# Generate baseline report
npx claude-flow@alpha performance report \
  --type baseline \
  --metrics baseline-metrics.json \
  --output baseline-report.md

主要なベースラインメトリクス

スウォームレベル:

  • 総スループット (tasks/min)
  • 平均レイテンシ (ms)
  • リソース使用率 (%)
  • エラー率 (%)
  • 協調オーバーヘッド (ms)

エージェントレベル:

  • タスク完了率
  • 応答時間 (ms)
  • CPU使用率 (%)
  • メモリ使用量 (MB)
  • アイドル時間 (%)

システムレベル:

  • 総CPU使用率 (%)
  • 総メモリ使用量 (MB)
  • ネットワーク帯域幅 (MB/s)
  • ディスクI/O (MB/s)

メモリパターン

# Store performance baseline
npx claude-flow@alpha memory store \
  --key "performance/baseline/timestamp" \
  --value "$(date -Iseconds)"

npx claude-flow@alpha memory store \
  --key "performance/baseline/metrics" \
  --value '{
    "throughput": 145.2,
    "latency": 38.5,
    "utilization": 0.78,
    "errorRate": 0.012,
    "timestamp": "'$(date -Iseconds)'"
  }'

フェーズ2: システムのプロファイル

目的

システムコンポーネントの詳細なプロファイリングを行い、パフォーマンス特性を特定します。

スクリプト

# Profile swarm execution
npx claude-flow@alpha performance profile-swarm \
  --duration 300 \
  --sample-rate 100 \
  --output swarm-profile.json

# Profile individual agents
for AGENT in $(npx claude-flow@alpha agent list --format json | jq -r '.[].id'); do
  npx claude-flow@alpha performance profile-agent \
    --agent-id "$AGENT" \
    --duration 60 \
    --output "profiles/agent-$AGENT.json"
done

# Profile memory usage
npx claude-flow@alpha memory profile \
  --show-hotspots \
  --show-leaks \
  --output memory-profile.json

# Profile network communication
npx claude-flow@alpha performance profile-network \
  --show-latency \
  --show-bandwidth \
  --output network-profile.json

# Generate flamegraph
npx claude-flow@alpha performance flamegraph \
  --input swarm-profile.json \
  --output flamegraph.svg

# Analyze CPU hotspots
npx claude-flow@alpha performance hotspots \
  --type cpu \
  --threshold 5 \
  --output cpu-hotspots.json

プロファイリング分析

# Identify slow functions
SLOW_FUNCTIONS=$(jq '[.profile[] | select(.time > 100)]' swarm-profile.json)

# Identify memory hogs
MEMORY_HOGS=$(jq '[.memory[] | select(.usage > 100)]' memory-profile.json)

# Identify network bottlenecks
NETWORK_ISSUES=$(jq '[.network[] | select(.latency > 50)]' network-profile.json)

echo "Slow Functions: $(echo $SLOW_FUNCTIONS | jq length)"
echo "Memory Hogs: $(echo $MEMORY_HOGS | jq length)"
echo "Network Issues: $(echo $NETWORK_ISSUES | jq length)"

フェーズ3: 問題の分析

目的

パフォーマンスの問題とボトルネックを特定し、分類します。

スクリプト

# Run comprehensive analysis
npx claude-flow@alpha performance analyze \
  --input swarm-profile.json \
  --detect-bottlenecks \
  --detect-memory-leaks \
  --detect-deadlocks \
  --output analysis-results.json

# Identify bottlenecks by type
npx claude-flow@alpha performance bottlenecks \
  --categorize \
  --priority-order \
  --output bottleneck-report.json

# Analyze agent performance
npx claude-flow@alpha agent analyze-performance \
  --all \
  --identify-underperformers \
  --output agent-analysis.json

# Analyze coordination overhead
npx claude-flow@alpha performance coordination-overhead \
  --calculate \
  --breakdown \
  --output coordination-analysis.json

# Root cause analysis
npx claude-flow@alpha performance root-cause \
  --issue "high-latency" \
  --trace-back \
  --output root-cause-analysis.json

問題の分類

クリティカルな問題:

  • デッドロック
  • メモリリーク
  • 完全なパフォーマンス低下
  • システムの不安定性

高優先度:

  • 30%以上の速度低下を引き起こすボトルネック
  • 高いエラー率 (>5%)
  • リソース枯渇
  • 協調の失敗

中優先度:

  • 中程度の速度低下 (10-30%)
  • 最適ではないリソース使用率
  • 非効率なアルゴリズム
  • 不適切な負荷分散

低優先度:

  • 軽微な最適化 (10%未満の影響)
  • コードスタイルの問題
  • ドキュメントの不足

メモリパターン

# Store analysis results
npx claude-flow@alpha memory store \
  --key "performance/analysis/issues" \
  --value '{
    "critical": 0,
    "high": 3,
    "medium": 8,
    "low": 12,
    "timestamp": "'$(date -Iseconds)'"
  }'

# Store bottleneck information
npx claude-flow@alpha mem
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

Performance Analysis SOP

Overview

Comprehensive performance analysis for Claude Flow swarms including bottleneck detection, profiling, benchmarking, and actionable optimization recommendations.

Agents & Responsibilities

performance-analyzer

Role: Analyze system performance and identify issues Responsibilities:

  • Collect performance metrics
  • Analyze resource utilization
  • Identify bottlenecks
  • Generate analysis reports

performance-benchmarker

Role: Run performance benchmarks and comparisons Responsibilities:

  • Execute benchmark suites
  • Compare performance across configurations
  • Establish performance baselines
  • Validate improvements

perf-analyzer

Role: Deep performance profiling and optimization Responsibilities:

  • Profile code execution
  • Analyze memory usage
  • Optimize critical paths
  • Recommend improvements

Phase 1: Establish Baseline

Objective

Measure current performance and establish baseline metrics.

Scripts

# Collect baseline metrics
npx claude-flow@alpha performance baseline \
  --duration 300 \
  --interval 5 \
  --output baseline-metrics.json

# Run benchmark suite
npx claude-flow@alpha benchmark run \
  --type swarm \
  --iterations 10 \
  --output benchmark-results.json

# Profile system resources
npx claude-flow@alpha performance profile \
  --include-cpu \
  --include-memory \
  --include-network \
  --output resource-profile.json

# Collect agent metrics
npx claude-flow@alpha agent metrics --all --format json > agent-metrics.json

# Store baseline
npx claude-flow@alpha memory store \
  --key "performance/baseline" \
  --file baseline-metrics.json

# Generate baseline report
npx claude-flow@alpha performance report \
  --type baseline \
  --metrics baseline-metrics.json \
  --output baseline-report.md

Key Baseline Metrics

Swarm-Level:

  • Total throughput (tasks/min)
  • Average latency (ms)
  • Resource utilization (%)
  • Error rate (%)
  • Coordination overhead (ms)

Agent-Level:

  • Task completion rate
  • Response time (ms)
  • CPU usage (%)
  • Memory usage (MB)
  • Idle time (%)

System-Level:

  • Total CPU usage (%)
  • Total memory usage (MB)
  • Network bandwidth (MB/s)
  • Disk I/O (MB/s)

Memory Patterns

# Store performance baseline
npx claude-flow@alpha memory store \
  --key "performance/baseline/timestamp" \
  --value "$(date -Iseconds)"

npx claude-flow@alpha memory store \
  --key "performance/baseline/metrics" \
  --value '{
    "throughput": 145.2,
    "latency": 38.5,
    "utilization": 0.78,
    "errorRate": 0.012,
    "timestamp": "'$(date -Iseconds)'"
  }'

Phase 2: Profile System

Objective

Deep profiling of system components to identify performance characteristics.

Scripts

# Profile swarm execution
npx claude-flow@alpha performance profile-swarm \
  --duration 300 \
  --sample-rate 100 \
  --output swarm-profile.json

# Profile individual agents
for AGENT in $(npx claude-flow@alpha agent list --format json | jq -r '.[].id'); do
  npx claude-flow@alpha performance profile-agent \
    --agent-id "$AGENT" \
    --duration 60 \
    --output "profiles/agent-$AGENT.json"
done

# Profile memory usage
npx claude-flow@alpha memory profile \
  --show-hotspots \
  --show-leaks \
  --output memory-profile.json

# Profile network communication
npx claude-flow@alpha performance profile-network \
  --show-latency \
  --show-bandwidth \
  --output network-profile.json

# Generate flamegraph
npx claude-flow@alpha performance flamegraph \
  --input swarm-profile.json \
  --output flamegraph.svg

# Analyze CPU hotspots
npx claude-flow@alpha performance hotspots \
  --type cpu \
  --threshold 5 \
  --output cpu-hotspots.json

Profiling Analysis

# Identify slow functions
SLOW_FUNCTIONS=$(jq '[.profile[] | select(.time > 100)]' swarm-profile.json)

# Identify memory hogs
MEMORY_HOGS=$(jq '[.memory[] | select(.usage > 100)]' memory-profile.json)

# Identify network bottlenecks
NETWORK_ISSUES=$(jq '[.network[] | select(.latency > 50)]' network-profile.json)

echo "Slow Functions: $(echo $SLOW_FUNCTIONS | jq length)"
echo "Memory Hogs: $(echo $MEMORY_HOGS | jq length)"
echo "Network Issues: $(echo $NETWORK_ISSUES | jq length)"

Phase 3: Analyze Issues

Objective

Identify and categorize performance issues and bottlenecks.

Scripts

# Run comprehensive analysis
npx claude-flow@alpha performance analyze \
  --input swarm-profile.json \
  --detect-bottlenecks \
  --detect-memory-leaks \
  --detect-deadlocks \
  --output analysis-results.json

# Identify bottlenecks by type
npx claude-flow@alpha performance bottlenecks \
  --categorize \
  --priority-order \
  --output bottleneck-report.json

# Analyze agent performance
npx claude-flow@alpha agent analyze-performance \
  --all \
  --identify-underperformers \
  --output agent-analysis.json

# Analyze coordination overhead
npx claude-flow@alpha performance coordination-overhead \
  --calculate \
  --breakdown \
  --output coordination-analysis.json

# Root cause analysis
npx claude-flow@alpha performance root-cause \
  --issue "high-latency" \
  --trace-back \
  --output root-cause-analysis.json

Issue Classification

Critical Issues:

  • Deadlocks
  • Memory leaks
  • Complete performance degradation
  • System instability

High Priority:

  • Bottlenecks causing >30% slowdown
  • High error rates (>5%)
  • Resource exhaustion
  • Coordination failures

Medium Priority:

  • Moderate slowdowns (10-30%)
  • Suboptimal resource utilization
  • Inefficient algorithms
  • Poor load balancing

Low Priority:

  • Minor optimizations (<10% impact)
  • Code style issues
  • Documentation gaps

Memory Patterns

# Store analysis results
npx claude-flow@alpha memory store \
  --key "performance/analysis/issues" \
  --value '{
    "critical": 0,
    "high": 3,
    "medium": 8,
    "low": 12,
    "timestamp": "'$(date -Iseconds)'"
  }'

# Store bottleneck information
npx claude-flow@alpha memory store \
  --key "performance/analysis/bottlenecks" \
  --file bottleneck-report.json

Phase 4: Optimize Performance

Objective

Apply optimizations based on analysis and measure improvements.

Scripts

# Get optimization recommendations
npx claude-flow@alpha performance recommend \
  --based-on analysis-results.json \
  --prioritize \
  --output recommendations.json

# Apply automatic optimizations
npx claude-flow@alpha performance optimize \
  --recommendations recommendations.json \
  --auto-apply safe-optimizations

# Manual optimizations
# 1. Fix identified bottlenecks
# 2. Optimize hot paths
# 3. Reduce coordination overhead
# 4. Improve resource utilization

# Optimize swarm topology
npx claude-flow@alpha swarm optimize-topology \
  --based-on analysis-results.json

# Optimize agent allocation
npx claude-flow@alpha agent rebalance \
  --strategy performance-optimized

# Optimize memory usage
npx claude-flow@alpha memory optimize \
  --reduce-footprint \
  --clear-unused

# Apply neural optimizations
npx claude-flow@alpha neural train \
  --pattern convergent \
  --iterations 10

Optimization Techniques

Parallelization:

# Increase parallelism for independent tasks
npx claude-flow@alpha swarm configure \
  --max-parallel-tasks 8

Caching:

# Enable result caching
npx claude-flow@alpha performance cache \
  --enable \
  --strategy lru \
  --max-size 1000

Load Balancing:

# Rebalance agent workloads
npx claude-flow@alpha swarm rebalance \
  --strategy adaptive \
  --target-variance 0.1

Resource Allocation:

# Optimize resource allocation
npx claude-flow@alpha agent configure --all \
  --memory-limit auto \
  --cpu-limit auto

Phase 5: Validate Results

Objective

Measure improvements and validate optimization effectiveness.

Scripts

# Collect post-optimization metrics
npx claude-flow@alpha performance baseline \
  --duration 300 \
  --output optimized-metrics.json

# Run comparison benchmark
npx claude-flow@alpha benchmark run \
  --type swarm \
  --iterations 10 \
  --output optimized-benchmark.json

# Compare before/after
npx claude-flow@alpha performance compare \
  --baseline baseline-metrics.json \
  --current optimized-metrics.json \
  --output improvement-report.json

# Calculate improvements
THROUGHPUT_IMPROVEMENT=$(jq '.improvements.throughput.percentage' improvement-report.json)
LATENCY_IMPROVEMENT=$(jq '.improvements.latency.percentage' improvement-report.json)

echo "Throughput improved by: $THROUGHPUT_IMPROVEMENT%"
echo "Latency improved by: $LATENCY_IMPROVEMENT%"

# Validate improvements meet targets
npx claude-flow@alpha performance validate \
  --improvements improvement-report.json \
  --targets performance-targets.json

# Generate final report
npx claude-flow@alpha performance report \
  --type comprehensive \
  --include-baseline \
  --include-analysis \
  --include-optimizations \
  --include-results \
  --output final-performance-report.md

# Archive performance data
npx claude-flow@alpha performance archive \
  --output performance-archive-$(date +%Y%m%d).tar.gz

Validation Criteria

Minimum Improvements:

  • Throughput: +15%
  • Latency: -20%
  • Resource utilization: More balanced (variance <10%)
  • Error rate: -50% or <1%

Validation Checks:

# Check if improvements meet targets
if (( $(echo "$THROUGHPUT_IMPROVEMENT >= 15" | bc -l) )); then
  echo "✓ Throughput target met"
else
  echo "✗ Throughput target not met"
fi

if (( $(echo "$LATENCY_IMPROVEMENT >= 20" | bc -l) )); then
  echo "✓ Latency target met"
else
  echo "✗ Latency target not met"
fi

Success Criteria

  • [ ] Baseline established
  • [ ] System profiled
  • [ ] Issues identified and categorized
  • [ ] Optimizations applied
  • [ ] Improvements validated

Performance Targets

  • Throughput improvement: ≥15%
  • Latency reduction: ≥20%
  • Resource utilization variance: <10%
  • Error rate: <1%
  • Optimization overhead: <5%

Best Practices

  1. Baseline First: Always establish baseline before optimizing
  2. Measure Everything: Comprehensive metrics collection
  3. Identify Bottlenecks: Focus on critical path
  4. Incremental Optimization: Apply optimizations incrementally
  5. Validate Improvements: Always measure after optimizing
  6. Document Changes: Record all optimization actions
  7. Regression Testing: Ensure optimizations don't break functionality
  8. Continuous Monitoring: Track performance over time

Common Issues & Solutions

Issue: No Performance Improvement

Symptoms: Metrics unchanged after optimization Solution: Re-analyze bottlenecks, verify optimizations applied correctly

Issue: Performance Regression

Symptoms: Performance worse after optimization Solution: Rollback changes, re-evaluate optimization strategy

Issue: Inconsistent Results

Symptoms: Performance varies significantly between runs Solution: Increase measurement duration, check for external factors

Integration Points

  • advanced-swarm: For topology optimization
  • swarm-orchestration: For coordination optimization
  • cascade-orchestrator: For workflow optimization

References

  • Performance Analysis Methodologies
  • Profiling Techniques
  • Optimization Patterns
  • Benchmarking Best Practices

同梱ファイル

※ ZIPに含まれるファイル一覧。`SKILL.md` 本体に加え、参考資料・サンプル・スクリプトが入っている場合があります。