react-best-practices

Reviews React and Next.js code for RSC boundaries, caching, bundle size, and data fetching anti-patterns.

15|3|Updated Jul 9, 2026
One-click install
npx skills add https://github.com/thefear078/cursor-kit-for-ai --skill react-best-practices-thefear078
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: react-best-practices
Source: https://github.com/thefear078/cursor-kit-for-ai/tree/main/plugins/frontend/skills/react-best-practices
Command: npx skills add https://github.com/thefear078/cursor-kit-for-ai --skill react-best-practices-thefear078

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? React and Next.js apps often ship with hidden performance problems: misplaced "use client" directives, client-side fetch waterfalls, bloated bundles, and missing cache revalidation. This Skill audits code against production performance patterns and reports findings with severity levels and concrete fixes. ## Core Features & Use Cases - RSC Boundary Audit: Verifies server/client component boundaries, checks for "use client" on layouts, and flags non-serializable props crossing the boundary. - Data Fetching & Caching Review: Detects useEffect fetch waterfalls, sequential awaits, missing revalidation after mutations, and shared cache keys leaking user data. - Bundle & Loading State Analysis: Identifies heavy imports like full lodash or moment.js, missing error.tsx boundaries, and full-page spinners instead of granular Suspense. - Use Case: Before shipping a Next.js App Router feature, run this review to get a severity-ranked report (Blocker/Major/Minor) with file:line references and fix snippets for each issue. ## Quick Start Review the React components in my app/ directory for performance anti-patterns and report blockers with fixes.

Frequently Asked Questions about react-best-practices

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

FAQPage Schema
How do I find unnecessary "use client" directives in Next.js?▼

Search for "use client" occurrences with ripgrep and check whether each component actually needs state, effects, browser APIs, or event handlers. Layouts and pages marked client just for one interactive child should push the boundary to a leaf component instead.

How to fix useEffect fetch waterfalls in React Server Components?▼

Move data fetching into async Server Components and use Promise.all for parallel requests instead of sequential awaits. Colocate fetching with the component that needs the data and use React.cache() for deduplication within a request.

Does Next.js App Router support server actions with form validation?▼

Yes, server actions marked with "use server" handle mutations, but input must be validated server-side with zod or valibot since client validation is only UX. Actions should return structured results and call revalidatePath or revalidateTag after mutations.

Why is my Next.js bundle size so large?▼

Common causes are full-library imports like lodash or moment (~70KB each), entire icon packs, and heavy UI frameworks imported at the root. Use ANALYZE=true npx next build to visualize contributors, then apply path-specific imports and dynamic imports for heavy components.

When should I not use React Server Components?▼

Components needing useState, useEffect, useRef, browser APIs like window or localStorage, or event handlers like onClick must remain Client Components. The goal is pushing the client boundary to leaf components, not eliminating it entirely.