frontend-lighthouse
Qué hace
Esta herramienta comprueba si el rendimiento de tu web es lo bastante bueno. Asegura que las páginas se cargan rápido y que los elementos no se desplazan de forma inesperada, bloqueando las actualizaciones que no cumplen estos estándares.
Cuándo usarla
- ✓Al añadir una comprobación de rendimiento para una web.
- ✓Al establecer límites para la velocidad de carga de las páginas y su estabilidad.
- ✓Al configurar cómo debe comportarse el sitio en las pruebas automatizadas.
Link de la skill
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/frontend-lighthouse/SKILL.mdCópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.
Cómo usar
La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.
Mensaje listo para pegar
Para Claude Code, Codex o Cursor: ejecútalo en la carpeta del proyecto y la skill queda instalada.
Descarga el SKILL.md y ponlo en la carpeta de skills de tu agente.
Ejemplo de qué pedirle a la IA
“Comprueba si la velocidad de carga de la página principal está dentro de los límites aceptables y si los elementos no se mueven durante la carga.”
5 skills nuevas por semana. 1 minuto de lectura.
Cómo funciona
Ejecuta pruebas en tu web una vez construida y compara los resultados con los límites predefinidos. Si las pruebas fallan, impide que las actualizaciones se publiquen.
Contenido técnico (SKILL.md original)
Texto original del autor, en inglés, directo de GitHub.
Frontend Lighthouse (portable performance gate)
Portable skill — readable by Claude Code, OpenCode, Codex, Cursor, Windsurf, and others. This skill describes a CI performance gate — a Lighthouse CI config plus a workflow — not a component library or a visual style. It pairs with the frontend-seo and frontend-architecture skills: SEO writes the metadata, Lighthouse proves it ships fast.
The goal: every pull request is blocked unless the production build meets explicit Core Web
Vitals budgets and category score floors. Budgets live in one lighthouserc.cjs, runs are
median-of-N so the gate doesn't flake, and the same config runs locally and in CI.
When to Use This Skill
- Use when adding a Lighthouse CI performance gate to a web app.
- Use when setting Core Web Vitals budgets for LCP, CLS, and TBT as the lab proxy for INP.
- Use when configuring category score floors for performance, SEO, accessibility, and best practices.
- Use when debugging flaky Lighthouse runs or making reports visible as CI artifacts.
0. The five core ideas
- 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. - Gate the production build, never dev. Lighthouse runs against
build+start(the real, optimized output). Dev-server numbers are meaningless for a budget. - 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.
- 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".
- Blocking in CI, visible as artifacts. A GitHub Action runs the gate on every PR touching the app and uploads the HTML/JSON reports so failures are debuggable.
1. Files this skill adds
apps/web/ (or your app root)
├── lighthouserc.cjs ← the gate: budgets + assertions + collect settings
├── package.json ← "lhci": "lhci autorun --config=./lighthouserc.cjs"
└── .github/workflows/lighthouse.yml ← PR-blocking CI job (build → start → lhci → upload)
Plus a dev dependency: @lhci/cli.
pnpm add -D @lhci/cli # or npm i -D / yarn add -D
2. The config (lighthouserc.cjs)
.cjs (CommonJS) so it loads without ESM/TS transpilation. Every budget is a named constant
with a comment explaining the threshold — never a bare number inside an assertion.
/**
* Lighthouse CI configuration — Core Web Vitals budgets for the marketing surface.
*
* Enforces Google's mobile "good" CWV thresholds:
* - Largest Contentful Paint (LCP) ≤ 2500 ms
* - Cumulative Layout Shift (CLS) ≤ 0.1
* - Interaction to Next Paint (INP) ≤ 200 ms
*
* INP is a *field* metric with no direct lab audit, so in the lab we gate on
* Total Blocking Time (TBT) — Lighthouse's recommended lab proxy — at the same
* budget, and assert the experimental INP audit directly as a warning where the
* build exposes it.
*
* Collection runs against the *production* server (build + start) on Lighthouse's
* default mobile (Moto G4 / slow 4G) emulation.
*/
/** The fixed port the production server is started on for the audit. */
const PORT = 3100;
const BASE_URL = `http://localhost:${PORT}`;
/** Pages whose budgets are enforced in CI. */
const MARKETING_URLS = [`${BASE_URL}/`];
/**
* Core Web Vitals budgets on mobile — Google's "good" thresholds.
* These are the values that earn the best Lighthouse scores.
*/
const LCP_BUDGET_MS = 2500; // good
const INP_BUDGET_MS = 200; // good (TBT lab proxy)
const CLS_BUDGET = 0.1; // good
module.exports = {
ci: {
collect: {
// Build is run separately in CI; here we only serve the production output.
startServerCommand: `pnpm start --port ${PORT}`,
startServerReadyPattern: "Ready in", // framework's "server ready" log line
startServerReadyTimeout: 120000,
url: MARKETING_URLS,
// Median of multiple runs keeps the gate stable against per-run jitter.
numberOfRuns: 3,
settings: {
// Default mobile emulation; opt into desktop via env for a second run.
preset:
process.env.LHCI_FORM_FACTOR === "desktop" ? "desktop" : undefined,
…
Preguntas frecuentes
¿Qué son los 'Core Web Vitals'?
Son métricas importantes que Google usa para medir la experiencia del usuario en una web, centradas en la velocidad de carga, la interactividad y la estabilidad visual.
¿Por qué ejecutar la prueba varias veces?
Ejecutar la prueba varias veces y usar la mediana ayuda a evitar resultados de fallo falsos, que pueden darse por problemas temporales de red o de servidor.
¿Dónde se guardan los ajustes?
Los ajustes, como los límites de rendimiento, se guardan en un archivo llamado `lighthouserc.cjs`.
Detalles
Descripción original del autor
Add a portable Lighthouse CI gate for production frontend builds with Core Web Vitals budgets, category floors, median runs, and CI artifacts.
Popularidad
- Estrellas en GitHub
- 48 mil
- Posición en el ranking
- #4667
- Licencia
- MIT
- Actualizada
- 15/10/2026
Comentarios
- …
Más skills de este repositorio
00-andruia-consultant
48 milAyuda a tu agente a iniciar o mejorar proyectos de IA. Analiza código, sugiere herramientas y crea planes de acción en español.
007
48 milPermite que tu agente realice auditorías de seguridad y modelado de amenazas. Es útil para proteger proyectos contra ataques y vulnerabilidades.
10-andruia-skill-smith
48 milAyuda a tu agente a crear o mejorar herramientas de IA. Define cómo funcionan, escribe la documentación y valida la estructura.
20-andruia-niche-intelligence
48 milPermite que tu agente cree un resumen de un sector específico. Es útil para entender su contexto, normas, patrones de uso y riesgos, usando fuentes fiables.
Skills parecidas
test-driven-development
311 milEnseña a tu agente a escribir primero una prueba que falle, verla fallar y después escribir el código más pequeño que la hace pasar, antes de construir cualquier función o corrección.
verification-before-completion
311 milEnseña a tu agente a ejecutar comprobaciones reales y leer su resultado antes de afirmar que una tarea, una corrección o una compilación está completa o en buen estado.
migrate-to-shoehorn
310 milSustituye los casts de tipo arriesgados de tus archivos de prueba por la librería shoehorn, para que las pruebas usen datos parciales y sigan pasando las comprobaciones de tipos.