vercel-react-best-practices

Diagnose and rewrite React and Next.js code to eliminate async waterfalls and reduce bundle size.

1|Updated May 24, 2026
One-click install
npx skills add https://github.com/gavin100305/traffic --skill vercel-react-best-practices-gavin100305
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-react-best-practices
Source: https://github.com/gavin100305/traffic/tree/main/agents/.agents/skills/vercel-react-best-practices
Command: npx skills add https://github.com/gavin100305/traffic --skill vercel-react-best-practices-gavin100305

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill eliminates common performance regressions in React and Next.js code by guiding AI-assisted changes that prevent waterfalls, reduce bundle size, and optimize rendering and serialization.

Core Features & Use Cases

  • Identify and fix async waterfall patterns: restructure server/client logic to parallelize independent work and defer async to only where needed.
  • Reduce bundle and load costs: avoid barrel imports, use dynamic/conditional loading, defer non-critical libraries, and preload based on intent.
  • Improve SSR/RSC efficiency and safety: minimize RSC prop serialization, avoid cross-request shared module state, and apply React.cache/LRU caching correctly.
  • Optimize rendering and UI responsiveness: use Suspense boundaries, useTransition/deferred value, and avoid remounting or unnecessary effect subscriptions.

Quick Start

Use the vercel-react-best-practices skill to review and refactor a React/Next.js code snippet for performance by prioritizing async parallelization, bundle size reductions, and RSC/SSR correctness.

Frequently Asked Questions about vercel-react-best-practices

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

FAQPage Schema
How do I fix async waterfalls in React Server Components?

Fix async waterfalls in React Server Components by restructuring server and client logic to parallelize independent data fetching. You eliminate sequential request delays by deferring asynchronous operations to only where strictly needed.

What is the best way to reduce bundle size in Next.js?

Reduce bundle size in Next.js by avoiding barrel imports, using dynamic loading, and deferring non-critical libraries. Preloading components based on user intent further minimizes load costs without sacrificing initial rendering speed.

How do I optimize React.cache and RSC prop serialization for SSR?

Optimize React.cache and RSC prop serialization by minimizing props passed across server and client boundaries. Apply React.cache or LRU caching correctly to prevent cross-request shared module state and improve SSR safety.

How do I use Suspense streaming and useTransition to improve UI responsiveness?

Use Suspense streaming and useTransition to improve UI responsiveness by avoiding unnecessary component remounting and effect subscriptions. Deferring non-critical UI updates keeps the main thread free during heavy rendering tasks.

Can I use this approach for automated code review of Next.js performance?

Yes, you can use this approach for automated code review of Next.js performance. It diagnoses code to identify incorrect patterns, applying structured rules to refactor components and route handlers for performance-critical features.

Why does my Next.js app have cross-request shared module state issues?

Cross-request shared module state in Next.js happens when server-side data leaks between concurrent requests. You resolve this by correctly applying React.cache and ensuring RSC prop serialization avoids shared mutable state.