vercel-react-best-practices

Applies Vercel's React and Next.js performance optimization rules when writing, reviewing, or refactoring code.

Updated Sep 6, 2026
One-click install
npx skills add https://github.com/AbuBakar125-co/Resturant_web --skill vercel-react-best-practices-abubakar125-co
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-react-best-practices
Source: https://github.com/AbuBakar125-co/Resturant_web/tree/main/agent/skills/vercel-react-best-practices
Command: npx skills add https://github.com/AbuBakar125-co/Resturant_web --skill vercel-react-best-practices-abubakar125-co

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? React and Next.js codebases often suffer from performance issues like data-fetching waterfalls, bloated bundles, unnecessary re-renders, and inefficient server-side patterns. This Skill gives AI agents and developers a prioritized, rule-based checklist from Vercel Engineering to detect and fix these issues consistently during code generation, review, and refactoring. ## Core Features & Use Cases - 70 Prioritized Performance Rules: Covers 8 categories ranked by impact, from eliminating async waterfalls (CRITICAL) to advanced hook patterns (LOW), each with incorrect vs. correct code examples. - Structured Rule Files: Individual rule files organized by prefix (async-, bundle-, server-, client-, rerender-, rendering-, js-, advanced-) for targeted lookup, plus a compiled AGENTS.md with the full guide. - Use Case: When reviewing a Next.js page that sequentially awaits multiple fetches, apply the async-parallel and async-api-routes rules to restructure the code with Promise.all() and early promise starts, cutting response latency significantly. ## Quick Start Ask the agent to review your React or Next.js component for performance issues using the Vercel React best practices rules.

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 optimize React and Next.js performance with these rules?

Reference the rule categories by priority: start with eliminating waterfalls and bundle size optimization (CRITICAL), then server-side performance (HIGH). Each rule file contains incorrect and correct code examples you can apply directly to your components.

How to eliminate data fetching waterfalls in Next.js?

Use Promise.all() for independent operations, start promises early and await late in API routes, and apply dependency-based parallelization with better-all for partial dependencies. Strategic Suspense boundaries also let wrapper UI render while data streams in.

Does this guide work with Next.js App Router and Server Components?

Yes, the rules specifically cover React Server Components, Server Actions, and Next.js features like next/dynamic, optimizePackageImports, after(), and React.cache(). Server-side rules address RSC serialization, authentication in Server Actions, and per-request deduplication.

What is the best way to reduce React bundle size?

Avoid barrel file imports from libraries like lucide-react and @mui/material, use next/dynamic for heavy components, defer non-critical third-party scripts until after hydration, and prefer statically analyzable import paths so bundlers can trace files narrowly.

When should I not use Suspense boundaries for data fetching?

Avoid Suspense when data is critical for layout decisions, when content is SEO-critical above the fold, when queries are small and fast, or when you want to prevent layout shift. The trade-off is faster initial paint versus potential content jumping.

Why do barrel file imports slow down React apps?

Barrel files re-export thousands of modules, forcing 200-800ms import costs on every cold start and slowing builds. Tree-shaking cannot help when libraries are external, so use Next.js optimizePackageImports or direct path imports instead.