performance-optimization
Skill1 starsChanged 3 months agoMITView on GitHub
Judge a diff's cost on measurements — profile the changed path, cite before/after numbers, and name N+1 queries, unbounded fetches, oversized bundles and needless re-renders. Reach for it code-cold on a slice touching data fetching, rendering or bundle size, or a load-time budget. Complexity alone is `code-simplification`; the five-axis grade is `code-review`.
83 other projects use a version of this.
Adopted by
Most recently taken up by
- Lukk17/agent-standardstheir own version, first seen Oct 5, 2026
- GuillemRoca/agent-skills-androidtheir own version, first seen Oct 3, 2026
- addyosmani/agent-skillstheir own version, first seen Oct 3, 2026
- weisser-dev/agentic-skillstheir own version, first seen Oct 3, 2026
- Rvey/agent-engineering-kittheir own version, first seen Oct 1, 2026
- JPeetz/agent-skillstheir own version, first seen Sep 29, 2026
Used with
Projects with it also use constraint-driven-development, git-workflow-and-versioning and 1 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
vinvcnSkillconstraint-driven-development
把一个项目的质量线确立为书面契约,并阻止 agent 悄悄降低它。通过访谈确定用户在意哪些维度,当用户心里没有数字时提供合理的默认阈值,把一切记录进 CONSTRAINTS.md,并盯住 diff 中质量线被削弱的迹象——新增的 @ts-ignore 或 eslint-disable 抑制注释、被跳过或删除的测试、被剥掉的断言、未实现的 stub、被调低的阈值。当没有任何质量线被写下来时使用;当用户说 "set up constraints" 或 "define our standards" 时;当用户希望把他们在意的维度——无障碍性、Web 性能、覆盖率——设置成被强制执行的约束时;当 agent 为了变绿不断静默检查或跳过测试时;当你需要一个覆盖率或性能阈值却不知道该选什么数字时;或者当 agent 写下的代码超出任何人会读的体量时。
Also in 4 projects that use this
LLl0k0laDSkillgit-workflow-and-versioning
Use when making any code change. Use when committing, branching, resolving conflicts, or when you need to organize work across multiple parallel streams.
Also in 23 projects that use this
LLl0k0laDSkillapi-and-interface-design
Use when designing APIs, module boundaries, or any public interface. Use when creating REST or GraphQL endpoints, defining type contracts between modules, or establishing boundaries between frontend and backend.
Also in 26 projects that use this
Other versions83 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 83
- addyosmani/agent-skills★ 101ksame name
- rohitg00/awesome-claude-code-toolkit★ 2.7ksame name
- gamedev-skills/awesome-gamedev-agent-skills★ 1.3ksame name
- ukanwat/overtime★ 387same name
- Mindrally/skills★ 266same name
- shashankswe2020-ux/whoop-mcp★ 165same name
- magnus919/agent-skills★ 109same name
- thiientv/godmode★ 96same name
- dylantarre/animation-principles★ 94same name
- DevelopersGlobal/ai-agent-skills★ 69same name
73 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository40 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- acceptance-criteriaSkill
- api-designSkill
- architecture-designSkill
- browser-testing-with-devtoolsSkill
- ci-cdSkill
- codebase-designSkill
- codebase-researchSkill
- code-reviewSkill
- code-simplificationSkill
- comprehension-quizSkill
- debugging-and-error-recoverySkill
- deprecation-and-migrationSkill
- documentation-and-adrsSkill
- doubt-driven-developmentSkill
- environment-manifestSkill
- gauntlet-loopSkill
- git-workflowSkill
- handoffSkill
- idea-refineSkill
- incremental-implementationSkill
- interview-meSkill
- literate-explainerSkill
- observability-and-instrumentationSkill
- orchestratorSkill
- plan-breakdownSkill
- preflight-readinessSkill
- project-setupSkill
- pull-requestSkill
- quality-verificationSkill
- security-and-hardeningSkill
- shipping-and-launchSkill
- source-driven-developmentSkill
- spec-grillingSkill
- spec-reviewSkill
- test-driven-developmentSkill
- to-prdSkill
- using-agent-skillsSkill
- worktreeSkill
The file
Files
Performance Optimization
Purpose
Stage: Review. Principles 6, 7, 8, 9.
The measure-first performance lens of the Review fan-out, dispatched code-cold over a slice's diff. It
profiles the changed path, holds the numbers against the feature's budget, and writes
reviews/<SLICE-ID>-perf.md: findings that each carry a measurement, and one verdict. It judges on
evidence and applies nothing.
When to use / when to skip
- The Review fan-out dispatches you code-cold over a wave's diffs, beside
code-review,code-simplificationandsecurity-and-hardening(safety-rails.md, Code-cold dispatch). - The diff touches data fetching, a query, rendering, an image, a font or the initial bundle, or an acceptance scenario names LCP, INP, CLS, a p95 or a bundle ceiling.
- The app is reported slow, a vital dropped a band, or a feature is about to meet a dataset nothing here was measured against.
- Skip a diff nothing has slowed and no budget covers: optimizing with no evidence of a problem costs more than the performance it gains.
- Near-miss. Five-axis grade:
code-review. Complexity in code believed correct:code-simplification. OWASP, secrets, dependencies:security-and-hardening. Driving the browser for a trace:browser-testing-with-devtools.
Inputs
Nobody is present on a code-cold pass; what is absent gets derived and marked derived in the findings.
- the diff — helps: it is the change whose cost you measure · without it: read
git diff <base>..HEADor the working tree and name the range,derived. - a way to measure — the running app, a build, a bundle report, a query log, Lighthouse, a trace —
helps: numbers, and a finding without one is an opinion · without it: read the changed paths for the
anti-patterns below, mark each finding
unmeasuredwith the instrument that would settle it, and hold the verdict atconcerns. An eyeballed pass is a guess dressed as evidence; a missing instrument names a gap rather than ending a slice. docs/features/<slug>/acceptance.md— helps: the scenarios naming a threshold, the numbers this diff owes · without it: take the defaults under Performance Budget,derived.docs/features/<slug>/prd.md— helps: the constraints and the Not-Doing list a recommended fix must not cross · without it: take the repo's existing conventions and say so,derived.docs/features/<slug>/environment.md— helps: what to profile against · without it: read the repo's run scripts and config,derived.STATE.mdanddocs/features/<slug>/plan/<slice-id>.md— helps: the slice id and its owned files, so a finding routes to its owner · without it: attribute by file path,derived.
Core Web Vitals Targets
The good / needs-improvement / poor bands are in
performance-checklist.md, read on a mid-range Android or at
4×–6× CPU throttling. A vital dropping a band on a path this diff changed is a finding with the trace
behind it.
The Optimization Workflow
Measure, find the real bottleneck, name the fix and the guard. Only what a measurement points at is worth changing.
- Measure the changed path before reading it for faults — the endpoint, the interaction, the bundle — and record the number with the conditions behind it. Take both kinds: a synthetic number (Lighthouse, a trace, a bundle report) catches a regression on demand; a field number (RUM, CrUX) is what says a real user got faster.
Let the symptom pick the instrument.
Symptom What to open First load bundle report; Network waterfall — DNS, TCP-TLS, waiting A lagging interaction Performance trace; tasks over 50ms; onINPattributionContent jumping layout-shift attribution — images without dimensions, late content, a font swap A slow page after navigation API timings and the request list — a fetch waterfall, a client N+1 One slow endpoint slow-query log and query plan — N+1, a missing index, an unbounded scan Every endpoint slow pool metrics, heap snapshot, CPU profile — exhaustion, a leak, GC pauses Slow only sometimes lock waits, GC logs, external-dependency timings — contention, a pause, a dependency degrading Name the anti-pattern the measurement points at, in the lines this diff changed.
In the diff The finding What closes it a read per row inside a loop N+1 one query with a join or an include a list read with no limit or order unbounded fetch take/skipor a cursor, plus an orderan <img>with nowidth/height, nosrcset, a legacy formatLCP and CLS cost the checklist's image rules a fresh object or closure as a prop; an unmemoized expensive component; a per-keystroke computation needless re-render a hoisted reference, or memoization where the profile shows the gain a heavy or rarely-used module imported eagerly bundle cost import()at the route or the featurethe same rarely-changing read every request missing cache a TTL on the read; the checklist's caching rules performance-checklist.mdholds those image and caching rules in full, and fonts, critical CSS, yielding the main thread and infrastructure besides.- Give every finding a number, a place, a fix and a guard — severity
blocker · major · minor, apath:linein the diff, the before against the after (or a projected after and what would confirm it), the change that closes it, and the check that keeps it out:bundlesizeorlhci autorunin CI, a query-count assertion, a threshold in the acceptance scenarios. Findings rest on a measurement or a named anti-pattern, never on an adjective. - Report, and edit nothing — not the code, not the tests, not the build config; the slice's owner applies the fix, re-runs the suite and re-measures against your before-number.
- Decide the rest yourself and leave the trace. An unstated budget, an anti-pattern acceptable at
this scale, a fix deferred to a later slice: take the default, state the reason, append one
docs/session-log.mdentry, handpull-requesta Decided-for-you row. A regression past budget raises the risk band; it is a finding, not a question. - Return one verdict —
pass · concerns · block.passis measured, inside budget, no anti-pattern in the changed paths.concernscarries what should move before merge, a past-budget regression and a poor-band vital included.blockis a stop-list item and nothing else (safety-rails.md).
Performance Budget
Where the feature states thresholds they win; where it states none, these are the defaults, reported
derived: initial JavaScript under 200KB gzipped · CSS under 50KB · an above-the-fold image under 200KB ·
fonts under 100KB total · API p95 under 200ms · time-to-interactive under 3.5s on 4G · Lighthouse
performance 90 or better.
Rationalizations
| Rationalization | Reality |
| "This optimization is obvious" | An unprofiled bottleneck is a guess, and the obvious candidate is rarely where the time sits. |
| "It's fast on my machine" | The user's machine is a mid-range phone on a worse network, where INP problems live. |
| "We'll optimize later" | These anti-patterns are cheap now and structural later; micro-optimizations are the ones worth deferring. |
| "Named imports are bloating the bundle" | A modern bundler tree-shakes them; the gains live in splitting and lazy loading. |
| "I'm in the file anyway, I'll just fix it" | A checker that edits what it graded has no independent evidence left, and a sibling axis is in that file. |
Red flags
- A recommendation with no number behind it, or a number with no conditions beside it.
- A fix aimed where the profile never pointed.
React.memoanduseMemosprayed across components nobody profiled.- A list endpoint with no limit, or a loop issuing one read per row.
- A finding written into the code under review instead of the findings file.
- A bundle that grew in this diff with nobody reporting by how much.
Verification
- Every changed path carries a before number and its conditions, or is marked
unmeasuredwith the instrument that would settle it. - Each finding cites a
path:linein the diff and carries a severity, a measurement or a named anti-pattern, the fix, and the guard. - The thresholds graded against are the feature's or the defaults marked
derived, each reported cleared or not. - No code, test or build configuration under review moved.
- Each call outside the stop list is a default with a reason, one log entry, and a Decided-for-you row.
- The verdict is one of
pass · concerns · block, and ablocknames the condition that fired.
Outputs & handoff
docs/features/<slug>/reviews/<SLICE-ID>-perf.md — cap 600 words, one file per owning slice, you its sole
writer. Called by hand with no slice and no feature, the same sections come back in conversation instead.
## Measurements— per changed path: instrument, conditions, the before number and the projected after with what would confirm it, orunmeasuredand what would settle it.## Findings— severity (blocker|major|minor) ·path:line· the number or the named anti-pattern · the fix · the guard,derivedon anything reconstructed.## Budget— each threshold, its source, and whether the measurement clears it.## Verdict—pass | concerns | block; on a block, the stop-list condition that fired.
Measure the draft against that cap and report the count; an over-cap draft goes on as an over-run, never
as one that fit. Where this pass settled something itself, one docs/session-log.md entry of at most 60
words is appended, matching the pull request's Decided for you row.
No STATE.md row is written and no gate flipped — the caller owns the slice's transition
(state-schema.md).
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.

