lighthouse-audit

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Lighthouse Audit

Lighthouse Audit

Automate Google Lighthouse audits to measure and track Core Web Vitals, SEO, and accessibility - the same metrics Google uses for search ranking.
自动化执行Google Lighthouse审计,以衡量和跟踪Core Web Vitals、SEO及可访问性指标——这些正是谷歌用于搜索排名的相同指标。

When to Use This Skill

何时使用此技能

  • Performance optimization - Measure LCP, FID, CLS before and after changes
  • SEO audits - Check technical SEO issues (meta tags, structured data, etc.)
  • Accessibility checks - Identify a11y issues for compliance
  • Client reporting - Generate professional performance reports
  • Monitoring - Track scores over time across multiple pages
  • 性能优化 - 在修改前后测量LCP、FID、CLS指标
  • SEO审计 - 检查技术SEO问题(元标签、结构化数据等)
  • 可访问性检查 - 识别合规性相关的a11y问题
  • 客户报告 - 生成专业的性能报告
  • 监控 - 跨多个页面跟踪分数随时间的变化

What Claude Does vs What You Decide

Claude负责的工作 vs 由你决定的事项

Claude DoesYou Decide
Structures analysis frameworksMetric definitions
Identifies patterns in dataBusiness interpretation
Creates visualization templatesDashboard design
Suggests optimization areasAction priorities
Calculates statistical measuresDecision thresholds
Claude负责的工作由你决定的事项
构建分析框架指标定义
识别数据中的模式业务解读
创建可视化模板仪表盘设计
建议优化方向行动优先级
计算统计指标决策阈值

Dependencies

依赖项

bash
pip install click pandas jinja2
bash
pip install click pandas jinja2

Also requires Chrome and Lighthouse CLI

Also requires Chrome and Lighthouse CLI

npm install -g lighthouse

npm install -g lighthouse

Or use Chrome DevTools built-in Lighthouse

Or use Chrome DevTools built-in Lighthouse

undefined
undefined

Commands

命令

Single URL Audit

单URL审计

bash
python scripts/main.py audit https://example.com --categories performance,seo
python scripts/main.py audit https://example.com --format html --output report.html
bash
python scripts/main.py audit https://example.com --categories performance,seo
python scripts/main.py audit https://example.com --format html --output report.html

Batch Audit

批量审计

bash
python scripts/main.py batch urls.txt --output results/
python scripts/main.py batch urls.txt --categories performance --format csv
bash
python scripts/main.py batch urls.txt --output results/
python scripts/main.py batch urls.txt --categories performance --format csv

Compare Before/After

优化前后对比

bash
python scripts/main.py compare https://example.com --baseline scores.json
python scripts/main.py compare https://example.com --baseline-url https://staging.example.com
bash
python scripts/main.py compare https://example.com --baseline scores.json
python scripts/main.py compare https://example.com --baseline-url https://staging.example.com

Monitor Over Time

长期监控

bash
python scripts/main.py history https://example.com --days 30
python scripts/main.py history https://example.com --plot
bash
python scripts/main.py history https://example.com --days 30
python scripts/main.py history https://example.com --plot

Examples

示例

Example 1: Full Site Performance Audit

示例1:全站点性能审计

bash
undefined
bash
undefined

Create URL list

Create URL list

Run batch audit

Run batch audit

python scripts/main.py batch urls.txt --categories performance,seo,accessibility
python scripts/main.py batch urls.txt --categories performance,seo,accessibility

Output: results/audit_2024-01-15/

Output: results/audit_2024-01-15/

├── example.com_.json

├── example.com_.json

├── example.com_pricing.json

├── example.com_pricing.json

├── example.com_features.json

├── example.com_features.json

├── example.com_blog.json

├── example.com_blog.json

└── summary.csv

└── summary.csv

undefined
undefined

Example 2: Before/After Comparison

示例2:优化前后对比

bash
undefined
bash
undefined

Save baseline

Save baseline

python scripts/main.py audit https://example.com --output baseline.json
python scripts/main.py audit https://example.com --output baseline.json

Make optimizations...

Make optimizations...

Compare

Compare

python scripts/main.py compare https://example.com --baseline baseline.json
python scripts/main.py compare https://example.com --baseline baseline.json

Output:

Output:

Core Web Vitals Comparison

Core Web Vitals Comparison

─────────────────────────────

─────────────────────────────

Metric Before After Change

Metric Before After Change

LCP 3.2s 1.8s -44% ✓

LCP 3.2s 1.8s -44% ✓

FID 120ms 45ms -63% ✓

FID 120ms 45ms -63% ✓

CLS 0.25 0.08 -68% ✓

CLS 0.25 0.08 -68% ✓

Performance 52 89 +37 pts

Performance 52 89 +37 pts

undefined
undefined

Example 3: Generate Client Report

示例3:生成客户报告

bash
undefined
bash
undefined

Full audit with HTML report

Full audit with HTML report

python scripts/main.py audit https://client-site.com
--format html
--output client-report.html
--include-screenshots
python scripts/main.py audit https://client-site.com
--format html
--output client-report.html
--include-screenshots

Output: Professional HTML report with:

Output: Professional HTML report with:

- Executive summary

- Executive summary

- Core Web Vitals scores

- Core Web Vitals scores

- Screenshots of issues

- Screenshots of issues

- Prioritized recommendations

- Prioritized recommendations

undefined
undefined

Audit Categories

审计类别

CategoryChecksImpact
performance
LCP, FID, CLS, TTFB, Speed IndexSearch ranking
seo
Meta tags, headings, links, mobileSearch visibility
accessibility
WCAG compliance, contrast, labelsCompliance
best-practices
HTTPS, security, modern APIsTrust
pwa
Service worker, manifest, offlineApp-like experience
类别检测内容影响
performance
LCP、FID、CLS、TTFB、Speed Index搜索排名
seo
元标签、标题、链接、移动端适配搜索可见性
accessibility
WCAG合规性、对比度、标签合规性
best-practices
HTTPS、安全性、现代API可信度
pwa
服务工作线程、清单、离线功能类应用体验

Core Web Vitals Thresholds

Core Web Vitals 阈值

MetricGoodNeeds ImprovementPoor
LCP (Largest Contentful Paint)≤2.5s2.5s-4.0s>4.0s
FID (First Input Delay)≤100ms100ms-300ms>300ms
CLS (Cumulative Layout Shift)≤0.10.1-0.25>0.25
INP (Interaction to Next Paint)≤200ms200ms-500ms>500ms
指标优秀需要改进较差
LCP (Largest Contentful Paint)≤2.5s2.5s-4.0s>4.0s
FID (First Input Delay)≤100ms100ms-300ms>300ms
CLS (Cumulative Layout Shift)≤0.10.1-0.25>0.25
INP (Interaction to Next Paint)≤200ms200ms-500ms>500ms

Output Formats

输出格式

FormatUse CaseContent
json
Automation, storageFull raw data
csv
Spreadsheets, analysisSummary scores
html
Client reportsVisual report
md
DocumentationMarkdown summary
格式适用场景内容
json
自动化、存储完整原始数据
csv
电子表格、分析摘要分数
html
客户报告可视化报告
md
文档编制Markdown摘要

Skill Boundaries

技能边界

What This Skill Does Well

此技能擅长的工作

  • Structuring data analysis
  • Identifying patterns and trends
  • Creating visualization frameworks
  • Calculating statistical measures
  • 构建数据分析结构
  • 识别模式与趋势
  • 创建可视化框架
  • 计算统计指标

What This Skill Cannot Do

此技能无法完成的工作

  • Access your actual data
  • Replace statistical expertise
  • Make business decisions
  • Guarantee prediction accuracy
  • 访问你的实际数据
  • 替代专业统计知识
  • 做出业务决策
  • 保证预测准确性

Related Skills

相关技能

  • schema-markup - Fix structured data issues
  • image-batch - Optimize images for LCP
  • link-checker - Find broken links
  • schema-markup - 修复结构化数据问题
  • image-batch - 优化图片以提升LCP表现
  • link-checker - 查找失效链接

Skill Metadata

技能元数据

  • Mode: centaur
yaml
category: seo-tools
subcategory: performance
dependencies: [lighthouse, click, pandas]
difficulty: beginner
time_saved: 3+ hours/week
  • Mode: centaur
yaml
category: seo-tools
subcategory: performance
dependencies: [lighthouse, click, pandas]
difficulty: beginner
time_saved: 3+ hours/week