/skillry-performance-and-cost:frontend-performance-budgetfrom skillry-performance-and-cost
Establishes enforceable frontend performance budgets with Core Web Vitals attribution, Lighthouse CI gates, and byte budgets per asset class. Use when pages feel slow, PRs add large dependencies, or hydration blocks interactivity.
Ships in skillry-performance-and-cost. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Skillry 3.0.0 folded the skills below into this one. When a request names one of them or matches its topic, open the listed reference and follow it; the rest of this file stays the default procedure.
| Old skill name | Reference | Use it for |
|---|---|---|
core-web-vitals | references/core-web-vitals.md | diagnosing and fixing LCP, INP and CLS with thresholds, causes and code-level fixes |
performance-optimization | references/performance-optimization.md | measure-first optimization workflow across frontend and backend, with a performance checklist and anti-pattern list |
Establish enforceable frontend performance budgets and wire them into CI so regressions fail the build instead of shipping. This goes past "LCP is 2.5s good" surface advice: it attributes each Core Web Vital to a concrete cause (render-blocking resource, layout shift source, long task), sets byte budgets per asset class, and measures the real cost of hydration and client-side JavaScript. The output is a budget file plus a Lighthouse CI configuration that other engineers can run locally and in the pipeline.
loading="lazy", routes are code-split, and heavy components are dynamically imported. Verify the LCP image is NOT lazy-loaded (that delays it).lighthouserc.js with budget assertions so the pipeline fails when a metric or byte budget regresses.<img> and media element has explicit width/height or an aspect-ratio box (prevents CLS).font-display: swap (or optional) and are preloaded if critical.async/defer or loaded post-interaction.lighthouserc.js (or equivalent) enforces budgets in CI and fails on regression.# One-off Lighthouse run, mobile + throttling, JSON output
npx lighthouse https://example.com/page \
--preset=perf \
--form-factor=mobile \
--throttling.cpuSlowdownMultiplier=4 \
--output=json --output-path=./lh-report.json --quiet
# Extract the three Core Web Vitals + total byte weight from the report
node -e '
const r = require("./lh-report.json");
const a = r.audits;
const m = (id) => a[id] && a[id].numericValue;
console.log("LCP(ms):", m("largest-contentful-paint"));
console.log("TBT(ms):", m("total-blocking-time"));
console.log("CLS:", m("cumulative-layout-shift"));
console.log("TotalBytes:", a["total-byte-weight"].numericValue);
'
# Inspect bundle composition (Vite / Rollup)
npx vite build && npx vite-bundle-visualizer
# or for webpack
npx webpack --profile --json=stats.json && npx webpack-bundle-analyzer stats.json
// lighthouserc.js — Lighthouse CI budget gates
module.exports = {
ci: {
collect: {
url: ['http://localhost:3000/'],
numberOfRuns: 3,
settings: { preset: 'perf', formFactor: 'mobile', throttlingMethod: 'simulate' },
},
assert: {
assertions: {
'largest-contentful-paint': ['error', { maxNumericValue: 2500 }],
'cumulative-layout-shift': ['error', { maxNumericValue: 0.1 }],
'total-blocking-time': ['error', { maxNumericValue: 200 }],
'interactive': ['warn', { maxNumericValue: 3800 }],
// byte budgets by resource type (bytes)
'resource-summary:script:size': ['error', { maxNumericValue: 175000 }],
'resource-summary:image:size': ['warn', { maxNumericValue: 300000 }],
'resource-summary:font:size': ['warn', { maxNumericValue: 100000 }],
'resource-summary:third-party:size': ['warn', { maxNumericValue: 150000 }],
},
},
upload: { target: 'temporary-public-storage' },
},
};
// budget.json — standalone Lighthouse budget (also usable via --budget-path)
[
{
"path": "/*",
"resourceSizes": [
{ "resourceType": "script", "budget": 170 },
{ "resourceType": "stylesheet", "budget": 60 },
{ "resourceType": "image", "budget": 300 },
{ "resourceType": "font", "budget": 100 },
{ "resourceType": "total", "budget": 700 }
],
"resourceCounts": [
{ "resourceType": "third-party", "budget": 10 }
]
}
]
loading="lazy" on the hero image delays the very metric you are trying to improve.font-display and no preload. Causes invisible text then a reflow that spikes CLS.font-display: swap and a system-font fallback stack.Produce a report containing:
budget.json / lighthouserc.js with per-asset-class ceilings and metric thresholds.lighthouserc.js collect URLs; use environment variables for authenticated runs.warn) first, then promote to error once the team agrees, so you do not block unrelated PRs on day one.references/core-web-vitals.md (opens in a new tab)references/core-web-vitals/LICENSE (opens in a new tab)references/performance-optimization.md (opens in a new tab)references/performance-optimization/LICENSE (opens in a new tab)references/performance-optimization/references/performance-checklist.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
2 skills in this plugin
npx claudepluginhub fluxonlab/skillry --plugin skillry-performance-and-costOther plugins' skills for the same job