From aura-frog
Systematic performance profiling and optimization. Use when performance issues are reported or suspected. Measure first, optimize second. Applies Pareto principle — find the 20% of code causing 80% of slowness, fix that, not the rest.
How this skill is triggered — by the user, by Claude, or both
Slash command
/aura-frog:perf-profilingWhen to use
slow, performance, profile, optimize speed, latency, memory leak, cpu usage, bottleneck, pareto, flamegraph, p95, p99, SLO
This skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
> **AI-consumed reference.** Optimized for Claude to read during execution.
AI-consumed reference. Optimized for Claude to read during execution. Human-readable explanation: see docs/architecture/HIERARCHICAL_PLANNING.md or docs/getting-started/ depending on topic.
Rule 0: Don't optimize what you haven't measured. Almost all "obvious" optimizations are wrong.
Performance is relative. Before optimizing:
If no target → ask the user. Don't optimize without a goal — you'll polish forever.
Use the appropriate profiler:
| Language | Profiler |
|---|---|
| Node.js | node --prof, clinic.js, 0x |
| Browser JS | Chrome DevTools Performance tab |
| Python | cProfile, py-spy, memory_profiler |
| Go | pprof (built-in) |
| Rust | cargo flamegraph, perf |
| CLI | hyperfine |
| HTTP | wrk, k6, vegeta |
Run the profiler under realistic load, not trivial input. Capture for 30–60s minimum — short captures miss long-tail events.
Identify the top 3 functions by:
Pareto check: Is there a clear 80/20?
For the bottleneck:
Common bottleneck classes + fixes:
| Bottleneck | Fix |
|---|---|
| O(n²) on large n | Change to O(n log n) or O(n) |
| Sync I/O in hot path | Async, batch, or remove the I/O |
| Allocations in loop | Pre-allocate, object pool, reuse |
| Redundant computation | Memoize, cache result |
| Lock contention | Lock-free structure, sharding, immutable data |
| Large object serialization | Streaming, lazy fields, columnar format |
| Database N+1 | Join, prefetch, dataloader pattern |
| Cold cache / page fault | Warm up, prefetch, locality |
One change at a time. Multiple simultaneous changes = unknown which one helped.
Measure the same workload after the change. Compute speedup. If < 10% improvement on the targeted bottleneck: wrong hypothesis — revert, try next.
Optimization can break correctness OR slow other paths. Run:
In PR or commit message:
map with a for loop "for speed" when the bottleneck is elsewhereIf profiling shows a flat distribution (no single bottleneck), OR if the target is 10× faster: individual optimizations won't close the gap. Options:
These are architectural calls. Use self-consistency for trade-off analysis, tree-of-thoughts for exploring design branches.
## Performance Profile: [task / endpoint / function]
**Baseline:** p50=Xms, p95=Yms, p99=Zms, memory=N MB
**Target:** p95 < Wms (source: [SLO / user request])
**Gap:** Yms − Wms = Kms to close
**Bottleneck:** [function/query/operation] — X% of total time
**Root Cause:** [why it's slow]
**Optimization Applied:** [single change]
**After:** p50=X'ms, p95=Y'ms, p99=Z'ms
**Speedup:** [factor]
**Correctness:** [tests pass]
**Broader Impact:** [other metrics checked, no regressions]
skills/self-consistency/SKILL.md — for architectural decisionsskills/tree-of-thoughts/SKILL.md — explore optimization branchesrules/core/verification.md — measure before + after, not just aftercommands/check.md — /check perf uses this skillrules/core/simplicity-over-complexity.md — the winning optimization is usually "do less," not "do the same thing with a clever structure"npx claudepluginhub nguyenthienthanh/aura-frog --plugin aura-frogMake code measurably faster or leaner without breaking it: define a target, measure a baseline, profile to find the actual bottleneck, apply optimizations in order of leverage, and re-verify correctness.
Investigates and fixes performance issues (slow responses, high memory, CPU spikes) using a measure-first methodology: profile before guessing, baseline before fixing, re-measure after changes.
Profiles and optimizes performance with a mandatory baseline-first gate. Use when something is slow or you need to hit a latency/throughput target.