react-best-practices

Optimize React and Next.js applications by eliminating waterfalls and reducing bundle size.

Updated Apr 10, 2026
One-click install
npx skills add https://github.com/erichugy/agentic.skills --skill react-best-practices-erichugy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-best-practices
Source: https://github.com/erichugy/agentic.skills/tree/main/react-best-practices
Command: npx skills add https://github.com/erichugy/agentic.skills --skill react-best-practices-erichugy

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill codifies Vercel Engineering's React and Next.js performance guidelines so agents and developers can find, diagnose, and fix common performance anti-patterns such as waterfalls, oversized bundles, and excessive serialization at server-client boundaries. It translates best-practice rules into actionable recommendations and concrete code examples to improve load time, Time to Interactive, and server response efficiency.

Core Features & Use Cases

  • Provides a structured set of prioritized rules across Eliminating Waterfalls, Bundle Size Optimization, Server-Side Performance, Client-Side Data Fetching, Re-render Optimization, Rendering Performance, JavaScript Performance, and Advanced Patterns.
  • Includes concrete incorrect vs correct examples, impact estimates, and references to tools (e.g., better-all, Promise.all, next/dynamic, React.cache, LRU cache) to guide automated refactoring and code generation.
  • Use cases: audit a Next.js page for server-side waterfalls, reduce initial bundle size, refactor Server Actions for proper auth, and apply Suspense boundaries to speed initial paint.

Quick Start

Use react-best-practices to audit and optimize the Next.js page at src/app/page.tsx for waterfall fetches, large bundle imports, and unnecessary server-to-client serialization.

Frequently Asked Questions about react-best-practices

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I eliminate data fetching waterfalls in Next.js pages?

Eliminate data fetching waterfalls in Next.js by parallelizing requests using Promise.all or better-all instead of sequential awaits. This prevents blocking server-side renders and significantly improves server response efficiency and Time to Interactive.

What is the best way to reduce initial bundle size in React applications?

Reduce initial bundle size in React by using dynamic imports with next/dynamic and applying code-splitting. This optimization minimizes the JavaScript shipped to the client, improving load time and overall rendering performance.

How does React.cache minimize expensive server-client serialization?

React.cache minimizes expensive server-client serialization by enabling per-request and cross-request caching of data fetches. This avoids redundant computations and prevents passing large serialized objects across the server-client boundary repeatedly.

How do I optimize React component re-renders during code review?

Optimize React component re-renders during code review by identifying unnecessary state changes and applying memoization patterns. The skill provides incorrect vs correct examples to guide automated refactoring for rendering performance.

Does this approach apply to securing Server Actions in Next.js?

Yes, this approach applies to securing Server Actions in Next.js by providing actionable rules for proper authentication. It guides automated refactoring to ensure secure server action authentication and minimize server-client serialization.