nextjs-performance
Skill0 starsChanged 2 months agoMITView on GitHub
Make Next.js App Router apps fast by default — RSC/client boundary decisions, caching layers, streaming, image and font strategy, and the bundle-diet checklist. Use when building or optimizing Next.js applications.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- jgamaraalv/delivery-looptheir own version, first seen Jul 4, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- jgamaraalv/delivery-loop★ 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 repository11 other files it gives its agents.
- api-contract-designSkill
- browser-debuggingSkill
- component-reviewSkill
- css-architectureSkill
- frontend-testing-strategySkill
- performance-budgetSkill
- react-hooks-disciplineSkill
- state-managementSkill
- typescript-strictnessSkill
- vue3-compositionSkill
- web-a11ySkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 10
Default every component to a Server Component.
- Very specific: line 72
Every route needs generateMetadata (title, description, OG) — it's also your search/snackable surface.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Next.js (App Router) performance
Put the boundary in the right place
Default every component to a Server Component; add 'use client' only where interactivity demands it.
- A
'use client'marker turns the whole subtree client-side — push it to the leaves:
// ❌ the entire page ships JS
'use client'
export default function Page() { return <Chart filters={<Filters/>} /> }
// ✅ page stays server; only the leaf is interactive
// page.tsx (server)
export default function Page() {
return <div><Filters /><Chart /></div> // Chart.tsx has 'use client'
}- Server Components can pass serializable props down; never pass functions/classes across the boundary.
Data fetching: know your cache layer
| Layer | Mechanism | Use for |
| Request memoization | same URL in one render pass | dedupe within a request |
| Data Cache | fetch next: { revalidate } | cross-request persistence |
| Full Route Cache | static routes | pages that rarely change |
| Router Cache | client-side nav | instant back/forward |
- Static by default; add dynamism explicitly (
cookies(),headers(),searchParamsmake a route dynamic — know which ones you're touching). revalidateTag/revalidatePathon writes — invalidation is part of the feature, ship it with the mutation code.
Streaming: suspend below the fold
Wrap slow sections in <Suspense> so the shell ships immediately; the slow data streams in:
export default function Page() {
return (
<>
<Header /> {/* instant */}
<Suspense fallback={<Skeleton />}>
<SlowDashboard /> {/* streams when ready */}
</Suspense>
</>
)
}Assets
next/imagewith correctsizes; LCP image getspriority.next/font(self-hosted, no layout shift, no extra request).- Route-level
dynamic = 'force-static'where content is truly static.
Bundle diet (per PR)
ANALYZE=1 next build— inspect the client graph.- Replace
moment/lodashfull imports withdate-fns/named imports. - Icons: import from the icon package's ESM entry or inline SVG — no barrel of 1MB.
- Heavy editors/charts:
next/dynamicwithssr: falseand a skeleton.
Meta
- Every route needs
generateMetadata(title, description, OG) — it's also your search/snackable surface. - Parallel data:
Promise.allin server components; sequential awaits are the #1 self-inflicted TTFB kill.
Definition of done (agent checklist)
'use client'count per route is minimal and leaf-placed- No fetch waterfalls in server components
- Mutations call the matching
revalidate* - LCP element uses
priorityimage or server-rendered text - Client bundle diff per PR within budget (see
performance-budgetskill)
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.

