From nexus-agents
Guides measure-first performance optimization: measure baselines, profile bottlenecks with tools like node --prof or DevTools, fix issues, verify gains, add guards. For proven slowdowns, regressions, Core Web Vitals.
npx claudepluginhub williamzujkowski/nexus-agentsThis skill is limited to using the following tools:
<!--
Optimizes application performance via measure-identify-fix-verify workflow. Use for Core Web Vitals, load times, regressions, or profiling bottlenecks.
Guides measure-first performance optimization via 4-phase process: baseline metrics, root cause ID, cost/benefit eval, targeted fixes. Balances speed gains vs complexity for slow code/profiling.
Optimizes app performance across frontend, backend, and databases: profiles with Node/Python/Lighthouse, identifies CPU/memory/IO/DB bottlenecks, reduces bundle sizes, improves queries/rendering.
Share bugs, ideas, or general feedback.
Skip when:
"Premature optimization is the root of all evil." Don't optimize before you have evidence. The cost of complexity is permanent; the cost of waiting for evidence is one more profile run.
node --prof, clinic.js, browser DevTools Performance, pprof for memory.| Pattern | Symptom | Fix |
|---|---|---|
| N+1 queries | One query per record in a loop | Single batched query with IN clause or proper join |
| Unbounded data | Fetching all rows when 50 would do | Pagination + cursor-based limits |
| Synchronous I/O in hot path | readFileSync, execSync per request | Async + worker pool, or cache the result |
| Unnecessary serialization | JSON-parse-and-stringify the same blob multiple times | Pass through, or hash-cache by input |
| Cache miss patterns | Read-only data fetched on every render/request | TTL cache or memoization (with size bound) |
| Bundle size growth | First-paint regression after a feature add | Dynamic import for heavy features, code splitting at route boundaries |
| Re-render storms (React/Svelte/etc.) | Component renders 100x for one state change | Stable references, key-based memoization, lift state up |
| Excuse | Counter |
|---|---|
| "I'll add the optimization while I'm in here" | Optimization without a profile is gambling. The added complexity is permanent; the win may be zero or negative. |
| "Big-O says it's faster" | Big-O is asymptotic. For your actual n, the constant factors and cache effects often dominate. Measure. |
| "JavaScript engines optimize this" | Modern engines optimize hot loops, not your data flow. Don't assume — profile. |
| "It's a tiny win but free" | Free in code, expensive in review and bisect. Many "tiny wins" together obscure the actual hot path. |
| "Premature optimization is fine if it's clean" | The dichotomy isn't "messy vs clean optimization." It's "with evidence vs without." Without evidence, even clean optimization is premature. |
| "We'll measure in production" | You won't. Production has too much noise. Build a representative reproduction first. |
useMemo / React.memo / signal() everywhere as a precautionpnpm lint && pnpm typecheck && pnpm test