lighthouse-ci
安装方式
先用 Prompt 核对来源与依赖。也可下载安装包。
用 AI 助手安装
复制提示词,让助手先核对固定版本和依赖。
查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "lighthouse-ci":https://skillpi.com/zh/skills/deepskill-9d9f4e2ee8b8165ad4bab85f1fc9f99ca15dd853a0fb658cb7b0223d3920279f。安装前核对上游来源和版本:https://github.com/TerminalSkills/skills。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。
来源与配置
github.com
配置方式待核实
请查看原始来源中的适用工具、依赖和权限要求。
安装实测待补充
在 CI 中使用 Lighthouse CI 自动运行 Lighthouse 审计。适用于需要跟踪核心 Web 指标、防止性能回退、在持续集成流程中审计可访问性或为 Web 应用建立性能预算的场景。
介绍来源: third_party · TerminalSkills · 1.0.0 参考来源
SkillPi 解读
- 实测状态
- 未测试
文件浏览
Frontmatter
name: lighthouse-ci
description: >-
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.
license: Apache-2.0
compatibility: 'Any web app, GitHub Actions, GitLab CI'
metadata:
author: terminal-skills
version: 1.0.0
category: development
tags:
- lighthouse
- performance
- web-vitals
- accessibility
- ciLighthouse 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.
当前收录版本
1.0.0
安全与评测信息
质量评测
满分100 · 来自 SkillPi LAB 实验室的评测报告。
亮点
- 解决 CI 中自动化性能审计的明确痛点
- 覆盖 Core Web Vitals 跟踪、性能预算等高频需求
- 目标用户群体广泛(Web 开发者、DevOps)
亮点
- 触发词精准完整,覆盖多种变体
- 边界清晰,不易误触或漏触
亮点
- Phase/步骤清晰,有出口条件
- 包含端到端完整示例
- frontmatter 完整,单文件长度合规
亮点
- 工具来源明确(lighthouse-ci-action@v11)
- 参数正确,覆盖主要异常(numberOfRuns=3)
- 无不可逆操作风险
取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。
正文静态检测
100 / 100 · skillpi-20261123-no-r3-v1
正文未命中当前规则。
分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。
权限与使用前检查
根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。
未从主文档识别到上述常见操作,不能据此判断无需权限或没有风险。
文档引用的域名或地址
这些地址可能用于文档链接或示例,不是已批准的联网清单。使用前核对实际目的地及发送的数据。
- localhost
安全评级与访问范围
safe · 静态证据核验,不代表运行安全保证。
使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。
用户讨论
还没有已核实的点评。