Skill: performance budget check

Enforce Core Web Vitals and API latency budgets so performance work stays measurable and mergeable.

Published 2026-11-09 · Translation: VI

What to do first

  • Load numeric budgets from team config (LCP, INP, CLS, p95 API latency) - or ask for them. Do not invent targets.
  • Name the surfaces the change actually hits (checkout, search, hot API), not “the app in general.”
  • Treat the run as unfinished until pass/fail against those budgets is clear, with lab vs field labeled.

“Make it faster” is how performance PRs become theater: a cold admin page gets a Lighthouse screenshot of 98, checkout LCP stays over budget, and nobody can say whether real users improved. Agents amplify this when they invent scores or optimize the wrong path.

This skill forces a budget file (or explicit numbers), a measurement method, a before/after comparison, and the smallest fix that restores the budget. It works in any chat that can read your repo, and as a SKILL.md for merge-time checks.

Part 1: Load budgets and scope surfaces

Budget Map

Budget Map

Before proposing a fix, the agent must produce a budget map:

Surface Metric Budget Source
Checkout LCP LCP ≤ 2.5s perf-budgets.json
Search API p95 latency ≤ 200ms same
Home CLS CLS ≤ 0.1 same

If the file is missing, stop and ask. Guessing “industry standard” numbers is how fake green reports happen.

Do not invent Lighthouse or field scores.

1. Load budgets from [path] or ask me for numeric targets.
2. List surfaces this change can affect (pages, APIs, assets).
3. For each: budget, how we will measure (command/dashboard), lab vs field.
4. Stop. Do not propose fixes until I confirm the map.

Part 2: Measure, compare, smallest fix

After the map is confirmed:

  1. Run or outline the measurement (exact command, URL, device profile, or RUM dashboard).
  2. Compare to budget; list overages only - no vanity scores.
  3. Propose the smallest change that restores budget on the failing surface.
  4. State residual risk and what to monitor after merge.
  5. Label every number as measured, estimated, or unknown. Never present an estimate as a lab score.
Using the confirmed budget map:
- Measure or outline measurement for each over-budget surface.
- Compare before/after only where you have a method.
- Propose the smallest fix; list tradeoffs (cache freshness, complexity).
- Hard rule: do not invent lab scores. Label estimates clearly.

Part 3: Traps this skill must catch

Failure modes to catch early

Failure modes to catch early

Read the board. Each card is a stop rule the skill must encode.

A worked example

Invented situation: a PR adds a hero image carousel on checkout. Team budget: checkout LCP ≤ 2.5s (field), API p95 on /cart ≤ 150ms.

Without the skill, the agent pastes “Lighthouse 96, feels snappy” and suggests more caching.

With the skill, it loads perf-budgets.json, scopes checkout + /cart, asks for a WebPageTest / CrUX / RUM method, and only then proposes deferring below-the-fold slides and preloading the LCP image. Invented scores are refused. Residual risk: CLS from late-loading slides - monitor named.

Save it as a skill file

# Skill: perf-budget
## When
- Perf checks on UI/API hot paths; "make it faster" requests
## Hard rules
1. Numeric budgets from config or ask - never invent targets or lab scores.
2. Prefer real user paths over microbenchmark theater.
3. Label lab vs field on every number.
## Steps

![Measure Gate](/images/articles/skill-for-perf-budget/en/02-measure-gate.jpg)

*Measure Gate*

1. Load budgets + scope surfaces; stop for confirm.
2. Measure / outline method; compare; list overages.
3. Smallest fix + residual risk + monitoring.
## Done when
- Pass/fail clear; method documented; no fake scores.

Test the skill before you trust it

  1. No budget file. Pass: skill asks or points at the config path.
  2. Invented score. Ask for “assume Lighthouse 98.” Pass: refuses; demands a method.
  3. Wrong surface. Docs-only PR. Pass: quick no-op, no fake perf essay.

Related: performance pass with agents if you have that guide in your locale set.

Common mistakes

  • Budgets as vibes. “Should be under 3 seconds” without a source gets argued every PR.
  • Lab-only wins. Caching forever to pass Lighthouse while stale content hurts users.
  • Fixing everything at once. One overage, one smallest fix; then remeasure.

You are done when every cited number has a source or an honest estimate label, the hot path is in scope, and pass/fail against the budget is unambiguous.

Share

X Facebook LinkedIn