lighthouse-audit
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseLighthouse 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 Does | You Decide |
|---|---|
| Structures analysis frameworks | Metric definitions |
| Identifies patterns in data | Business interpretation |
| Creates visualization templates | Dashboard design |
| Suggests optimization areas | Action priorities |
| Calculates statistical measures | Decision thresholds |
| Claude负责的工作 | 由你决定的事项 |
|---|---|
| 构建分析框架 | 指标定义 |
| 识别数据中的模式 | 业务解读 |
| 创建可视化模板 | 仪表盘设计 |
| 建议优化方向 | 行动优先级 |
| 计算统计指标 | 决策阈值 |
Dependencies
依赖项
bash
pip install click pandas jinja2bash
pip install click pandas jinja2Also 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
undefinedundefinedCommands
命令
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.htmlbash
python scripts/main.py audit https://example.com --categories performance,seo
python scripts/main.py audit https://example.com --format html --output report.htmlBatch Audit
批量审计
bash
python scripts/main.py batch urls.txt --output results/
python scripts/main.py batch urls.txt --categories performance --format csvbash
python scripts/main.py batch urls.txt --output results/
python scripts/main.py batch urls.txt --categories performance --format csvCompare 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.combash
python scripts/main.py compare https://example.com --baseline scores.json
python scripts/main.py compare https://example.com --baseline-url https://staging.example.comMonitor Over Time
长期监控
bash
python scripts/main.py history https://example.com --days 30
python scripts/main.py history https://example.com --plotbash
python scripts/main.py history https://example.com --days 30
python scripts/main.py history https://example.com --plotExamples
示例
Example 1: Full Site Performance Audit
示例1:全站点性能审计
bash
undefinedbash
undefinedCreate URL list
Create URL list
cat > urls.txt << EOF
https://example.com/
https://example.com/pricing
https://example.com/features
https://example.com/blog
EOF
cat > urls.txt << EOF
https://example.com/
https://example.com/pricing
https://example.com/features
https://example.com/blog
EOF
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
undefinedundefinedExample 2: Before/After Comparison
示例2:优化前后对比
bash
undefinedbash
undefinedSave 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
undefinedundefinedExample 3: Generate Client Report
示例3:生成客户报告
bash
undefinedbash
undefinedFull 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
--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
--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
undefinedundefinedAudit Categories
审计类别
| Category | Checks | Impact |
|---|---|---|
| LCP, FID, CLS, TTFB, Speed Index | Search ranking |
| Meta tags, headings, links, mobile | Search visibility |
| WCAG compliance, contrast, labels | Compliance |
| HTTPS, security, modern APIs | Trust |
| Service worker, manifest, offline | App-like experience |
| 类别 | 检测内容 | 影响 |
|---|---|---|
| LCP、FID、CLS、TTFB、Speed Index | 搜索排名 |
| 元标签、标题、链接、移动端适配 | 搜索可见性 |
| WCAG合规性、对比度、标签 | 合规性 |
| HTTPS、安全性、现代API | 可信度 |
| 服务工作线程、清单、离线功能 | 类应用体验 |
Core Web Vitals Thresholds
Core Web Vitals 阈值
| Metric | Good | Needs Improvement | Poor |
|---|---|---|---|
| LCP (Largest Contentful Paint) | ≤2.5s | 2.5s-4.0s | >4.0s |
| FID (First Input Delay) | ≤100ms | 100ms-300ms | >300ms |
| CLS (Cumulative Layout Shift) | ≤0.1 | 0.1-0.25 | >0.25 |
| INP (Interaction to Next Paint) | ≤200ms | 200ms-500ms | >500ms |
| 指标 | 优秀 | 需要改进 | 较差 |
|---|---|---|---|
| LCP (Largest Contentful Paint) | ≤2.5s | 2.5s-4.0s | >4.0s |
| FID (First Input Delay) | ≤100ms | 100ms-300ms | >300ms |
| CLS (Cumulative Layout Shift) | ≤0.1 | 0.1-0.25 | >0.25 |
| INP (Interaction to Next Paint) | ≤200ms | 200ms-500ms | >500ms |
Output Formats
输出格式
| Format | Use Case | Content |
|---|---|---|
| Automation, storage | Full raw data |
| Spreadsheets, analysis | Summary scores |
| Client reports | Visual report |
| Documentation | Markdown summary |
| 格式 | 适用场景 | 内容 |
|---|---|---|
| 自动化、存储 | 完整原始数据 |
| 电子表格、分析 | 摘要分数 |
| 客户报告 | 可视化报告 |
| 文档编制 | 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