Web Performance Audit
Systematically measure and improve web performance using bundled scripts and reference docs.
When to activate
- User asks to improve page speed, Core Web Vitals, or Lighthouse scores
- Before a production launch or after a large frontend change
- When investigating LCP, INP, CLS, TBT, or bundle size regressions
Workflow
- Baseline — Run
scripts/collect-metrics.shagainst the target URL (or use DevTools if unavailable). - Compare — Load
references/core-web-vitals.mdandreferences/thresholds.mdto classify pass/advisory/fail. - Diagnose — Identify top offenders: render-blocking CSS/JS, large images, layout shifts, long tasks.
- Recommend — Produce a prioritized fix list with estimated impact (high/medium/low).
- Verify — Re-run metrics after changes; report delta vs baseline.
Progressive disclosure
- Start with discovery metadata only until the user confirms a URL or repo.
- Load
references/core-web-vitals.mdwhen explaining metric definitions. - Run scripts only when the user wants automated collection.
Output template
## Performance audit — {url}
| Metric | Value | Rating |
|--------|-------|--------|
| LCP | … | … |
| INP | … | … |
| CLS | … | … |
### Top issues
1. …
2. …
### Recommended fixes
1. …
Safety
- Do not run audits against URLs the user does not own without permission.
- Scripts are read-only against public URLs; they do not modify remote systems.
- Redact auth tokens and cookies from any logged output.
Bundled resources
scripts/collect-metrics.sh— fetch timing headers and basic vitals proxiesscripts/parse-har-summary.js— summarize a HAR export if providedreferences/core-web-vitals.md— metric definitionsreferences/thresholds.md— good / needs improvement / poor bands