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/kiurakku/cursor-kit-for-ai --skill react-best-practices-kiurakku
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: react-best-practices
Source: https://github.com/kiurakku/cursor-kit-for-ai/tree/main/plugins/frontend/skills/react-best-practices
Command: npx skills add https://github.com/kiurakku/cursor-kit-for-ai --skill react-best-practices-kiurakku

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? React and Next.js applications 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: Detects "use client" placed too high in the tree, non-serializable props crossing the server/client boundary, and server-only code imported into client components. - Data Fetching & Caching Review: Flags 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 the review to get a severity-ranked report (Blocker/Major/Minor) with file:line references and fix snippets for each issue. ## Quick Start Review my Next.js app in the app/ directory for React performance anti-patterns and give me a severity-ranked report 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 uses hooks, browser APIs, or event handlers. The directive should sit at leaf components, never on layouts or pages that only render props and children.

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

Move the fetch into an async Server Component so data loads on the server without a client round-trip. When multiple fetches are needed, run them in parallel with Promise.all instead of sequential awaits to eliminate waterfalls.

Does Next.js App Router support React 19 server actions?▼

Yes, server actions work in App Router by marking functions with "use server" in dedicated actions.ts files. Always validate input server-side with zod or valibot, check auth inside the action, 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. Run ANALYZE=true npx next build to visualize contributors, then use dynamic imports and specific path imports.

When should I not use React Server Components?▼

Avoid RSC for components that genuinely need useState, useEffect, browser APIs, or event handlers, since those require client interactivity. The review explicitly avoids flagging small interactive leaf components and only targets boundaries placed too high.