agentleFS
shinzoxDshinzoxD/knackbox/skills/coding/frontend-performance/SKILL.md

frontend-performance

Skill0 starsChanged 5 months agoApache-2.0View on GitHub

Implement frontend performance — Core Web Vitals (LCP, INP, CLS),

6 other projects use a version of this.

Adopted by

Most recently taken up by

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 5 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. Distinctive:

    Gather evidence: Prefer field (CrUX/RUM) over one lab run.

    line 29
  2. Distinctive:

    Never invent Lighthouse scores, CrUX percentiles, or byte sizes.

    line 76
  3. Very specific:

    Never drop alt, focus rings, skip links, captions, or prefers-reduced-motion to save milliseconds.

    line 78
  4. Distinctive:

    Never claim a speedup percentage except as a labeled estimate.

    line 80
  5. Very specific:

    If HTML TTFB or the API is the owner, say so and hand origin CPU/DB to performance-review.

    line 81
  6. Very specific:

    Prefer width/height or aspect-ratio, srcset/sizes, and fetch priority over custom lazy-load scripts.

    line 83
  7. Very specific:

    Do not hide content with display: none or off-screen hacks that break keyboard, AT, or SEO and call it a win.

    line 85
  8. Distinctive:

    Images vs CLS: never strip dimensions to “make it load faster.”

    line 100

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

Frontend Performance

Ship browser-side speed. Measure Core Web Vitals, then implement the change that moves the dominant one. This is not a general app profile.

Server CPU, p95 APIs, N+1 queries, and DB plans belong in performance-review. Stay on LCP, INP, CLS, waterfalls, images, bundles, and hydration.

Workflow

  1. Name the surface and the goal vital. Route or template, device class, and which of LCP / INP / CLS (or a JS-byte budget) is the SLO.
  2. Gather evidence. Prefer field (CrUX/RUM) over one lab run. Use a Lighthouse report, Perf-panel waterfall, long-task profile, or bundle analyzer when given. If none, prescribe the cheapest measurement first.
  3. Own the dominant vital. Name the LCP element, the long task or handler, the shifting node, or the blocking request. One owner.
  4. Implement the highest-impact browser change. Typical: priority + dimensions on the LCP image (never loading="lazy" on it), route-level import(), defer non-critical JS, shrink the hydration surface, reserve space, font-display with fallback metrics.
  5. Verify the same vital on the same device class. Do not pivot to a vanity Performance score.

Common owners

SymptomOften the owner
Bad LCPlate hero, render-blocking CSS/JS, webfont, HTML TTFB
Bad INPlong tasks, sync hydration, heavy click/input handlers
Bad CLSunsized media, injected banners, font swap, late ads
Huge JSno route split, unused deps, SSR + client duplicate
Slow first paintblocking CSS/JS, long critical request chain

Output format

## Frontend performance: <route or page>

**Goal vital / budget:** …
**Evidence used:** … (or: measurements to collect first)
**Field vs lab:** …

### Dominant bottleneck
Vital + owning element/request/script + confidence (low/med/high)

### Implementation
1. [high impact] … — expected effect, a11y impact, how to verify
2. …

### Do not do yet
Micro-opts and score theater that miss the owner.

### Verify
Same vital, same device class; what must not regress (a11y, SEO).

Rules

  1. Never invent Lighthouse scores, CrUX percentiles, or byte sizes.
  2. Measure, then fix one dominant Web Vital before a laundry list.
  3. Never drop alt, focus rings, skip links, captions, or prefers-reduced-motion to save milliseconds.
  4. Never claim a speedup percentage except as a labeled estimate.
  5. If HTML TTFB or the API is the owner, say so and hand origin CPU/DB to performance-review; still name the page vital it hurts.
  6. Prefer width/height or aspect-ratio, srcset/sizes, and fetch priority over custom lazy-load scripts.
  7. Do not hide content with display: none or off-screen hacks that break keyboard, AT, or SEO and call it a win.
  8. Distinguish lab (Lighthouse) from field (CrUX/RUM); prefer field when they disagree.

Edge cases

  • No trace or Lighthouse: give a 3-step recipe (field vital → waterfall → long tasks / coverage) before rewrites.
  • Backend-bound page: TTFB or API waterfalls → performance-review for the origin; do not pretend a useMemo will fix SQL.
  • SSR / hydration: ship less client JS; do not hydrate static trees; do not flash a non-keyboard first paint.
  • "Make Lighthouse 100": refuse score chasing; pick the failing vital and a real budget (e.g. LCP under 2.5s on mid-tier mobile).
  • Images vs CLS: never strip dimensions to “make it load faster.”

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.