[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6P3K46ZSMG4W6HEY39B1RKT":3,"skill-same:01M6P3K46ZSMG4W6HEY39B1RKT":77},{"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":25,"publishedAt":46,"linkOnly":47,"markdownContent":48,"markdownBody":49,"frontMatter":50,"refName":34,"commitSha":58,"skillDirectory":59,"forksCount":13,"repositoryHtmlUrl":60,"repositoryHomepageUrl":6,"ownerHtmlUrl":61,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":62,"install":63,"resources":76},"01M6P3K46ZSMG4W6HEY39B1RKT","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.","duc-duy-1612\u002FOnline-Delivery-Systems-Web","duc-duy-1612","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F192231384?v=4","01M6NSDKQQDKVTHZ8DZMZ1VYY6","01M6NSDKW8DDVTQHBT1HBDDJPT",0,"MIT","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Ffrontend-lighthouse\u002FSKILL.md",[17,22],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000009","前端开发","SCENARIO","使用场景",{"categoryNo":23,"categoryName":24,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000023","Skill与智能体开发",[26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],"frontend","frontend lighthouse","Lighthouse","vitals","for","add","core-web-vitals","median","main","community","node","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 proves it ships fast.\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** so the gate doesn't flake, 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\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. **Median-of-N kills flakiness.** Run 3+ times and assert on the median run, so per-run jitter (cold caches, CI noise) never red-flags a healthy build.\n4. **Budgets encode Google's \"good\" thresholds.** LCP ≤ 2500 ms, INP ≤ 200 ms (gated via the TBT lab proxy), CLS ≤ 0.1 — the values that earn green scores, not \"needs improvement\".\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```\napps\u002Fweb\u002F                          (or your app root)\n├── lighthouserc.cjs               ← the gate: budgets + assertions + collect settings\n├── package.json                   ← \"lhci\": \"lhci autorun --config=.\u002Flighthouserc.cjs\"\n└── .github\u002Fworkflows\u002Flighthouse.yml  ← PR-blocking CI job (build → start → lhci → upload)\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) — Lighthouse's recommended lab proxy — at the same\n * budget, and assert the experimental INP audit directly as a warning where the\n * build exposes it.\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 INP_BUDGET_MS = 200; \u002F\u002F good (TBT lab proxy)\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 Median across runs is the value compared against each budget.\n      aggregationMethod: \"median-run\",\n      assertions: {\n        \u002F\u002F --- Core Web Vitals budgets (the contract) ---------------------\n        \"largest-contentful-paint\": [\n          \"error\",\n          { maxNumericValue: LCP_BUDGET_MS },\n        ],\n        \"cumulative-layout-shift\": [\"error\", { maxNumericValue: CLS_BUDGET }],\n        \"total-blocking-time\": [\"error\", { maxNumericValue: INP_BUDGET_MS }],\n        \u002F\u002F Direct INP audit where the Lighthouse build exposes it (else ignored).\n        \"interaction-to-next-paint\": [\n          \"warn\",\n          { maxNumericValue: INP_BUDGET_MS },\n        ],\n\n        \u002F\u002F --- Category floors (target top Lighthouse scores) -------------\n        \"categories:performance\": [\"error\", { minScore: 0.9 }],\n        \"categories:seo\": [\"error\", { minScore: 0.95 }],\n        \"categories:accessibility\": [\"error\", { minScore: 0.95 }],\n        \"categories:best-practices\": [\"error\", { minScore: 0.9 }],\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-run\"` is non-negotiable — single-run gates flake constantly.\n- `numberOfRuns` ≥ 3 (odd numbers give a clean median).\n- Assert on TBT for INP in the lab; treat the experimental `interaction-to-next-paint` audit as a `warn`, not an `error` (it isn't present in every Lighthouse build).\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| `interaction-to-next-paint` | `warn`   | ≤ 200 ms  | not in all builds; don't hard-fail on a missing 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\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-run`, and make sure nothing else is competing for CPU on the runner.\n- **`interaction-to-next-paint` errors** → it should be `warn`, not `error`; the audit is missing in some Lighthouse versions.\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-run\"` with `numberOfRuns` ≥ 3.\n- [ ] CWV budgets at Google \"good\" thresholds (LCP ≤ 2500, TBT ≤ 200, CLS ≤ 0.1).\n- [ ] INP gated via TBT (`error`); experimental INP audit is `warn`.\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 proves it ships fast.\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** so the gate doesn't flake, 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\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. **Median-of-N kills flakiness.** Run 3+ times and assert on the median run, so per-run jitter (cold caches, CI noise) never red-flags a healthy build.\n4. **Budgets encode Google's \"good\" thresholds.** LCP ≤ 2500 ms, INP ≤ 200 ms (gated via the TBT lab proxy), CLS ≤ 0.1 — the values that earn green scores, not \"needs improvement\".\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```\napps\u002Fweb\u002F                          (or your app root)\n├── lighthouserc.cjs               ← the gate: budgets + assertions + collect settings\n├── package.json                   ← \"lhci\": \"lhci autorun --config=.\u002Flighthouserc.cjs\"\n└── .github\u002Fworkflows\u002Flighthouse.yml  ← PR-blocking CI job (build → start → lhci → upload)\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) — Lighthouse's recommended lab proxy — at the same\n * budget, and assert the experimental INP audit directly as a warning where the\n * build exposes it.\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 INP_BUDGET_MS = 200; \u002F\u002F good (TBT lab proxy)\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 Median across runs is the value compared against each budget.\n      aggregationMethod: \"median-run\",\n      assertions: {\n        \u002F\u002F --- Core Web Vitals budgets (the contract) ---------------------\n        \"largest-contentful-paint\": [\n          \"error\",\n          { maxNumericValue: LCP_BUDGET_MS },\n        ],\n        \"cumulative-layout-shift\": [\"error\", { maxNumericValue: CLS_BUDGET }],\n        \"total-blocking-time\": [\"error\", { maxNumericValue: INP_BUDGET_MS }],\n        \u002F\u002F Direct INP audit where the Lighthouse build exposes it (else ignored).\n        \"interaction-to-next-paint\": [\n          \"warn\",\n          { maxNumericValue: INP_BUDGET_MS },\n        ],\n\n        \u002F\u002F --- Category floors (target top Lighthouse scores) -------------\n        \"categories:performance\": [\"error\", { minScore: 0.9 }],\n        \"categories:seo\": [\"error\", { minScore: 0.95 }],\n        \"categories:accessibility\": [\"error\", { minScore: 0.95 }],\n        \"categories:best-practices\": [\"error\", { minScore: 0.9 }],\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-run\"` is non-negotiable — single-run gates flake constantly.\n- `numberOfRuns` ≥ 3 (odd numbers give a clean median).\n- Assert on TBT for INP in the lab; treat the experimental `interaction-to-next-paint` audit as a `warn`, not an `error` (it isn't present in every Lighthouse build).\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| `interaction-to-next-paint` | `warn`   | ≤ 200 ms  | not in all builds; don't hard-fail on a missing 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\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-run`, and make sure nothing else is competing for CPU on the runner.\n- **`interaction-to-next-paint` errors** → it should be `warn`, not `error`; the audit is missing in some Lighthouse versions.\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-run\"` with `numberOfRuns` ≥ 3.\n- [ ] CWV budgets at Google \"good\" thresholds (LCP ≤ 2500, TBT ≤ 200, CLS ≤ 0.1).\n- [ ] INP gated via TBT (`error`); experimental INP audit is `warn`.\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":45,"tags":51,"tools":53,"author":54,"source":35,"license":14,"category":26,"date_added":55,"description":7,"source_repo":56,"source_type":35,"license_source":57},[26,52,44,32,38],"lighthouse",[52,36,37],"stareezy-1","2026-06-29","stareezy-1\u002Ffrontend-architecture-skill","https:\u002F\u002Fgithub.com\u002Fstareezy-1\u002Ffrontend-architecture-skill\u002Fblob\u002Fmain\u002FLICENSE","f3312ba749561b6159f477dbfc9313c875d40a56",".agents\u002Fskills_archive\u002Ffrontend-lighthouse","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612","2026-10-25 23:50:58",{"source":8,"skillName":5,"commands":64,"prompt":74,"zipAvailable":75},[65,68,71],{"tool":66,"command":67},"npx","npx skills add duc-duy-1612\u002FOnline-Delivery-Systems-Web --skill frontend-lighthouse",{"tool":69,"command":70},"bunx","bunx skills add duc-duy-1612\u002FOnline-Delivery-Systems-Web --skill frontend-lighthouse",{"tool":72,"command":73},"pnpm","pnpm dlx skills add duc-duy-1612\u002FOnline-Delivery-Systems-Web --skill frontend-lighthouse","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Ffrontend-lighthouse\u002FSKILL.md",true,[],[78,104,127,150,178,202],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":87,"publishedAt":46},"01M6Q0FA5FZ410Z33Z3TFQ4DBA","zero-trust","Implement zero-trust network architecture. Configure identity-based access, micro-segmentation, and continuous verification. Use when implementing modern security architectures.","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fzero-trust\u002FSKILL.md",[84],{"categoryNo":85,"categoryName":86,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000011","运维与部署",[88,89,90,43,91,92,80,93,94,95,96,97,35,34,98,99,100,101,102,103],"ZeRO","trust","zero trust","assessment","verification","segmentation","devops-security","access","configure","only","active","critical","scope","scripts","relevant","implementing",{"skillNo":105,"name":106,"nameZh":6,"description":107,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":108,"categories":109,"keywords":110,"publishedAt":46},"01M6Q0F1YZJW3KX5FBKEVZ8CV4","zcode-delegate","Delegate coding tasks to the Z.AI ZCode CLI only when the user explicitly requests it, while the orchestrator retains review and landing responsibility.","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fzcode-delegate\u002FSKILL.md",[],[111,112,113,114,115,116,117,118,119,120,36,121,122,97,123,35,124,125,99,126],"delegate","zcode","zcode delegate","review","cli","orchestration","tasks","run","Bash","model","read","orchestrator","files","desktop app","app","agent-orchestration",{"skillNo":128,"name":129,"nameZh":6,"description":130,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":131,"categories":132,"keywords":133,"publishedAt":46},"01M6Q0ETK41VGNMYEXW0T00AJN","youtube-transcript","Fetch YouTube transcripts through DeepAPI or local fallback tooling and save clean text output.","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fyoutube-transcript\u002FSKILL.md",[],[134,135,136,45,137,138,139,40,140,141,142,143,144,35,34,145,146,147,148,149],"transcript","youtube transcript","youtube","github","codex","research","https","text","fetch","tooling","clean","local","output","deepapi","youtube transcripts","blob",{"skillNo":151,"name":152,"nameZh":6,"description":153,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":154,"categories":155,"keywords":167,"publishedAt":46},"01M6Q0EPPH2PVMDW40017F8WX0","youtube-transcript-skills","Fetch YouTube video transcripts, search videos\u002Fchannels, browse channels, and extract playlists via the getyoutubetranscript.com API - free tier, no card required.","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fyoutube-transcript-skills\u002FSKILL.md",[156,159,162],{"categoryNo":157,"categoryName":158,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000010","后端与接口",{"categoryNo":160,"categoryName":161,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000016","图像与多媒体",{"categoryNo":163,"categoryName":164,"taxonomyType":165,"taxonomyTypeDesc":166},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[134,135,136,168,45,169,137,138,40,170,171,172,173,142,174,35,34,175,176,177],"youtube transcript skills","gemini","search","api","Video","browse","api-integration","free","card","channels",{"skillNo":179,"name":180,"nameZh":6,"description":181,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":182,"categories":183,"keywords":188,"publishedAt":46},"01M6Q0EAB96PX83W5PTE8A0R8D","youtube-notetaker","Turn YouTube talks into local study notes with slides, transcripts, editable annotations, and a markdown-backed viewer.","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fyoutube-notetaker\u002FSKILL.md",[184,187],{"categoryNo":185,"categoryName":186,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000003","演示文稿",{"categoryNo":160,"categoryName":161,"taxonomyType":20,"taxonomyTypeDesc":21},[136,189,190,115,45,191,192,193,194,40,172,195,196,197,198,34,199,145,200,201],"youtube notetaker","notetaker","workflow","official","notes","code","markdown","slides","annotations","README","study","dair-academy","viewer",{"skillNo":203,"name":204,"nameZh":6,"description":205,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":206,"categories":207,"keywords":209,"publishedAt":46},"01M6Q0E55F0GW5MX48V8HXS8B5","youtube-full","Fetch YouTube transcripts, search videos, browse channels, and extract playlists via TranscriptAPI — no yt-dlp, no Google API key, works from any cloud server.","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fyoutube-full\u002FSKILL.md",[208],{"categoryNo":157,"categoryName":158,"taxonomyType":20,"taxonomyTypeDesc":21},[210,136,211,212,45,169,170,213,214,171,172,173,142,215,174,35,34,175,216,148],"youtube full","full","google","server","dlp","credits","automatic"]