vercel-react-best-practices

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

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

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, data-fetching waterfalls, bloated bundles, and unnecessary re-renders. This Skill gives AI agents and developers a prioritized, rule-based checklist to detect and fix these performance problems during code generation, review, and refactoring. ## Core Features & Use Cases - 64 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 with an 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 from parallelizing fetches. - Use Case: When asked to optimize a slow Next.js page, the agent applies rules such as replacing sequential awaits with Promise.all(), avoiding barrel file imports from libraries like lucide-react, using React.cache() for per-request deduplication, and adding Suspense boundaries for faster initial paint. ## Quick Start Ask the agent to review your React or Next.js component for performance issues and apply the Vercel best practices rules to fix any waterfalls, bundle bloat, or unnecessary re-renders it finds.

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 promises immediately and await them together with Promise.all(), or use better-all for partial dependency chains. In API routes, kick off auth and config fetches before awaiting, and restructure Server Components with composition so sibling components fetch in parallel.

How to reduce bundle size from icon libraries like lucide-react?

Import directly from source files such as lucide-react/dist/esm/icons/check instead of the barrel entry point, which can load thousands of modules. On Next.js 13.5+, configure experimental.optimizePackageImports to transform barrel imports automatically at build time.

What is the difference between React.cache() and LRU caching?

React.cache() deduplicates calls within a single request only, ideal for repeated auth or database lookups in one render. An LRU cache like lru-cache persists across sequential requests, which works especially well with Vercel Fluid Compute where function instances are shared.

When should I not use Suspense boundaries for data fetching?

Avoid Suspense when data drives layout decisions, when content is SEO-critical above the fold, when queries are small and fast, or when layout shift from loading to content would hurt the user experience.

Why does .sort() cause bugs in React state?

The .sort() method mutates the array in place, which breaks React's immutability expectations and can cause stale closure bugs. Use .toSorted() instead to create a new sorted array, with a spread-and-sort fallback for older browsers.