This skill provides React and Next.js performance optimization knowledge from Vercel Engineering, covering 57 optimization rules across 8 critical categories.
What This Skill Provides
The Next.js & React Performance Expert skill equips agents with comprehensive performance optimization strategies for React and Next.js applications. It follows a philosophy of eliminating waterfalls first, optimizing bundles second, then micro-optimizing.Core Knowledge Areas
Critical Optimizations
- Eliminating Waterfalls - Parallel data fetching, Promise.all(), Suspense boundaries
- Bundle Size Optimization - Dynamic imports, tree-shaking, avoiding barrel imports
- Server-Side Performance - Parallel server fetching, streaming, API route optimization
Medium Priority Optimizations
- Client-Side Data Fetching - SWR deduplication, localStorage caching
- Re-render Optimization - React.memo, useMemo, useCallback patterns
- Rendering Performance - Virtualization, image optimization, layout thrashing prevention
Advanced Patterns
- JavaScript Performance - Loop optimization, caching, RegExp hoisting
- Advanced React Patterns - useLatest hook, init-once patterns, event handler refs
When This Skill Is Loaded
Agents automatically load this skill when:- Building React components or Next.js applications
- Optimizing application performance
- Eliminating data fetching waterfalls
- Reducing bundle size or improving Time to Interactive
- Reviewing code for performance issues
- Implementing server-side or client-side optimizations
Use Cases
Performance Audits
When conducting performance reviews, agents start with CRITICAL sections (waterfalls and bundle size), then move to HIGH/MEDIUM priority optimizations based on profiling results.New Feature Development
- Check waterfalls and bundle size while building (prevent issues)
- Use server components by default
- Apply memoization for expensive operations
Debugging Slow Performance
- Identify the symptom (slow load, UI lag, etc.)
- Use the skill’s decision tree to find relevant section
- Apply fixes in priority order
Code Reviews
Review implementations against the performance checklist:- No sequential data fetching
- Bundle size under 200KB
- No barrel imports in app code
- Dynamic imports for large components
- Parallel data fetching where possible
Key Principles
Golden Rules from Vercel Engineering:
- Measure first - Use React DevTools Profiler and 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
Related Skills
API Patterns
API design patterns for optimizing data fetching
Frontend Design
UI/UX design principles for React components
Tailwind Patterns
Modern CSS-first styling with Tailwind v4
Web Design Guidelines
Accessibility and best practices auditing
Which Agents Use This Skill
Frontend Specialist
The primary agent using this skill. The Frontend Specialist loads this skill for all React and Next.js development work, performance optimization, and code reviews.
Impact Priority Guide
The skill organizes optimizations by impact: 1️⃣ CRITICAL (Biggest Gains - Do First)- Eliminating Waterfalls - Each waterfall adds 100-500ms+ latency
- Bundle Size Optimization - Affects Time to Interactive and Largest Contentful Paint
- Server-Side Performance - Faster response times, better SEO
- Client-Side Data Fetching, Re-render Optimization, Rendering Performance
- JavaScript Performance micro-optimizations, Advanced Patterns
Anti-Patterns to Avoid
Content Organization
The skill contains 8 detailed reference files covering 57 optimization rules:- Eliminating Waterfalls (5 rules) - CRITICAL impact
- Bundle Size Optimization (5 rules) - CRITICAL impact
- Server-Side Performance (7 rules) - HIGH impact
- Client-Side Data Fetching (4 rules) - MEDIUM-HIGH impact
- Re-render Optimization (12 rules) - MEDIUM impact
- Rendering Performance (9 rules) - MEDIUM impact
- JavaScript Performance (12 rules) - LOW-MEDIUM impact
- Advanced Patterns (3 rules) - VARIABLE impact
