next-best-practices

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

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents common Next.js mistakes by standardizing conventions for App Router file structure, React Server Component boundaries, async APIs, routing, metadata, and performance-critical optimizations.

Core Features & Use Cases

  • RSC boundary guardrails: Detects invalid async client components and non-serializable props passed from Server to Client.
  • Next.js 15+ async API compliance: Ensures correct handling of async params, searchParams, cookies(), and headers(), including migration guidance.
  • Production-grade routing & runtime rules: Covers route handler constraints, server vs client directives, error-handling files, metadata/OG image patterns, and bundling/runtime selection.

Quick Start

Apply the rules in this Skill to your Next.js App Router codebase and fix any violations (for example, update any async request API usage, validate RSC boundaries, and ensure your route handlers and metadata follow the documented 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 handle async params and searchParams in Next.js App Router?

Next.js 15+ makes params, searchParams, cookies(), and headers() asynchronous, returning Promises. You must await these APIs in Server Components or route handlers to resolve values correctly and prevent rendering inconsistencies.

What are common React Server Component boundary mistakes in Next.js?

Common RSC boundary mistakes include marking client components as async and passing non-serializable props like functions from Server to Client components. Enforcing correct 'use client' and 'use server' directives prevents these violations.

How do I implement generateMetadata and OG image generation in Next.js?

Implementing generateMetadata and OG image generation requires following App Router file conventions and route handler constraints. Adhering to documented metadata patterns ensures correct dynamic rendering and bundling compatibility.

What is the best way to structure route handlers and error handling files in Next.js App Router?

Production-grade routing requires following App Router file conventions for route handlers and deterministic error-handling files. Adhering to server and client directive rules ensures proper runtime selection and bundling compatibility.

Can I pass non-serializable props from a Server Component to a Client Component in Next.js?

No, passing non-serializable props across RSC boundaries violates Next.js App Router rules. You must validate that all data passed from Server to Client components is fully serializable to prevent runtime errors and rendering failures.

Why does my Next.js 15 migration break async request API usage?

Next.js 15 migration breaks async request APIs because params, searchParams, cookies(), and headers() now return Promises. Updating your codebase to await these asynchronous APIs resolves migration errors and restores deterministic behavior.