Skip to main content
command CX Codex

performance-optimization · ormus-solutions — Claude Code command

performance-optimization coordinates end-to-end performance audits, database optimizations, frontend tuning, and load testing.

MIT ★ 126 updated 2026-10-04

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add Ormus-Solutions/LibreUIUX-Claude-Code
/plugin install application-performance@libreuiux
Open on GitHub

What performance-optimization does

This workflow delegates profiling and refactoring tasks across specialised agents. It starts by assigning performance-engineer and observability-engineer to trace bottlenecks, capture flame graphs, evaluate OpenTelemetry instrumentation, and track Core Web Vitals. Findings feed directly into subsequent layers.

Next, database and backend specialists inspect slow queries, configure indexes, implement Redis or Memcached caching, and resolve N+1 overhead. Frontend and cloud architects then handle asset splitting, CloudFront or Cloudflare CDN caching, and Brotli compression. If load generators like k6, Gatling, or Artillery are missing from your environment, agents cannot complete the automated validation phase.

What it helps with

  • identify CPU hot paths, memory leaks, and inefficient database queries
  • streamline API responses and resolve N+1 bottlenecks across services
  • trim frontend assets and improve Core Web Vitals metrics
  • verify service reliability under peak traffic using load testing tools

Example prompts for the agent

  • /performance-optimization checkout service
  • /performance-optimization user onboarding flow
  • /performance-optimization search API and caching layer

How to install performance-optimization

1Plugin marketplace

/plugin marketplace add Ormus-Solutions/LibreUIUX-Claude-Code
/plugin install application-performance@libreuiux

2Manually: put the files in place

.claude/commands/performance-optimization.md

Call it with /performance-optimization. For all projects use ~/.claude/commands/

Questions about performance-optimization

How do I install performance-optimization in Claude Code?

Add the repository using /plugin marketplace add Ormus-Solutions/LibreUIUX-Claude-Code, then install it by running /plugin install application-performance@libreuiux.

What does the performance-optimization command do?

It orchestrates deep profiling, database tuning, API refactoring, frontend asset trimming, and load testing across distinct subagents.

Which external tools are involved in this workflow?

The prompts reference APM platforms like DataDog or New Relic, OpenTelemetry tracing, and load testing utilities such as k6, Artillery, or Gatling.

Source text

performance-optimization.md · MIT
---
description: "Profile an application end to end and run a coordinated performance optimization"
argument-hint: "[application or area to optimize]"
---

Optimize application performance end-to-end using specialized performance and optimization agents:

[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.]

## Phase 1: Performance Profiling & Baseline

### 1. Comprehensive Performance Profiling
- Use Task tool with subagent_type="performance-engineer"
- 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."
- Context: Initial performance investigation
- Output: Detailed performance profile with flame graphs, memory analysis, bottleneck identification, baseline metrics

### 2. Observability Stack Assessment
- Use Task tool with subagent_type="observability-engineer"
- 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."
- Context: Performance profile from step 1
- Output: Observability assessment report, instrumentation gaps, monitoring recommendations

### 3. User Experience Analysis
- Use Task tool with subagent_type="performance-engineer"
- 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."
- Context: Performance baselines from step 1
- Output: UX performance report, Core Web Vitals analysis, user impact assessment

## Phase 2: Database & Backend Optimization

### 4. Database Performance Optimization
- Use Task tool with subagent_type="database-cloud-optimization::database-optimizer"
- 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."
- Context: Performance bottlenecks from phase 1
- Output: Optimized queries, new indexes, caching strategy, connection pool configuration

### 5. Backend Code & API Optimization
- Use Task tool with subagent_type="backend-development::backend-architect"
- 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."
- Context: Database optimizations from step 4, profiling data from phase 1
- Output: Optimized backend code, caching implementation, API improvements, resilience patterns

### 6. Microservices & Distributed System Optimization
- Use Task tool with subagent_type="performance-engineer"
- 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."
- Context: Backend optimizations from step 5
- Output: Service communication improvements, message queue optimization, distributed caching setup

## Phase 3: Frontend & CDN Optimization

### 7. Frontend Bundle & Loading Optimization
- Use Task tool with subagent_type="frontend-developer"
- 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."
- Context: UX analysis from phase 1, backend optimizations from phase 2
- Output: Optimized bundles, lazy loading implementation, improved Core Web Vitals

### 8. CDN & Edge Optimization
- Use Task tool with subagent_type="cloud-infrastructure::cloud-architect"
- 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."
- Context: Frontend optimizations from step 7
- Output: CDN configuration, edge caching rules, compression setup, geographic optimization

### 9. Mobile & Progressive Web App Optimization
- Use Task tool with subagent_type="frontend-mobile-development::mobile-developer"
- 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."
- Context: Frontend optimizations from steps 7-8
- Output: Mobile-optimized code, PWA implementation, offline functionality

## Phase 4: Load Testing & Validation

### 10. Comprehensive Load Testing
- Use Task tool with subagent_type="performance-engineer"
- 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."
- Context: All optimizations from phases 1-3
- Output: Load test results, performance under load, breaking points, scalability analysis

### 11. Performance Regression Testing
- Use Task tool with subagent_type="performance-testing-review::test-automator"
- 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."
- Context: Load test results from step 10, baseline metrics from phase 1
- Output: Performance test suite, CI/CD integration, regression prevention system

## Phase 5: Monitoring & Continuous Optimization

### 12. Production Monitoring Setup
- Use Task tool with subagent_type="observability-engineer"
- 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."
- Context: Performance improvements from all previous phases
- Output: Monitoring dashboards, alert rules, SLI/SLO definitions, runbooks

### 13. Continuous Performance Optimization
- Use Task tool with subagent_type="performance-engineer"
- 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."
- Context: Monitoring setup from step 12, all previous optimization work
- Output: Performance budget tracking, optimization backlog, capacity planning, review process

## Configuration Options

- **performance_focus**: "latency" | "throughput" | "cost" | "balanced" (default: "balanced")
- **optimization_depth**: "quick-wins" | "comprehensive" | "enterprise" (default: "comprehensive")
- **tools_available**: ["datadog", "newrelic", "prometheus", "grafana", "k6", "gatling"]
- **budget_constraints**: Set maximum acceptable costs for infrastructure changes
- **user_impact_tolerance**: "zero-downtime" | "maintenance-window" | "gradual-rollout"

## Success Criteria

- **Response Time**: P50 < 200ms, P95 < 1s, P99 < 2s for critical endpoints
- **Core Web Vitals**: LCP < 2.5s, FID < 100ms, CLS < 0.1
- **Throughput**: Support 2x current peak load with <1% error rate
- **Database Performance**: Query P95 < 100ms, no queries > 1s
- **Resource Utilization**: CPU < 70%, Memory < 80% under normal load
- **Cost Efficiency**: Performance per dollar improved by minimum 30%
- **Monitoring Coverage**: 100% of critical paths instrumented with alerting

Performance optimization target: $ARGUMENTS

© Seth Hobson · MIT · Ormus-Solutions/LibreUIUX-Claude-Code

Similar slash commands

All slash commands for DevOps and infrastructure →

performance-optimization by other authors comes first.

performance-optimization Seth Hobson performance-optimization orchestrates application performance profiling and optimization through dedicated subagents. Tracks progress via disk state and pauses at approval checkpoints. CX Codex +1 ★ 42,780repo stars performance-engineer VoltAgent Community performance-engineer — a Claude Code subagent designed to identify performance bottlenecks across code, databases, and infrastructure under heavy load. CX Codex 671installs application-performance-performance-engineer Seth Hobson The application-performance-performance-engineer subagent helps investigate application bottlenecks through profiling, traces, and load-test results. Use it for performance and scalability work. CX Codex ★ 42,780repo stars magento-performance-analyst maxnorm magento-performance-analyst — a skill that walks the agent through Magento 2 profiling: finding bottlenecks, reading slow queries, planning optimizations. CX Codex +1 449installs optimizing-performance CloudAI-X optimizing-performance guides performance profiling and tuning across frontend, backend, and database layers. It enforces measuring baselines before touching code and verifying against latency targets. CX Codex +1 ★ 1,424repo stars performance-testing aj-geddes performance-testing — a skill that walks your agent through designing load tests and benchmarks: response times, throughput, resource use. CX Codex +1 611installs python-performance-optimization Seth Hobson The python-performance-optimization skill profiles Python code to locate CPU and memory bottlenecks. Use it when an application responds slowly or consumes too many resources. CX Codex +1 35,675installs

From the same set42

The whole set →
debugging-toolkit debugging-toolkit adds the /smart-debug command and two subagents to Claude Code for root cause analysis and workspace tuning. Useful when investigating test failures or production errors. ★ 126repo stars full-review full-review runs a phased multi-agent code audit in Claude Code. Inspects architecture, OWASP vulnerabilities, runtime bottlenecks, and test suites. CX Codex +1 ★ 126repo stars full-stack-feature full-stack-feature runs feature work through four phases — schema design, API contracts, parallel implementation, testing — by delegating each step to a specialized subagent. Takes a feature description as its argument. CX Codex +1 ★ 126repo stars security-hardening The security-hardening command hardens an application through coordinated security agents. Use it to assess vulnerabilities, fix high-risk issues, and add layered controls. CX Codex +1 ★ 126repo stars incident-response The incident-response command coordinates incident triage, investigation, mitigation, and recovery. Give it an incident description to start a staged response. CX Codex +1 ★ 126repo stars ui-responsive The ui-responsive command analyzes a component or page at five breakpoints and gives specific fixes for mobile, tablet and desktop layouts. CX Codex +1 ★ 126repo stars jungian-archetypes jungian-archetypes maps twelve brand archetypes to UI layout, typography, animations, and Tailwind styling. CX Codex +1 ★ 126repo stars feature-development feature-development is a Claude Code command that coordinates feature work from requirements through deployment preparation. It starts from a feature description. CX Codex +1 ★ 126repo stars

Project sponsors

Companies that keep this analytics open