react-best-practices
Skill1 starsChanged 10 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.
66 other projects use a version of this, 21 of them edited.
Adopted by
Most recently taken up by
- eea/eea.agent.skillstheir own version, first seen Nov 8, 2026
- amanuelmamo7/Skillstheir own version, first seen Nov 7, 2026
- drinkspiller/skillsedited, first seen Nov 6, 2026
- sbrudz/agent-skillstheir own version, first seen Nov 1, 2026
- poizoncoded/skillsedited, first seen Nov 1, 2026
- sreejithraman/SreeStacktheir own version, first seen Oct 27, 2026
Used with
Projects with it also use composition-patterns, python-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.
eeaSkillcomposition-patterns
React composition patterns that scale. Use when refactoring components with boolean prop proliferation, building flexible component libraries, or designing reusable APIs. Triggers on tasks involving compound components, render props, context providers, or component architecture. Includes React 19 API changes.
Also in 4 projects that use this
jefflesterSkillpython-best-practices
Python development best practices including PEP 8 style guidelines, type hints, docstring conventions, and common patterns. Use when writing or modifying Python code.
Also in 3 projects that use this
MicrosoftSkillplanning-with-files
**USE THIS FOR COMPLEX TASKS.** Implements Manus-style file-based planning for multi-step tasks. Creates task_plan.md, findings.md, and progress.md in .agent_cache/<task-name>/. Use when: implementing multiple APIs, refactoring modules, research tasks, or ANY task requiring >5 tool calls.
Also in 5 projects that use this
MicrosoftSkillcode-quality
Statically check changed C# against the same deterministic rules github-code-quality[bot] runs on pull requests, so a contributor can fix likely findings before opening the PR and keep the bot's inline comments to a minimum. Activate when a contributor asks to "check code quality", "run code quality on my changes", "will the code quality bot complain", "pre-check before I open the PR", "code quality check", or similar. Scoped to C#. Reads the diff and compares it against the enumerated csharp-code-quality rule set below — no CodeQL download or build required. This is a fast approximation of a dataflow engine, not a reproduction; report accordingly. Does NOT apply fixes unless explicitly asked.
Also in 5 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 10 projects that use this
JetBrainsSkillwebapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.
Also in 7 projects that use this
- +1 more from microsoft
Other versions66 projects use a version of this.
Word for word · 0
None found.
Edited · 21
- mastra-ai/mastra★ 29k11% same
- openai/plugins★ 7.8k13% same
- involvex/youtube-music-cli★ 47713% same
- mikeOnBreeze/cc-crossbeam★ 29775% same
- typv/nest-turbo-starter★ 22416% same
- tdimino/claude-code-minoan★ 4159% same
- ttmouse/skills★ 3475% same
- georgekhananaev/claude-skills-vault★ 2811% same
- Fandry96/k3-agentic-skills★ 2713% same
- DawnMoon1542/agents-skills★ 816% same
11 more not listed
Wrote their own version · 45
- ryokun6/ryos★ 1.3ksame name
- vercel/vercel-plugin★ 328same name
- AvivK5498/Beads-Kanban-UI★ 102same name
- mxyhi/token_proxy★ 94same name
- laguagu/claude-code-nextjs-skills★ 72same name
- ahonn/dotfiles★ 62same name
- baekenough/oh-my-customcode★ 42same name
- oxedom/haflow★ 34same name
- sabahattink/antigravity-fullstack-hq★ 30same name
- PracticalSwan/agent-skills★ 22same name
35 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.
In this repository7 other files it gives its agents.
- skills/ui-ux-guidelines/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- react-next-modernSkill
- ui-ux-guidelinesSkill
- ultraciteSkill
- vercel-deploySkill
- vercel-design-guidelinesSkill
The file
We split this skill into the rules it gives an agent
10 rules. 0 are common, 6 are distinctive, and 4 are very specific to this project.
0
Common
Most of the 56 edited versions we read keep these.
6
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 41
Use Promise.all() for independent async operations
- Distinctive: line 42
Start promises early, await late
- Very specific: line 43
Use better-all for partial dependencies
- Distinctive: line 44
Use Suspense boundaries to stream content
- Distinctive: line 47
Avoid barrel file imports (import directly from source)
- Very specific: line 48
Use next/dynamic for heavy components
- Very specific: line 54
Use React.cache() for per-request deduplication
- Distinctive: line 55
Use LRU cache for cross-request caching
- Distinctive: line 61
Use SWR for automatic request deduplication
- Distinctive: line 63
Use derived state subscriptions
“Common” is measured: kept by at least 6 in 10 of the 56 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
React Best Practices
Overview
Performance optimization guide for React and Next.js applications, ordered by impact. Apply these patterns when writing or reviewing code to maximize performance gains.
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
Priority-Ordered Guidelines
Rules are prioritized by impact:
| Priority | Category | Impact |
| 1 | Eliminating Waterfalls | CRITICAL |
| 2 | Bundle Size Optimization | CRITICAL |
| 3 | Server-Side Performance | HIGH |
| 4 | Client-Side Data Fetching | MEDIUM-HIGH |
| 5 | Re-render Optimization | MEDIUM |
| 6 | Rendering Performance | MEDIUM |
| 7 | JavaScript Performance | LOW-MEDIUM |
| 8 | Advanced Patterns | LOW |
Quick Reference
Critical Patterns (Apply First)
Eliminate Waterfalls:
- Use
Promise.all()for independent async operations - Start promises early, await late
- Use
better-allfor partial dependencies - Use Suspense boundaries to stream content
Reduce Bundle Size:
- Avoid barrel file imports (import directly from source)
- Use
next/dynamicfor heavy components - Defer non-critical third-party libraries
- Preload based on user intent
High-Impact Server Patterns
- Use
React.cache()for per-request deduplication - Use LRU cache for cross-request caching
- Minimize serialization at RSC boundaries
- Parallelize data fetching with component composition
Medium-Impact Client Patterns
- Use SWR for automatic request deduplication
- Defer state reads to usage point
- Use derived state subscriptions
- Apply
startTransitionfor non-urgent updates
References
Full documentation with code examples is available in:
references/react-performance-guidelines.md- Complete guide with all patternsreferences/rules/- Individual rule files organized by category
To look up a specific pattern, grep the rules directory:
grep -l "suspense" references/rules/
grep -l "barrel" references/rules/
grep -l "swr" references/rules/Rule Categories in references/rules/
async-*- Waterfall elimination patternsbundle-*- Bundle size optimizationserver-*- Server-side performanceclient-*- Client-side data fetchingrerender-*- Re-render optimizationrendering-*- DOM rendering performancejs-*- JavaScript micro-optimizationsadvanced-*- Advanced patterns
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.

