vercel-react-best-practices
Skill36 starsChanged 7 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.
182 other projects use a version of this, 179 of them edited.
Adopted by
Most recently taken up by
- Significant-Gravitas/AutoGPTedited, first seen Nov 18, 2026
- gilsmt/skillsedited, first seen Oct 4, 2026
- calesthio/OpenMontageedited, first seen Oct 3, 2026
- STIFLEUR390/kwiktalk-docsedited, first seen Oct 3, 2026
- delorenj/skillsedited, first seen Oct 2, 2026
- louisbrulenaudet/monorepo-templateedited, first seen Oct 2, 2026
Used with
Projects with it also use next-cache-components, next-best-practices and 9 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 7 projects that use this
SentrySkillnext-best-practices
Next.js best practices - file conventions, RSC boundaries, data patterns, async APIs, metadata, error handling, route handlers, image/font optimization, bundling
Also in 20 projects that use this
jarrodwattsSkillreact-useeffect
React useEffect best practices from official docs. Use when writing/reviewing useEffect, useState for derived values, data fetching, or state synchronization. Teaches when NOT to use Effect and better alternatives.
Also in 5 projects that use this
VercelSkillvercel-react-native-skills
Also in 17 projects that use this
itsyasirkhandevSkilltailwind-css-patterns
Provides comprehensive Tailwind CSS utility-first styling patterns including responsive design, layout utilities, flexbox, grid, spacing, typography, colors, and modern CSS best practices. Use when styling React/Vue/Svelte components, building responsive layouts, implementing design systems, or optimizing CSS workflow.
Also in 3 projects that use this
VercelSkillweb-design-guidelines
Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".
Also in 94 projects that use this
- +3 more from vercel-labs
Other versions182 projects use a version of this.
Word for word · 0
None found.
Edited · 179
- Significant-Gravitas/AutoGPT★ 188k56% same
- calesthio/OpenMontage★ 63k58% same
- CherryHQ/cherry-studio★ 52k59% same
- vercel-labs/agent-skills★ 32k62% same
- open-metadata/OpenMetadata★ 15k62% same
- zhukunpenglinyutong/jetbrains-cc-gui★ 6.8k62% same
- vercel-labs/open-agents★ 5.8k60% same
- zebbern/claude-code-guide★ 4.6k59% same
- compozy/compozy★ 2.8k56% same
- agentset-ai/agentset★ 2.1k59% same
169 more not listed
Wrote their own version · 3
- QuantumNous/new-api★ 49ksame name
- quaylabshq/skill-graph★ 10same name
- coder-zhuzm/vercel-react-skills-zh★ 2same 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 repository18 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .agents/skills/composition-patterns/AGENTS.mdAGENTS.md
- .agents/skills/react-best-practices/AGENTS.mdAGENTS.md
- ui/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- ui/CLAUDE.mdCLAUDE.md
- accessibilitySkill
- vercel-composition-patternsSkill
- frontend-designSkill
- nodejs-backend-patternsSkill
- nodejs-best-practicesSkill
- seoSkill
- typescript-advanced-typesSkill
- viteSkill
- vitestSkill
- pupila-ai-reviewSkill
- pupila-fetchersSkill
- pupila-filtersSkill
The file
We split this skill into the rules it gives an agent
1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.
0
Common
Most of the 177 edited versions we read keep these.
1
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 134
Read rule files for details + examples:
“Common” is measured: kept by at least 6 in 10 of the 177 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
Perf optimization guide for React/Next.js, by Vercel. 70 rules across 8 categories, prioritized by impact.
When to Apply
Reference when:
- Writing new React components / Next.js pages
- Implementing data fetching (client or server)
- Reviewing code for perf issues
- Refactoring React/Next.js code
- Optimizing bundle size / 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-cheap-condition-before-await- Check cheap sync conditions before awaiting flags/remote valuesasync-defer-await- Move await into branches where usedasync-parallel-Promise.all()for independent opsasync-dependencies- better-all for partial depsasync-api-routes- Start promises early, await late in API routesasync-suspense-boundaries- Suspense to stream content
2. Bundle Size Optimization (CRITICAL)
bundle-barrel-imports- Import directly, avoid barrel filesbundle-analyzable-paths- Statically analyzable import/FS paths — avoid broad bundles/tracesbundle-dynamic-imports-next/dynamicfor heavy componentsbundle-defer-third-party- Load analytics/logging post-hydrationbundle-conditional- Load modules only when feature activatesbundle-preload- Preload on hover/focus for perceived speed
3. Server-Side Performance (HIGH)
server-auth-actions- Authenticate server actions like API routesserver-cache-react-React.cache()for per-request dedupserver-cache-lru- LRU cache for cross-request cachingserver-dedup-props- Avoid duplicate serialization in RSC propsserver-hoist-static-io- Hoist static I/O (fonts, logos) to module levelserver-no-shared-module-state- Avoid module-level mutable request state in RSC/SSRserver-serialization- Minimize data to client componentsserver-parallel-fetching- Restructure components to parallelize fetchesserver-parallel-nested-fetching- Chain nested fetches per item inPromise.allserver-after-nonblocking-after()for non-blocking ops
4. Client-Side Data Fetching (MEDIUM-HIGH)
client-swr-dedup- SWR for auto request dedupclient-event-listeners- Dedup global event listenersclient-passive-event-listeners- Passive listeners for scrollclient-localstorage-schema- Version + 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- Primitive deps in effectsrerender-derived-state- Subscribe to derived booleans, not raw valuesrerender-derived-state-no-effect- Derive state during render, not in effectsrerender-functional-setstate- Functional setState for stable callbacksrerender-lazy-state-init- Pass function touseStatefor expensive valuesrerender-simple-expression-in-memo- No memo for simple primitivesrerender-split-combined-hooks- Split hooks with independent depsrerender-move-effect-to-event- Interaction logic in event handlersrerender-transitions-startTransitionfor non-urgent updatesrerender-use-deferred-value- Defer expensive renders to keep input responsivererender-use-ref-transient-values- Refs for transient frequent valuesrerender-no-inline-components- No components inside components
6. Rendering Performance (MEDIUM)
rendering-animate-svg-wrapper- Animate div wrapper, not SVG elementrendering-content-visibility-content-visibilityfor long listsrendering-hoist-jsx- Extract static JSX outside componentsrendering-svg-precision- Reduce SVG coord precisionrendering-hydration-no-flicker- Inline script for client-only datarendering-hydration-suppress-warning- Suppress expected mismatchesrendering-activity-Activitycomponent for show/hiderendering-conditional-render- Ternary, not&&, for conditionalsrendering-usetransition-loading- PreferuseTransitionfor loading staterendering-resource-hints- React DOM resource hints for preloadrendering-script-defer-async-deferorasyncon script tags
7. JavaScript Performance (LOW-MEDIUM)
js-batch-dom-css- Group CSS changes via classes orcssTextjs-index-maps- Build Map for repeated lookupsjs-cache-property-access- Cache object props in loopsjs-cache-function-results- Cache function results in module-level Mapjs-cache-storage- CachelocalStorage/sessionStoragereadsjs-combine-iterations- Combine multiple filter/map into one loopjs-length-check-first- Check array length before expensive comparisonjs-early-exit- Return earlyjs-hoist-regexp- HoistRegExpcreation outside loopsjs-min-max-loop- Loop for min/max instead of sortjs-set-map-lookups- Set/Map for O(1) lookupsjs-tosorted-immutable-toSorted()for immutabilityjs-flatmap-filter-flatMapto map + filter in one passjs-request-idle-callback- Defer non-critical work to browser idle
8. Advanced Patterns (LOW)
advanced-effect-event-deps- Don't putuseEffectEventresults in effect depsadvanced-event-handler-refs- Store event handlers in refsadvanced-init-once- Init app once per app loadadvanced-use-latest-useLatestfor stable callback refs
How to Use
Read rule files for details + examples:
rules/async-parallel.md
rules/bundle-barrel-imports.mdEach rule contains:
- Why it matters
- Incorrect example + explanation
- Correct example + explanation
- Context + refs
Full Compiled Document
Complete guide with all rules: 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.

