vercel-react-best-practices

Applies Vercel performance optimization rules when writing and refactoring React and Next.js code.

Updated Jul 12, 2025
One-click install
npx skills add https://github.com/kpayakv2/check-products --skill vercel-react-best-practices-kpayakv2
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: vercel-react-best-practices
Source: https://github.com/kpayakv2/check-products/tree/main/.agents/skills/vercel-react-best-practices
Command: npx skills add https://github.com/kpayakv2/check-products --skill vercel-react-best-practices-kpayakv2

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? React and Next.js codebases often suffer from slow load times, unnecessary re-renders, and bloated bundles because developers miss subtle performance pitfalls. This Skill provides a structured, prioritized rule set from Vercel Engineering so AI agents and developers consistently apply proven optimization patterns during code generation and review. ## Core Features & Use Cases - 70 Prioritized Rules Across 8 Categories: Covers eliminating async waterfalls, bundle size optimization, server-side performance, client-side data fetching, re-render optimization, rendering performance, JavaScript micro-optimizations, and advanced patterns, each tagged by impact level from CRITICAL to LOW. - Incorrect vs. Correct Code Examples: Every rule includes concrete TypeScript/TSX examples showing the anti-pattern and the optimized implementation, plus impact metrics like 2-10x improvements or 200-800ms import cost savings. - Use Case: When refactoring a Next.js page that fetches user, posts, and comments sequentially, apply the async-parallel rule to rewrite the fetches with Promise.all(), cutting three network round trips down to one. ## Quick Start Review my Next.js page component and apply the Vercel React best practices rules to eliminate data fetching waterfalls and reduce bundle size.

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 eliminate data fetching waterfalls in Next.js?▼

Start independent async operations immediately and await them together with Promise.all() instead of awaiting sequentially. For partial dependencies, use the better-all library or chain promises so each task starts at the earliest possible moment.

How to reduce bundle size in a React or Next.js app?▼

Avoid barrel file imports from libraries like lucide-react or @mui/material, use next/dynamic to lazy-load heavy components, and defer non-critical third-party scripts like analytics until after hydration. Next.js 13.5+ can auto-optimize package imports via optimizePackageImports.

When should I use Suspense boundaries in React Server Components?▼

Use Suspense when only part of a page needs async data, so the wrapper layout renders immediately while data streams in. Avoid it for SEO-critical above-the-fold content or when layout shift from loading states would hurt the user experience.

Does this guide work with React frameworks other than Next.js?▼

Most rules apply to any React codebase, including re-render optimization, JavaScript performance, and hooks patterns. Next.js-specific rules cover Server Actions, RSC serialization, and next/dynamic, but alternatives are noted for non-Next.js projects.

Why do Server Actions need authentication checks inside the function?▼

Server Actions are exposed as public endpoints just like API routes, so middleware or layout guards alone are insufficient. Always verify session and authorization inside each action, and validate inputs with a schema library like zod before performing mutations.