Sub-Agent Performance Optimizer Command banner
derek-opdee derek-opdee

Sub-Agent Performance Optimizer Command

DevOps & Infrastructure community intermediate

Description

Optimizes application performance across the entire stack using specialized agents for frontend, backend, database, and infrastructure optimization.

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

Repository README

This is the README for derek-codebridge/subagent-example-script, shared by 8 entries in this directory. It describes the repository, not this entry specifically.

Sub-Agent Performance Optimizer Command

Optimizes application performance across the entire stack using specialized agents for frontend, backend, database, and infrastructure optimization.

Command Syntax

sub-agent-performance-optimizer [target] [options]

# Aliases
@perf-optimize [target] [options]
@performance [target] [options]
@sapo [target] [options]

Parameters

  • target - Directory or specific area to optimize
  • --target - Optimization target (frontend, backend, database, all)
  • --bundle-analysis - Analyze JavaScript bundles
  • --suggest-indexes - Database index recommendations
  • --baseline - Compare against performance baseline
  • --profile - Generate performance profiles
  • --tree-shake - Aggressive tree shaking
  • --cache-strategy - Generate caching recommendations
  • --output - Report format (text, json, html)
  • --auto-fix - Apply safe optimizations

Examples

# Frontend bundle optimization
@perf-optimize src/ --target frontend --bundle-analysis

# Database query optimization
@perf-optimize --target database --suggest-indexes

# Full stack optimization
@performance . --baseline perf-baseline.json

# WordPress specific optimization
@perf-optimize wp-content/ --target wordpress --cache-strategy

Agent Orchestration

Stage 1: Analysis Agents (Parallel)

Agent 1: Frontend Performance Analyzer

Analyze frontend performance in [TARGET]

Tasks:
1. Bundle Analysis:
   - Bundle sizes by chunk
   - Duplicate modules
   - Tree shaking opportunities
   - Code splitting points
   - Unused exports
   - Large dependencies

2. React/Component Performance:
   - Unnecessary re-renders
   - Missing React.memo
   - useCallback/useMemo opportunities
   - Large component trees
   - Expensive computations
   - State management overhead

3. Asset Optimization:
   - Unoptimized images
   - Missing lazy loading
   - Font loading strategy
   - CSS optimization
   - Script loading order
   - Resource hints missing

4. Runtime Performance:
   - Long tasks (>50ms)
   - Memory leaks
   - DOM manipulation cost
   - Event listener overhead
   - Animation performance
   - Third-party impact

Return:
- Bundle size breakdown
- Performance bottlenecks
- Optimization opportunities
- Load time analysis
- Runtime metrics

Agent 2: Backend Performance Analyzer

Analyze backend performance in [TARGET]

Tasks:
1. API Performance:
   - Response time analysis
   - N+1 query detection
   - Slow endpoints
   - Payload sizes
   - Serialization overhead
   - Rate limiting needs

2. Laravel/PHP Specific:
   - Eager loading missing
   - Query builder inefficiency
   - Cache opportunities
   - Queue usage
   - Service container overhead
   - Middleware performance

3. Cloudflare Workers:
   - Cold start times
   - KV/D1 query patterns
   - Subrequest optimization
   - CPU time usage
   - Memory consumption
   - Bundle size impact

4. Resource Usage:
   - Memory patterns
   - CPU hotspots
   - I/O bottlenecks