next-best-practices
Skill1 starsChanged 13 days agoMITView on GitHub
Author, optimize, and review Next.js applications (App Router, React Server Components, Server Actions, Partial Prerendering, and caching). Enforces sub-second TTFB, zero hydration mismatches, and pristine component boundaries.
We split this skill into the rules it gives an agent
4 rules. 0 are common, 4 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 47 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Server by Default: Keep components as React Server Components (RSC) unless interactivity (useState, useEffect, event listeners) or browser …
- Distinctive: line 20
Avoid passing sensitive environment variables or un-sanitized server contexts into Client Component props.
- Distinctive: line 23
Always validate inputs in Server Actions using Zod or typed schemas before executing database mutations.
- Distinctive: line 28
Never render non-deterministic content (random numbers, current time, localStorage state) on the initial SSR render to prevent hydration …
“Common” is measured: kept by at least 6 in 10 of the 47 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
Next.js Production Best Practices (Vercel Engineering Standards)
Comprehensive guidelines for modern Next.js 14/15+ App Router architectures.
1. Component Boundaries & RSC Directives
- Server by Default: Keep components as React Server Components (RSC) unless interactivity (useState, useEffect, event listeners) or browser APIs are required.
- Client Leaf Pattern: Push
'use client'to the farthest leaf components in the tree to maximize streaming and server rendering. - Data Flow: Fetch data directly inside Server Components using async/await. Pass serialized data down to Client Components as props.
2. Dynamic APIs & Route Handlers
- In Next.js 15,
cookies(),headers(), and routeparamsare asynchronous promises. Alwaysawaitthem. - Avoid passing sensitive environment variables or un-sanitized server contexts into Client Component props.
3. Server Actions & Mutations
- Always validate inputs in Server Actions using Zod or typed schemas before executing database mutations.
- Revalidate paths precisely with
revalidatePathorrevalidateTagto update cache without reloading the whole layout. - Wrap mutations with
useTransition/useActionStateon the client for optimistic UI updates.
4. Hydration & Performance
- Never render non-deterministic content (random numbers, current time, localStorage state) on the initial SSR render to prevent hydration mismatch errors.
- Wrap dynamic subtrees with
<Suspense fallback={<Skeleton />}>to enable immediate streaming responses and progressive page hydration. - Optimize assets using
next/imagewith explicit aspect ratios andnext/fontfor zero layout shift (CLS: 0).
Other versions47 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 47
- midudev/preguntas-entrevista-react★ 7.8ksame name
- Kiranism/next-shadcn-dashboard-starter★ 7.1ksame name
- JimmyLv/BibiGPT-v1★ 6.2ksame name
- TheEdoRan/next-safe-action★ 3.1ksame name
- compozy/compozy★ 2.8ksame name
- openstatusHQ/data-table-filters★ 2.3ksame name
- kokonut-labs/kokonutui★ 2.2ksame name
- vercel-labs/openreview★ 1.7ksame name
- legions-developer/invoicely★ 923same name
- subhadeeproy3902/mvpblocks★ 834same name
37 more not listed
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.
Used alongsideProjects with it also use next-cache-components, next-upgrade and 10 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.
VercelSkillnext-cache-components
Next.js 16 Cache Components - PPR, use cache directive, cacheLife, cacheTag, updateTag
Also in 15 projects that use this
VercelSkillnext-upgrade
Upgrade Next.js to the latest version following official migration guides and codemods
Also in 10 projects that use this
pedronauckSkillapp-renderer-systems
Create, extend, or debug frontend domain modules organized under systems/. Covers adapters, Query hooks, local state, and public exports; excludes generic components and backend implementation.
Also in 3 projects that use this
pedronauckSkillrefactoring-analysis
Audit code quality and architectural health or plan refactoring using Fowler code smells and techniques; write prioritized findings to docs/_refacs/. Excludes formatting, performance, and security audits.
Also in 3 projects that use this
jander99Skilltypescript-advanced
Design, implement, refactor, and debug advanced TypeScript patterns including generics, utility types, mapped types, conditional types, type guards, discriminated unions, and strict mode configuration. Use when writing type-safe code, fixing type errors, or improving type inference.
Also in 3 projects that use this
crafter-stationSkilltech-logos
Install official tech brand logos from the Elements registry. Use when user needs logos for tech companies (Clerk, Vercel, GitHub, etc.), AI providers (OpenAI, Anthropic, Claude), social platforms, or any brand assets. Triggers on "logo", "brand", "icon for [company]", "add [company] logo", placeholder logo detection, or when building landing pages, auth UIs, or integrations showcases.
Also in 3 projects that use this
- +1 more from vercel-labs
In this repository39 other files it gives its agents.
- AGENTS.mdAGENTS.md
- antigravity-agent/AGENTS.mdAGENTS.md
- claude-code-agent/CLAUDE.mdCLAUDE.md
- CLAUDE.mdCLAUDE.md
- ci/copilot-instructions.mdCopilot instructions
- .github/copilot-instructions.mdCopilot instructions
- .cursor/rules/01-craftsman.mdcCursor rule
- .cursor/rules/02-architecture-standards.mdcCursor rule
- .cursor/rules/03-security-directives.mdcCursor rule
- .cursor/rules/04-testing-tdd.mdcCursor rule
- .cursor/rules/05-design-standards.mdcCursor rule
- adversarial-code-reviewSkill
- agi-god-modeSkill
- audit-context-buildingSkill
- brainstormingSkill
- craftsman-evaluatorSkill
- creative-pipeline-conductorSkill
- data-science-masterSkill
- differential-reviewSkill
- flaw-remediatorSkill
- game-developerSkill
- hacker-modeSkill
- hallwright-memorySkill
- omni-executorSkill
- persona-activatorSkill
- postgres-best-practicesSkill
- prompt-firstSkill
- reverse-engineer-anythingSkill
- spatial-3d-physicsSkill
- subagent-driven-developmentSkill
- super-web-devSkill
- swarm-intelligenceSkill
- systematic-debuggingSkill
- test-driven-developmentSkill
- threejs-masterySkill
- writing-plansSkill
- zero-drift-sentinelSkill
- hwmemSkill
- prompt-firstSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

