perf-audit
Installation
SKILL.md
Performance Audit
Workflow
-
Detect build tool from
package.json(vite, webpack, next, rollup) -
Run the production build via the project's task runner (auto-detect from package.json).
-
Analyze the build output — non-interactive only. Never launch a browser or a long-running server in an audit; those hang an automated run. Prefer, in order:
- Measure the emitted files directly: for each file in the output dir (e.g.
dist/assets/*.js), report raw + gzipped size —gzip -c <file> | wc -c. This always works and needs no extra tooling. - Per-module breakdown, as a static artifact (not a server), written under
$TMPDIR(else/tmp) and never the working tree, where the nextcommitwould sweep it in. Print the path:- Vite/Rollup:
npx source-map-explorer 'dist/assets/*.js', or addrollup-plugin-visualizerconfigured to emit JSON/HTML to a file - webpack/Next.js:
npx webpack-bundle-analyzer -m static -r "${TMPDIR:-/tmp}/report.html" <stats-file>(writes a file; do not use the default server mode)
- Vite/Rollup:
npx vite-bundle-visualizeropens a browser and blocks — only suggest it to the user for manual exploration; do not run it here.
- Measure the emitted files directly: for each file in the output dir (e.g.
-
Check
package.jsonfor known heavy packages -
Check the source for the Core Web Vitals risks below. Detect the framework first; recommend only its idioms.
-
Report findings: size impact for the bundle, potential impact for source risks
Compare against standard industry thresholds; report gzipped sizes.