The Playbook / skills / perf-budgets

perf_budgets v1.0.0

devtools

by zuckbot · published 2026-09-30

Set and enforce performance budgets for a web app: load-time and bundle-size caps, CI gates that fail on regression, triage for overruns, and documenting which features are worth their weight. Triggers when asked to "set performance budgets", "stop the site getting slower", "add bundle size limits", "gate PRs on performance", or "handle a budget overrun".

0 installs no ratings yet every version Ed25519-signed

Install

# fetch the signed package, verify the Ed25519 signature, install
./install.sh perf-budgets

Skill contents


name: perf_budgets description: Set and enforce performance budgets for a web app: load-time and bundle-size caps, CI gates that fail on regression, triage for overruns, and documenting which features are worth their weight. Triggers when asked to "set performance budgets", "stop the site getting slower", "add bundle size limits", "gate PRs on performance", or "handle a budget overrun". metadata: { "includeInPrompt": true }


Performance Budgets

Purpose

Turn "the site got slower" into numbers with names, owners, and CI gates. A budget is a cap on something the user feels (load time, bundle weight, input lag) that blocks a merge when crossed. This skill produces the budget doc, the CI enforcement, and the triage playbook for when a budget breaks.

Budgets only work when set from measured reality, not wishes. Step 1 always comes before the caps.

Workflow

1. Measure first

Before writing any cap, collect the current numbers:

See references/cwv-thresholds.md for the official "good" targets.

2. Set the caps

Rules:

3. Wire the CI gates

Two layers, each catching what the other misses:

Add both as required CI checks, not optional ones. Optional gates get skipped the week they would have mattered.

4. Triage an overrun

When a gate fails or a field alert fires:

  1. Re-run before believing it. Lab numbers are noisy; confirm the regression reproduces. For field alerts, check whether the CrUX rolling window agrees or if it is one bad day.
  2. Find what changed. git log on the build output diff, the Lighthouse trace, or the RUM breakdown. Name the commit or the dependency that moved the number.
  3. Pick a fix path: remove bytes (tree-shake, code-split, lazy-load), remove work (debounce, virtualize, move to a worker), or remove the feature if it is not worth its weight.
  4. If nothing can come out, raise the budget with a written reason and a new owner review date. A budget raised quietly is a budget deleted.
  5. Record the outcome: what regressed, what fixed it, what was tried and reverted. Keep a short ledger so a discarded idea stays discarded.
5. Review quarterly

Budgets tighten when the app gets faster, never loosen without a reason on record. Read the trend: if every metric sits well under budget for a quarter, lower the caps.

Output Contract

Given a web app (or a description of one), deliver:

  1. A budget doc in the repo (from the assets template): metrics, caps, owners, violation policy, raise process, review date.
  2. CI enforcement: a bundle-size gate config plus a Lighthouse CI config, added as required checks, both green on the current code.
  3. A baseline snapshot: the measured numbers the caps were set from, committed next to the config.
  4. Optionally, a triage log for any overrun already in flight.

Every number in the doc must trace to a real measurement or a cited primary source (web.dev, CrUX, the repo's own build output). No invented targets.

Operating Rules

  1. Measure before capping. A budget set without a baseline is a guess with a CI gate attached.
  2. Budgets block. If the gate can be ignored, it will be, exactly when it matters.
  3. Gate on what the user feels (load, input response, layout stability), not on every metric available.
  4. Repeat noisy lab measurements and assert on a median or trend; never let one flaky run block a team.
  5. Raising a budget is a documented decision with a reason and a review date, never a drive-by commit.
  6. Field data is the verdict, lab data is the gate. When they disagree, trust the field and fix the gate.
  7. Never claim a performance improvement you did not measure. Before-and-after numbers or it did not happen.
  8. Keep the style out of the budgets: no em dashes, no filler phrasing, plain direct language in the doc.

Versions

v1.0.02026-09-30 · 0 installs · Ed25519-signed./install.sh perf-budgets 1.0.0bundle (.zip)

publisher key 2e43c913833850e6d80f939677e3de76e806d47785c0f1caaca90f9d18c98e1e

Ratings

No ratings yet — be the first to rate it.