vercel-react-best-practices
Skill3.1k starsChanged 9 months agoMITView on GitHub
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.
207 other projects use a version of this, 143 of them edited.
Trending
Quiet since March.about the whole repository
Most recently taken up by
- QuantumNous/new-apitheir own version, first seen Nov 15, 2026
- axiom-desu/ZCodiumedited, first seen Nov 15, 2026
- CherryHQ/cherry-studioedited, first seen Nov 15, 2026
- Dimon94/dverityedited, first seen Nov 15, 2026
- Dimon94/skillsedited, first seen Nov 15, 2026
- Significant-Gravitas/AutoGPTedited, first seen Nov 14, 2026
Who's talking about TheEdoRan/next-safe-action
- vercel/next.js“"Server Actions must be async functions." being reported incorrectly”GitHub · Nov 5, 2024 · 13 reactions
- next-safe-action/next-safe-action“[BUG] `onError` called on redirects if it was called previously”GitHub · Dec 1, 2024 · 7 reactions
- next-safe-action/next-safe-action“[BUG] TypeScript issue with parsedInput in useAction Hook”GitHub · Jun 16, 2024 · 3 reactions
- next-safe-action/next-safe-action“[BUG] Not possible to handle errors that are not instance of Error”GitHub · Jan 10, 2025 · 2 reactions
- airjp73/rvf“Fix zod-form-data schema output type that are using `stripEmpty`”GitHub · Jun 10, 2025 · 1 reactions
The biggest 5 of 50 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 50
Talked about on GitHub (50 times).
On GitHub · 50
- Nov 5, 2024"Server Actions must be async functions." being reported incorrectly — vercel/next.js13 reactions · 5 comments
- Dec 1, 2024[BUG] `onError` called on redirects if it was called previously — next-safe-action/next-safe-action7 reactions · 4 comments
- Jun 16, 2024[BUG] TypeScript issue with parsedInput in useAction Hook — next-safe-action/next-safe-action3 reactions · 8 comments
- Jan 10, 2025[BUG] Not possible to handle errors that are not instance of Error — next-safe-action/next-safe-action2 reactions · 3 comments
- Jun 10, 2025Fix zod-form-data schema output type that are using `stripEmpty` — airjp73/rvf1 reaction · 4 comments
45 more on GitHub
- May 20, 2025Zod v4 support — next-safe-action/next-safe-action1 reaction · 1 comment
- Feb 19, 2025Fix `zfd.formData` input type — airjp73/rvf1 reaction · 3 comments
- Mar 8, 2024[ASK] Error: Cannot access 'action' before initialization — next-safe-action/next-safe-action1 reaction · 3 comments
- Oct 11, 2023Dist files contain incorrect types — next-safe-action/next-safe-action1 reaction · 2 comments
- Mar 25, 2026Bump next-safe-action from 7.10.8 to 8.1.8 — ChazWyllie/kairofit0 reactions · 1 comment
- Mar 15, 2026chore(deps): bump the npm-dependencies group across 1 directory with 14 updates — startberlin/cockpit0 reactions · 2 comments
- Mar 4, 2026[BUG] `returnValidationErrors` called from middleware catch block throws instead of returning `validationErrors` — next-safe-action/next-safe-action0 reactions
- Mar 1, 2026build(deps): bump next-safe-action from 8.0.11 to 8.1.4 — wuyuan1992/react-components0 reactions · 2 comments
- Mar 1, 2026chore(deps): bump the npm-dependencies group across 1 directory with 12 updates — startberlin/cockpit0 reactions · 2 comments
- Feb 28, 2026Bump next-safe-action from 8.0.11 to 8.1.4 — rifandani/feature-flag0 reactions
- Feb 27, 2026Bump next-safe-action from 8.0.11 to 8.1.4 — joehentges/pendulem0 reactions
- Feb 11, 2026[Module Listing Request]: `nuxt-safe-action` — nuxt/modules0 reactions · 2 comments
- Dec 16, 2025Bump next-safe-action from 7.10.8 to 8.0.11 — hiteshhJ/ticketing-app0 reactions
- Oct 29, 2025Bump next-safe-action from 7.10.2 to 8.0.11 — akunpbhanz-lgtm/starter0 reactions · 1 comment
- Sep 30, 2025Bump next-safe-action from 7.10.8 to 8.0.11 — eersnington/diff00 reactions · 2 comments
- Sep 8, 2025Bump next-safe-action from 8.0.10 to 8.0.11 — joehentges/skyline0 reactions
- Sep 1, 2025[npm dependencies]: Bump next-safe-action from 7.10.8 to 8.0.11 in /src — Smegfi/papago0 reactions
- Sep 1, 2025chore(deps): bump next-safe-action from 8.0.8 to 8.0.11 — Shironex/portfolio0 reactions · 1 comment
- Sep 1, 2025chore: bump the dependencies group with 20 updates — alex289/NextJs-Boilerplate0 reactions · 2 comments
- Aug 25, 2025chore(deps): bump the all group across 1 directory with 94 updates — jaqubowsky/create-nextjs-app0 reactions · 1 comment
- Aug 23, 2025chore: bump the dependencies group with 19 updates — alex289/NextJs-Boilerplate0 reactions · 3 comments
- Aug 18, 2025[npm dependencies]: Bump next-safe-action from 7.10.8 to 8.0.10 in /src — Smegfi/papago0 reactions · 1 comment
- Aug 18, 2025chore(deps): bump the all group with 71 updates — jaqubowsky/create-nextjs-app0 reactions · 2 comments
- Aug 18, 2025chore(deps): bump next-safe-action from 8.0.8 to 8.0.10 — Shironex/portfolio0 reactions · 1 comment
- Aug 1, 2025chore(deps): bump next-safe-action from 8.0.2 to 8.0.8 — rifandani/ai-monorepo0 reactions · 1 comment
- Aug 1, 2025⬆️ Bump next-safe-action from 7.10.4 to 8.0.8 — quantified-uncertainty/squiggle0 reactions · 4 comments
- Jul 28, 2025[npm dependencies]: Bump next-safe-action from 7.10.8 to 8.0.8 in /src — Smegfi/papago0 reactions · 1 comment
- Jul 15, 2025chore(deps): bump next-safe-action from 7.10.4 to 8.0.8 — santosmarco/github-jtgc5e-20 reactions
- Jul 15, 2025Bump the dependencies group with 6 updates — RasengunShotaro/pdcxa0 reactions · 1 comment
- Jun 30, 2025[npm dependencies]: Bump next-safe-action from 7.10.8 to 8.0.7 in /src — Smegfi/papago0 reactions · 1 comment
- Jun 26, 2025Bump the dependencies group with 5 updates — RasengunShotaro/pdcxa0 reactions
- Jun 23, 2025[npm dependencies]: Bump next-safe-action from 7.10.8 to 8.0.4 in /src — Smegfi/papago0 reactions · 1 comment
- Jun 17, 2025chore(deps): bump next-safe-action from 7.10.4 to 8.0.3 — santosmarco/github-jtgc5e-20 reactions · 1 comment
- Jun 16, 2025Bump next-safe-action from 7.10.8 to 8.0.3 — joehentges/skyline0 reactions · 1 comment
- Jun 12, 2025[BUG] throwValidationErrors with overrideErrorMessage not working in v7.10.5 — next-safe-action/next-safe-action0 reactions · 1 comment
- Jun 9, 2025Bump next-safe-action from 7.10.8 to 8.0.2 — joehentges/skyline0 reactions · 1 comment
- Jun 9, 2025chore(deps): bump next-safe-action from 7.10.4 to 8.0.2 — santosmarco/github-jtgc5e-20 reactions · 1 comment
- Jun 9, 2025[npm dependencies]: Bump next-safe-action from 7.10.8 to 8.0.2 in /src — Smegfi/papago0 reactions · 1 comment
- Jun 4, 2025chore(deps): bump next-safe-action from 7.10.4 to 8.0.1 — santosmarco/github-jtgc5e-20 reactions · 1 comment
- Jun 3, 2025chore(deps): bump next-safe-action from 7.10.4 to 8.0.0 — santosmarco/github-jtgc5e-20 reactions · 1 comment
- Jun 3, 2025Bump the dependencies group with 5 updates — RasengunShotaro/pdcxa0 reactions · 1 comment
- Jun 2, 2025Bump next-safe-action from 7.10.8 to 8.0.0 — joehentges/skyline0 reactions · 1 comment
- May 13, 2025chore(deps): bump next-safe-action from 7.10.4 to 7.10.8 — santosmarco/github-jtgc5e-20 reactions · 1 comment
- May 1, 2025chore(deps): bump next-safe-action from 7.10.5 to 7.10.8 — rifandani/ai-monorepo0 reactions · 1 comment
- May 1, 2025⬆️ Bump next-safe-action from 7.10.4 to 7.10.8 — quantified-uncertainty/squiggle0 reactions · 3 comments
Used with
Projects with it also use dep-refs, feature-boundary-planner and 7 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.
betacatslingSkilldep-refs
Use when needs to inspect TypeScript export references in the z-code workspace, list exports from a file, verify whether an export is unused before deletion, investigate who imports a symbol during refactors, or combine pnpm knip unused-export results with pnpm dep:refs symbol-level reference tracing.
Also in 5 projects that use this
betacatslingSkillfeature-boundary-planner
Map a ZCode behavior change to current UI surfaces, state owners, protocol commands, persistence, and validation. Use for impact analysis, product-boundary planning, or an implementation handoff grounded in the checked-out source.
Also in 5 projects that use this
SentrySkillvercel-composition-patterns
Also in 124 projects that use this
Cartograf666Skillarchitecture-governance
Bootstrap, document, enforce, and review a project's architecture through layer responsibilities, dependency direction, architecture manifests, legacy baselines, Change Envelopes, cross-layer approval policy, and deterministic architecture checks. Use when starting a project, auditing an existing codebase, planning cross-layer work, preventing architecture erosion, reviewing structural changes, or deciding whether implementation may expand into another layer.
Also in 5 projects that use this
thongdn-itSkillnuqs
nuqs (type-safe URL query state) best practices for Next.js applications. This skill should be used when writing, reviewing, or refactoring code that uses nuqs for URL state management. Triggers on tasks involving useQueryState, useQueryStates, search params, URL state, query parameters, nuqs parsers, or Next.js routing with state.
Also in 4 projects that use this
VercelSkillvercel-optimize
Use for Vercel cost and performance optimization on deployed projects, especially Next.js, SvelteKit, Nuxt, and limited Astro apps. Collect Vercel metrics, usage, project config, and code scan results first; investigate only metric-backed candidates; produce ranked recommendations grounded in verified files and version-aware Vercel/framework docs. Trigger for Vercel bill reduction, slow or expensive routes, caching opportunities, Function Invocations, Build Minutes, Fast Data Transfer, Core Web Vitals, Bot Management, Fluid compute, or cost breakdown requests.
Also in 14 projects that use this
Other versions207 projects use a version of this.
Word for word · 60
- mfts/papermark★ 9.2k100% same
- papermark/papermark★ 9.2k100% same
- dinerojs/dinero.js★ 6.8k100% same
- yournextstore/yournextstore★ 5.5k100% same
- bestofjs/bestofjs★ 3.1k100% same
- Draculabo/AntigravityManager★ 2.5k100% same
- kokonut-labs/kokonutui★ 2.3k100% same
- agentset-ai/agentset★ 2.1k100% same
- jewbetcha/openflight★ 1.2k100% same
- KartikLabhshetwar/screenshot-studio★ 1.1k100% same
50 more not listed
Edited · 143
- Significant-Gravitas/AutoGPT★ 188k93% same
- calesthio/OpenMontage★ 81k80% same
- OpenMontageInc/OpenMontage★ 81k80% same
- CherryHQ/cherry-studio★ 54k91% same
- vercel-labs/agent-skills★ 33k79% same
- udecode/plate★ 17k79% same
- open-metadata/OpenMetadata★ 16k79% same
- Arize-ai/phoenix★ 12k79% same
- trycompai/crm★ 12k79% same
- polarsource/polar★ 10k82% same
133 more not listed
Wrote their own version · 4
- QuantumNous/new-api★ 52ksame name
- coco-research/coco★ 797same name
- extra-org/extra★ 120same name
- composio-community/opencode-skills★ 14same 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 repository12 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .agents/skills/vercel-react-best-practices/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- frontend-designSkill
- next-best-practicesSkill
- next-cache-componentsSkill
- next-upgradeSkill
- pnpmSkill
- skill-creatorSkill
- tsdownSkill
- turborepoSkill
- vitestSkill
The file
We split this skill into the rules it gives an agent
1 rule. 1 is common, 0 are distinctive, and 0 are very specific to this project.
1
Common
Most of the 144 edited versions we read keep these.
0
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
- Common: line 121
Read individual rule files for detailed explanations and code examples:
“Common” is measured: kept by at least 6 in 10 of the 144 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
Vercel React Best Practices
Comprehensive performance optimization guide for React and Next.js applications, maintained by Vercel. Contains 57 rules across 8 categories, prioritized by impact to guide automated refactoring and code generation.
When to Apply
Reference these guidelines when:
- Writing new React components or Next.js pages
- Implementing data fetching (client or server-side)
- Reviewing code for performance issues
- Refactoring existing React/Next.js code
- Optimizing bundle size or load times
Rule Categories by Priority
| Priority | Category | Impact | Prefix |
| 1 | Eliminating Waterfalls | CRITICAL | async- |
| 2 | Bundle Size Optimization | CRITICAL | bundle- |
| 3 | Server-Side Performance | HIGH | server- |
| 4 | Client-Side Data Fetching | MEDIUM-HIGH | client- |
| 5 | Re-render Optimization | MEDIUM | rerender- |
| 6 | Rendering Performance | MEDIUM | rendering- |
| 7 | JavaScript Performance | LOW-MEDIUM | js- |
| 8 | Advanced Patterns | LOW | advanced- |
Quick Reference
1. Eliminating Waterfalls (CRITICAL)
async-defer-await- Move await into branches where actually usedasync-parallel- Use Promise.all() for independent operationsasync-dependencies- Use better-all for partial dependenciesasync-api-routes- Start promises early, await late in API routesasync-suspense-boundaries- Use Suspense to stream content
2. Bundle Size Optimization (CRITICAL)
bundle-barrel-imports- Import directly, avoid barrel filesbundle-dynamic-imports- Use next/dynamic for heavy componentsbundle-defer-third-party- Load analytics/logging after hydrationbundle-conditional- Load modules only when feature is activatedbundle-preload- Preload on hover/focus for perceived speed
3. Server-Side Performance (HIGH)
server-auth-actions- Authenticate server actions like API routesserver-cache-react- Use React.cache() for per-request deduplicationserver-cache-lru- Use LRU cache for cross-request cachingserver-dedup-props- Avoid duplicate serialization in RSC propsserver-serialization- Minimize data passed to client componentsserver-parallel-fetching- Restructure components to parallelize fetchesserver-after-nonblocking- Use after() for non-blocking operations
4. Client-Side Data Fetching (MEDIUM-HIGH)
client-swr-dedup- Use SWR for automatic request deduplicationclient-event-listeners- Deduplicate global event listenersclient-passive-event-listeners- Use passive listeners for scrollclient-localstorage-schema- Version and minimize localStorage data
5. Re-render Optimization (MEDIUM)
rerender-defer-reads- Don't subscribe to state only used in callbacksrerender-memo- Extract expensive work into memoized componentsrerender-memo-with-default-value- Hoist default non-primitive propsrerender-dependencies- Use primitive dependencies in effectsrerender-derived-state- Subscribe to derived booleans, not raw valuesrerender-derived-state-no-effect- Derive state during render, not effectsrerender-functional-setstate- Use functional setState for stable callbacksrerender-lazy-state-init- Pass function to useState for expensive valuesrerender-simple-expression-in-memo- Avoid memo for simple primitivesrerender-move-effect-to-event- Put interaction logic in event handlersrerender-transitions- Use startTransition for non-urgent updatesrerender-use-ref-transient-values- Use refs for transient frequent values
6. Rendering Performance (MEDIUM)
rendering-animate-svg-wrapper- Animate div wrapper, not SVG elementrendering-content-visibility- Use content-visibility for long listsrendering-hoist-jsx- Extract static JSX outside componentsrendering-svg-precision- Reduce SVG coordinate precisionrendering-hydration-no-flicker- Use inline script for client-only datarendering-hydration-suppress-warning- Suppress expected mismatchesrendering-activity- Use Activity component for show/hiderendering-conditional-render- Use ternary, not && for conditionalsrendering-usetransition-loading- Prefer useTransition for loading state
7. JavaScript Performance (LOW-MEDIUM)
js-batch-dom-css- Group CSS changes via classes or cssTextjs-index-maps- Build Map for repeated lookupsjs-cache-property-access- Cache object properties in loopsjs-cache-function-results- Cache function results in module-level Mapjs-cache-storage- Cache localStorage/sessionStorage readsjs-combine-iterations- Combine multiple filter/map into one loopjs-length-check-first- Check array length before expensive comparisonjs-early-exit- Return early from functionsjs-hoist-regexp- Hoist RegExp creation outside loopsjs-min-max-loop- Use loop for min/max instead of sortjs-set-map-lookups- Use Set/Map for O(1) lookupsjs-tosorted-immutable- Use toSorted() for immutability
8. Advanced Patterns (LOW)
advanced-event-handler-refs- Store event handlers in refsadvanced-init-once- Initialize app once per app loadadvanced-use-latest- useLatest for stable callback refs
How to Use
Read individual rule files for detailed explanations and code examples:
rules/async-parallel.md
rules/bundle-barrel-imports.mdEach rule file contains:
- Brief explanation of why it matters
- Incorrect code example with explanation
- Correct code example with explanation
- Additional context and references
Full Compiled Document
For the complete guide with all rules expanded: AGENTS.md
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.

