When analyzing performance use performance analysis

From DNYoussef/context-cascade · View interactive version

When analyzing performance use performance analysis is an AI agent skill from the GitHub repository DNYoussef/context-cascade. [assert|neutral] Comprehensive performance analysis, bottleneck detection, and optimization recommendations for Claude Flow swarms [ground:given] [conf:0.95] [state:confirmed]

How to use this skill

Skill file

/============================================================================/

/* WHEN-ANALYZING-PERFORMANCE-USE-PERFORMANCE-ANALYSIS SKILL :: VERILINGUA x VERIX EDITION */

/============================================================================/


name: when-analyzing-performance-use-performance-analysis

version: 1.0.0

description: |

[assert|neutral] Comprehensive performance analysis, bottleneck detection, and optimization recommendations for Claude Flow swarms [ground:given] [conf:0.95] [state:confirmed]

category: performance

tags:

author: system

cognitive_frame:

primary: evidential

goal_analysis:

first_order: "Execute when-analyzing-performance-use-performance-analysis workflow"

second_order: "Ensure quality and consistency"

third_order: "Enable systematic performance processes"


/----------------------------------------------------------------------------/

/* S0 META-IDENTITY */

/----------------------------------------------------------------------------/

[define|neutral] SKILL := {

name: "when-analyzing-performance-use-performance-analysis",

category: "performance",

version: "1.0.0",

layer: L1

} [ground:given] [conf:1.0] [state:confirmed]

/----------------------------------------------------------------------------/

/* S1 COGNITIVE FRAME */

/----------------------------------------------------------------------------/

[define|neutral] COGNITIVE_FRAME := {

frame: "Evidential",

source: "Turkish",

force: "How do you know?"

} [ground:cognitive-science] [conf:0.92] [state:confirmed]

Kanitsal Cerceve (Evidential Frame Activation)

Kaynak dogrulama modu etkin.

/----------------------------------------------------------------------------/

/* S2 TRIGGER CONDITIONS */

/----------------------------------------------------------------------------/

[define|neutral] TRIGGER_POSITIVE := {

keywords: ["when-analyzing-performance-use-performance-analysis", "performance", "workflow"],

context: "user needs when-analyzing-performance-use-performance-analysis capability"

} [ground:given] [conf:1.0] [state:confirmed]

/----------------------------------------------------------------------------/

/* S3 CORE CONTENT */

/----------------------------------------------------------------------------/

Performance Analysis SOP

Kanitsal Cerceve (Evidential Frame Activation)

Kaynak dogrulama modu etkin.

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:

performance-benchmarker

Role: Run performance benchmarks and comparisons

Responsibilities:

perf-analyzer

Role: Deep performance profiling and optimization

Responsibilities:

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:

Agent-Level:

System-Level:

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

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.