[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7DKEV2MM7AZBP30VAPYVVW6":3,"skill-same:01M7DKEV2MM7AZBP30VAPYVVW6":60},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":39,"commitSha":40,"skillDirectory":41,"forksCount":42,"repositoryHtmlUrl":43,"repositoryHomepageUrl":6,"ownerHtmlUrl":44,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":45,"install":46,"resources":59},"01M7DKEV2MM7AZBP30VAPYVVW6","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.","Hazek-dc\u002FPresensiGuru_FaceNet_EMAR","Hazek-dc","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F75208960?v=4","01M7DEQV5B4YGS86A81DYH81DR","Hazek","01M7DEQV5XP4TM0C6NTHXCXCHR",1,"MIT","https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Ffrontend-lighthouse\u002FSKILL.md",[],[],"2026-11-15 14:19:17",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":24,"tags":25,"tools":31,"author":34,"source":35,"license":15,"category":26,"date_added":36,"description":7,"source_repo":37,"source_type":35,"license_source":38},"safe",[26,27,28,29,30],"frontend","lighthouse","performance","core-web-vitals","ci",[27,32,33],"node","github-actions","stareezy-1","community","2026-06-29","stareezy-1\u002Ffrontend-architecture-skill","https:\u002F\u002Fgithub.com\u002Fstareezy-1\u002Ffrontend-architecture-skill\u002Fblob\u002Fmain\u002FLICENSE","main","b1e4ffadb4f933bbbcaa03a83f8b9929171ac28b",".agents\u002Fskills\u002Ffrontend-lighthouse",0,"https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR","https:\u002F\u002Fgithub.com\u002FHazek-dc","2026-10-22 08:36:44",{"source":8,"skillName":5,"commands":47,"prompt":57,"zipAvailable":58},[48,51,54],{"tool":49,"command":50},"npx","npx skills add Hazek-dc\u002FPresensiGuru_FaceNet_EMAR --skill frontend-lighthouse",{"tool":52,"command":53},"bunx","bunx skills add Hazek-dc\u002FPresensiGuru_FaceNet_EMAR --skill frontend-lighthouse",{"tool":55,"command":56},"pnpm","pnpm dlx skills add Hazek-dc\u002FPresensiGuru_FaceNet_EMAR --skill frontend-lighthouse","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Ffrontend-lighthouse\u002FSKILL.md",true,[],[61,68,75,82,89,96],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":19},"01M7DS6GGYRZAYD33PFPS8Z2T3","testing-best-practices","Laravel test design and review. Use when selecting coverage, naming or structuring tests, choosing assertions or test data, isolating dependencies, testing HTTP or security boundaries, improving suite performance, or reviewing test value. Use framework guidance or search-docs for Pest and PHPUnit syntax.","https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002Fattendance-web\u002F.claude\u002Fskills\u002Ftesting-best-practices\u002FSKILL.md",[],[],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":19},"01M7DS6BC3AW7HTPRHE2TTVKWM","tailwindcss-development","Always invoke when the user's message includes 'tailwind' in any form. Also invoke for: building responsive grid layouts (multi-column card grids, product grids), flex\u002Fgrid page structures (dashboards with sidebars, fixed topbars, mobile-toggle navs), styling UI components (cards, tables, navbars, pricing sections, forms, inputs, badges), adding dark mode variants, fixing spacing or typography, and Tailwind v3\u002Fv4 work. The core use case: writing or fixing Tailwind utility classes in HTML templates (Blade, JSX, Vue). Skip for backend PHP logic, database queries, API routes, JavaScript with no HTML\u002FCSS component, CSS file audits, build tool configuration, and vanilla CSS.","https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002Fattendance-web\u002F.claude\u002Fskills\u002Ftailwindcss-development\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":19},"01M7DS66GE6B11MYJDVC74HXM4","laravel-best-practices","Apply this skill whenever writing, reviewing, or refactoring Laravel PHP code. This includes creating or modifying controllers, models, migrations, form requests, policies, jobs, scheduled commands, service classes, and Eloquent queries. Triggers for N+1 and query performance issues, caching strategies, authorization and security patterns, validation, error handling, queue and job configuration, route definitions, and architectural decisions. Also use for Laravel code reviews and refactoring existing Laravel code to follow best practices. Covers any task involving Laravel backend PHP code patterns.","https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002Fattendance-web\u002F.claude\u002Fskills\u002Flaravel-best-practices\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":19},"01M7DS5ZW717DMS6P1E90AQCKV","infer-conventions","Use this skill to analyze how a Laravel application is actually written and record its conventions as shared rules. Trigger when the user wants to detect, infer, document, or standardize project conventions or coding style, set up or grow `.ai\u002Frules`, resolve mixed or conflicting patterns (e.g. \"are we using Form Requests or inline validation?\"), or onboard agents and teammates to \"how we do things here\". Covers: a systematic sweep of ~49 Laravel convention dimensions (validation, models, architecture, testing, frontend, database, console), open-ended house-pattern discovery, conflict reporting, and recording rules scoped to the right paths via the Boost `record-rule` MCP tool. Only run this skill when the user explicitly asks for it; never start a sweep as part of another task. Do not use for one-off code review, enforcing formatting a linter already handles, or editing `.ai\u002Frules` files by hand.","https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002Fattendance-web\u002F.claude\u002Fskills\u002Finfer-conventions\u002FSKILL.md",[],[],{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":19},"01M7DS5W12RGCVJTFQJ1N0GB8E","inertia-react-development","Develops Inertia.js v2 React client-side applications. Activates when creating React pages, forms, or navigation; using \u003CLink>, \u003CForm>, useForm, or router; working with deferred props, prefetching, or polling; or when user mentions React with Inertia, React pages, React forms, or React navigation.","https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002Fattendance-web\u002F.claude\u002Fskills\u002Finertia-react-development\u002FSKILL.md",[],[],{"skillNo":97,"name":98,"nameZh":6,"description":99,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":100,"categories":101,"keywords":102,"publishedAt":19},"01M7DS5PVDPMPCWSK2RXPDC9BB","deploying-to-cloud","Deploys and manages Laravel applications on Laravel Cloud using the `cloud` CLI. Use when the user wants to deploy an app, ship to Cloud, create or manage applications, environments, databases, caches, object storage, queues, domains, instances, background processes, secrets, compute, scheduled tasks, or Laravel Cloud infrastructure; or check billing, usage, or spend. Triggers on deployment, shipping, Cloud management, environment setup, database provisioning, billing or usage queries, the `cloud` CLI, and Laravel Cloud deployment troubleshooting.","https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002Fattendance-web\u002F.claude\u002Fskills\u002Fdeploying-to-cloud\u002FSKILL.md",[],[]]