vercel-react-best-practices

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

Updated Jul 16, 2026
One-click install
npx skills add https://github.com/X-manist/Cohmira --skill vercel-react-best-practices-x-manist
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-react-best-practices
Source: https://github.com/X-manist/Cohmira/tree/main/src/builtin-plugins/openmontage/.agents/skills/vercel-react-best-practices
Command: npx skills add https://github.com/X-manist/Cohmira --skill vercel-react-best-practices-x-manist

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, bloated bundles, and sequential data-fetching waterfalls. This Skill provides a structured, prioritized rule set from Vercel Engineering so AI agents and developers consistently apply proven performance patterns when writing, reviewing, or refactoring code. ## Core Features & Use Cases - 65 Prioritized Rules Across 8 Categories: Covers eliminating 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, making it directly actionable during code review or generation. - Use Case: When refactoring a Next.js page that fetches user, posts, and comments sequentially, the Skill guides you to parallelize with Promise.all(), add Suspense boundaries for streaming, and replace barrel imports with direct imports to cut bundle size. ## Quick Start Review my Next.js page component using the vercel-react-best-practices skill and fix any data-fetching waterfalls or bundle size issues.

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, start the dependent promise chain early or use the better-all library to maximize parallelism.

How to reduce bundle size from barrel file imports in React?

Import directly from source files instead of barrel entry points, or use Next.js 13.5+ optimizePackageImports to transform imports automatically. Barrel files in libraries like lucide-react or @mui/material can load thousands of unused modules, adding 200-800ms per cold start.

Does this guide apply to React apps without Next.js?

Yes, most rules apply to any React codebase, including re-render optimization, JavaScript performance, and client-side fetching patterns. Next.js-specific rules cover Server Actions, RSC serialization, and next/dynamic, which only apply to Next.js projects.

When should I use React.cache() versus an LRU cache?

React.cache() deduplicates fetches within a single request only. Use an LRU cache like lru-cache when the same data is needed across sequential requests, such as multiple user actions hitting different endpoints within seconds.

Why do Server Actions need their own authentication checks?

Server Actions are exposed as public endpoints just like API routes, so middleware or layout guards alone are insufficient. Always verify authentication and authorization inside each Server Action before performing mutations.

When should I avoid using Suspense boundaries for data fetching?

Avoid Suspense when the data drives layout decisions, when content is SEO-critical above the fold, or when queries are small and fast. The trade-off is faster initial paint versus potential layout shift when content loads.