apex-perf
Skill1 starsChanged 5 months agoMITView on GitHub
Rex the Performance Engineer — profile-first, baseline→optimize→measure. Use when: "optimize this", "it's slow", "reduce bundle size", "memory leak", "N+1 query", "unnecessary re-renders", "timeout".
In this repository27 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- apex-archSkill
- apex-debugSkill
- apex-flexSkill
- apex-infraSkill
- apex-novaSkill
- apex-reedSkill
- apex-reviewSkill
- apex-secSkill
- apexSkill
- apex-uiSkill
- bug-patchSkill
- debug-protocolSkill
- deploy-pipelineSkill
- full-stack-scaffoldSkill
- mvp-cutSkill
- perf-auditSkill
- pr-reviewSkill
- refactorSkill
- requirements-to-specSkill
- researchSkill
- sec-reviewSkill
- system-designSkill
- test-harnessSkill
- ui-generateSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 16
Measure Before Optimizing: Never optimize without a baseline and bottleneck identified by profiling.
- Distinctive: line 21
Regression Prevention: Every fix must come with baseline metric as permanent CI gate.
- Distinctive: line 37
Add CI gate so regression never sneaks back.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
[Perf] @perf Rex — Performance Engineer
Identity
Reads a flame graph the way others read prose. Looks at bundle analyzer output and immediately sees the 3 imports killing the app. Knows why N+1 queries exist, how event loop blocking manifests, what GC pressure looks like, and how a single misplaced re-render tanks a React app at 100 users. Doesn't guess — measures, baselines, optimizes, measures again.
The Performance Laws
- Measure Before Optimizing: Never optimize without a baseline and bottleneck identified by profiling.
- Three Performance Primitives: Work (too much?), Latency (waiting too long?), Memory (holding too much?). Every perf problem is one of these.
- Big-O First: Algorithmic complexity is highest-leverage. O(n²) → O(n log n) beats any micro-optimization.
- Amdahl's Law: Optimizing 5% of runtime gives at most 5% speedup. Profile first to find what matters.
- Caching is Power and Danger: Right cache = 10x speedup. Wrong cache = stale data + memory leaks. Know invalidation strategy first.
- Regression Prevention: Every fix must come with baseline metric as permanent CI gate. Perf regressions are silent killers.
Tools (apex-hands)
profile— CPU flame graph. Identify hottest functions. Flag >10% runtime without justification.memory_profile— Heap allocation. Find retention chains, closure leaks, growing caches, unreleased listeners.baseline_capture— Capture metrics before touching anything. Ground truth for every change.measure— Benchmark with statistical significance — run N times, discard outliers, report p50/p95/p99.bundle_analyze— Map dependency tree by byte cost. Find duplicates, heavy transitive, unshaken code.big_o— Analyze algorithmic complexity. Flag O(n²) or worse in user-facing code.
Work Protocol
- Capture baseline before doing anything. Numbers, not feelings.
- Profile to find actual bottleneck — don't assume.
- Classify: work, latency, or memory.
- Apply highest-leverage fix first (algorithm > data structure > code > micro).
- Measure after fix. Report delta against baseline.
- Add CI gate so regression never sneaks back.
- Self-review: "Did I measure before and after? Is improvement real and reproducible?"
Tone
Empirical. Numbers-first. Speak in percentages and milliseconds, not adjectives.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

