lighthouse-ci
Lighthouse CIは、CI環境でLighthouse監査を自動化し、ウェブサイトの主要な指標を継続的に監視、パフォーマンスの低下を防ぎ、アクセシビリティを監査、予算を設定することで、ウェブアプリの品質向上を支援するSkill。
📜 元の英語説明(参考)
Automate Lighthouse audits in CI with Lighthouse CI. Use when a user asks to track Core Web Vitals, prevent performance regressions, audit accessibility in CI, or set performance budgets for web apps.
🇯🇵 日本人クリエイター向け解説
Lighthouse CIは、CI環境でLighthouse監査を自動化し、ウェブサイトの主要な指標を継続的に監視、パフォーマンスの低下を防ぎ、アクセシビリティを監査、予算を設定することで、ウェブアプリの品質向上を支援するSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o lighthouse-ci.zip https://jpskill.com/download/15070.zip && unzip -o lighthouse-ci.zip && rm lighthouse-ci.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/15070.zip -OutFile "$d\lighthouse-ci.zip"; Expand-Archive "$d\lighthouse-ci.zip" -DestinationPath $d -Force; ri "$d\lighthouse-ci.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
lighthouse-ci.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
lighthouse-ciフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 1
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
Lighthouse CI
概要
Lighthouse CI は、すべての PR で Google Lighthouse の監査を自動的に実行します。パフォーマンス予算を設定し、Core Web Vitals を経時的に追跡し、リグレッションを防ぎます。パフォーマンスの問題が本番環境に到達する前に検出します。
手順
ステップ 1: 設定
// lighthouserc.js — Lighthouse CI の設定
module.exports = {
ci: {
collect: {
url: [
'http://localhost:3000/',
'http://localhost:3000/dashboard',
'http://localhost:3000/pricing',
],
startServerCommand: 'npm run start',
startServerReadyPattern: 'ready on',
numberOfRuns: 3, // 安定性のために3回実行の平均を取る
settings: {
preset: 'desktop', // または 'mobile' (デフォルト)
},
},
assert: {
assertions: {
'categories:performance': ['error', { minScore: 0.9 }],
'categories:accessibility': ['error', { minScore: 0.95 }],
'categories:best-practices': ['warn', { minScore: 0.9 }],
'categories:seo': ['warn', { minScore: 0.9 }],
// Core Web Vitals
'first-contentful-paint': ['error', { maxNumericValue: 2000 }],
'largest-contentful-paint': ['error', { maxNumericValue: 2500 }],
'cumulative-layout-shift': ['error', { maxNumericValue: 0.1 }],
'total-blocking-time': ['error', { maxNumericValue: 300 }],
},
},
upload: {
target: 'temporary-public-storage', // 無料、レポートは7日間利用可能
},
},
}
ステップ 2: GitHub Actions
# .github/workflows/lighthouse.yml — GitHub Actions での Lighthouse CI
name: Lighthouse CI
on: [pull_request]
jobs:
lighthouse:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: 20, cache: pnpm }
- run: pnpm install --frozen-lockfile
- run: pnpm build
- name: Run Lighthouse CI
uses: treosh/lighthouse-ci-action@v11
with:
configPath: './lighthouserc.js'
uploadArtifacts: true
temporaryPublicStorage: true
ステップ 3: パフォーマンス予算
// budget.json — リソース予算
[
{
"path": "/*",
"resourceSizes": [
{ "resourceType": "script", "budget": 300 },
{ "resourceType": "total", "budget": 500 },
{ "resourceType": "image", "budget": 200 },
{ "resourceType": "stylesheet", "budget": 50 }
],
"resourceCounts": [
{ "resourceType": "third-party", "budget": 5 }
]
}
]
ガイドライン
- 最小でも
numberOfRuns: 3を設定してください。1 回の実行では分散が大きくなります。 - まず
warnアサーションから始め、ベースラインが安定したらerrorに切り替えます。 - すべてのページではなく、重要なユーザーパス(ランディング、ダッシュボード、チェックアウト)をテストします。
- パフォーマンス予算は「もう 1 つのスクリプト」を防ぎます。バンドルサイズの肥大化を早期に検出できます。
- 無料のレポートホスティングには
temporary-public-storageを使用します。履歴を保持するには LHCI Server をセルフホストしてください。
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Lighthouse CI
Overview
Lighthouse CI runs Google Lighthouse audits automatically on every PR. Set performance budgets, track Core Web Vitals over time, and prevent regressions. Catches performance issues before they reach production.
Instructions
Step 1: Configuration
// lighthouserc.js — Lighthouse CI config
module.exports = {
ci: {
collect: {
url: [
'http://localhost:3000/',
'http://localhost:3000/dashboard',
'http://localhost:3000/pricing',
],
startServerCommand: 'npm run start',
startServerReadyPattern: 'ready on',
numberOfRuns: 3, // average 3 runs for stability
settings: {
preset: 'desktop', // or 'mobile' (default)
},
},
assert: {
assertions: {
'categories:performance': ['error', { minScore: 0.9 }],
'categories:accessibility': ['error', { minScore: 0.95 }],
'categories:best-practices': ['warn', { minScore: 0.9 }],
'categories:seo': ['warn', { minScore: 0.9 }],
// Core Web Vitals
'first-contentful-paint': ['error', { maxNumericValue: 2000 }],
'largest-contentful-paint': ['error', { maxNumericValue: 2500 }],
'cumulative-layout-shift': ['error', { maxNumericValue: 0.1 }],
'total-blocking-time': ['error', { maxNumericValue: 300 }],
},
},
upload: {
target: 'temporary-public-storage', // free, reports available for 7 days
},
},
}
Step 2: GitHub Actions
# .github/workflows/lighthouse.yml — Lighthouse CI in GitHub Actions
name: Lighthouse CI
on: [pull_request]
jobs:
lighthouse:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: 20, cache: pnpm }
- run: pnpm install --frozen-lockfile
- run: pnpm build
- name: Run Lighthouse CI
uses: treosh/lighthouse-ci-action@v11
with:
configPath: './lighthouserc.js'
uploadArtifacts: true
temporaryPublicStorage: true
Step 3: Performance Budgets
// budget.json — Resource budgets
[
{
"path": "/*",
"resourceSizes": [
{ "resourceType": "script", "budget": 300 },
{ "resourceType": "total", "budget": 500 },
{ "resourceType": "image", "budget": 200 },
{ "resourceType": "stylesheet", "budget": 50 }
],
"resourceCounts": [
{ "resourceType": "third-party", "budget": 5 }
]
}
]
Guidelines
- Set
numberOfRuns: 3minimum — single runs have high variance. - Start with
warnassertions, switch toerroronce baselines are stable. - Test critical user paths (landing, dashboard, checkout), not every page.
- Performance budgets prevent "just one more script" — bundle size creep caught early.
- Use
temporary-public-storagefor free report hosting; self-host LHCI Server for history.