本文へ移動
cccskills
無料GitHub で公開

lighthouse-perf

Configures Lighthouse CI (`@lhci/cli`) to audit Web Vitals (LCP, INP, CLS) on every PR, asserts against canonical thresholds (LCP ≤2.5s, INP ≤200ms, CLS ≤0.1 at the 75th percentile), uploads Lighthouse reports as build artifacts, and posts deltas as PR comments. Includes a budget-authoring reference: per-route LCP/INP/CLS thresholds by traffic class (cached / dynamic / api-heavy / form-heavy / media-heavy) via `assertMatrix`, plus `budget.json` resource-size caps (JS / CSS / images / total bytes). Use when the project ships a web frontend and the team needs continuous Web Vitals monitoring tied to PR gating, or needs its first Lighthouse budgets drafted.

日本語の概要は準備中です。原文の説明を表示しています。

testland/qaスター 13(GitHub 13 + cccskills 0)

実行スコア 未検証

インストール方法を見る

含まれるファイル(13)

  • SKILL.md9.8 KB
  • .tessl-plugin/plugin.json799 B
  • evals/cutting-the-rum-vendor-because-ci-reports-the-same-three/criteria.json5.1 KB
  • evals/cutting-the-rum-vendor-because-ci-reports-the-same-three/task.md7.3 KB
  • evals/first-gate-on-an-app-that-misses-every-target/criteria.json5.4 KB
  • evals/first-gate-on-an-app-that-misses-every-target/task.md5.6 KB
  • evals/green-gate-while-the-reports-page-takes-nine-seconds/criteria.json5.1 KB
  • evals/green-gate-while-the-reports-page-takes-nine-seconds/task.md7.8 KB
  • evals/interactivity-assertion-that-has-never-fired/criteria.json4.8 KB
  • evals/interactivity-assertion-that-has-never-fired/task.md6.1 KB
  • evals/nightly-audit-firing-at-the-live-storefront/criteria.json4.5 KB
  • evals/nightly-audit-firing-at-the-live-storefront/task.md6.7 KB
  • references/budgets.md8.8 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

lighthouse-perf

Overview

The Core Web Vitals are Google's three canonical user-experience metrics (web-vitals):

MetricMeasures"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).

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/cli@0.15.x 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',                       // or 'mobile' (default)
        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
        'interaction-to-next-paint': ['error', { maxNumericValue: 200 }],   // 200ms
        '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 URL.
  2. assert - compare results against the assertion config; exit non-zero on error-level failures.
  3. upload - upload reports to the configured target for trend tracking.

For finer control, the phases can run independently: lhci collect, lhci assert, lhci upload.

Running specific URLs

For a single PR-relevant audit:

lhci collect --url=http://localhost:3000/dashboard --numberOfRuns=3
lhci assert

CI integration

# .github/workflows/lighthouse.yml
name: lighthouse

on:
  pull_request:
    paths:
      - 'src/**'
      - 'package.json'
      - 'package-lock.json'

jobs:
  lighthouse:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5

      - uses: actions/setup-node@v4
        with:
          node-version: '20'
          cache: 'npm'

      - run: npm ci

      - name: Build
        run: npm run build

      - name: Lighthouse CI
        env:
          LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}   # optional, for PR comments
        run: npx lhci autorun

      - name: Upload Lighthouse reports
        if: always()
        uses: actions/upload-artifact@v4
        with:
          name: lighthouse-reports
          path: .lighthouseci/
          retention-days: 14

The optional LHCI_GITHUB_APP_TOKEN (set up via the Lighthouse CI GitHub App) enables PR comments showing the per-metric delta vs. the main branch's last green run.

Authoring budgets

Budget authoring is part of Lighthouse CI configuration: picking per-route LCP / INP / CLS thresholds by traffic class, resource-size caps in budget.json, the assertMatrix config shape, and how to validate a new budget against production before committing it, are all in references/budgets.md. Start there when the project has no budgets yet or the existing ones need a redesign.

Mobile vs desktop budgets

LCP / INP thresholds are the same across mobile and desktop, but mobile is consistently slower in practice - the same JS bundle runs on a less-powerful CPU over a less-stable network.

Common pattern: separate .lighthouserc.mobile.js and .lighthouserc.desktop.js, run both in CI. The mobile run uses preset: 'mobile' (default) which applies CPU + network throttling to simulate a mid-range Android device.

# Run both
LHCI_BUILD_CONTEXT__GITHUB_BASE_URL=https://github.com/... \
  npx lhci autorun --config=.lighthouserc.mobile.js
npx lhci autorun --config=.lighthouserc.desktop.js

Anti-patterns

Anti-patternWhy it failsFix
numberOfRuns: 1Single-run measurements are noisy; flaky alerts.Use 3 (canonical) or 5 for high-stakes pages; LHCI uses the median.
Asserting on first-input-delay (FID)FID was retired in 2024 (web-vitals).Use interaction-to-next-paint (INP).
Hard error on every metric out of the boxExisting pages may not meet thresholds; team learns to ignore the gate.Start with warn for everything; promote to error once green for 2 weeks.
Auditing only the homepageThe homepage is usually the most-optimized page; misses regressions on long-tail routes.Audit a representative URL set: home + 1 logged-in dashboard + 1 long-form content + 1 form-heavy.
Lighthouse score as the sole metricLighthouse score conflates multiple subscores; doesn't isolate which Web Vital regressed.Assert on the individual Web Vitals (largest-contentful-paint, interaction-to-next-paint, cumulative-layout-shift); category score is supplementary.
Running against productionLighthouse fires real network requests and triggers analytics; pollutes prod metrics.Always against staging or a local build.

Lab vs field

Lighthouse CI measures lab data (synthetic; deterministic runner). Field data (real-user metrics, RUM) is measured by Web Vitals JS in production. Both matter:

SourceToolUse for
Lab (synthetic)Lighthouse CIPer-PR regression gate.
Field (RUM)web-vitals library + analyticsReal-user 75th-percentile tracking.

Lighthouse CI catches per-PR regressions; field data tracks the 75th-percentile threshold per web-vitals. Don't substitute one for the other.

References

  • web-vitals - canonical Core Web Vitals definitions and thresholds (LCP ≤2.5s, INP ≤200ms, CLS ≤0.1; 75th-percentile measurement; INP-replaces-FID in 2024).
  • lhci - Lighthouse CI canonical install, lhci autorun, configuration shape, assertion levels.
  • references/budgets.md - drafting per-route budgets and budget.json resource-size caps at design time.
  • perf-budget-gate - downstream unified gate aggregating Lighthouse + load-runner verdicts.
  • non-functional-requirement-extractor - upstream skill that surfaces Web Vitals NFRs from PRDs.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

コメント

ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。

まだコメントはありません。最初のコメントを書いてみませんか。

送信するとすぐに公開されます。メールアドレスや電話番号などの個人情報は書かないでください。URL は 2 つまでです。

0 / 1000 文字

このフォームは reCAPTCHA で保護されており、Google のプライバシーポリシーと利用規約が適用されます。

同じリポジトリのスキル

Builds a CI gate that fails the build on **new** WCAG / a11y violations introduced by a PR while grandfathering pre-existing violations on a per-rule / per-page baseline. Aggregates verdicts from axe-core / pa11y / Lighthouse a11y / WAVE / IBM Equal Access scans. Use when a project has accumulated a11y debt and a strict "zero violations" gate would block every PR - the ratchet pattern lets the team ship while preventing regressions.

日本語の概要は準備中です。原文の説明を表示しています。

testland/qa132026年10月20日 更新

Workflow skill that builds an A/B-test validity checklist from an experiment proposal, walking the canonical design-correctness gates - pre-registered OEC/power/guardrails, randomization unit + SRM check, assignment integrity, telemetry, peeking discipline, novelty/primacy, post-experiment SRM re-check - into a per-experiment checklist + sign-off form. Use when launching, auditing, or governing an experiment. For pitfall mechanics (guardrails, peeking) see experiment-results-interpreter's references; to read an already-valid result use experiment-results-interpreter; for per-SDK harness tests use experiment-sdk-testing - this gates DESIGN, not SDK code.

日本語の概要は準備中です。原文の説明を表示しています。

testland/qa132026年10月20日 更新

The single install-flow skill: the reference contract for the PWA install flow (installability gate fields, `beforeinstallprompt` handshake, per-platform paths - Android WebAPK / iOS Share menu / Firefox no-op - and the `display-mode` post-install signal, in references/install-flow-reference.md) plus the build-an-X workflow that emits the Add-to-Home-Screen suite. Walks the four-stage timeline, emitting one test per gate cell per [web.dev/articles/install-criteria][install-criteria], the deferred-prompt → `prompt()` → `userChoice` chain per [web.dev/articles/customize-install][customize-install], the iOS Safari manual-metadata branch (`apple-touch-icon`) per [web.dev/learn/pwa/installation][learn-pwa], and the post-install `(display-mode: standalone)` MQ assertion. Output: a Playwright spec with per-stage cells plus a coverage matrix. Use when a PWA's manifest, icons, or install handler change, when install conversion drops at an unknown stage, or when triaging a flaky install assertion.

日本語の概要は準備中です。原文の説明を表示しています。

testland/qa132026年10月20日 更新

Build-an-X workflow that uses an LLM to map existing tests to spec sections - given a spec doc + the test suite, the LLM identifies which tests cover which sections, surfaces uncovered sections (gap), and recommends specific tests to add. Output is a coverage matrix per spec ID. Scope is mapping tests that already exist and naming the gaps, not authoring tests for new acceptance criteria. Use when a spec doc and a test suite both exist but nobody can say which requirements are actually covered - before a release sign-off, an audit, or a decision about where to spend the next round of test effort.

日本語の概要は準備中です。原文の説明を表示しています。

testland/qa132026年10月20日 更新

Generates tests from natural-language specs (acceptance criteria, user stories, requirements) using an LLM, with confidence scoring per test case (LLM self-assessment plus heuristics: assertion quality, naming, completeness), batching uncertain cases for human review, and integration with the team's existing test framework. Use when the user asks to generate unit tests from acceptance criteria, convert user stories to test cases, automate test creation from requirements, or augment a spec-driven test suite with AI-generated stubs that are then curated before merge.

日本語の概要は準備中です。原文の説明を表示しています。

testland/qa132026年10月20日 更新

Configures Allure Report (test-runner adapter install, `allure-results` directory wiring, `categories.json` for failure classification, `history-trend.json` retention via the copy-history-between-runs pattern), runs the Allure CLI to convert `allure-results` to a static HTML site, and uploads the report as a CI artifact. Use when the team needs richer test reporting than JUnit XML - step-level attachments, per-test history, retry tracking, and severity / epic / feature labeling across framework-agnostic adapters (pytest, Jest, JUnit, TestNG, NUnit, Mocha). As a rich static HTML report generator, it is the open-source alternative to the sunset ExtentReports (JVM/.NET per-test HTML narrative); for hosted cross-run flakiness analytics rather than a static per-run report use currents-integration.

日本語の概要は準備中です。原文の説明を表示しています。

testland/qa132026年10月20日 更新

testland のスキルをすべて見る

このスキルの問題を報告する