.agent/skills/nextjs-react-expert/SKILL.md
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.
npx skillsauth add CongDon1207/AGENTS.md react-best-practicesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
From Vercel Engineering - 57 optimization rules prioritized by impact Philosophy: Eliminate waterfalls first, optimize bundles second, then micro-optimize.
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.
| 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 |
Total: 57 rules across 8 categories
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
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
| 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] |
Before shipping to production:
Critical (Must Fix):
High Priority:
Medium Priority:
Low Priority (Polish):
DON'T:
await for independent operationsindex.ts re-exports) in app codeDO:
Promise.all()const Comp = dynamic(() => import('./Heavy'))import { specific } from 'library/specific'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
| Script | Purpose | Command |
| -------------------------------------- | --------------------------- | ------------------------------------------------------------ |
| scripts/react_performance_checker.py | Automated performance audit | python scripts/react_performance_checker.py <project_path> |
Impact: Each waterfall adds 100-500ms+ latency Key Concepts: Parallel fetching, Promise.all(), Suspense boundaries, preloading
Impact: Directly affects Time to Interactive, Largest Contentful Paint Key Concepts: Dynamic imports, tree-shaking, barrel import avoidance
Impact: Faster server responses, better SEO Key Concepts: Parallel server fetching, streaming, API route optimization
Impact: Reduces redundant requests, better UX Key Concepts: SWR deduplication, localStorage caching, event listeners
Impact: Smoother UI, less wasted computation Key Concepts: React.memo, useMemo, useCallback, component structure
Impact: Better rendering efficiency Key Concepts: Virtualization, image optimization, layout thrashing
Impact: Incremental improvements in hot paths Key Concepts: Loop optimization, caching, RegExp hoisting
Impact: Specific use cases Key Concepts: useLatest hook, init-once patterns, event handler refs
Golden Rules:
Performance Mindset:
await in sequence = potential waterfallimport = potential bundle bloatSource: Vercel Engineering Date: January 2026 Version: 1.0.0 Total Rules: 57 across 8 categories
development
Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications, OR when they provide screenshots/images/designs to replicate or draw inspiration from. For screenshot inputs, extracts design guidelines first using ai-multimodal analysis, then implements code following those guidelines. Generates creative, polished code that avoids generic AI aesthetics.
development
Use when the user asks to investigate, understand, explore, or explain how a feature works, asks about existing logic, or wants to understand code flow. Triggers on keywords like "how does", "explain", "investigate", "understand", "what does", "where is", "how works", "logic flow", "trace", "explore feature".
development
Use when the user asks to implement a new feature, enhancement, add functionality, build something new, or create new capabilities. Triggers on keywords like "implement", "add feature", "build", "create new", "develop", "enhancement".
development
Use when the user asks to generate comprehensive feature documentation with verified test cases, create feature README with code evidence, or document a complete feature with test verification. Triggers on keywords like "feature documentation", "document feature", "comprehensive docs", "feature README", "test verification", "verified documentation".