agentleFS
helderbertohelderberto/agent-skills/skills/perf-audit/SKILL.md

perf-audit

Skill19 starsChanged 32 days agoMITView on GitHub

Audit frontend bundle size and Core Web Vitals risks. Use when asked to "audit performance", "analyze bundle", "check bundle size", "check Core Web Vitals", or find frontend bottlenecks. Don't use for backend performance, database queries, or diagnosing a specific slowdown (/debug).

14 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use security-audit.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • CloudflareSkill

    security-audit

    Security guidance and vulnerability review for codebases, APIs, services, CLI tools, libraries, and daemons. Use for security questions, focused reviews, vulnerability research, security audits, or pen tests. Run the complete workflow only for explicit codebase audit or pen-test requests, full/comprehensive/end-to-end reviews, or requested report artifacts.

    Also in 4 projects that use this

The file

We split this skill into the rules it gives an agent

8 rules. 0 are common, 4 are distinctive, and 4 are very specific to this project.

  • 0

    Common

    Most of the 10 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run the production build via the project's task runner (auto-detect from package.json).

    line 12
  2. Very specific:

    Check package.json for known heavy packages

    line 20
  3. Distinctive:

    Check the source for the Core Web Vitals risks below.

    line 21
  4. Very specific:

    Read the source for these.

    line 28
  5. Very specific:

    INP: no long synchronous work in event handlers.

    line 32
  6. Distinctive:

    Never auto-change dependencies -- report and suggest only

    line 48
  7. Distinctive:

    Never state an LCP, INP, or CLS value without a measurement the user provided (Lighthouse or PageSpeed JSON, CrUX data, a DevTools trace).

    line 49
  8. Distinctive:

    No build output found -- run production build first

    line 55

“Common” is measured: kept by at least 6 in 10 of the 10 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Performance Audit

Workflow

  1. Detect build tool from package.json (vite, webpack, next, rollup)
  2. Run the production build via the project's task runner (auto-detect from package.json).
  3. 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 next commit would sweep it in. Print the path:
      • Vite/Rollup: npx source-map-explorer 'dist/assets/*.js', or add rollup-plugin-visualizer configured 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)
    • npx vite-bundle-visualizer opens a browser and blocks — only suggest it to the user for manual exploration; do not run it here.
  4. Check package.json for known heavy packages
  5. Check the source for the Core Web Vitals risks below. Detect the framework first; recommend only its idioms.
  6. Report findings: size impact for the bundle, potential impact for source risks

Compare against standard industry thresholds; report gzipped sizes.

Core Web Vitals risks

Read the source for these; each is a potential impact until measured.

  • LCP: hero image or heading not lazy-loaded; LCP image in the initial HTML with fetchpriority="high"; no <head> scripts without defer/async; critical fonts preloaded
  • CLS: images, iframes, and embeds reserve space (width/height or aspect-ratio); nothing injected above existing content; fonts with font-display and matched fallbacks
  • INP: no long synchronous work in event handlers; long loops yield (scheduler.yield(), setTimeout fallback); heavy work in a worker
  • Rendering: long lists virtualized; animations on transform/opacity; no read-then-write layout loops; memoization only where it pays
  • Network: independent requests in parallel, not sequential awaits; no over-fetching; lists paginated; hashed static assets cached long; heavy third-party widgets behind a facade

Output format

  • Bundle summary: total size / gzipped size vs budget
  • Large chunks: name + size + % of total
  • Heavy deps: package + size + lighter alternative
  • Quick wins: sorted by estimated savings
  • Core Web Vitals: LCP, INP, CLS — value + source, or not measured
  • Source risks: file:line, the metric at risk, the fix

Rules

  • Report gzipped sizes (what the browser downloads)
  • Never auto-change dependencies -- report and suggest only
  • Never state an LCP, INP, or CLS value without a measurement the user provided (Lighthouse or PageSpeed JSON, CrUX data, a DevTools trace); label it lab or field
  • Skip micro-optimizations with no plausible effect on a Core Web Vital or the bundle

Error Handling

  • Build fails -- report the error, skip the bundle steps, still run the source checks
  • No build output found -- run production build first
  • Build tool unrecognized -- scan package.json for heavy packages, then run the source checks

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.