Optimize end-to-end application performance with profiling, observability, and backend/frontend tuning. Use when coordinating performance optimization across the stack.
Add this skill
npx mdskills install sickn33/application-performance-performance-optimizationComprehensive 13-phase workflow orchestrating stack-wide performance optimization with clear metrics and validation
1---2name: application-performance-performance-optimization3description: "Optimize end-to-end application performance with profiling, observability, and backend/frontend tuning. Use when coordinating performance optimization across the stack."4---56Optimize application performance end-to-end using specialized performance and optimization agents:78[Extended thinking: This workflow orchestrates a comprehensive performance optimization process across the entire application stack. Starting with deep profiling and baseline establishment, the workflow progresses through targeted optimizations in each system layer, validates improvements through load testing, and establishes continuous monitoring for sustained performance. Each phase builds on insights from previous phases, creating a data-driven optimization strategy that addresses real bottlenecks rather than theoretical improvements. The workflow emphasizes modern observability practices, user-centric performance metrics, and cost-effective optimization strategies.]910## Use this skill when1112- Coordinating performance optimization across backend, frontend, and infrastructure13- Establishing baselines and profiling to identify bottlenecks14- Designing load tests, performance budgets, or capacity plans15- Building observability for performance and reliability targets1617## Do not use this skill when1819- The task is a small localized fix with no broader performance goals20- There is no access to metrics, tracing, or profiling data21- The request is unrelated to performance or scalability2223## Instructions24251. Confirm performance goals, constraints, and target metrics.262. Establish baselines with profiling, tracing, and real-user data.273. Execute phased optimizations across the stack with measurable impact.284. Validate improvements and set guardrails to prevent regressions.2930## Safety3132- Avoid load testing production without approvals and safeguards.33- Roll out performance changes gradually with rollback plans.3435## Phase 1: Performance Profiling & Baseline3637### 1. Comprehensive Performance Profiling3839- Use Task tool with subagent_type="performance-engineer"40- Prompt: "Profile application performance comprehensively for: $ARGUMENTS. Generate flame graphs for CPU usage, heap dumps for memory analysis, trace I/O operations, and identify hot paths. Use APM tools like DataDog or New Relic if available. Include database query profiling, API response times, and frontend rendering metrics. Establish performance baselines for all critical user journeys."41- Context: Initial performance investigation42- Output: Detailed performance profile with flame graphs, memory analysis, bottleneck identification, baseline metrics4344### 2. Observability Stack Assessment4546- Use Task tool with subagent_type="observability-engineer"47- Prompt: "Assess current observability setup for: $ARGUMENTS. Review existing monitoring, distributed tracing with OpenTelemetry, log aggregation, and metrics collection. Identify gaps in visibility, missing metrics, and areas needing better instrumentation. Recommend APM tool integration and custom metrics for business-critical operations."48- Context: Performance profile from step 149- Output: Observability assessment report, instrumentation gaps, monitoring recommendations5051### 3. User Experience Analysis5253- Use Task tool with subagent_type="performance-engineer"54- Prompt: "Analyze user experience metrics for: $ARGUMENTS. Measure Core Web Vitals (LCP, FID, CLS), page load times, time to interactive, and perceived performance. Use Real User Monitoring (RUM) data if available. Identify user journeys with poor performance and their business impact."55- Context: Performance baselines from step 156- Output: UX performance report, Core Web Vitals analysis, user impact assessment5758## Phase 2: Database & Backend Optimization5960### 4. Database Performance Optimization6162- Use Task tool with subagent_type="database-cloud-optimization::database-optimizer"63- Prompt: "Optimize database performance for: $ARGUMENTS based on profiling data: {context_from_phase_1}. Analyze slow query logs, create missing indexes, optimize execution plans, implement query result caching with Redis/Memcached. Review connection pooling, prepared statements, and batch processing opportunities. Consider read replicas and database sharding if needed."64- Context: Performance bottlenecks from phase 165- Output: Optimized queries, new indexes, caching strategy, connection pool configuration6667### 5. Backend Code & API Optimization6869- Use Task tool with subagent_type="backend-development::backend-architect"70- Prompt: "Optimize backend services for: $ARGUMENTS targeting bottlenecks: {context_from_phase_1}. Implement efficient algorithms, add application-level caching, optimize N+1 queries, use async/await patterns effectively. Implement pagination, response compression, GraphQL query optimization, and batch API operations. Add circuit breakers and bulkheads for resilience."71- Context: Database optimizations from step 4, profiling data from phase 172- Output: Optimized backend code, caching implementation, API improvements, resilience patterns7374### 6. Microservices & Distributed System Optimization7576- Use Task tool with subagent_type="performance-engineer"77- Prompt: "Optimize distributed system performance for: $ARGUMENTS. Analyze service-to-service communication, implement service mesh optimizations, optimize message queue performance (Kafka/RabbitMQ), reduce network hops. Implement distributed caching strategies and optimize serialization/deserialization."78- Context: Backend optimizations from step 579- Output: Service communication improvements, message queue optimization, distributed caching setup8081## Phase 3: Frontend & CDN Optimization8283### 7. Frontend Bundle & Loading Optimization8485- Use Task tool with subagent_type="frontend-developer"86- Prompt: "Optimize frontend performance for: $ARGUMENTS targeting Core Web Vitals: {context_from_phase_1}. Implement code splitting, tree shaking, lazy loading, and dynamic imports. Optimize bundle sizes with webpack/rollup analysis. Implement resource hints (prefetch, preconnect, preload). Optimize critical rendering path and eliminate render-blocking resources."87- Context: UX analysis from phase 1, backend optimizations from phase 288- Output: Optimized bundles, lazy loading implementation, improved Core Web Vitals8990### 8. CDN & Edge Optimization9192- Use Task tool with subagent_type="cloud-infrastructure::cloud-architect"93- Prompt: "Optimize CDN and edge performance for: $ARGUMENTS. Configure CloudFlare/CloudFront for optimal caching, implement edge functions for dynamic content, set up image optimization with responsive images and WebP/AVIF formats. Configure HTTP/2 and HTTP/3, implement Brotli compression. Set up geographic distribution for global users."94- Context: Frontend optimizations from step 795- Output: CDN configuration, edge caching rules, compression setup, geographic optimization9697### 9. Mobile & Progressive Web App Optimization9899- Use Task tool with subagent_type="frontend-mobile-development::mobile-developer"100- Prompt: "Optimize mobile experience for: $ARGUMENTS. Implement service workers for offline functionality, optimize for slow networks with adaptive loading. Reduce JavaScript execution time for mobile CPUs. Implement virtual scrolling for long lists. Optimize touch responsiveness and smooth animations. Consider React Native/Flutter specific optimizations if applicable."101- Context: Frontend optimizations from steps 7-8102- Output: Mobile-optimized code, PWA implementation, offline functionality103104## Phase 4: Load Testing & Validation105106### 10. Comprehensive Load Testing107108- Use Task tool with subagent_type="performance-engineer"109- Prompt: "Conduct comprehensive load testing for: $ARGUMENTS using k6/Gatling/Artillery. Design realistic load scenarios based on production traffic patterns. Test normal load, peak load, and stress scenarios. Include API testing, browser-based testing, and WebSocket testing if applicable. Measure response times, throughput, error rates, and resource utilization at various load levels."110- Context: All optimizations from phases 1-3111- Output: Load test results, performance under load, breaking points, scalability analysis112113### 11. Performance Regression Testing114115- Use Task tool with subagent_type="performance-testing-review::test-automator"116- Prompt: "Create automated performance regression tests for: $ARGUMENTS. Set up performance budgets for key metrics, integrate with CI/CD pipeline using GitHub Actions or similar. Create Lighthouse CI tests for frontend, API performance tests with Artillery, and database performance benchmarks. Implement automatic rollback triggers for performance regressions."117- Context: Load test results from step 10, baseline metrics from phase 1118- Output: Performance test suite, CI/CD integration, regression prevention system119120## Phase 5: Monitoring & Continuous Optimization121122### 12. Production Monitoring Setup123124- Use Task tool with subagent_type="observability-engineer"125- Prompt: "Implement production performance monitoring for: $ARGUMENTS. Set up APM with DataDog/New Relic/Dynatrace, configure distributed tracing with OpenTelemetry, implement custom business metrics. Create Grafana dashboards for key metrics, set up PagerDuty alerts for performance degradation. Define SLIs/SLOs for critical services with error budgets."126- Context: Performance improvements from all previous phases127- Output: Monitoring dashboards, alert rules, SLI/SLO definitions, runbooks128129### 13. Continuous Performance Optimization130131- Use Task tool with subagent_type="performance-engineer"132- Prompt: "Establish continuous optimization process for: $ARGUMENTS. Create performance budget tracking, implement A/B testing for performance changes, set up continuous profiling in production. Document optimization opportunities backlog, create capacity planning models, and establish regular performance review cycles."133- Context: Monitoring setup from step 12, all previous optimization work134- Output: Performance budget tracking, optimization backlog, capacity planning, review process135136## Configuration Options137138- **performance_focus**: "latency" | "throughput" | "cost" | "balanced" (default: "balanced")139- **optimization_depth**: "quick-wins" | "comprehensive" | "enterprise" (default: "comprehensive")140- **tools_available**: ["datadog", "newrelic", "prometheus", "grafana", "k6", "gatling"]141- **budget_constraints**: Set maximum acceptable costs for infrastructure changes142- **user_impact_tolerance**: "zero-downtime" | "maintenance-window" | "gradual-rollout"143144## Success Criteria145146- **Response Time**: P50 < 200ms, P95 < 1s, P99 < 2s for critical endpoints147- **Core Web Vitals**: LCP < 2.5s, FID < 100ms, CLS < 0.1148- **Throughput**: Support 2x current peak load with <1% error rate149- **Database Performance**: Query P95 < 100ms, no queries > 1s150- **Resource Utilization**: CPU < 70%, Memory < 80% under normal load151- **Cost Efficiency**: Performance per dollar improved by minimum 30%152- **Monitoring Coverage**: 100% of critical paths instrumented with alerting153154Performance optimization target: $ARGUMENTS155
Full transparency — inspect the skill content before installing.