last update
Jun 2, 2026
license
MITv1.0.0
format
SKILL.md
- Install
// Downloads SKILL.md into ~/.claude/skills/vercel-react-best-practices/
$ curl -fsSL --create-dirs -o ~/.claude/skills/vercel-react-best-practices/SKILL.md https://claudeskil.com/skills/vercel-react-best-practices/SKILL.md - Invoke
// Inside Claude Code, type the skill name as a slash command
> /vercel-react-best-practices give my landing page a hero treatment - Or just ask
// Claude loads the skill by itself when a request matches its description
> give my landing page a hero treatment
- name:
- Vercel React Best Practices
- slug:
- vercel-react-best-practices
- version:
- v1.0.0
- license:
- MIT
- author:
- @chiragthummar16
- categories:
- tags:
- #vercel#react#nextjs#performance#core-web-vitals
- description:
React + Next.js performance — RSC patterns, partial pre-rendering, edge config, ISR, Core Web Vitals.
// What you can do with it
- Server vs Client boundaries — keep "use client" as low in the tree as possible; pass Server Components as children into client wrappers instead of importing them.
- Partial Prerendering — export const experimental_ppr = true so a static shell streams instantly while dynamic holes resolve inside .
- Caching & ISR — export const revalidate = N, fetch(url, { next: { revalidate, tags } }), and on-demand revalidateTag() / revalidatePath() in Server Actions or route handlers.
- Runtime selection — export const runtime = "edge" for low-latency, lightweight routes; Node for heavy deps or native modules.
- Assets — next/image with explicit sizes/priority, and next/font to self-host fonts and eliminate layout shift.
- CWV targets — LCP < 2.5s, INP < 200ms, CLS < 0.1, validated with @vercel/speed-insights.
README.md
Vercel React Best Practices
A working playbook for shipping fast Next.js App Router applications, distilled from the patterns Vercel's React engineering team uses in production. It focuses on the decisions that actually move Core Web Vitals: where rendering happens, what runs at the edge, how aggressively you cache, and how the asset pipeline is configured. Aimed at engineers building or auditing Next.js 14/15 apps who want concrete guidance instead of trial-and-error.
When to use it
- You're deciding whether a component should be a Server Component or a Client Component and keep guessing.
- LCP is slow because too much JavaScript ships, or INP is poor from oversized client bundles and hydration.
- You want to adopt Partial Prerendering (PPR) or
revalidate-based ISR but aren't sure where the boundaries go. - A CLS regression appeared after adding images, fonts, or ads.
- You're choosing between the Node.js and Edge runtimes for a route or middleware.
What it does
The skill applies these patterns to your code and review comments:
- Server vs Client boundaries — keep
"use client"as low in the tree as possible; pass Server Components aschildreninto client wrappers instead of importing them. - Partial Prerendering —
export const experimental_ppr = trueso a static shell streams instantly while dynamic holes resolve inside<Suspense>. - Caching & ISR —
export const revalidate = N,fetch(url, { next: { revalidate, tags } }), and on-demandrevalidateTag()/revalidatePath()in Server Actions or route handlers. - Runtime selection —
export const runtime = "edge"for low-latency, lightweight routes; Node for heavy deps or native modules. - Assets —
next/imagewith explicitsizes/priority, andnext/fontto self-host fonts and eliminate layout shift. - CWV targets — LCP < 2.5s, INP < 200ms, CLS < 0.1, validated with
@vercel/speed-insights.
Usage example
curl -fsSL --create-dirs -o ~/.claude/skills/vercel-react-best-practices/SKILL.md https://claudeskil.com/skills/vercel-react-best-practices/SKILL.md
// app/dashboard/page.tsx
import { Suspense } from "react";
export const experimental_ppr = true; // static shell + streamed dynamic parts
export default function Page() {
return (
<main>
<Header /> {/* prerendered instantly */}
<Suspense fallback={<Skeleton />}>
<LiveStats /> {/* dynamic, streamed in */}
</Suspense>
</main>
);
}
Tips & gotchas
- PPR needs
ppr: "incremental"innext.config.jsbefore per-routeexperimental_pprworks — it's opt-in by route. next/dynamicwithssr: falseonly defers hydration; it does not shrink the server-rendered HTML. Move the boundary instead.- Reaching for
cookies(),headers(), orsearchParamsopts a route into dynamic rendering — wrap that subtree in<Suspense>so PPR still prerenders the rest. - Set
sizeson every responsivenext/image; without it the browser downloads the largest candidate and tanks LCP.
FAQ
Edge or Node runtime? Edge for short, globally-distributed reads with small bundles; Node when you need full Node APIs, large dependencies, or longer compute.
ISR vs PPR? ISR controls how often a page regenerates; PPR controls which parts render statically vs dynamically within a single request. They compose.
How do I measure INP in the field? Add @vercel/speed-insights; it reports real-user LCP, INP, and CLS per route on Vercel.
$ cat reviews/