next-best-practices

Review Next.js App Router code for file conventions and React Server Component boundaries.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/Maykesantos98/Fiap-Totvs --skill next-best-practices-maykesantos98
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: next-best-practices
Source: https://github.com/Maykesantos98/Fiap-Totvs/tree/main/.claude/skills/next-best-practices
Command: npx skills add https://github.com/Maykesantos98/Fiap-Totvs --skill next-best-practices-maykesantos98

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you avoid common Next.js App Router mistakes that cause broken builds, invalid React Server Component behavior, hydration issues, routing bugs, and performance regressions.

Core Features & Use Cases

  • Enforces correct App Router file conventions: clarifies how special files and route segments should be structured to prevent 404s and routing conflicts.
  • Validates Server/Client boundaries: detects invalid async client components and non-serializable props passed from Server to Client.
  • Prevents runtime and performance pitfalls: covers async Next.js 15+ request APIs, caching and runtime selection, image/font optimization, metadata/OG generation, error boundaries, suspense boundaries, and route handler vs server action usage with concrete examples.

Quick Start

Ask an AI code reviewer to apply the next-best-practices checklist to my Next.js App Router changes, focusing on RSC boundaries, async params/searchParams usage, and route/file conventions.

Frequently Asked Questions about next-best-practices

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

FAQPage Schema
How do I prevent hydration mismatches in Next.js App Router?

To prevent hydration mismatches in Next.js App Router, validate Server and Client component boundaries to ensure non-serializable props are not passed between them. This practice avoids client-server markup differences that cause runtime hydration errors during page rendering.

What's the best way to structure async params and searchParams in React Server Components?

The best way to handle async params and searchParams in React Server Components is to await Next.js 15+ request APIs directly on the server. Using correct async patterns prevents suspense bailouts and ensures data is fully resolved before stream completion.

Why does my Next.js route handler conflict with server actions?

Route handler and server action conflicts occur when file conventions are incorrectly structured. Enforcing correct App Router special file naming and route segment boundaries prevents 404s, routing bugs, and unexpected request routing behavior between handlers and actions.

Can I pass functions from a Server Component to a Client Component in Next.js?

You cannot pass functions from a Server Component to a Client Component in Next.js. Validating Server and Client boundaries detects non-serializable props like functions, preventing serialization failures and ensuring correct React Server Component behavior.

How do I fix suspense bailouts when using async APIs in Next.js?

Fix suspense bailouts in Next.js by applying correct async API patterns for Next.js 15+ request APIs within your React Server Components. Ensuring proper await usage and suspense boundary placement prevents stream suspensions and runtime performance regressions.