agent-browser-automati…
Automate browser interactions for development testing using Puppeteer MCP
Systematic performance bottleneck analysis and optimization across application stack
How it fires
How this command gets triggered: by you, by Claude, or both.
/bottleneckContext preview
What this command does when you run it.
Systematic performance bottleneck analysis and optimization across application stack
allowed-tools: Bash(top:*), Bash(htop:*), Bash(iostat:*), Bash(free:*), Bash(uptime:*), Bash(ps:*), Bash(netstat:*), Bash(rg:*), Bash(fd:*), Bash(jq:*), Bash(gdate:*), Bash(psql:*), Bash(mysql:*), Read, Write, Task name: "Bottleneck" description: "Systematic performance bottleneck analysis and optimization across application stack" author: "wcygan" tags: ["code","analyze"] version: "1.0.0" created_at: "2025-07-14T00:00:00Z" updated_at: "2025-07-14T00:00:00Z"
**IMMEDIATELY DEPLOY 10 PARALLEL PERFORMANCE ANALYSIS AGENTS** for ultra-fast comprehensive bottleneck analysis: **$ARGUMENTS**
Think deeply about comprehensive performance optimization while maximizing parallel execution for 10x speedup.
**CRITICAL**: Launch ALL agents simultaneously in first response - NO sequential processing.
STEP 1: **LAUNCH ALL 10 AGENTS SIMULTANEOUSLY**
**NO SEQUENTIAL PROCESSING** - Deploy these specialized performance analysis agents in parallel:
1. **CPU & Memory Analysis Agent**: CPU utilization patterns, memory allocation, garbage collection pressure, resource contention 2. **Database Performance Agent**: Query performance, index usage, connection pooling, slow queries, database-specific bottlenecks 3. **Network & I/O Agent**: Network latency, bandwidth utilization, disk I/O patterns, storage performance 4. **Application Code Profiling Agent**: Application logic, algorithmic inefficiencies, code-level performance issues, hot paths 5. **Infrastructure & Deployment Agent**: Monitoring tools, deployment configuration, system architecture bottlenecks 6. **Caching & Storage Agent**: Cache hit rates, storage efficiency, data access patterns, memory usage optimization 7. **Concurrency & Threading Agent**: Thread pool efficiency, lock contention, async patterns, parallel processing bottlenecks 8. **External Dependencies Agent**: Third-party API performance, service mesh latency, external database connections 9. **Resource Scaling Agent**: Auto-scaling efficiency, resource allocation patterns, capacity planning issues 10. **Monitoring & Observability Agent**: Existing monitoring gaps, alerting thresholds, performance baseline establishment
**Expected speedup**: 10x faster than sequential bottleneck analysis.
STEP 2: Initialize Parallel Session Management
// /tmp/bottleneck-analysis-$SESSION_ID.json
{
"sessionId": "$SESSION_ID",
"timestamp": "$(date -Iseconds)",
"target": "$ARGUMENTS",
"phase": "parallel_analysis",
"architecture": "auto-detect",
"analysis_domains": [
"cpu_memory",
"database",
"network_io",
"application_code",
"infrastructure",
"caching_storage",
"concurrency",
"external_deps",
"scaling",
"monitoring"
],
"baseline_metrics": {},
"discovered_bottlenecks": [],
"optimization_recommendations": [],
"monitoring_setup": {}
}STEP 3: Parallel Bottleneck Discovery & Analysis
**ALL AGENTS WORK CONCURRENTLY:**
**Performance Bottleneck Discovery Execution:**
# System metrics and performance indicators
CPU_USAGE=$(top -bn1 2>/dev/null | rg "Cpu\(s\)" | awk '{print $2}' | cut -d'%' -f1 || echo "0")
MEMORY_USED=$(free -h 2>/dev/null | awk 'NR==2{printf "%.1f", $3/$2*100}' || echo "0")
LOAD_AVG=$(uptime | awk -F'load average:' '{print $2}' || echo "0, 0, 0")
# Database and application patterns
rg "SELECT.*FROM|UPDATE.*SET|INSERT.*INTO" . --type sql -n | head -10
rg "sleep|wait|block|sync|lock" . -n | head -10
# Performance anti-patterns
rg "N\+1|nested.*loop|sequential.*scan" . -n
rg "synchronized|mutex|lock|await|Promise\.all" . -nTRY: Launch all 10 parallel agents for comprehensive bottleneck analysis Execute concurrent discovery across all performance dimensions Collect baseline metrics and performance indicators Synthesize findings from all agent results Generate optimization recommendations with impact estimates Update session state: phase = "bottleneck_analysis_complete"
CATCH (agent_failures): Continue with available agent results Document failed analysis areas Provide partial bottleneck assessment with gaps identified Generate basic optimization roadmap
FINALLY: Aggregate all parallel agent findings Create comprehensive bottleneck assessment matrix Generate structured optimization plan with effort estimates Save artifacts: bottleneck-analysis.md, optimization-roadmap.md Clean up temporary analysis files
STEP 4: **Parallel Results Synthesis**
WAIT for ALL 10 agents to complete bottleneck analysis AGGREGATE findings from all parallel streams:
A lightweight (~46kB) and comprehensive CLI tool for managing Claude commands, configurations, and workflows.
Repo: kiliczsh/claude-cmd
Automate browser interactions for development testing using Puppeteer MCP
Prepare branches for merging across multiple worktrees and coordinate integration
Transform into accessibility expert for WCAG compliance and inclusive design
Transform into an API design specialist who creates well-structured, developer-friendly APIs
Transform into backend specialist for scalable API and system design
Cloud architect persona for designing scalable, secure cloud infrastructure using modern cloud-native technologies