
Next.js & React Performance Expert
FreeOptimize your React and Next.js applications effectively.
Free Β· Opens the source repo
What Next.js & React Performance Expert does
The Next.js & React Performance Expert skill provides a comprehensive set of optimization rules specifically designed for enhancing the performance of React components and Next.js applications. Developed by Vercel Engineering, this skill includes 58 prioritized optimization rules that tackle various performance challenges, such as eliminating waterfalls, reducing bundle sizes, and optimizing server and client-side rendering. The structured approach focuses on critical issues first, ensuring that developers can address the most impactful performance bottlenecks before moving on to less critical optimizations.
This skill is particularly useful for developers working with React and Next.js who need to ensure their applications are responsive and efficient. It covers a wide range of topics, including strategies for asynchronous data fetching, bundle size reduction techniques, and methods to minimize re-renders. Each section is designed to guide users through specific performance issues, making it easier to implement effective solutions based on the nature of the problem being faced.
For those developing applications that rely heavily on server-side rendering or client-side data fetching, this skill provides targeted advice to streamline these processes. Additionally, the inclusion of advanced patterns and caching strategies for Next.js 16+ allows developers to leverage the latest capabilities of the framework to further enhance performance. Overall, this skill serves as a valuable resource for developers aiming to build high-performance applications using React and Next.js.
When to use it
Use this skill when you need to improve the performance of your React components or Next.js applications, especially in cases of slow page loads or excessive re-renders.
When not to use it
This skill may not be suitable for projects that do not involve React or Next.js, or for applications that are already optimized and do not require further performance enhancements.
What you can build with it
Improving Load Times
Use the skill to identify and eliminate waterfalls that cause slow page loads, focusing on critical sections for immediate impact.
Reducing Bundle Size
Follow the bundle size optimization rules to ensure your application loads quickly and efficiently, particularly for larger projects.
Optimizing Server-Side Rendering
Utilize the server-side performance guidelines to enhance the efficiency of API routes and SSR processes, improving overall application responsiveness.
How to install Next.js & React Performance Expert
View source1. Install with the skills CLI
npx skills add vudovn/ag-kit/nextjs-react-expert --agent claude-code2. Or install it manually
Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.
Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs
Inside SKILL.md
Written by vudovnNext.js & React Performance Expert
From Vercel Engineering - 58 optimization rules prioritized by impact, plus Next.js 16 Cache Components 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 | 6 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: 58 rules across 8 categories, plus Section 9 (Cache Components) for Next.js 16+
π 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 (Next.js 16 / React 19 era) Total Rules: 58 across 8 categories, plus Section 9 (Cache Components)
Frequently asked questions about Next.js & React Performance Expert
Similar skills
Heap Snapshot Analysis
Investigate V8 heap snapshots for memory issues.
VS Code Performance Workflow
Automate performance investigations in VS Code.
Memory Leak Audit
Prevent memory leaks with effective coding patterns.
CPU Profile Analysis
Analyze V8 and Chrome performance profiles for optimization.
Chat Performance Testing
Benchmark and validate chat UI performance in VS Code.
Vercel React Best Practices
Optimize your React and Next.js applications for performance.
