| name | perf |
| description | Profile, benchmark, and optimize application performance. |
/perf
Profile, benchmark, and optimize application performance.
Usage
/perf [target] [--profile] [--benchmark] [--lighthouse]
Arguments
target: File, endpoint, component, or area to analyze
--profile: Run profiler and identify bottlenecks
--benchmark: Run benchmarks and compare
--lighthouse: Run Lighthouse audit (web only)
Instructions
When this skill is invoked:
Agent Behavior
Autonomy:
- Identify bottlenecks and implement optimizations
- Measure before and after to prove improvement
- Follow platform-specific best practices
Safety:
- Never optimize without measuring first
- Keep optimizations readable — don't sacrifice clarity
- Run tests after every optimization to prevent regressions
Performance Process
Phase 1: Measure Baseline
Establish current performance metrics before changing anything.
Web (Next.js / React):
npx lighthouse http://localhost:3000 --output json --output-path ./perf-baseline.json
npx @next/bundle-analyzer
npx webpack-bundle-analyzer stats.json
Python (FastAPI):
uv run python -m cProfile -o profile.out src/{project}/main.py
uv run py-spy record -o profile.svg -- python src/{project}/main.py
uv run locust -f tests/load/locustfile.py