/============================================================================/
/* WHEN-PROFILING-PERFORMANCE-USE-PERFORMANCE-PROFILER SKILL :: VERILINGUA x VERIX EDITION */
/============================================================================/
name: when-profiling-performance-use-performance-profiler
version: 1.0.0
description: |
[assert|neutral] Comprehensive performance profiling, bottleneck detection, and optimization system [ground:given] [conf:0.95] [state:confirmed]
category: performance
tags:
- performance
- profiling
- optimization
- benchmarking
- mece
author: Claude Code
cognitive_frame:
primary: evidential
goal_analysis:
first_order: "Execute when-profiling-performance-use-performance-profiler workflow"
second_order: "Ensure quality and consistency"
third_order: "Enable systematic performance processes"
/----------------------------------------------------------------------------/
/* S0 META-IDENTITY */
/----------------------------------------------------------------------------/
[define|neutral] SKILL := {
name: "when-profiling-performance-use-performance-profiler",
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-profiling-performance-use-performance-profiler", "performance", "workflow"],
context: "user needs when-profiling-performance-use-performance-profiler capability"
} [ground:given] [conf:1.0] [state:confirmed]
/----------------------------------------------------------------------------/
/* S3 CORE CONTENT */
/----------------------------------------------------------------------------/
Performance Profiler Skill
Kanitsal Cerceve (Evidential Frame Activation)
Kaynak dogrulama modu etkin.
Overview
When profiling performance, use performance-profiler to measure, analyze, and optimize application performance across CPU, memory, I/O, and network dimensions.
MECE Breakdown
Mutually Exclusive Components:
- Baseline Phase: Establish current performance metrics
- Detection Phase: Identify bottlenecks and hot paths
- Analysis Phase: Root cause analysis and impact assessment
- Optimization Phase: Generate and prioritize recommendations
- Implementation Phase: Apply optimizations with agent assistance
- Validation Phase: Benchmark improvements and verify gains
Collectively Exhaustive Coverage:
- CPU Profiling: Function execution time, hot paths, call graphs
- Memory Profiling: Heap usage, allocations, leaks, garbage collection
- I/O Profiling: File system, database, network latency
- Network Profiling: Request timing, bandwidth, connection pooling
- Concurrency: Thread utilization, lock contention, async operations
- Algorithm Analysis: Time complexity, space complexity
- Cache Analysis: Hit rates, cache misses, invalidation patterns
- Database: Query performance, N+1 problems, index usage
Features
Core Capabilities:
- Multi-dimensional performance profiling (CPU, memory, I/O, network)
- Automated bottleneck detection with prioritization
- Real-time profiling and historical analysis
- Flame graph generation for visual analysis
- Memory leak detection and heap snapshots
- Database query optimization
- Algorithmic complexity analysis
- A/B comparison of before/after optimizations
- Production-safe profiling with minimal overhead
- Integration with APM tools (New Relic, DataDog, etc.)
Profiling Modes:
- Quick Scan: 30-second lightweight profiling
- Standard: 5-minute comprehensive analysis
- Deep: 30-minute detailed investigation
- Continuous: Long-running production monitoring
- Stress Test: Load-based profiling under high traffic
Usage
Slash Command:
/profile [path] [--mode quick|standard|deep] [--target cpu|memory|io|network|all]
Subagent Invocation:
Task("Performance Profiler", "Profile ./app with deep CPU and memory analysis", "performance-analyzer")
MCP Tool:
mcp__performance-profiler__analyze({
project_path: "./app",
profiling_mode: "standard",
targets: ["cpu", "memory", "io"],
generate_optimizations: true
})
Architecture
Phase 1: Baseline Measurement
- Establish current performance metrics
- Define performance budgets
- Set up monitoring infrastructure
- Capture baseline snapshots
Phase 2: Bottleneck Detection
- CPU profiling (sampling or instrumentation)
- Memory profiling (heap analysis)
- I/O profiling (syscall tracing)
- Network profiling (packet analysis)
- Database profiling (query logs)
Phase 3: Root Cause Analysis
- Correlate metrics across dimensions
- Identify causal relationships
- Calculate performance impact
- Prioritize issues by severity
Phase 4: Optimization Generation
- Algorithmic improvements
- Caching strategies
- Parallelization opportunities
- Database query optimization
- Memory optimization
- Network optimization
Phase 5: Implementation
- Generate optimized code with coder agent
- Apply database optimizations
- Configure caching layers
- Implement parallelization
Phase 6: Validation
- Run benchmark suite
- Compare before/after metrics
- Verify no regressions
- Generate performance report