agentleFS
chatquillchatquill/claude-code-websites/.claude/skills/perf-audit/SKILL.md

perf-audit

Skill1 starsChanged 24 days agoMITView on GitHub

Audits performance against project.yaml budgets: Lighthouse on key routes, Core Web Vitals, JS bundle size, images, fonts and caching. Use before launch, after big UI changes, when pages feel slow, or when a budget check fails.

17 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use triage, code-review and 2 more.

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.
  • Google CloudSkill

    triage

    Gather context on a change or bug and plan the implementation.

    Also in 5 projects that use this

  • GoogleSkill

    code-review

    Adversarial systems, concurrency, memory-model, and architecture code review protocol. Use this skill whenever asked to review code, PRs, diffs, or branches in Filament.

    Also in 5 projects that use this

  • NVIDIASkill

    research

    Before designing a feature, research how comparable libraries solve the problem, check best practices, known pitfalls, and upstream changes. Use when starting a new feature, investigating an unfamiliar area, or the user asks to research something.

    Also in 3 projects that use this

  • MicrosoftSkill

    release

    Use ONLY when the user explicitly asks to cut/publish a Huabu desktop release or tag a version. Performs an outward action — bumps the version in apps/desktop/package.json, commits + annotated-tags vX.Y.Z, and pushes the branch + tag. That tag push auto-builds the macOS/Windows installers and publishes a GitHub Release. Provides `status`, `bump`, `tag-push`, and a one-command `run` (bump → tag-push).

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

5 rules. 0 are common, 2 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 13 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Ask (unless the argument answers it): "What should I measure?"

    line 27
  2. Distinctive:

    Never measure the dev server: its numbers are meaningless.

    line 32
  3. Very specific:

    If @lhci/cli is configured (lighthouserc.*), prefer npx @lhci/cli autorun.

    line 45
  4. Very specific:

    If the user has CrUX, Vercel Speed Insights or analytics Web Vitals, ask them to paste p75 LCP/INP/CLS.

    line 61
  5. Very specific:

    Write the report with the perf-report template: a budget table (route × metric, with ✅/❌ against the budget), findings ranked Critical …

    line 66

“Common” is measured: kept by at least 6 in 10 of the 13 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

Measures the site against the budgets in project.yaml and writes a severity-ranked report to production/audits/perf-YYYY-MM-DD.md. It never changes code: every fix becomes a proposed story or bug the user approves.

Inputs

  • project.yaml: budgets.lighthouse.*, budgets.web_vitals.*, budgets.js_initial_kb, budgets.image_max_kb, stack.frontend, stack.hosting
  • .claude/docs/stack-matrix.md: the build and start commands for the stack
  • docs/content/sitemap.md or the PRD's critical journeys: which routes matter
  • Argument: a preview/staging URL, a list of routes, or local

Phases

Phase 1: Choose the target

Ask (unless the argument answers it): "What should I measure?"

  • Local production build (Recommended): build and start locally, then measure http://localhost:<port>.
  • Preview / staging URL: you give the URL.
  • Production URL: read-only Lighthouse runs only; no load is generated.

Never measure the dev server: its numbers are meaningless. Pick 3–8 key routes (home, pricing/landing, signup, the core app screen, a content page, a product page) from the sitemap; show the list and let the user edit it.

Phase 2: Lab measurements

For each route, run Lighthouse with the mobile preset (throttled), three runs, and take the median:

npx lighthouse <url> --preset=perf --form-factor=mobile --output=json --output-path=./.lighthouseci/<slug>.json --quiet --chrome-flags="--headless"

If @lhci/cli is configured (lighthouserc.*), prefer npx @lhci/cli autorun. Record performance, accessibility, best-practices and SEO scores, plus LCP, CLS, TBT (lab proxy for INP), the LCP element, and render-blocking resources.

Phase 3: Bundle and asset checks

Spawn performance-engineer with the build output path and the budgets:

  • Initial JS per route (gzipped) vs budgets.js_initial_kb: use the framework's build report (Next.js route table, Vite/Rollup visualiser, Nuxt analyze, Angular stats.json).
  • The largest dependencies and whether they are needed on first load (moment, lodash, chart and editor libs, icon packs imported whole).
  • Images over budgets.image_max_kb, missing width/height, no modern format, lazy-loading on the LCP image.
  • Fonts: count, subsetting, font-display, preload of the main face.
  • Third-party scripts loaded before interaction or before consent.
  • Caching headers on static assets (immutable, long max-age) and HTML.

Phase 4: Field data (optional)

If the user has CrUX, Vercel Speed Insights or analytics Web Vitals, ask them to paste p75 LCP/INP/CLS. Field data outranks lab data when they disagree.

Phase 5: Report

Write the report with the perf-report template: a budget table (route × metric, with ✅/❌ against the budget), findings ranked Critical (budget blown on a key route) → High → Medium → Low. Each finding has evidence (number, file:line or asset path), the likely cause, the fix, and the expected gain. Ask "May I write this to production/audits/perf-YYYY-MM-DD.md?"

Phase 6: Follow-up

Offer to turn Critical and High findings into stories (/create-stories) or bugs (/bug-report). Create nothing without a yes.

Output

production/audits/perf-YYYY-MM-DD.md (template: .claude/docs/templates/perf-report.md).

Rigor

  • minimal: home + one key route, Lighthouse only.
  • standard: all key routes, bundle and asset checks.
  • full: adds field data, a before/after comparison with the previous report, and a TD-GATE note for /gate-check launch.

Next step

/sprint-plan to schedule the fixes, or /launch-checklist if everything is within budget.

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.