← ClaudeAtlas

web-perf-auditlisted

审计并优化网页/站点的加载性能与交互响应性(Core Web Vitals: LCP/CLS/INP/TBT)。 当用户提到"网站慢""首屏优化""Lighthouse 分数低""性能审计""图片/字体/JS 优化" 或粘贴了一个网址想知道"为什么加载慢"时,都应主动使用本技能,即使用户没有明说 "性能优化"四个字。
EVEDensity/web-perf-audit · ★ 3 · Web & Frontend · score 71
Install: claude install-skill EVEDensity/web-perf-audit
# Web Performance Audit Skill 基于 web.dev《Learn Performance》知识体系的全自动 Web 性能审计技能包。 多阶段流水线:SCAN → ANALYZE → SCORE → REPORT。 结果落盘为 JSON + Markdown,支持增量对比和 CI 集成。 ## Pipeline Overview ``` SCAN ANALYZE SCORE REPORT ───── ───────── ───── ────── fetch_metrics.py ┌→ analyze_critical_path.py ┐ (Lighthouse/PSI) ├→ check_resource_hints.py ├→ score_and_report.py → audit-report.json ├→ audit_images.py │ report.md ├→ audit_fonts.py │ dashboard.html └→ audit_js_bundles.js ┘ diff_report.py (CI/PR 对比) ``` ## Prerequisites 在首次使用前,确认以下依赖可用: ```bash # Node.js 依赖(Lighthouse + Puppeteer) npm install -g lighthouse npm install puppeteer # 或在技能目录下 npm install # Python 依赖(仅标准库 + urllib,无需额外安装) # Python 3.8+ 即可 ``` ## Stage 1: SCAN — 抓取页面原始数据 **目标:** 获取 Core Web Vitals 原始指标和 Lighthouse 审计结果。 使用 `scripts/fetch_metrics.py`: ```bash # 默认使用本地 Lighthouse CLI(推荐,无需 API Key) python scripts/fetch_metrics.py <URL> --output-dir .web-perf # 可选:使用 PageSpeed Insights API(获取 CrUX 真实用户数据) python scripts/fetch_metrics.py <URL> --output-dir .web-perf --psi-key <YOUR_API_KEY> # 桌面端策略 python scripts/fetch_metrics.py <URL> --output-dir .web-perf --strategy desktop ``