frontend-performance
Skill4 starsChanged 32 days agoMITView on GitHub
This skill should be used when a frontend feels slow, fails Core Web Vitals, has a large bundle, or needs performance optimization. Trigger phrases include "make it faster", "improve performance", "Core Web Vitals", "LCP", "INP", "CLS", "reduce bundle size", "code splitting", "lazy load", "it's slow to load", "optimize images", "bundle too big", "Lighthouse score". It targets the real Core Web Vitals thresholds with stack-specific fixes for React + Vite + Vercel.
7 other projects use a version of this.
Adopted by
Most recently taken up by
- nahid-sparktales/agent-dispatchertheir own version, first seen Sep 21, 2026
- bestdeejay-design/agent-skillstheir own version, first seen Aug 9, 2026
- shreyas-makes/agent-skillstheir own version, first seen Jul 15, 2026
- miptah21/skillstheir own version, first seen May 26, 2026
- basidiocarp/pileustheir own version, first seen May 25, 2026
- yiweiwan/skillstheir own version, first seen May 12, 2026
Other versions7 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 7
- nahid-sparktales/agent-dispatcher★ 59same name
- bestdeejay-design/agent-skills★ 6same name
- thejordanleopold/claude-code-skills-distilled★ 4same name
- miptah21/skills★ 2same name
- shreyas-makes/agent-skills★ 2same name
- yiweiwan/skills★ 1same name
- basidiocarp/pileus★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository21 other files it gives its agents.
- accessibilitySkill
- ai-featuresSkill
- api-designSkill
- architecture-primerSkill
- authSkill
- data-modelingSkill
- deploymentSkill
- design-taste-frontendSkill
- image-to-codeSkill
- integrationsSkill
- landing-pageSkill
- multi-tenancySkill
- paymentsSkill
- pre-ship-securitySkill
- product-discoverySkill
- pwaSkill
- rls-auditSkill
- saas-routerSkill
- secure-codingSkill
- technical-seoSkill
- ui-designSkill
The file
We split this skill into the rules it gives an agent
5 rules. 0 are common, 4 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 6 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 21
Do you have field data (real users) or only a Lighthouse lab score?
- Distinctive: line 32
Keep the largest initial chunk under ~200KB gzipped: Treat Vite's "chunks larger than 500KB" warning as a budget failure, not a suggestion.
- Very specific: line 45
Use useTransition / startTransition for non-urgent React updates so input handlers stay responsive.
- Distinctive: line 46
Avoid synchronous work inside input/click handlers.
- Distinctive: line 51
Don't inject content above existing content after load.
“Common” is measured: kept by at least 6 in 10 of the 6 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.
Files
Frontend Performance
This skill makes a React + Vite app hit the Core Web Vitals bar — the same metrics Google uses for ranking and that users feel as "fast." It optimizes against real thresholds, not vibes.
Analogy: shipping a fast app is like packing for a flight. You don't drag every possession to the gate — you pack the carry-on with what's needed now (above-the-fold) and check the rest (lazy-load below-the-fold). Overpacking the initial bundle is what makes the page heavy.
The targets (field data, 75th percentile)
- LCP < 2.5s — largest content paint.
- INP < 200ms — interaction to next paint (replaced FID in March 2024).
- CLS < 0.1 — cumulative layout shift.
Discovery (max 3 questions, only if unknown)
- What's slow — first load (LCP/bundle) or interactions (INP)?
- Do you have field data (real users) or only a Lighthouse lab score?
- What's the biggest payload — JS bundle, images, or fonts?
Step 1 — Measure real users first
Install web-vitals (attribution build) and report onLCP/onINP/onCLS to your analytics. Lab tools (Lighthouse) miss field INP — optimize against real-user data, not just a local score. The Vercel Speed Insights package gives this with no backend.
Step 2 — Cut the bundle
- Route-level code splitting with
React.lazy+<Suspense>. Lazy-load below-the-fold and modal/dialog components so the initial bundle ships only above-the-fold code. - Split vendors in
vite.config.tsviabuild.rollupOptions.output.manualChunks(separatereact/react-dom, charts, icons) for long-term cache hits. - Keep the largest initial chunk under ~200KB gzipped. Treat Vite's "chunks larger than 500KB" warning as a budget failure, not a suggestion.
- Enforce the budget in CI with
size-limit; fail the build on regression. Inspect withvite-bundle-visualizer. - Tree-shake via named imports; prefer
lucide-reactover monolithic icon packs.
Step 3 — Fix LCP
- Preload the LCP image:
<link rel="preload" fetchpriority="high">. Never lazy-load the hero. - Serve images as AVIF/WebP through Vercel image optimization; always set explicit
width/height(oraspect-ratio) to prevent CLS. - Self-host or
preconnectfonts; usefont-display: swap.
Step 4 — Fix INP
- Break up long tasks; defer non-critical JS.
- Use
useTransition/startTransitionfor non-urgent React updates so input handlers stay responsive. - Avoid synchronous work inside input/click handlers.
Step 5 — Fix CLS
- Reserve space for images, ads, and embeds (explicit dimensions /
aspect-ratio). - Don't inject content above existing content after load.
- Animate only
transform/opacity(GPU-composited) — neverwidth/height/top/left, which trigger layout and hurt both CLS and INP.
Output
Deliver: a before/after of the three vitals (or the targets if no baseline), the concrete vite.config.ts chunk config, the React.lazy split points, the image/font fixes, and the CI bundle-budget step.
Reference
GoogleChrome/web-vitals (~8.5k⭐), web.dev Core Web Vitals, Vite build docs (manualChunks), Vercel image optimization, size-limit.
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
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.

