ワンクリックで
perf
Profile, benchmark, and optimize application performance.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Profile, benchmark, and optimize application performance.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
| name | perf |
| description | Profile, benchmark, and optimize application performance. |
Profile, benchmark, and optimize application performance.
/perf [target] [--profile] [--benchmark] [--lighthouse]
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)When this skill is invoked:
Autonomy:
Safety:
Establish current performance metrics before changing anything.
Web (Next.js / React):
# Lighthouse CI
npx lighthouse http://localhost:3000 --output json --output-path ./perf-baseline.json
# Bundle analysis
npx @next/bundle-analyzer
# or
npx webpack-bundle-analyzer stats.json
Python (FastAPI):
# Endpoint profiling
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
# Load testing
uv run locust -f tests/load/locustfile.py
iOS:
Instruments → Time Profiler, Allocations, Network
Xcode → Debug Navigator → CPU / Memory / Network gauges
Android:
Android Studio → Profiler → CPU / Memory / Network
./gradlew benchmark
Analyze profiling results and categorize:
| Category | Symptoms | Common Causes |
|---|---|---|
| Slow queries | High DB time, N+1 | Missing indexes, unoptimized joins |
| Memory leaks | Growing memory, OOM | Unclosed connections, retained references |
| Bundle size | Slow page load | Large dependencies, no tree-shaking |
| Render perf | Janky UI, low FPS | Unnecessary re-renders, large lists |
| Network | Slow API calls | No caching, large payloads, no compression |
Apply targeted fixes based on findings:
Database:
API:
Frontend:
Mobile:
FlatList / LazyColumn / LazyVStack for listsMeasure again and compare:
## Performance Comparison
| Metric | Before | After | Change |
|--------|--------|-------|--------|
| API Response (p95) | 450ms | 120ms | -73% |
| Bundle Size | 1.2MB | 680KB | -43% |
| Lighthouse Score | 62 | 94 | +52% |
| Memory Usage | 256MB | 180MB | -30% |
| DB Query Count | 47 | 12 | -74% |
Run full test suite to confirm no regressions:
{test_all_command}
## Performance Report
**Target:** {what was analyzed}
**Date:** {date}
### Baseline Metrics
{metrics before optimization}
### Bottlenecks Found
1. {bottleneck}: {impact}
2. {bottleneck}: {impact}
### Optimizations Applied
1. {change}: {expected improvement}
2. {change}: {expected improvement}
### Results
{metrics after optimization with comparison}
### Recommendations
- {further optimizations not yet applied}
$ /perf /api/users --profile
Profiling /api/users endpoint...
Baseline (10 requests, p95):
Response time: 450ms
DB queries: 47
Memory: 45MB
Bottlenecks found:
1. N+1 query on user.posts (38 extra queries)
2. No index on users.email (full table scan)
3. Serializing unused fields (posts.body)
Applying fixes...
Added eager loading for user.posts
Created index on users.email
Added field selection to query
Results:
Response time: 120ms (-73%)
DB queries: 3 (-94%)
Memory: 38MB (-16%)
All tests passing (142/142).
Write a structured handoff at session end. Preserves context so the next agent can resume without human briefing. Invoke before ending any feature session longer than 30 minutes.
Multi-perspective code review against project standards with P1/P2/P3 severity classification. Works in Claude Code (Agent + optional GitHub MCP) and Cursor (Task subagents + gh/git). Use when the user invokes /review, asks for a PR or diff review, or wants a standards-aligned review with severity tags.
Multi-perspective code review (P1/P2/P3) for Cursor: inline checklists plus three parallel Task subagents (perf-auditor, security-reviewer, simplicity-reviewer with combined data-integrity prompt). Use when the user invokes /review, asks for a PR review, or wants repo-standard findings with severity.
Create well-formatted git commits following conventional commit standards.
Red→green→refactor discipline for new behavior — forces a failing test before implementation and a passing test before any claim of done.
Create or manage a git worktree for isolated parallel development — lets multiple agents work in the repo simultaneously without branch collisions.