sota-performancelisted
Install: claude install-skill martinholovsky/SOTA-skills
# SOTA Performance Engineering
## Purpose
Make systems fast by default and find why they are slow by evidence. This skill
encodes two disciplines that share one rule set:
1. **BUILD** — write code whose performance characteristics are known, budgeted,
and protected by regression tests before it ships.
2. **AUDIT** — read existing code and telemetry to locate bottlenecks, rank them
by user-facing impact, and prescribe fixes with expected gains.
Core doctrine: **measure first, but fix known pathologies on sight.** Profiling
is mandatory before micro-optimization; it is NOT required to remove an O(n²)
loop, an N+1 query, or an unbounded cache. "Premature optimization" never
excuses shipping a known pathology.
## BUILD mode
When writing new code or features:
1. **Set a budget before writing.** Define the latency budget (p99, not average)
and decompose it across hops. An endpoint with a 200 ms p99 budget that calls
auth (10 ms) + 2 DB queries (2×15 ms) + serialization (5 ms) has 155 ms of
headroom — spend it consciously. See `rules/01-methodology.md`.
2. **Choose data structures by access pattern, not habit.** Know the n. n < 100:
anything works. n unbounded: complexity class is the design.
See `rules/02-algorithms-data-structures.md`.
3. **Batch and stream at every boundary.** One round trip per collection, not
per item. Stream large results; never materialize unbounded data.
4. **Control allocation in hot paths.** Pre-size collections, reuse buffer