next-best-practices

Enforce Next.js App Router best practices for code review and refactoring.

Updated Apr 11, 2026
One-click install
npx skills add https://github.com/BrunoAlpezdev/lluvia-de-ideas --skill next-best-practices-brunoalpezdev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: next-best-practices
Source: https://github.com/BrunoAlpezdev/lluvia-de-ideas/tree/main/.agents/skills/next-best-practices
Command: npx skills add https://github.com/BrunoAlpezdev/lluvia-de-ideas --skill next-best-practices-brunoalpezdev

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Next.js codebases often drift into patterns that break React Server Components boundaries, metadata rules, routing conventions, or performance expectations, causing bugs, hydration issues, and inefficient builds.

Core Features & Use Cases

  • App Router file conventions: Guides correct placement and usage of page.tsx, layout.tsx, route.ts, and related special files.
  • RSC boundary safety: Detects invalid async client components and non-serializable props crossing Server → Client.
  • Modern Next.js async and runtime correctness: Covers async params/searchParams, cookies()/headers(), and when to prefer Node.js vs Edge runtime.
  • Operational guardrails: Standardizes directives (use client/use server/use cache), route handlers vs server actions, error handling, Suspense requirements for CSR bailout, and hydration error causes.
  • SEO, performance, and assets: Implements metadata and OG image best practices, plus image/font optimization and bundling safeguards.

Quick Start

Apply the next-best-practices skill to review your Next.js App Router changes and fix any RSC boundary, async API usage, metadata, and route handler mistakes.

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 React Server Components boundary violations in Next.js App Router?

To fix React Server Components boundary violations, verify that non-serializable props do not cross Server to Client boundaries and eliminate invalid async client components. Enforce deterministic checks during code review to validate correct directive usage.

Why do hydration errors occur in Next.js and how can I prevent them?

Hydration errors in Next.js occur when server-rendered HTML mismatches client output. Prevent these regressions by standardizing Suspense boundaries for client-side rendering bailouts and reviewing common runtime pitfalls in your App Router components.

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

In Next.js 15+, async params and searchParams require proper handling within App Router file conventions. Enforce modern Next.js async correctness by applying deterministic checks to validate async request APIs like cookies and headers.

When should I use route handlers vs server actions in Next.js?

Choose route handlers vs server actions based on specific routing conventions and operational guardrails. Standardize your selection process by applying deterministic code review checks to align with Next.js App Router best practices.

How do I implement metadata and OG image generation best practices in Next.js?

Implement metadata and OG image generation best practices by following App Router file conventions for SEO assets. Apply code review rules to ensure image and font optimization safeguards and correct bundling configurations are in place.

Can I use this approach to review Next.js Edge vs Node.js runtime choices?

Yes, you can review Next.js runtime choices by applying operational guardrails that dictate when to prefer Node.js vs Edge runtime. This prevents common performance regressions and runtime pitfalls during App Router refactoring.