next-best-practices

Validate Next.js App Router file conventions and Server/Client boundaries.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill prevents common Next.js App Router mistakes by enforcing best practices around file conventions, Server/Client boundaries, async APIs, routing, metadata, assets, and error handling.

Core Features & Use Cases

  • App Router file conventions: Clarifies where key route files belong (page, layout, route handlers, templates, and special fallbacks) to avoid routing and runtime confusion.
  • RSC boundary safety checks: Detects invalid React Server Component patterns such as async Client Components and non-serializable props passed to Client Components.
  • Modern async and caching correctness: Guides correct usage of Next.js 15+ async request APIs, runtime selection, metadata/OG image patterns, and directive usage.
  • Practical reliability patterns: Covers error handling behavior, hydration mismatch prevention, Suspense boundaries, and parallel/intercepting routes for modal workflows.

Quick Start

Ask the AI to review your Next.js code and point out any Server/Client boundary violations and routing or metadata issues using the next-best-practices rules.

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 Next.js App Router Server/Client component boundary violations?

To detect invalid RSC patterns, validate that Client Components are not async and ensure non-serializable props are not passed to Client Components. Checking directive usage prevents Server/Client boundary violations and serialization errors in your Next.js App Router application.

What is the correct way to handle async params and searchParams in Next.js 15?

Handling async params and searchParams in Next.js 15 requires awaiting these request APIs before accessing their values. Validating modern async API usage ensures correct data fetching, directive-aware caching, and prevents runtime errors in App Router route handlers and pages.

How do I set up parallel and intercepting routes for modals in Next.js?

Setting up parallel and intercepting routes for modals in Next.js involves using specific App Router file conventions to intercept navigation and render parallel route segments. Correct Suspense boundary placement manages loading states and prevents hydration mismatches during modal workflows.

Does Next.js App Router require Suspense boundaries for streaming and hydration safety?

Next.js App Router requires Suspense boundaries to manage loading states and prevent hydration mismatches during streaming. Wrapping dynamic content in Suspense components ensures reliable client-side hydration and correct fallback rendering for asynchronous server components.

What are the limitations of passing non-serializable props to Client Components in Next.js?

Passing non-serializable props to Client Components in Next.js is limited by RSC serialization constraints, causing runtime errors when functions or class instances cross the boundary. Detecting non-serializable props prevents these violations and maintains Server Component integrity.

How to validate Next.js route handlers and metadata OG image generation patterns?

Validating Next.js route handlers and metadata OG image generation requires checking specific file conventions and runtime selection. Correct directive usage and modern metadata patterns ensure proper dynamic OG image generation and reliable route handler execution in App Router.