A Claude Skill that automates web performance audits (LCP, CLS, INP) using web.dev guidelines, delivers structured reports, actionable fix scripts, and incremental analysis.
FAQ
web-perf-audit is a Claude Code plugin with 1 hand-picked skill for testing work, indexed on Flowy. Install it with the command on its page. It includes web-perf-audit. Its skills do not fire on their own yet. Request auto-invocation to have Flowy route them as you prompt. Free and open source.
$ npx -y skills add EVEDensity/web-perf-audit --agent claude-code
Repo: EVEDensity/web-perf-audit
You run Lighthouse. It says LCP 4.2s, score 62. You stare at the screen. Now what?
Every tool tells you what's wrong. None of them tell you what to change, line by line, and why that specific change will work. web-perf-audit fills that gap โ it runs a multi-agent pipeline that:
"The goal isn't a 100/100 Lighthouse score โ it's a page that loads fast and responds instantly for real users."
Every audit rule traces back to web.dev/learn/performance. LCP โค 2.5s, INP โค 200ms, CLS โค 0.1. Not our opinions โ Google's thresholds, measured at p75.
5 specialized agents run in parallel: Project Scanner, Resource Analyzer, Metric Scorer, Change Predictor, and Optimization Planner. Each does one thing well.
Static checks (missing defer, wrong font-display, absent srcset) are deterministic โ same page, same result. Runtime metrics (LCP, TBT) come from real browser measurement via Lighthouse + Puppeteer.
Interactive Chart.js dashboard with score ring, CWV cards, category breakdown, and priority-ordered issue list. Works entirely offline โ no external API calls after audit.
SHA256 fingerprint caching skips unchanged pages. perf-diff compares two audits across branches โ catch performance regressions before they merge, not after.
Runs on macOS / Linux / Windows. Native Claude Code skill, plus Cursor rules, VSCode Copilot instructions. One-liner CI integration for GitHub Actions, GitLab CI, Jenkins.
graph TB
subgraph Trigger["๐ Trigger"]
CLI["/perf analyze URL"]
CI["git push / PR opened"]
IDE["Claude Code / Cursor / Copilot"]
end
subgraph Stage1["Stage 1 โ SCAN"]
Scanner["๐ Project Scanner Agent<br/>ยท Framework detection (Vite/Webpack/Next)<br/>ยท Build artifact discovery<br/>ยท .webperfignore filtering"]
LH["๐ก Lighthouse + Puppeteer<br/>ยท LCP / CLS / INP / TBT / FCP<br/>ยท CrUX field data (PSI optional)"]
end
subgraph Stage2["Stage 2 โ ANALYZE (5 agents parallel)"]
CRP["๐ Critical Path Agent<br/>render-blocking CSS/JS<br/>request chain depth<br/>DOM size audit"]
Hints["๐ก Resource Hints Agent<br/>preload/prefetch/preconnect<br/>missing crossorigin<br/>sync script detection"]
Img["๐ผ Image Audit Agent<br/>WebP/AVIF detection<br/>srcset/sizes check<br/>LCP image optimization"]
Font["๐ค Font Audit Agent<br/>font-display analysis<br/>woff2 format check<br/>subsetting audit"]
JS["โก JS Bundle Agent<br/>Puppeteer Coverage API<br/>Long Task observer<br/>third-party attribution"]
end
subgraph Stage3["Stage 3 โ SCORE"]
Scorer["โ๏ธ Metric Scorer Agent<br/>ยท CWV impact weighting<br/>ยท severity ร reach multiplier<br/>ยท P0 (โฅ20) / P1 (10-19) / P2 (<10)"]
end
subgraph Stage4["Stage 4 โ REPORT"]
Reporter["๐ Optimization Plan Agent<br/>ยท match fix templates<br/>ยท generate before/after code<br/>ยท estimate millisecond savings"]
Output["๐ฆ Output<br/>audit-report.json<br/>report.md<br/>dashboard.html"]
end
subgraph Diff["๐ Incremental / Diff Mode"]
Fingerprint["SHA256 fingerprint cache"]
Predictor["๐ฎ Change Predictor Agent<br/>ยท Git diff โ impact estimation<br/>ยท regression risk flagging"]
end
CLI --> Scanner & LH
CI --> Scanner & LH
IDE --> Scanner & LH
Scanner & LH --> CRP & Hints & Img & Font & JS
CRP & Hints & Img & Font & JS --> Scorer
Scorer --> Reporter --> Output
Output --> Fingerprint
Fingerprint --> Predictor
Predictor --> Output
| Layer | Responsibility | Technology |
|---|---|---|
| Trigger | CLI / CI / IDE invocation | Claude Code Skill, GitHub Actions, Cursor rules |
| Scan | Raw data collection + project discovery | Lighthouse CLI, Puppeteer, PageSpeed Insights API |
| Analyze | 5-dimension static + runtime analysis | Python 3.8+ (HTMLParser, urllib), Node.js (Puppeteer) |
| Score | CWV-weighted priority calculation | Python scoring engine (7-category ร severity multipliers) |
| Generate | Report rendering + fix templating | Python (Markdown/JSON), Chart.js (dashboard HTML) |
| Diff | Incremental caching + cross-branch comparison | SHA256 fingerprinting, JSON structural diff |
Understand-Anything pioneered the multi-agent code analysis pipeline โ project-scanner โ file-analyzer โ architecture-analyzer โ tour-builder โ graph-reviewer. We adapted this pattern for web performance:
| Understand-Anything | web-perf-audit | Adaptation |
|---|---|---|
project-scanner (language/framework detection) | Project Scanner Agent (build tool detection, .webperfignore) | Code structure โ page structure |
file-analyzer (function/class extraction) | Resource Analyzer Agent (HTML/CSS/JS static audit) | AST nodes โ DOM + CSSOM nodes |
architecture-analyzer (layer tagging) | Metric Scorer Agent (CWV impact scoring) | Architecture layers โ performance dimensions |
tour-builder (guided walkthrough) | Optimization Plan Agent (fix generation) | Code tour โ fix checklist |
graph-reviewer (integrity check) | Change Predictor Agent (regression detection) | Schema validation โ performance regression |
# 1. Clone
git clone https://github.com/EVEDensity/web-perf-audit.git && cd web-perf-audit
# 2. Install dependencies
npm install -g lighthouse && npm install
# 3. Run your first audit
python scripts/fetch_metrics.py "https://example.com" --output-dir .web-perf
python scripts/analyze_critical_path.py .web-perf/metrics.json -o .web-perf/critical-path.json &
python scripts/check_resource_hints.py "https://example.com" -o .web-perf/resource-hints.json &
python scripts/audit_images.py "https://example.com" -o .web-perf/images.json &
python scripts/audit_fonts.py "https://example.com" -o .web-perf/fonts.json &
node scripts/audit_js_bundles.js "https://example.com" --output .web-perf/js-bundles.json &
wait
python scripts/score_and_report.py "https://example.com" --output-dir .web-perf --format all
# 4. Open the dashboard
open .web-perf/dashboard.html # macOS
start .web-perf/dashboard.html # Windows
xdg-open .web-perf/dashboard.html # Linux
/plugin install web-perf-audit@EVEDensity/web-perf-audit
/perf analyze https://example.com
# One-shot install
curl -fsSL https://raw.githubusercontent.com/EVEDensity/web-perf-audit/main/install.sh | bash
# Or step by step
git clone https://github.com/EVEDensity/web-perf-audit.git ~/.web-perf-audit
cd ~/.web-perf-audit
npm install -g lighthouse
npm install
echo 'alias perf-audit="python ~/.web-perf-audit/scripts/fetch_metrics.py"' >> ~/.bashrc
# One-shot install
iwr -Uri https://raw.githubusercontent.com/EVEDensity/web-perf-audit/main/install.ps1 -OutFile install.ps1; ./install.ps1
# Or step by step
git clone https://github.com/EVEDensity/web-perf-audit.git $env:USERPROFILE\.web-perf-audit
cd $env:USERPROFILE\.web-perf-audit
npm install -g lighthouse
npm install
| IDE | How to enable |
|---|---|
| Claude Code | /plugin install web-perf-audit@EVEDensity/web-perf-audit |
| Cursor | Add .cursorrules: @web-perf-audit analyze on save |
| VSCode Copilot | Add to .github/copilot-instructions.md: Use web-perf-audit for performance reviews |
| Codex / Gemini CLI | Copy SKILL.md to your skills directory |
| Dependency | Version | Required For |
|---|---|---|
| Python | โฅ 3.8 | All analysis + scoring scripts |
| Node.js | โฅ 18 | Lighthouse CLI + Puppeteer (JS audit) |
| Lighthouse | latest (npm i -g lighthouse) | CWV metric collection |
| Puppeteer | ^22.0.0 (npm i puppeteer) | JS Coverage + Long Task API |
All commands follow the /perf namespace. Each entry shows: purpose, example, flags, and output.
/perf analyze โ Full AuditRun the complete SCAN โ ANALYZE โ SCORE โ REPORT pipeline against a URL.
python scripts/fetch_metrics.py <URL> --output-dir .web-perf
# ... (5 parallel analyzers) ...
python scripts/score_and_report.py <URL> --output-dir .web-perf --audience dev --format all
| Flag | Default | Description |
|---|---|---|
--output-dir | .web-perf | Where to write output files |
--audience | dev | dev (full + code fixes) or pm (summary + scores only) |
--format | all | json, markdown, html, or all |
--strategy | mobile | Lighthouse emulation: mobile or desktop |
--psi-key | โ | PageSpeed Insights API key (for CrUX field data) |
--extra-lighthouse-flags | โ | Pass additional flags to Lighthouse CLI |
Output: .web-perf/audit-report.json, report.md, dashboard.html
/perf dashboard โ Visual DashboardLaunch the interactive Chart.js dashboard without re-running the audit.
# Opens .web-perf/dashboard.html in your browser
open .web-perf/dashboard.html
# Or serve via HTTP for remote access
python -m http.server 8080 -d .web-perf
# Then open http://localhost:8080/dashboard.html
The dashboard includes:
/perf diff โ Git Change ImpactCompare two audit reports to catch performance regressions before they merge.
# Compare two audit snapshots
python scripts/diff_report.py \
.web-perf/before/audit-report.json \
.web-perf/after/audit-report.json \
--format both \
-o .web-perf/diff-report.json
Output: diff-report.json (structured) + diff-report.md (human-readable) with:
CI integration example:
# .github/workflows/perf-diff.yml
name: Performance Diff
on: [pull_request]
jobs:
perf-diff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Audit base branch
run: |
git checkout ${{ github.base_ref }}
python scripts/fetch_metrics.py "$STAGING_URL" --output-dir .web-perf/before
- name: Audit PR branch
run: |
git checkout ${{ github.head_ref }}
python scripts/fetch_metrics.py "$STAGING_URL" --output-dir .web-perf/after
- name: Diff & Comment
run: |
python scripts/diff_report.py \
.web-perf/before/audit-report.json \
.web-perf/after/audit-report.json \
--format markdown -o .web-perf/diff-report.md
gh pr comment ${{ github.event.pull_request.number }} --body-file .web-perf/diff-report.md
/perf explain โ Single File Deep DiveAnalyze one HTML/CSS/JS file in isolation. Useful for debugging a specific component or template.
python scripts/check_resource_hints.py <URL> -o .web-perf/resource-hints.json
# Then read the per-file breakdown in audit-report.json
/perf resource โ Static Resource Batch AuditAudit all images, fonts, and third-party scripts referenced by a page without running Lighthouse.
# Run only the static analysis scripts (no browser needed)
python scripts/audit_images.py "https://example.com" -o .web-perf/images.json
python scripts/audit_fonts.py "https://example.com" -o .web-perf/fonts.json
Use when:
/perf chat โ Conversational Performance ConsultingAsk natural-language questions about your audit results (Claude Code native).
"Why is my LCP so high?" "Which of these P0 issues should I fix first?" "What's the estimated LCP improvement if I implement all image fixes?"
The Claude Code skill reads your latest audit-report.json and answers with context from the 8 web.dev reference modules.
# Start your dev server
npm run dev &
# Audit the local build
python scripts/fetch_metrics.py "http://localhost:5173" --output-dir .web-perf
# ... (5 parallel analyzers) ...
python scripts/score_and_report.py "http://localhost:5173" --output-dir .web-perf --audience dev --format all
Typical findings on first run:
width/height on hero images (CLS impact)font-display: swap not set on custom fonts# .github/workflows/perf-gate.yml
name: Performance Gate
on: [push]
jobs:
gate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Full Audit
run: |
npm install -g lighthouse && npm install
URL="https://staging.example.com"
OUT=".web-perf"
python scripts/fetch_metrics.py "$URL" --output-dir "$OUT"
for script in analyze_critical_path.py check_resource_hints.py audit_images.py audit_fonts.py; do
python "scripts/$script" "$URL" -o "$OUT/$(basename $script .py).json" &
done
node scripts/audit_js_bundles.js "$URL" --output "$OUT/js-bundles.json" &
wait
python scripts/score_and_report.py "$URL" --output-dir "$OUT" --format all
- name: Check Thresholds
run: |
# Fail if overall score < 70
SCORE=$(python -c "import json; print(json.load(open('.web-perf/audit-report.json'))['overallScore']['overallScore'])")
if [ "$SCORE" -lt 70 ]; then echo "Score $SCORE < 70 โ failing gate"; exit 1; fi
# .git/hooks/post-commit (add this to your repo)
#!/bin/bash
PREV_FINGERPRINT=$(cat .web-perf/fingerprint.txt 2>/dev/null || echo "")
python scripts/fetch_metrics.py "http://localhost:5173" --output-dir .web-perf
# ... (parallel analyzers) ...
python scripts/score_and_report.py "http://localhost:5173" --output-dir .web-perf --format json
CURR_FINGERPRINT=$(cat .web-perf/fingerprint.txt)
if [ "$PREV_FINGERPRINT" != "$CURR_FINGERPRINT" ] && [ -n "$PREV_FINGERPRINT" ]; then
echo "โ ๏ธ Performance profile changed. Check .web-perf/dashboard.html"
fi
web-perf-audit is designed as a first-class AgentHub plugin:
// AgentHub plugin registry entry
{
"name": "web-perf-audit",
"type": "official-plugin",
"repo": "EVEDensity/web-perf-audit",
"entry": "SKILL.md",
"commands": ["perf-analyze", "perf-dashboard", "perf-diff"],
"category": "performance",
"requires": ["python>=3.8", "node>=18", "lighthouse"]
}
Once registered, AgentHub users can install it with a single command and run performance audits across all their projects.
rules/:# rules/custom_security_headers.py
def audit_security_headers(url, html_content):
"""
Check for performance-relevant security headers.
Returns: list of issue dicts with {type, description, severity, fix, ref}
"""
issues = []
# Your detection logic here
return issues
score_and_report.py:# In score_and_report.py, add to the analyzer registry
from rules.custom_security_headers import audit_security_headers
ANALYZERS['securityHeaders'] = audit_security_headers
WEIGHTS['securityHeaders'] = 0.03 # 3% of total score
Agents follow a standard interface โ input JSON, output JSON + text:
# agents/my_agent.py
def analyze(input_data: dict) -> dict:
"""
Args:
input_data: {"url": str, "html": str, "metrics": dict}
Returns:
{"issues": [...], "score": float, "summary": str}
"""
# Your agent logic
return {"issues": [], "score": 100.0, "summary": ""}
if __name__ == "__main__":
import sys, json
data = json.loads(sys.stdin.read())
result = analyze(data)
print(json.dumps(result, indent=2))
Wire it into score_and_report.py's agent registry, and it runs in parallel with the built-in agents.
templates/dashboard.html uses Chart.js and CSS custom properties:
/* Override in your own build */
:root {
--bg: #0f172a; /* Dark background */
--card-bg: #1e293b; /* Card surface */
--green: #22c55e; /* Good score */
--yellow: #eab308; /* Needs improvement */
--red: #ef4444; /* Poor */
--blue: #3b82f6; /* Accent */
}
Change the 6 CSS variables for your brand. The Chart.js config is in render() โ swap bar charts for radar, add trend lines, whatever fits.
For air-gapped or private deployments, swap the scoring LLM:
# In score_and_report.py, replace the LLM call
import requests
def score_with_local_llm(issue):
resp = requests.post("http://localhost:11434/api/generate", json={
"model": "llama3.1",
"prompt": f"Rate this performance issue's severity (1-10): {issue['description']}",
"stream": False
})
return resp.json()["response"]
# Replace the default `estimate_severity()` call
severity = score_with_local_llm(issue)
For vLLM, change the endpoint to http://localhost:8000/v1/completions.
Lighthouse gives you a score and an audit list. web-perf-audit:
@font-face rule parsing, real JS Coverage via Puppeteer, third-party attribution, DOM depth audit30โ90 seconds for a typical page. Breakdown:
For CI, consider caching the Lighthouse run or using PSI API (faster, no browser overhead).
The JSON report includes per-file breakdowns from the JS Coverage audit โ if your page loads 200+ JS chunks, the unused-bytes-per-file list adds up. Use .webperfignore to exclude third-party resources you can't control (analytics, ads, chat widgets). The Markdown report is filtered to P0/P1 issues only and is usually < 50KB.
chmod +x install.sh && ./install.sh
Or run it through bash directly: bash install.sh
Lighthouse uses simulated throttling by default (4x CPU slowdown, 1.6 Mbps network). This is intentional โ it reflects median mobile users. To match your DevTools experience, pass --strategy desktop --extra-lighthouse-flags "--throttling-method=provided".
Yes. The Puppeteer-based JS audit waits for networkidle2 before collecting Coverage data, so dynamically loaded chunks are captured. For fully client-rendered apps:
--strategy desktop if that matches your user base--extra-lighthouse-flags "--preset=desktop" for realistic LCPYes. Lighthouse supports http://localhost:* and internal IPs. For self-signed certificates:
python scripts/fetch_metrics.py "https://internal.company.com" \
--extra-lighthouse-flags "--chrome-flags='--ignore-certificate-errors'"
Three options:
.web-perf/dashboard.html is self-contained โ upload to any static host (S3, Netlify, GitHub Pages).web-perf/ as a build artifact โ teammates download and open locallydashboard.html to gh-pages branch with a data embedYes. See Extension Development โ Local LLM Integration. The scoring engine's severity estimation is the only part that benefits from an LLM โ everything else is deterministic. Replace the estimate_severity() function with your Ollama/vLLM/OpenAI-compatible endpoint.
| Lighthouse CLI | PageSpeed Insights API | |
|---|---|---|
| Data source | Simulated lab data | CrUX real-user field data + lab |
| Speed | 15-40s | 5-10s |
| API key | Not required | Required (free tier: 25k/day) |
| Accuracy | Lab โ consistent, reproducible | Field โ real user experience |
| Offline | โ | โ (needs network) |
Use PSI for production monitoring (real-user p75 data). Use Lighthouse CLI for local dev and CI (no rate limits, offline-capable).
.md to references/ following the problem โ detect โ fix โ benefit template, then wire it into the relevant analyzer scriptscripts/ (Python or Node.js), produce JSON output, register it in score_and_report.pytemplates/dashboard.html, test with sample JSONaudit-report.json and the URL tested### URL tested
### Expected behavior
### Actual behavior
### audit-report.json snippet
### Lighthouse version (`lighthouse --version`)
### Node.js version (`node --version`)
### Python version (`python --version`)
urllib for HTTPpython -m py_compile <script> or node --check <script>| Project | Description |
|---|---|
| AgentHub | Multi-agent orchestration platform โ web-perf-audit is an official plugin |
| MineWorld | WebGL voxel engine โ the performance lessons that inspired this tool |
MIT ยฉ 2026 EVEDensity
.claude-plugin/
plugin.json
.webperfignore
docs/
ASSETS.md
pipeline.png
install.ps1
install.sh
LICENSE
package.json
README_es.md
README_ja.md
README_ko.md
README_ru.md
README_tr.md
README_zh-CN.md
README_zh-TW.md
README.md
references/
critical-path.md
font-performance.md
html-loading.md
image-performance.md
js-performance.md
predictive-loading.md
resource-hints.md
video-performance.md
scripts/
__pycache__/
analyze_critical_path.cpython-313.pyc
audit_fonts.cpython-313.pyc
audit_images.cpython-313.pyc
check_resource_hints.cpython-313.pyc
diff_report.cpython-313.pyc
fetch_metrics.cpython-313.pyc
score_and_report.cpython-313.pyc
analyze_critical_path.py
audit_fonts.py
audit_images.py
audit_js_bundles.js
check_resource_hints.py
diff_report.py
fetch_metrics.py
score_and_report.py
SKILL.md
templates/
dashboard.htmlยฉ 2026 Flowy ยท Free and open source
Built for Claude Code ยท Not affiliated with Anthropic