react-best-practices
Skill0 starsChanged 8 months agoMITView on GitHub
React and Next.js performance optimization from Vercel Engineering. Use when building React components, optimizing performance, eliminating waterfalls, reducing bundle size, reviewing code for performance issues, or implementing server/client-side optimizations.
38 other projects use a version of this, 2 of them edited.
Adopted by
Most recently taken up by
- baekenough/oh-my-customcodetheir own version, first seen Oct 3, 2026
- BytePioneer-AI/codex-hosttheir own version, first seen Oct 2, 2026
- laguagu/claude-code-nextjs-skillstheir own version, first seen Sep 30, 2026
- Isabella-a/Skillstheir own version, first seen Sep 27, 2026
- sabahattink/antigravity-fullstack-hqtheir own version, first seen Sep 20, 2026
- drinkspiller/skillstheir own version, first seen Sep 16, 2026
Used with
Projects with it also use python-best-practices, notebooklm and 3 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.
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
ttmouseSkillnotebooklm
Automate Google NotebookLM - create notebooks, add sources, generate podcasts/videos/quizzes, download artifacts. Supports browser-based content extraction for anti-crawler platforms (Twitter/X, LinkedIn, etc.). Activates on explicit /notebooklm or intent like "create a podcast about X
Also in 3 projects that use this
JetBrainsSkillcanvas-design
Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.
Also in 3 projects that use this
MicrosoftSkillskill-creator
Guide for creating effective GitHub Copilot skills (.github/skills/) in this repository. Use when creating a new skill, updating an existing skill, or when asked about skill structure, format, or best practices for the vscode-documentdb project.
Also in 7 projects that use this
StrayDragonSkillui-ux-pro-max
UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient.
Also in 3 projects that use this
Other versions38 projects use a version of this.
Word for word · 0
None found.
Edited · 2
- jornalistainclusivo/jinc-skills★ 199% same
- tiendatwork/claude-skills★ 199% same
Wrote their own version · 36
- openai/plugins★ 7.3ksame name
- BytePioneer-AI/codex-host★ 2.7ksame name
- vercel/vercel-plugin★ 297same name
- mxyhi/token_proxy★ 94same name
- laguagu/claude-code-nextjs-skills★ 67same name
- baekenough/oh-my-customcode★ 43same name
- tdimino/claude-code-minoan★ 40same name
- itallstartedwithaidea/agent-skills★ 39same name
- ttmouse/skills★ 34same name
- sabahattink/antigravity-fullstack-hq★ 30same name
26 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 repository25 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- api-patternsSkill
- architectureSkill
- brainstormingSkill
- clean-codeSkill
- code-review-checklistSkill
- database-designSkill
- data-engineeringSkill
- frontend-designSkill
- llm-evaluationSkill
- mcp-builderSkill
- memory-managementSkill
- nodejs-best-practicesSkill
- observabilitySkill
- parallel-agentsSkill
- powershell-windowsSkill
- prompt-engineeringSkill
- python-patternsSkill
- rag-patternsSkill
- seo-fundamentalsSkill
- systematic-debuggingSkill
- tdd-workflowSkill
- vulnerability-scannerSkill
- webapp-testingSkill
- web-design-guidelinesSkill
The file
We split this skill into the rules it gives an agent
10 rules. 0 are common, 8 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 33 edited versions we read keep these.
8
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 16
Read ONLY sections relevant to your task!: Check the content map below and load what you need.
- Distinctive: line 123
Before shipping to production:
- Distinctive: line 183
Check Section 1 & 2 while building (prevent waterfalls, keep bundle small)
- Distinctive: line 184
Use server components by default (Section 3)
- Distinctive: line 189
Start with Section 1 (waterfalls = biggest impact)
- Distinctive: line 197
Use Quick Decision Tree above
- Distinctive: line 274
Measure first: - Use React DevTools Profiler, Chrome DevTools
- Very specific: line 282
Every await in sequence = potential waterfall
- Very specific: line 283
Every import = potential bundle bloat
- Distinctive: line 284
Every re-render = wasted computation (if unnecessary)
“Common” is measured: kept by at least 6 in 10 of the 33 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 & React Performance Expert
From Vercel Engineering - 57 optimization rules prioritized by impact Philosophy: Eliminate waterfalls first, optimize bundles second, then micro-optimize.
🎯 Selective Reading Rule (MANDATORY)
Read ONLY sections relevant to your task! Check the content map below and load what you need.
🔴 For performance reviews: Start with CRITICAL sections (1-2), then move to HIGH/MEDIUM.
📑 Content Map
| File | Impact | Rules | When to Read |
1-async-eliminating-waterfalls.md | 🔴 CRITICAL | 5 rules | Slow page loads, sequential API calls, data fetching waterfalls |
2-bundle-bundle-size-optimization.md | 🔴 CRITICAL | 5 rules | Large bundle size, slow Time to Interactive, First Load issues |
3-server-server-side-performance.md | 🟠 HIGH | 7 rules | Slow SSR, API route optimization, server-side waterfalls |
4-client-client-side-data-fetching.md | 🟡 MEDIUM-HIGH | 4 rules | Client data management, SWR patterns, deduplication |
5-rerender-re-render-optimization.md | 🟡 MEDIUM | 12 rules | Excessive re-renders, React performance, memoization |
6-rendering-rendering-performance.md | 🟡 MEDIUM | 9 rules | Rendering bottlenecks, virtualization, image optimization |
7-js-javascript-performance.md | ⚪ LOW-MEDIUM | 12 rules | Micro-optimizations, caching, loop performance |
8-advanced-advanced-patterns.md | 🔵 VARIABLE | 3 rules | Advanced React patterns, useLatest, init-once |
9-cache-components.md | 🔴 CRITICAL | 4 sections | Next.js 16+ Only: use cache, cacheLife, PPR, cacheTag |
Total: 57 rules across 8 categories
🚀 Quick Decision Tree
What's your performance issue?
🐌 Slow page loads / Long Time to Interactive
→ Read Section 1: Eliminating Waterfalls
→ Read Section 2: Bundle Size Optimization
📦 Large bundle size (> 200KB)
→ Read Section 2: Bundle Size Optimization
→ Check: Dynamic imports, barrel imports, tree-shaking
🖥️ Slow Server-Side Rendering
→ Read Section 3: Server-Side Performance
→ Check: Parallel data fetching, streaming
🔄 Too many re-renders / UI lag
→ Read Section 5: Re-render Optimization
→ Check: React.memo, useMemo, useCallback
🎨 Rendering performance issues
→ Read Section 6: Rendering Performance
→ Check: Virtualization, layout thrashing
🌐 Client-side data fetching problems
→ Read Section 4: Client-Side Data Fetching
→ Check: SWR deduplication, localStorage
✨ Need advanced patterns
→ Read Section 8: Advanced Patterns
🚀 **Next.js 16+ Performance (Caching & PPR)**
→ Read Section 9: Cache Components📊 Impact Priority Guide
Use this order when doing comprehensive optimization:
1️⃣ CRITICAL (Biggest Gains - Do First):
├─ Section 1: Eliminating Waterfalls
│ └─ Each waterfall adds full network latency (100-500ms+)
└─ Section 2: Bundle Size Optimization
└─ Affects Time to Interactive and Largest Contentful Paint
2️⃣ HIGH (Significant Impact - Do Second):
└─ Section 3: Server-Side Performance
└─ Eliminates server-side waterfalls, faster response times
3️⃣ MEDIUM (Moderate Gains - Do Third):
├─ Section 4: Client-Side Data Fetching
├─ Section 5: Re-render Optimization
└─ Section 6: Rendering Performance
4️⃣ LOW (Polish - Do Last):
├─ Section 7: JavaScript Performance
└─ Section 8: Advanced Patterns
🔥 **MODERN (Next.js 16+):**
└─ Section 9: Cache Components (Replaces most traditional revalidation)🔗 Related Skills
| Need | Skill |
| API design patterns | @[skills/api-patterns] |
| Database optimization | @[skills/database-design] |
| Testing strategies | @[skills/testing-patterns] |
| UI/UX design principles | @[skills/frontend-design] |
| TypeScript patterns | @[skills/typescript-expert] |
| Deployment & DevOps | @[skills/deployment-procedures] |
✅ Performance Review Checklist
Before shipping to production:
Critical (Must Fix):
- No sequential data fetching (waterfalls eliminated)
- Bundle size < 200KB for main bundle
- No barrel imports in app code
- Dynamic imports used for large components
- Parallel data fetching where possible
High Priority:
- Server components used where appropriate
- API routes optimized (no N+1 queries)
- Suspense boundaries for data fetching
- Static generation used where possible
Medium Priority:
- Expensive computations memoized
- List rendering virtualized (if > 100 items)
- Images optimized with next/image
- No unnecessary re-renders
Low Priority (Polish):
- Hot path loops optimized
- RegExp patterns hoisted
- Property access cached in loops
❌ Anti-Patterns (Common Mistakes)
DON'T:
- ❌ Use sequential
awaitfor independent operations - ❌ Import entire libraries when you need one function
- ❌ Use barrel exports (
index.tsre-exports) in app code - ❌ Skip dynamic imports for large components/libraries
- ❌ Fetch data in useEffect without deduplication
- ❌ Forget to memoize expensive computations
- ❌ Use client components when server components work
DO:
- ✅ Fetch data in parallel with
Promise.all() - ✅ Use dynamic imports:
const Comp = dynamic(() => import('./Heavy')) - ✅ Import directly:
import { specific } from 'library/specific' - ✅ Use Suspense boundaries for better UX
- ✅ Leverage React Server Components
- ✅ Measure performance before optimizing
- ✅ Use Next.js built-in optimizations (next/image, next/font)
🎯 How to Use This Skill
For New Features:
- Check Section 1 & 2 while building (prevent waterfalls, keep bundle small)
- Use server components by default (Section 3)
- Apply memoization for expensive operations (Section 5)
For Performance Reviews:
- Start with Section 1 (waterfalls = biggest impact)
- Then Section 2 (bundle size)
- Then Section 3 (server-side)
- Finally other sections as needed
For Debugging Slow Performance:
- Identify the symptom (slow load, lag, etc.)
- Use Quick Decision Tree above
- Read relevant section
- Apply fixes in priority order
📚 Learning Path
Beginner (Focus on Critical): → Section 1: Eliminating Waterfalls → Section 2: Bundle Size Optimization
Intermediate (Add High Priority): → Section 3: Server-Side Performance → Section 5: Re-render Optimization
Advanced (Full Optimization): → All sections + Section 8: Advanced Patterns
🔍 Validation Script
| Script | Purpose | Command |
scripts/react_performance_checker.py | Automated performance audit | python scripts/react_performance_checker.py <project_path> |
📖 Section Details
Section 1: Eliminating Waterfalls (CRITICAL)
Impact: Each waterfall adds 100-500ms+ latency Key Concepts: Parallel fetching, Promise.all(), Suspense boundaries, preloading
Section 2: Bundle Size Optimization (CRITICAL)
Impact: Directly affects Time to Interactive, Largest Contentful Paint Key Concepts: Dynamic imports, tree-shaking, barrel import avoidance
Section 3: Server-Side Performance (HIGH)
Impact: Faster server responses, better SEO Key Concepts: Parallel server fetching, streaming, API route optimization
Section 4: Client-Side Data Fetching (MEDIUM-HIGH)
Impact: Reduces redundant requests, better UX Key Concepts: SWR deduplication, localStorage caching, event listeners
Section 5: Re-render Optimization (MEDIUM)
Impact: Smoother UI, less wasted computation Key Concepts: React.memo, useMemo, useCallback, component structure
Section 6: Rendering Performance (MEDIUM)
Impact: Better rendering efficiency Key Concepts: Virtualization, image optimization, layout thrashing
Section 7: JavaScript Performance (LOW-MEDIUM)
Impact: Incremental improvements in hot paths Key Concepts: Loop optimization, caching, RegExp hoisting
Section 8: Advanced Patterns (VARIABLE)
Impact: Specific use cases Key Concepts: useLatest hook, init-once patterns, event handler refs
🎓 Best Practices Summary
Golden Rules:
- Measure first - Use React DevTools Profiler, Chrome DevTools
- Biggest impact first - Waterfalls → Bundle → Server → Micro
- Don't over-optimize - Focus on real bottlenecks
- Use platform features - Next.js has optimizations built-in
- Think about users - Real-world conditions matter
Performance Mindset:
- Every
awaitin sequence = potential waterfall - Every
import= potential bundle bloat - Every re-render = wasted computation (if unnecessary)
- Server components = less JavaScript to ship
- Measure, don't guess
Source: Vercel Engineering Date: January 2026 Version: 1.0.0 Total Rules: 57 across 8 categories
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.

