[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6F6KW7ZWWCCPGM2TR8WCG95":3,"skill-same:01M6F6KW7ZWWCCPGM2TR8WCG95":73},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":41,"linkOnly":42,"markdownContent":43,"markdownBody":44,"frontMatter":45,"refName":30,"commitSha":53,"skillDirectory":54,"forksCount":55,"repositoryHtmlUrl":56,"repositoryHomepageUrl":6,"ownerHtmlUrl":57,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":58,"install":59,"resources":72},"01M6F6KW7ZWWCCPGM2TR8WCG95","frontend-lighthouse",null,"Add a portable Lighthouse CI gate for production frontend builds with Core Web Vitals budgets, category floors, median runs, and CI artifacts.","boisenoise\u002Fskills-collections","boisenoise","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F193180?v=4","01M6CDBDQK6BDN55ZMA6B6PKBM","01M6CDBDVSJ3JPTBYN26FZ7TZK",13,"MIT","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-frontend-lighthouse\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40],"frontend lighthouse","Lighthouse","frontend","node","2026","vitals","for","with","web vitals","add","core-web-vitals","median","main","community","github-actions","ci","actions","license","artifacts","core","architecture","performance","safe","2026-11-10 10:12:30",false,"---\nname: frontend-lighthouse\ndescription: \"Add a portable Lighthouse CI gate for production frontend builds with Core Web Vitals budgets, category floors, median runs, and CI artifacts.\"\ncategory: frontend\nrisk: safe\nsource: community\nsource_repo: stareezy-1\u002Ffrontend-architecture-skill\nsource_type: community\ndate_added: \"2026-06-29\"\nauthor: stareezy-1\ntags: [frontend, lighthouse, performance, core-web-vitals, ci]\ntools: [lighthouse, node, github-actions]\nlicense: \"MIT\"\nlicense_source: \"https:\u002F\u002Fgithub.com\u002Fstareezy-1\u002Ffrontend-architecture-skill\u002Fblob\u002Fmain\u002FLICENSE\"\n---\n\n# Frontend Lighthouse (portable performance gate)\n\n> Portable skill — readable by Claude Code, OpenCode, Codex, Cursor, Windsurf, and others.\n> This skill describes a **CI performance gate** — a Lighthouse CI config plus a workflow — not a\n> component library or a visual style. It pairs with the **frontend-seo** and\n> **frontend-architecture** skills: SEO writes the metadata, Lighthouse supplies a reproducible lab performance signal.\n\nThe goal: every pull request is **blocked unless the production build meets explicit Core Web\nVitals budgets and category score floors**. Budgets live in **one** `lighthouserc.cjs`, runs are\n**median-of-N** to reduce noise, and the same config runs locally and in CI.\n\n## When to Use This Skill\n\n- Use when adding a Lighthouse CI performance gate to a web app.\n- Use when setting Core Web Vitals budgets for LCP, CLS, and TBT as the lab proxy for INP.\n- Use when configuring category score floors for performance, SEO, accessibility, and best practices.\n- Use when debugging flaky Lighthouse runs or making reports visible as CI artifacts.\n\n---\n\nLighthouse category scores and navigation lab metrics are not field Core Web Vitals certification or complete accessibility\u002FSEO verification. Configure the job as a required check in branch protection for actual blocking; a workflow alone does not enforce that. Required checks with path filters can remain pending, so align trigger policy with repository rules. Build\u002Faudit code from PRs only with read-only credentials, bounded runtime and no production secrets; reports may contain page content\u002FURLs.\n\n## 0. The five core ideas\n\n1. **One config, one source of truth.** All budgets and assertions live in a single `lighthouserc.cjs`. Named constants for each budget — no magic numbers buried in assertion objects.\n2. **Gate the production build, never dev.** Lighthouse runs against `build` + `start` (the real, optimized output). Dev-server numbers are meaningless for a budget.\n3. **Multiple runs reduce noise.** Run 3+ times and assert on the median run, to reduce per-run jitter; repeated runs do not eliminate CI noise.\n4. **Separate lab budgets from field thresholds.** Use LCP\u002FCLS lab budgets plus a chosen TBT budget; field INP ≤200 ms needs separate representative field monitoring. Lab category scores do not certify field CWV.\n5. **Blocking in CI, visible as artifacts.** A GitHub Action runs the gate on every PR touching the app and uploads the HTML\u002FJSON reports so failures are debuggable.\n\n---\n\n## 1. Files this skill adds\n\n```\nrepository\u002F\n├── .github\u002Fworkflows\u002Flighthouse.yml  ← workflow must be at repository root\n└── apps\u002Fweb\u002F                        ← or your app root\n    ├── lighthouserc.cjs              ← budgets, assertions and collect settings\n    └── package.json                 ← \"lhci\": \"lhci autorun --config=.\u002Flighthouserc.cjs\"\n```\n\nPlus a dev dependency: `@lhci\u002Fcli`.\n\n```bash\npnpm add -D @lhci\u002Fcli        # or npm i -D \u002F yarn add -D\n```\n\n---\n\n## 2. The config (`lighthouserc.cjs`)\n\n`.cjs` (CommonJS) so it loads without ESM\u002FTS transpilation. Every budget is a **named constant**\nwith a comment explaining the threshold — never a bare number inside an assertion.\n\n```js\n\u002F**\n * Lighthouse CI configuration — Core Web Vitals budgets for the marketing surface.\n *\n * Enforces Google's mobile \"good\" CWV thresholds:\n *   - Largest Contentful Paint (LCP) ≤ 2500 ms\n *   - Cumulative Layout Shift (CLS)  ≤ 0.1\n *   - Interaction to Next Paint (INP) ≤ 200 ms\n *\n * INP is a *field* metric with no direct lab audit, so in the lab we gate on\n * Total Blocking Time (TBT) with a separately selected budget. There is no\n * experimental INP audit assumed here; measure INP with field instrumentation.\n *\n * Collection runs against the *production* server (build + start) on Lighthouse's\n * default mobile (Moto G4 \u002F slow 4G) emulation.\n *\u002F\n\n\u002F** The fixed port the production server is started on for the audit. *\u002F\nconst PORT = 3100;\nconst BASE_URL = `http:\u002F\u002Flocalhost:${PORT}`;\n\n\u002F** Pages whose budgets are enforced in CI. *\u002F\nconst MARKETING_URLS = [`${BASE_URL}\u002F`];\n\n\u002F**\n * Core Web Vitals budgets on mobile — Google's \"good\" thresholds.\n * These are the values that earn the best Lighthouse scores.\n *\u002F\nconst LCP_BUDGET_MS = 2500; \u002F\u002F good\nconst TBT_BUDGET_MS = 200; \u002F\u002F Chosen lab budget; not an INP measurement\nconst CLS_BUDGET = 0.1; \u002F\u002F good\n\nmodule.exports = {\n  ci: {\n    collect: {\n      \u002F\u002F Build is run separately in CI; here we only serve the production output.\n      startServerCommand: `pnpm start --port ${PORT}`,\n      startServerReadyPattern: \"Ready in\", \u002F\u002F framework's \"server ready\" log line\n      startServerReadyTimeout: 120000,\n      url: MARKETING_URLS,\n      \u002F\u002F Median of multiple runs keeps the gate stable against per-run jitter.\n      numberOfRuns: 3,\n      settings: {\n        \u002F\u002F Default mobile emulation; opt into desktop via env for a second run.\n        preset:\n          process.env.LHCI_FORM_FACTOR === \"desktop\" ? \"desktop\" : undefined,\n        \u002F\u002F Only gate the categories we care about; skip PWA category noise.\n        onlyCategories: [\n          \"performance\",\n          \"seo\",\n          \"accessibility\",\n          \"best-practices\",\n        ],\n      },\n    },\n    assert: {\n      \u002F\u002F Per-audit median aggregation is configured on each assertion.\n      \u002F\u002F Set aggregationMethod per assertion below.\n      assertions: {\n        \u002F\u002F --- Core Web Vitals budgets (the contract) ---------------------\n        \"largest-contentful-paint\": [\n          \"error\",\n          { maxNumericValue: LCP_BUDGET_MS, aggregationMethod: \"median\" },\n        ],\n        \"cumulative-layout-shift\": [\"error\", { maxNumericValue: CLS_BUDGET, aggregationMethod: \"median\" }],\n        \"total-blocking-time\": [\"error\", { maxNumericValue: TBT_BUDGET_MS, aggregationMethod: \"median\" }],\n        \u002F\u002F --- Category floors (target top Lighthouse scores) -------------\n        \"categories:performance\": [\"error\", { minScore: 0.9, aggregationMethod: \"median\" }],\n        \"categories:seo\": [\"error\", { minScore: 0.95, aggregationMethod: \"median\" }],\n        \"categories:accessibility\": [\"error\", { minScore: 0.95, aggregationMethod: \"median\" }],\n        \"categories:best-practices\": [\"error\", { minScore: 0.9, aggregationMethod: \"median\" }],\n      },\n    },\n    upload: {\n      \u002F\u002F Keep reports in the CI run's filesystem; no external LHCI server.\n      target: \"filesystem\",\n      outputDir: \".\u002F.lighthouseci\",\n    },\n  },\n};\n```\n\n**Hard rules:**\n\n- Every budget is a named constant with a unit in its name (`LCP_BUDGET_MS`) and a comment.\n- `aggregationMethod: \"median\"` is non-negotiable — single-run gates flake constantly.\n- `numberOfRuns` ≥ 3 (odd numbers give a clean median).\n- TBT is a lab diagnostic correlated with responsiveness, not an INP threshold guarantee. Do not configure a nonexistent INP audit; measure field INP separately.\n- Keep `onlyCategories` to exactly what you gate — fewer audits, faster, less noise.\n\n---\n\n## 3. Choosing budget severity and thresholds\n\n| Audit \u002F category            | Severity | Threshold | Why                                                   |\n| --------------------------- | -------- | --------- | ----------------------------------------------------- |\n| `largest-contentful-paint`  | `error`  | ≤ 2500 ms | Google \"good\" LCP                                     |\n| `cumulative-layout-shift`   | `error`  | ≤ 0.1     | Google \"good\" CLS                                     |\n| `total-blocking-time`       | `error`  | ≤ 200 ms  | INP lab proxy                                         |\n| Field INP | separate monitoring | ≤ 200 ms | Not supplied by default Lighthouse navigation audit |\n| `categories:performance`    | `error`  | ≥ 0.9     | top (green) band                                      |\n| `categories:seo`            | `error`  | ≥ 0.95    | SEO is cheap to keep perfect                          |\n| `categories:accessibility`  | `error`  | ≥ 0.95    | a11y regressions must block                           |\n| `categories:best-practices` | `error`  | ≥ 0.9     | green band                                            |\n\nUse `error` for contracts that must hold and `warn` for audits that are environment-dependent or\naspirational. **Start strict and only loosen with a recorded reason** — a budget you keep raising\nto make CI pass is a budget that no longer protects anything.\n\n---\n\n## 4. The npm script\n\n```jsonc\n\u002F\u002F package.json\n{\n  \"scripts\": {\n    \"lhci\": \"lhci autorun --config=.\u002Flighthouserc.cjs\"\n  }\n}\n```\n\n`lhci autorun` runs `collect` → `assert` → `upload` in sequence. Run it locally before pushing to\nreproduce exactly what CI does:\n\n```bash\npnpm build && pnpm lhci\n# desktop form factor:\nLHCI_FORM_FACTOR=desktop pnpm build && LHCI_FORM_FACTOR=desktop pnpm lhci\n```\n\n---\n\n## 5. The GitHub Actions workflow\n\nRuns on PRs that touch the app or the workflow itself. Builds the production output, runs the\ngate, and **always** uploads the reports (even on failure) so a red check is debuggable.\n\n```yaml\nname: Lighthouse CWV\n\non:\n  pull_request:\n    branches: [main]\n    paths:\n      - \"apps\u002Fweb\u002F**\"\n      - \".github\u002Fworkflows\u002Flighthouse.yml\"\n      - \"package.json\"\n      - \"pnpm-lock.yaml\"\n      - \"pnpm-workspace.yaml\"\n\npermissions:\n  contents: read\n\njobs:\n  lighthouse:\n    name: Lighthouse CWV (marketing pages)\n    runs-on: ubuntu-latest\n    defaults:\n      run:\n        working-directory: apps\u002Fweb\n    steps:\n      - uses: actions\u002Fcheckout@v4\n\n      - name: Setup pnpm\n        uses: pnpm\u002Faction-setup@v4 # version comes from root package.json packageManager\n\n      - name: Setup Node\n        uses: actions\u002Fsetup-node@v4\n        with:\n          node-version: 22\n          cache: pnpm\n\n      - name: Install dependencies\n        working-directory: .\n        run: pnpm install --frozen-lockfile\n\n      - name: Build web app\n        run: pnpm build\n\n      # build + start the production server, run Lighthouse on mobile emulation,\n      # fail the job if any budget in lighthouserc.cjs is exceeded.\n      - name: Run Lighthouse CI\n        run: pnpm lhci\n\n      - name: Upload Lighthouse reports\n        if: always()\n        uses: actions\u002Fupload-artifact@v4\n        with:\n          name: lighthouse-reports\n          path: apps\u002Fweb\u002F.lighthouseci\n          if-no-files-found: ignore\n```\n\n**Hard rules:**\n\n- Trigger on the app path **and** the workflow file so config changes are self-testing.\n- `if: always()` on the upload step — you need the report most when the gate fails.\n- Gate on the **production** build (`pnpm build` then the `start` server in `collect`).\n- Match the CI Node\u002Fpnpm versions to the repo's pinned versions to avoid lockfile drift.\n\n---\n\n## 6. Framework adapters\n\nThe config is framework-neutral except `startServerCommand` and `startServerReadyPattern`.\n\n| Framework     | `startServerCommand`                                              | `startServerReadyPattern`                   |\n| ------------- | ----------------------------------------------------------------- | ------------------------------------------- |\n| **Next.js**   | `pnpm start --port 3100` (after `next build`)                     | `\"Ready in\"`                                |\n| **Remix**     | `pnpm start` (serve the built app)                                | server's listening log line                 |\n| **Astro**     | `node .\u002Fdist\u002Fserver\u002Fentry.mjs` (SSR) or `npx serve dist` (static) | the adapter's ready line \u002F serve's URL line |\n| **SvelteKit** | `node build` (node adapter)                                       | `\"Listening on\"`                            |\n| **Vite SPA**  | `npx vite preview --port 3100`                                    | `\"Local:\"`                                  |\n\nFor purely static output you can skip the server and point `collect.staticDistDir` at the build\nfolder instead of `startServerCommand` — Lighthouse serves it internally.\n\n---\n\n## 7. Debugging failing or flaky runs\n\n- **Flaky LCP\u002FTBT** → raise `numberOfRuns` (5), confirm `median`, and make sure nothing else is competing for CPU on the runner.\n- **Unknown audit errors** → remove unsupported audit assertions after checking the pinned Lighthouse audit list; warn does not make a missing audit valid.\n- **\"server not ready\" timeout** → fix `startServerReadyPattern` to match the framework's actual ready log, and raise `startServerReadyTimeout`.\n- **Real regressions** → open the uploaded report artifact, read the failed audit's \"Opportunities\"\u002F\"Diagnostics\", fix the cause (oversized image, render-blocking JS, layout shift from unsized media) — don't just bump the budget.\n- **Desktop vs mobile divergence** → run both form factors; mobile is the stricter gate and should be the default.\n\n---\n\n## 8. Conventions checklist (enforce in review)\n\n- [ ] All budgets are named constants with units and comments — no magic numbers in assertions.\n- [ ] Gate runs against the **production** build, never the dev server.\n- [ ] `aggregationMethod: \"median\"` with `numberOfRuns` ≥ 3.\n- [ ] Lab budgets explicitly named (LCP ≤2500, chosen TBT ≤200, CLS ≤0.1), with separate field CWV monitoring.\n- [ ] TBT is a separately named lab budget; field INP is measured separately.\n- [ ] Category floors set as `error` (perf ≥ 0.9, SEO\u002Fa11y ≥ 0.95, best-practices ≥ 0.9).\n- [ ] `onlyCategories` lists exactly the gated categories.\n- [ ] CI triggers on the app path **and** the workflow file; reports upload with `if: always()`.\n- [ ] Local `pnpm lhci` reproduces the CI run.\n- [ ] Budgets are tightened over time, loosened only with a recorded reason.\n\n---\n\n## 9. How to apply this skill\n\n**Adding the gate to a project:** install `@lhci\u002Fcli`, drop in `lighthouserc.cjs` with your URLs\nand `startServerCommand`, add the `lhci` script, and add the workflow. Run `pnpm build && pnpm lhci`\nlocally to confirm it passes before opening a PR.\n\n**Adding a page to the gate:** append its URL to `MARKETING_URLS` (or a second URL array). Each URL\nis audited independently against the same budgets.\n\n**Tuning budgets:** change the named constant, not the assertion. Record why in the comment. Prefer\nfixing the regression over raising the budget.\n\n**Reviewing performance:** run the checklist in §8. The highest-value catches are a gate that runs\nagainst the dev server (meaningless numbers) and single-run assertions (chronic flakiness).\n\n---\n\n## Publishing \u002F installing this skill\n\nThis skill follows the Anthropic `SKILL.md` format and is portable across agents.\n\n1. Keep it under `skills\u002Ffrontend-lighthouse\u002FSKILL.md` in a public GitHub repo.\n2. Keep the frontmatter `name` and high-signal `description` — discovery indexes match against it.\n3. Install with: `npx skills add \u003Corg>\u002F\u003Crepo> --skill \"frontend-lighthouse\"`.\n4. Non-`SKILL.md` agents can be pointed here from `AGENTS.md` \u002F `CLAUDE.md`; Kiro can mirror it as a steering file.\n\n## Limitations\n\n- Lighthouse CI is a lab signal and does not replace field monitoring from real-user metrics.\n- Budgets must be tuned to the actual app route, hosting platform, and device\u002Fnetwork assumptions.\n- A passing Lighthouse gate does not prove business-critical flows, visual correctness, or backend availability.\n","# Frontend Lighthouse (portable performance gate)\n\n> Portable skill — readable by Claude Code, OpenCode, Codex, Cursor, Windsurf, and others.\n> This skill describes a **CI performance gate** — a Lighthouse CI config plus a workflow — not a\n> component library or a visual style. It pairs with the **frontend-seo** and\n> **frontend-architecture** skills: SEO writes the metadata, Lighthouse supplies a reproducible lab performance signal.\n\nThe goal: every pull request is **blocked unless the production build meets explicit Core Web\nVitals budgets and category score floors**. Budgets live in **one** `lighthouserc.cjs`, runs are\n**median-of-N** to reduce noise, and the same config runs locally and in CI.\n\n## When to Use This Skill\n\n- Use when adding a Lighthouse CI performance gate to a web app.\n- Use when setting Core Web Vitals budgets for LCP, CLS, and TBT as the lab proxy for INP.\n- Use when configuring category score floors for performance, SEO, accessibility, and best practices.\n- Use when debugging flaky Lighthouse runs or making reports visible as CI artifacts.\n\n---\n\nLighthouse category scores and navigation lab metrics are not field Core Web Vitals certification or complete accessibility\u002FSEO verification. Configure the job as a required check in branch protection for actual blocking; a workflow alone does not enforce that. Required checks with path filters can remain pending, so align trigger policy with repository rules. Build\u002Faudit code from PRs only with read-only credentials, bounded runtime and no production secrets; reports may contain page content\u002FURLs.\n\n## 0. The five core ideas\n\n1. **One config, one source of truth.** All budgets and assertions live in a single `lighthouserc.cjs`. Named constants for each budget — no magic numbers buried in assertion objects.\n2. **Gate the production build, never dev.** Lighthouse runs against `build` + `start` (the real, optimized output). Dev-server numbers are meaningless for a budget.\n3. **Multiple runs reduce noise.** Run 3+ times and assert on the median run, to reduce per-run jitter; repeated runs do not eliminate CI noise.\n4. **Separate lab budgets from field thresholds.** Use LCP\u002FCLS lab budgets plus a chosen TBT budget; field INP ≤200 ms needs separate representative field monitoring. Lab category scores do not certify field CWV.\n5. **Blocking in CI, visible as artifacts.** A GitHub Action runs the gate on every PR touching the app and uploads the HTML\u002FJSON reports so failures are debuggable.\n\n---\n\n## 1. Files this skill adds\n\n```\nrepository\u002F\n├── .github\u002Fworkflows\u002Flighthouse.yml  ← workflow must be at repository root\n└── apps\u002Fweb\u002F                        ← or your app root\n    ├── lighthouserc.cjs              ← budgets, assertions and collect settings\n    └── package.json                 ← \"lhci\": \"lhci autorun --config=.\u002Flighthouserc.cjs\"\n```\n\nPlus a dev dependency: `@lhci\u002Fcli`.\n\n```bash\npnpm add -D @lhci\u002Fcli        # or npm i -D \u002F yarn add -D\n```\n\n---\n\n## 2. The config (`lighthouserc.cjs`)\n\n`.cjs` (CommonJS) so it loads without ESM\u002FTS transpilation. Every budget is a **named constant**\nwith a comment explaining the threshold — never a bare number inside an assertion.\n\n```js\n\u002F**\n * Lighthouse CI configuration — Core Web Vitals budgets for the marketing surface.\n *\n * Enforces Google's mobile \"good\" CWV thresholds:\n *   - Largest Contentful Paint (LCP) ≤ 2500 ms\n *   - Cumulative Layout Shift (CLS)  ≤ 0.1\n *   - Interaction to Next Paint (INP) ≤ 200 ms\n *\n * INP is a *field* metric with no direct lab audit, so in the lab we gate on\n * Total Blocking Time (TBT) with a separately selected budget. There is no\n * experimental INP audit assumed here; measure INP with field instrumentation.\n *\n * Collection runs against the *production* server (build + start) on Lighthouse's\n * default mobile (Moto G4 \u002F slow 4G) emulation.\n *\u002F\n\n\u002F** The fixed port the production server is started on for the audit. *\u002F\nconst PORT = 3100;\nconst BASE_URL = `http:\u002F\u002Flocalhost:${PORT}`;\n\n\u002F** Pages whose budgets are enforced in CI. *\u002F\nconst MARKETING_URLS = [`${BASE_URL}\u002F`];\n\n\u002F**\n * Core Web Vitals budgets on mobile — Google's \"good\" thresholds.\n * These are the values that earn the best Lighthouse scores.\n *\u002F\nconst LCP_BUDGET_MS = 2500; \u002F\u002F good\nconst TBT_BUDGET_MS = 200; \u002F\u002F Chosen lab budget; not an INP measurement\nconst CLS_BUDGET = 0.1; \u002F\u002F good\n\nmodule.exports = {\n  ci: {\n    collect: {\n      \u002F\u002F Build is run separately in CI; here we only serve the production output.\n      startServerCommand: `pnpm start --port ${PORT}`,\n      startServerReadyPattern: \"Ready in\", \u002F\u002F framework's \"server ready\" log line\n      startServerReadyTimeout: 120000,\n      url: MARKETING_URLS,\n      \u002F\u002F Median of multiple runs keeps the gate stable against per-run jitter.\n      numberOfRuns: 3,\n      settings: {\n        \u002F\u002F Default mobile emulation; opt into desktop via env for a second run.\n        preset:\n          process.env.LHCI_FORM_FACTOR === \"desktop\" ? \"desktop\" : undefined,\n        \u002F\u002F Only gate the categories we care about; skip PWA category noise.\n        onlyCategories: [\n          \"performance\",\n          \"seo\",\n          \"accessibility\",\n          \"best-practices\",\n        ],\n      },\n    },\n    assert: {\n      \u002F\u002F Per-audit median aggregation is configured on each assertion.\n      \u002F\u002F Set aggregationMethod per assertion below.\n      assertions: {\n        \u002F\u002F --- Core Web Vitals budgets (the contract) ---------------------\n        \"largest-contentful-paint\": [\n          \"error\",\n          { maxNumericValue: LCP_BUDGET_MS, aggregationMethod: \"median\" },\n        ],\n        \"cumulative-layout-shift\": [\"error\", { maxNumericValue: CLS_BUDGET, aggregationMethod: \"median\" }],\n        \"total-blocking-time\": [\"error\", { maxNumericValue: TBT_BUDGET_MS, aggregationMethod: \"median\" }],\n        \u002F\u002F --- Category floors (target top Lighthouse scores) -------------\n        \"categories:performance\": [\"error\", { minScore: 0.9, aggregationMethod: \"median\" }],\n        \"categories:seo\": [\"error\", { minScore: 0.95, aggregationMethod: \"median\" }],\n        \"categories:accessibility\": [\"error\", { minScore: 0.95, aggregationMethod: \"median\" }],\n        \"categories:best-practices\": [\"error\", { minScore: 0.9, aggregationMethod: \"median\" }],\n      },\n    },\n    upload: {\n      \u002F\u002F Keep reports in the CI run's filesystem; no external LHCI server.\n      target: \"filesystem\",\n      outputDir: \".\u002F.lighthouseci\",\n    },\n  },\n};\n```\n\n**Hard rules:**\n\n- Every budget is a named constant with a unit in its name (`LCP_BUDGET_MS`) and a comment.\n- `aggregationMethod: \"median\"` is non-negotiable — single-run gates flake constantly.\n- `numberOfRuns` ≥ 3 (odd numbers give a clean median).\n- TBT is a lab diagnostic correlated with responsiveness, not an INP threshold guarantee. Do not configure a nonexistent INP audit; measure field INP separately.\n- Keep `onlyCategories` to exactly what you gate — fewer audits, faster, less noise.\n\n---\n\n## 3. Choosing budget severity and thresholds\n\n| Audit \u002F category            | Severity | Threshold | Why                                                   |\n| --------------------------- | -------- | --------- | ----------------------------------------------------- |\n| `largest-contentful-paint`  | `error`  | ≤ 2500 ms | Google \"good\" LCP                                     |\n| `cumulative-layout-shift`   | `error`  | ≤ 0.1     | Google \"good\" CLS                                     |\n| `total-blocking-time`       | `error`  | ≤ 200 ms  | INP lab proxy                                         |\n| Field INP | separate monitoring | ≤ 200 ms | Not supplied by default Lighthouse navigation audit |\n| `categories:performance`    | `error`  | ≥ 0.9     | top (green) band                                      |\n| `categories:seo`            | `error`  | ≥ 0.95    | SEO is cheap to keep perfect                          |\n| `categories:accessibility`  | `error`  | ≥ 0.95    | a11y regressions must block                           |\n| `categories:best-practices` | `error`  | ≥ 0.9     | green band                                            |\n\nUse `error` for contracts that must hold and `warn` for audits that are environment-dependent or\naspirational. **Start strict and only loosen with a recorded reason** — a budget you keep raising\nto make CI pass is a budget that no longer protects anything.\n\n---\n\n## 4. The npm script\n\n```jsonc\n\u002F\u002F package.json\n{\n  \"scripts\": {\n    \"lhci\": \"lhci autorun --config=.\u002Flighthouserc.cjs\"\n  }\n}\n```\n\n`lhci autorun` runs `collect` → `assert` → `upload` in sequence. Run it locally before pushing to\nreproduce exactly what CI does:\n\n```bash\npnpm build && pnpm lhci\n# desktop form factor:\nLHCI_FORM_FACTOR=desktop pnpm build && LHCI_FORM_FACTOR=desktop pnpm lhci\n```\n\n---\n\n## 5. The GitHub Actions workflow\n\nRuns on PRs that touch the app or the workflow itself. Builds the production output, runs the\ngate, and **always** uploads the reports (even on failure) so a red check is debuggable.\n\n```yaml\nname: Lighthouse CWV\n\non:\n  pull_request:\n    branches: [main]\n    paths:\n      - \"apps\u002Fweb\u002F**\"\n      - \".github\u002Fworkflows\u002Flighthouse.yml\"\n      - \"package.json\"\n      - \"pnpm-lock.yaml\"\n      - \"pnpm-workspace.yaml\"\n\npermissions:\n  contents: read\n\njobs:\n  lighthouse:\n    name: Lighthouse CWV (marketing pages)\n    runs-on: ubuntu-latest\n    defaults:\n      run:\n        working-directory: apps\u002Fweb\n    steps:\n      - uses: actions\u002Fcheckout@v4\n\n      - name: Setup pnpm\n        uses: pnpm\u002Faction-setup@v4 # version comes from root package.json packageManager\n\n      - name: Setup Node\n        uses: actions\u002Fsetup-node@v4\n        with:\n          node-version: 22\n          cache: pnpm\n\n      - name: Install dependencies\n        working-directory: .\n        run: pnpm install --frozen-lockfile\n\n      - name: Build web app\n        run: pnpm build\n\n      # build + start the production server, run Lighthouse on mobile emulation,\n      # fail the job if any budget in lighthouserc.cjs is exceeded.\n      - name: Run Lighthouse CI\n        run: pnpm lhci\n\n      - name: Upload Lighthouse reports\n        if: always()\n        uses: actions\u002Fupload-artifact@v4\n        with:\n          name: lighthouse-reports\n          path: apps\u002Fweb\u002F.lighthouseci\n          if-no-files-found: ignore\n```\n\n**Hard rules:**\n\n- Trigger on the app path **and** the workflow file so config changes are self-testing.\n- `if: always()` on the upload step — you need the report most when the gate fails.\n- Gate on the **production** build (`pnpm build` then the `start` server in `collect`).\n- Match the CI Node\u002Fpnpm versions to the repo's pinned versions to avoid lockfile drift.\n\n---\n\n## 6. Framework adapters\n\nThe config is framework-neutral except `startServerCommand` and `startServerReadyPattern`.\n\n| Framework     | `startServerCommand`                                              | `startServerReadyPattern`                   |\n| ------------- | ----------------------------------------------------------------- | ------------------------------------------- |\n| **Next.js**   | `pnpm start --port 3100` (after `next build`)                     | `\"Ready in\"`                                |\n| **Remix**     | `pnpm start` (serve the built app)                                | server's listening log line                 |\n| **Astro**     | `node .\u002Fdist\u002Fserver\u002Fentry.mjs` (SSR) or `npx serve dist` (static) | the adapter's ready line \u002F serve's URL line |\n| **SvelteKit** | `node build` (node adapter)                                       | `\"Listening on\"`                            |\n| **Vite SPA**  | `npx vite preview --port 3100`                                    | `\"Local:\"`                                  |\n\nFor purely static output you can skip the server and point `collect.staticDistDir` at the build\nfolder instead of `startServerCommand` — Lighthouse serves it internally.\n\n---\n\n## 7. Debugging failing or flaky runs\n\n- **Flaky LCP\u002FTBT** → raise `numberOfRuns` (5), confirm `median`, and make sure nothing else is competing for CPU on the runner.\n- **Unknown audit errors** → remove unsupported audit assertions after checking the pinned Lighthouse audit list; warn does not make a missing audit valid.\n- **\"server not ready\" timeout** → fix `startServerReadyPattern` to match the framework's actual ready log, and raise `startServerReadyTimeout`.\n- **Real regressions** → open the uploaded report artifact, read the failed audit's \"Opportunities\"\u002F\"Diagnostics\", fix the cause (oversized image, render-blocking JS, layout shift from unsized media) — don't just bump the budget.\n- **Desktop vs mobile divergence** → run both form factors; mobile is the stricter gate and should be the default.\n\n---\n\n## 8. Conventions checklist (enforce in review)\n\n- [ ] All budgets are named constants with units and comments — no magic numbers in assertions.\n- [ ] Gate runs against the **production** build, never the dev server.\n- [ ] `aggregationMethod: \"median\"` with `numberOfRuns` ≥ 3.\n- [ ] Lab budgets explicitly named (LCP ≤2500, chosen TBT ≤200, CLS ≤0.1), with separate field CWV monitoring.\n- [ ] TBT is a separately named lab budget; field INP is measured separately.\n- [ ] Category floors set as `error` (perf ≥ 0.9, SEO\u002Fa11y ≥ 0.95, best-practices ≥ 0.9).\n- [ ] `onlyCategories` lists exactly the gated categories.\n- [ ] CI triggers on the app path **and** the workflow file; reports upload with `if: always()`.\n- [ ] Local `pnpm lhci` reproduces the CI run.\n- [ ] Budgets are tightened over time, loosened only with a recorded reason.\n\n---\n\n## 9. How to apply this skill\n\n**Adding the gate to a project:** install `@lhci\u002Fcli`, drop in `lighthouserc.cjs` with your URLs\nand `startServerCommand`, add the `lhci` script, and add the workflow. Run `pnpm build && pnpm lhci`\nlocally to confirm it passes before opening a PR.\n\n**Adding a page to the gate:** append its URL to `MARKETING_URLS` (or a second URL array). Each URL\nis audited independently against the same budgets.\n\n**Tuning budgets:** change the named constant, not the assertion. Record why in the comment. Prefer\nfixing the regression over raising the budget.\n\n**Reviewing performance:** run the checklist in §8. The highest-value catches are a gate that runs\nagainst the dev server (meaningless numbers) and single-run assertions (chronic flakiness).\n\n---\n\n## Publishing \u002F installing this skill\n\nThis skill follows the Anthropic `SKILL.md` format and is portable across agents.\n\n1. Keep it under `skills\u002Ffrontend-lighthouse\u002FSKILL.md` in a public GitHub repo.\n2. Keep the frontmatter `name` and high-signal `description` — discovery indexes match against it.\n3. Install with: `npx skills add \u003Corg>\u002F\u003Crepo> --skill \"frontend-lighthouse\"`.\n4. Non-`SKILL.md` agents can be pointed here from `AGENTS.md` \u002F `CLAUDE.md`; Kiro can mirror it as a steering file.\n\n## Limitations\n\n- Lighthouse CI is a lab signal and does not replace field monitoring from real-user metrics.\n- Budgets must be tuned to the actual app route, hosting platform, and device\u002Fnetwork assumptions.\n- A passing Lighthouse gate does not prove business-critical flows, visual correctness, or backend availability.\n",{"name":5,"risk":40,"tags":46,"tools":48,"author":49,"source":31,"license":14,"category":20,"date_added":50,"description":7,"source_repo":51,"source_type":31,"license_source":52},[20,47,39,28,33],"lighthouse",[47,21,32],"stareezy-1","2026-06-29","stareezy-1\u002Ffrontend-architecture-skill","https:\u002F\u002Fgithub.com\u002Fstareezy-1\u002Ffrontend-architecture-skill\u002Fblob\u002Fmain\u002FLICENSE","7bf2279c8a65758319526a721d5c4b75683aec9c","skills\u002Fantigravity-frontend-lighthouse",3,"https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections","https:\u002F\u002Fgithub.com\u002Fboisenoise","2026-11-14 14:18:11",{"source":8,"skillName":5,"commands":60,"prompt":70,"zipAvailable":71},[61,64,67],{"tool":62,"command":63},"npx","npx skills add boisenoise\u002Fskills-collections --skill frontend-lighthouse",{"tool":65,"command":66},"bunx","bunx skills add boisenoise\u002Fskills-collections --skill frontend-lighthouse",{"tool":68,"command":69},"pnpm","pnpm dlx skills add boisenoise\u002Fskills-collections --skill frontend-lighthouse","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-frontend-lighthouse\u002FSKILL.md",true,[],[74,83,91,100,108,116],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":78,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":82},"01M7B6HREHB53EHGGVZND7DDXN","scrapely-scrape","Collect web data with ready-made Scrape.ly scrapers: Google Maps places, Amazon products, LinkedIn jobs, reviews, social posts. Use when the user wants structured data from a site.","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-scrapely-scrape\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-scrapely-scrape\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":87,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":82},"01M7B6GDNNN4HE662KA6KPF7GW","lumify-odds","Lumify's hosted sports MCP\u002FREST API for sportsbook odds, line-movement history, public betting splits, and player props across MLB, NFL, NBA, NHL, soccer, tennis, NCAAF, NCAAB. Read-only market data.","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-lumify-odds\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-lumify-odds\u002FSKILL.md",[],[],{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":95,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":99},"01M743PZMJW2GEKG5J199GPSK7","sync-lipsync","Lip-sync an existing video of a real person to new audio or a typed script with sync. labs through its hosted MCP server, quoting the cost and waiting for approval first.","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-sync-lipsync\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-sync-lipsync\u002FSKILL.md",[],[],"2026-11-11 15:11:14",{"skillNo":101,"name":102,"nameZh":6,"description":103,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":104,"sourceHtmlUrl":105,"categories":106,"keywords":107,"publishedAt":99},"01M743MMN3CKTJVNRSZMB684E5","music-for-robots","Optional music-inspired creative exercise for multimodal agents. Ingests an unquantized acoustic MP3 composition by Michael Luchtan (Music For Robots) into a private temporary directory, analyzing microtiming and texture to inspire creative writing, brainstorming, or technical tasks.","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-music-for-robots\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-music-for-robots\u002FSKILL.md",[],[],{"skillNo":109,"name":110,"nameZh":6,"description":111,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":112,"sourceHtmlUrl":113,"categories":114,"keywords":115,"publishedAt":99},"01M743KC2GN5WE11BSTWSSWD8B","imagera-media","Generate or edit images, video clips, voiceovers and music through the hosted Imagera MCP server, quoting the credit cost and getting approval before each paid call.","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-imagera-media\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-imagera-media\u002FSKILL.md",[],[],{"skillNo":117,"name":118,"nameZh":6,"description":119,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":120,"sourceHtmlUrl":121,"categories":122,"keywords":123,"publishedAt":99},"01M743HDJNZQA8A4VT68NWGWQJ","deja-history","Search this machine's past AI coding sessions across Claude Code, Codex, Cursor, Gemini CLI and thirty-nine other agents before editing, debugging, or denying something exists.","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-deja-history\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-deja-history\u002FSKILL.md",[],[]]