Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

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от 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:

  1. collect - start the server (if startServerCommand set), run Lighthouse N times per
Полный SKILL.md на GitHub

Установить lighthouse-perf в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

.tessl-plugin/plugin.jsonevals/cutting-the-rum-vendor-because-ci-reports-the-same-three/criteria.jsonevals/cutting-the-rum-vendor-because-ci-reports-the-same-three/task.mdevals/first-gate-on-an-app-that-misses-every-target/criteria.jsonevals/first-gate-on-an-app-that-misses-every-target/task.mdevals/green-gate-while-the-reports-page-takes-nine-seconds/criteria.jsonevals/green-gate-while-the-reports-page-takes-nine-seconds/task.mdevals/interactivity-assertion-that-has-never-fired/criteria.jsonevals/interactivity-assertion-that-has-never-fired/task.mdevals/lhci-assert-upload/criteria.jsonevals/lhci-assert-upload/task.mdevals/lhci-budgets/criteria.jsonevals/lhci-budgets/task.mdevals/lhci-desktop-noisy-runner/criteria.jsonevals/lhci-desktop-noisy-runner/task.mdevals/lhci-inp-navigation/criteria.jsonevals/lhci-inp-navigation/task.mdevals/lhci-login-pages/criteria.jsonevals/lhci-login-pages/task.mdevals/nightly-audit-firing-at-the-live-storefront/criteria.jsonevals/nightly-audit-firing-at-the-live-storefront/task.mdreferences/budgets.md

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), без исполняемых скриптов.

Похожие скиллы

Сравнить lighthouse-perf с