next-best-practices

Enforce Next.js App Router patterns for RSC boundaries and async APIs.

Updated Feb 8, 2026
One-click install
npx skills add https://github.com/irchamaji/agents --skill next-best-practices-irchamaji
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: next-best-practices
Source: https://github.com/irchamaji/agents/tree/main/skills/next-best-practices
Command: npx skills add https://github.com/irchamaji/agents --skill next-best-practices-irchamaji

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill prevents common Next.js App Router mistakes that lead to broken RSC boundaries, inefficient data fetching, incorrect routing behavior, and hard-to-debug runtime errors.

Core Features & Use Cases

  • RSC boundary enforcement: Detect and avoid invalid async client patterns and non-serializable server-to-client props.
  • Next.js 15+ async API correctness: Apply async params, searchParams, cookies(), and headers() patterns (including metadata and route handlers).
  • Production-ready routing & APIs: Follow file conventions, route handler rules, and correct patterns for parallel/intercepting routes (modals).
  • Performance and correctness across the stack: Cover metadata/OG images, next/image and next/font optimization, bundling pitfalls, runtime selection, hydration error causes, and Suspense boundaries.

Quick Start

Tell the AI: Review my Next.js App Router file for RSC boundary violations, async API misuse, and route handling conflicts, then suggest the exact fixes following the conventions in this skill.

Frequently Asked Questions about next-best-practices

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

FAQPage Schema
How do I fix invalid React Server Component boundaries in Next.js App Router?

Invalid React Server Component boundaries in Next.js App Router are fixed by detecting non-serializable server-to-client props and avoiding invalid async client patterns. Enforcing these conventions prevents broken server-to-client data passing.

How do I use async params, searchParams, cookies, and headers in Next.js 15?

In Next.js 15+, async params, searchParams, cookies(), and headers() must be properly typed and awaited. Applying these async API patterns in pages, layouts, and route handlers prevents runtime errors and incorrect data fetching.

What is the best way to configure route handlers and file conventions in Next.js?

The best way to configure Next.js route handlers is by following strict file conventions and route handler rules. Correctly implementing parallel and intercepting routes for modals ensures production-ready routing and conflict-free API behavior.

Why does my Next.js app have hydration errors and inefficient data fetching?

Hydration errors and inefficient data fetching in Next.js often stem from incorrect Suspense boundary placement and bundling pitfalls. Debugging these causes and optimizing runtime selection resolves mismatches and slow rendering.

Does this Next.js pattern guide cover metadata, OG images, and font optimization?

Yes, this Next.js pattern guide covers metadata and OG image generation alongside next/image and next/font optimization. Enforcing these conventions ensures optimized asset delivery and proper metadata configuration across the stack.