{"aiPlatform":"claude-code@2025.06","category":"performance-optimization","commandName":"/performance-optimization","content":"---\nname: Performance Optimization\ndescription: Optimize application performance end-to-end using specialized performance and optimization agents\nallowed_tools:\n  - memory          # For storing performance metrics and optimization strategies\n  - filesystem      # For implementing optimizations across frontend, backend, and infrastructure\ntags:\n  - performance\n  - optimization\n  - backend\n  - frontend\n  - database\n  - infrastructure\n  - monitoring\n  - testing\n  - workflow\ncategory: development\nversion: 2.0.0\nauthor: AI Commands Team\n---\n\nOptimize application performance end-to-end using specialized performance and optimization agents:\n\n[Extended thinking: This workflow coordinates multiple agents to identify and fix performance bottlenecks across the entire stack. From database queries to frontend rendering, each agent contributes their expertise to create a highly optimized application.]\n\n## Phase 1: Performance Analysis\n\n### 1. Application Profiling\n- Use Task tool with subagent_type=\"performance-engineer\"\n- Prompt: \"Profile application performance for: $ARGUMENTS. Identify CPU, memory, and I/O bottlenecks. Include flame graphs, memory profiles, and resource utilization metrics.\"\n- Output: Performance profile, bottleneck analysis, optimization priorities\n\n### 2. Database Performance Analysis\n- Use Task tool with subagent_type=\"database-optimizer\"\n- Prompt: \"Analyze database performance for: $ARGUMENTS. Review query execution plans, identify slow queries, check indexing, and analyze connection pooling.\"\n- Output: Query optimization report, index recommendations, schema improvements\n\n## Phase 2: Backend Optimization\n\n### 3. Backend Code Optimization\n- Use Task tool with subagent_type=\"performance-engineer\"\n- Prompt: \"Optimize backend code for: $ARGUMENTS based on profiling results. Focus on algorithm efficiency, caching strategies, and async operations.\"\n- Output: Optimized code, caching implementation, performance improvements\n\n### 4. API Optimization\n- Use Task tool with subagent_type=\"backend-architect\"\n- Prompt: \"Optimize API design and implementation for: $ARGUMENTS. Consider pagination, response compression, field filtering, and batch operations.\"\n- Output: Optimized API endpoints, GraphQL query optimization, response time improvements\n\n## Phase 3: Frontend Optimization\n\n### 5. Frontend Performance\n- Use Task tool with subagent_type=\"frontend-developer\"\n- Prompt: \"Optimize frontend performance for: $ARGUMENTS. Focus on bundle size, lazy loading, code splitting, and rendering performance. Implement Core Web Vitals improvements.\"\n- Output: Optimized bundles, lazy loading implementation, performance metrics\n\n### 6. Mobile App Optimization\n- Use Task tool with subagent_type=\"mobile-developer\"\n- Prompt: \"Optimize mobile app performance for: $ARGUMENTS. Focus on startup time, memory usage, battery efficiency, and offline performance.\"\n- Output: Optimized mobile code, reduced app size, improved battery life\n\n## Phase 4: Infrastructure Optimization\n\n### 7. Cloud Infrastructure Optimization\n- Use Task tool with subagent_type=\"cloud-architect\"\n- Prompt: \"Optimize cloud infrastructure for: $ARGUMENTS. Review auto-scaling, instance types, CDN usage, and geographic distribution.\"\n- Output: Infrastructure improvements, cost optimization, scaling strategy\n\n### 8. Deployment Optimization\n- Use Task tool with subagent_type=\"deployment-engineer\"\n- Prompt: \"Optimize deployment and build processes for: $ARGUMENTS. Improve CI/CD performance, implement caching, and optimize container images.\"\n- Output: Faster builds, optimized containers, improved deployment times\n\n## Phase 5: Monitoring and Validation\n\n### 9. Performance Monitoring Setup\n- Use Task tool with subagent_type=\"devops-troubleshooter\"\n- Prompt: \"Set up comprehensive performance monitoring for: $ARGUMENTS. Include APM, real user monitoring, and custom performance metrics.\"\n- Output: Monitoring dashboards, alert thresholds, SLO definitions\n\n### 10. Performance Testing\n- Use Task tool with subagent_type=\"test-automator\"\n- Prompt: \"Create performance test suites for: $ARGUMENTS. Include load tests, stress tests, and performance regression tests.\"\n- Output: Performance test suite, benchmark results, regression prevention\n\n## Coordination Notes\n- Performance metrics guide optimization priorities\n- Each optimization must be validated with measurements\n- Consider trade-offs between different performance aspects\n- Document all optimizations and their impact\n\nPerformance optimization target: $ARGUMENTS","contentHash":"dd9241bd48a476f8f9618016b21c3a60935aa367b7a5751ec80e61393493d592","copies":0,"createdAt":"2025-08-12T16:09:34.623Z","description":"End-to-end optimization with performance subagents","github":{"repoUrl":"https://github.com/Commands-com/commands","lastSyncDirection":"from-github","metadata":{"importedFrom":"github_repository","repoPrivate":false,"repoDefaultBranch":"main","connectedAt":"2025-08-12T16:09:34.623Z"},"importedAt":"2025-08-12T16:09:34.623Z","lastSyncAt":"2025-08-17T17:57:46.494Z","fileMapping":{"license":null,"readme":null,"assets":[],"mainFile":"workflows/performance-optimization.md"},"selectedCommand":"performance-optimization","fileShas":{"mainFile":"cd301b912b14ad74aa037cd831c3ffcbe4a05c52","yamlPath":"313647b1fb381389da33b7913e95baf617c4b392"},"branch":"main","connectionType":"commands_yaml","connected":true,"lastSyncCommit":"01591bc061d236bde47bf23b0f47e8afcf1a5144","importSource":"repository_import","installationId":"69232615","syncStatus":"synced"},"githubRepoUrl":"https://github.com/Commands-com/commands","id":"7e2f8916-bfa8-4823-bbdf-1cc293b2bcd2","inputParameters":[{"defaultValue":"latency","name":"optimization_target","options":["latency","throughput","memory","cpu","cost","all"],"description":"What to optimize for","label":"Optimization Target","type":"select","required":false},{"defaultValue":"25","name":"performance_goal","options":["10","25","50","75","90"],"description":"Target improvement percentage","label":"Performance Goal","type":"select","required":false}],"instructions":"End-to-end optimization with performance subagents","likes":0,"mcp_search_content":"","organizationUsername":"commands-com","price":"free","search_content":"performance optimization end-to-end optimization with performance subagents /performance-optimization performance-optimization claude-code@2025.06","title":"Performance Optimization","type":"command","updatedAt":"2025-08-17T17:57:46.494Z","userId":"W0V8NAw5AhWRwcuwSoFLOi1Yem83","visibility":"public","name":"performance-optimization","userInteraction":{"userHasStarred":false}}