lighthouse-perf
БесплатноБез исполняемых скриптовНе проверенUse when a web frontend needs Core Web Vitals (LCP, INP, CLS) checked on every PR, or its first performance budgets drafted. Sets up Lighthouse CI with…
от testland★ 18 звёзд на GitHubОб этом скилле
lighthouse-perf
Overview
The Core Web Vitals are Google's three canonical user-experience metrics (web-vitals):
| Metric | Measures | "Good" threshold |
|---|---|---|
| LCP (Largest Contentful Paint) | Loading performance | ≤ 2.5 seconds |
| INP (Interaction to Next Paint) | Interactivity | ≤ 200 milliseconds |
| CLS (Cumulative Layout Shift) | Visual stability | ≤ 0.1 |
INP became a stable Core Web Vital in 2024, replacing FID (web-vitals). The canonical measurement standard is the 75th percentile of page loads, segmented across mobile and desktop (web-vitals).
INP needs a real user interaction, so a Lighthouse navigation run (what
lhci autorun does) cannot report it: the interaction-to-next-paint
audit only runs in timespan mode (lh-inp). In the lab, gate on
Total Blocking Time (TBT), which web.dev calls "a reasonable proxy metric
for INP, but it's not a substitute for INP" (inp), and track INP
itself from field data (see "Lab vs field" below).
This skill covers Lighthouse CI (@lhci/cli) - the official
Google Chrome team tool for running Lighthouse on every PR and
asserting against budgets (lhci).
When to use
- The project ships a web frontend (Next.js, Vite, Remix, plain static, etc.).
- The team has documented Web Vitals NFRs (per
non-functional-requirement-extractor) and needs CI enforcement. - A PR's perf delta vs. main needs to be visible (regression-block or just-warn).
- The team uses Lighthouse for accessibility / SEO / best-practices audits beyond perf.
If the project is a backend API or a CLI tool, this skill doesn't
apply - use k6-load-testing or a
sibling load runner for backend perf.
Install
npm install --save-dev @lhci/cli
(Per lhci; the docs reference @lhci/[email protected] as the
current major.) Pin to a specific minor in CI for determinism.
Configure
Create .lighthouserc.js (or .lighthouserc.json) at the project
root. The canonical shape per lhci:
module.exports = {
ci: {
collect: {
// What to audit
url: [
'http://localhost:3000/',
'http://localhost:3000/dashboard',
'http://localhost:3000/pricing',
],
// How many runs per URL - median report wins; 3 is canonical for stability
numberOfRuns: 3,
// Lighthouse settings
settings: {
preset: 'desktop', // desktop apps only; omit it for the default mobile run (there is no 'mobile' preset)
chromeFlags: '--no-sandbox', // CI-runner-friendly
},
// Use a static-server when running headless in CI
startServerCommand: 'npm run start',
startServerReadyPattern: 'ready on',
},
assert: {
// Canonical Web Vitals budgets per web.dev/articles/vitals
assertions: {
'largest-contentful-paint': ['error', { maxNumericValue: 2500 }], // 2.5s
// INP is timespan-only in Lighthouse; TBT is its lab proxy.
// 200 ms = Lighthouse's mobile "fast" band; use 150 with preset: 'desktop'.
'total-blocking-time': ['error', { maxNumericValue: 200 }],
'cumulative-layout-shift': ['error', { maxNumericValue: 0.1 }], // 0.1
// Lighthouse category scores (0-1)
'categories:performance': ['warn', { minScore: 0.9 }],
'categories:accessibility': ['error', { minScore: 0.95 }],
'categories:best-practices': ['warn', { minScore: 0.9 }],
},
},
upload: {
// Where to upload the .json reports for trend analysis
target: 'temporary-public-storage', // or 'lhci' for self-hosted server
},
},
};
Assertion levels per lhci:
'error'- fails the CI run (exits non-zero).'warn'- surfaces in the report but doesn't fail.'off'- disabled (useful for opt-out per-page).
Running
The canonical invocation per lhci:
lhci autorun
autorun runs three phases in sequence:
- collect - start the server (if
startServerCommandset), run Lighthouse N times per
Установить lighthouse-perf в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл lighthouse-perf?
Use when a web frontend needs Core Web Vitals (LCP, INP, CLS) checked on every PR, or its first performance budgets drafted. Sets up Lighthouse CI with Google's thresholds at the 75th percentile, per-route budgets by page type, resource-size budgets, report artifacts and PR comments.
Как установить скилл lighthouse-perf?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл lighthouse-perf запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
docx
Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include…
от AnthropicUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple…
от Anthropicxlsx
Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing…
от Anthropicpptx
Use this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or…
от Anthropic