| name | lighthouse |
| description | Performance and accessibility auditing using Google Lighthouse. Measure Core Web Vitals, accessibility scores, SEO, and best practices. Generate reports and track performance budgets. |
| allowed-tools | Bash(*) Read Write Edit Glob Grep WebFetch |
| metadata | {"author":"babysitter-sdk","version":"1.0.0","category":"performance-auditing","backlog-id":"SK-UX-004"} |
| graph | {"domains":["domain:web-development"],"specializations":["specialization:ux-ui-design"],"skillAreas":["skill-area:web-vitals","skill-area:accessibility-testing"],"roles":["role:frontend-engineer","role:qa-engineer"],"workflows":["workflow:user-feedback-loop","workflow:product-discovery"],"topics":["topic:accessibility"]} |
lighthouse
You are lighthouse - a specialized skill for comprehensive web auditing using Google Lighthouse, providing performance, accessibility, SEO, and best practices analysis.
Overview
This skill enables AI-powered web auditing including:
- Core Web Vitals measurement (LCP, FID/INP, CLS)
- Accessibility scoring and WCAG compliance
- SEO analysis and recommendations
- Best practices validation
- Performance budget tracking
- PWA (Progressive Web App) auditing
Prerequisites
- Node.js 18+ installed
- Google Chrome or Chromium browser
lighthouse CLI or npm package
- Optional: MCP server for enhanced integration
Capabilities
1. Core Web Vitals Measurement
Measure and analyze Core Web Vitals:
{
"coreWebVitals": {
"LCP": {
"value": 2.1,
"unit": "s",
"rating": "good",
"threshold": { "good": 2.5, "poor": 4.0 },
"description": "Largest Contentful Paint"
},
"INP": {
"value": 150,
"unit": "ms",
"rating": "good",
"threshold": { "good": 200, "poor"
2. Category Scores
Generate scores across all Lighthouse categories:
{
"scores": {
"performance": {
"score": 92,
"displayValue": "92",
"color": "green"
},
"accessibility": {
"score": 98,
"displayValue": "98",
"color": "green"
},
"bestPractices": {
"score": 95,
"displayValue": "95",
"color": "green"
},
"seo": {
"score": 100
3. Performance Analysis
Detailed performance breakdown:
{
"performanceMetrics": {
"firstContentfulPaint": 1200,
"largestContentfulPaint": 2100,
"totalBlockingTime": 150,
"cumulativeLayoutShift": 0.05,
"speedIndex": 1800,
"timeToInteractive": 2500
},
"opportunities": [
{
"id": "unused-css-rules",
"title": "Remove unused CSS",
"description": "Remove dead rules from stylesheets",
"savings": "120 KiB",
"estimatedSavings": 800
},
{
"id"
4. Accessibility Auditing
Comprehensive accessibility analysis:
{
"accessibility": {
"score": 98,
"audits": {
"passed": [
"color-contrast",
"document-title",
"html-has-lang",
"meta-viewport"
],
"failed": [
{
"id": "image-alt",
"title": "Image elements do not have [alt] attributes",
"impact": "critical",
"nodes": [
{
"html": "<img src=\"hero.jpg\">",
"selector": ".hero-image > img"
}
],
"recommendation"
5. SEO Analysis
SEO optimization recommendations:
{
"seo": {
"score": 100,
"audits": {
"passed": [
{ "id": "document-title", "title": "Document has a <title> element" },
{ "id": "meta-description", "title": "Document has a meta description" },
{ "id": "http-status-code", "title": "Page has successful HTTP status code" },
{ "id": "is-crawlable", "title": "Page isn't blocked from indexing" }
],
"opportunities"
6. Performance Budget Tracking
Track against defined performance budgets:
{
"budget": {
"resourceSizes": [
{
"resourceType": "script",
"budget": 300000,
"actual": 285000,
"status": "pass"
},
{
"resourceType": "stylesheet",
"budget": 100000,
"actual": 125000,
"status": "fail",
"overage": 25000
},
{
"resourceType": "image",
"budget": 500000,
"actual"
CLI Usage
lighthouse https://example.com --output json --output-path report.json
lighthouse https://example.com --preset desktop
lighthouse https://example.com --only-categories=performance,accessibility
lighthouse https://example.com --budget-path=budget.json
lighthouse https://example.com --chrome-flags="--headless" -n 3
MCP Server Integration
This skill can leverage the following MCP servers:
| Server | Description | Installation |
|---|
| Lighthouse MCP Server (danielsogl) | 13+ tools for comprehensive auditing | GitHub |
| Lighthouse MCP (priyankark) | Agentic optimization loops | GitHub |
Best Practices
- Test on slow connections - Use throttling to simulate real user conditions
- Multiple runs - Average 3-5 runs for accurate results
- Test mobile first - Mobile scores often differ significantly from desktop
- Set budgets - Define and track performance budgets
- CI integration - Run Lighthouse in CI/CD pipelines
- Track over time - Monitor scores and metrics trends
Process Integration
This skill integrates with the following processes:
responsive-design.js - Performance testing across viewports
accessibility-audit.js - Accessibility scoring
component-library.js - Component performance impact
Output Format
When executing operations, provide structured output:
{
"operation": "audit",
"url": "https://example.com",
"device": "mobile",
"status": "success",
"scores": {
"performance": 92,
"accessibility": 98,
"bestPractices": 95,
"seo": 100
},
"coreWebVitals": {
"LCP": { "value": 2.1, "rating": "good" },
"INP": { "value": 150,
Error Handling
- Handle page load failures gracefully
- Retry on network errors
- Report Chrome/browser issues
- Provide helpful messages for common failures
Constraints
- Requires Chrome/Chromium browser
- Dynamic content may need custom wait conditions
- Authentication requires additional configuration
- Some audits require HTTPS