next-best-practices

Applies Next.js best practices for RSC boundaries, data patterns, metadata, and error handling.

1|Updated Mar 13, 2026
One-click install
npx skills add https://github.com/dominionism/Noesis --skill next-best-practices-dominionism
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: next-best-practices
Source: https://github.com/dominionism/Noesis/tree/main/assets/skills/next-best-practices
Command: npx skills add https://github.com/dominionism/Noesis --skill next-best-practices-dominionism

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Writing and reviewing Next.js code requires keeping track of many evolving conventions—async APIs in v15+, Server/Client Component boundaries, middleware renames in v16, and correct data fetching patterns. This Skill consolidates those rules so code follows current Next.js conventions and avoids common runtime errors. ## Core Features & Use Cases - RSC Boundary Validation: Detects invalid patterns like async Client Components and non-serializable props (Date, Map, class instances) passed across the server/client boundary. - Data Pattern Guidance: Helps choose between Server Components, Server Actions, and Route Handlers, and avoid data waterfalls with Promise.all, Suspense, and preload patterns. - Platform Conventions: Covers file conventions, metadata and OG image generation, image/font optimization, error handling, hydration errors, parallel routes, and self-hosting with Docker. - Use Case: When reviewing a Next.js 15 page that fetches data, the Skill flags synchronous access to params, suggests awaiting it as a Promise, and recommends wrapping useSearchParams consumers in Suspense boundaries. ## Quick Start Review my Next.js page component and apply the next-best-practices rules to fix any async API, RSC boundary, or data fetching issues.

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 15?▼

In Next.js 15+, params and searchParams are Promises that must be awaited. Type them as Promise<{ slug: string }> and await them in pages, layouts, route handlers, and generateMetadata. A codemod is available via npx @next/codemod@latest next-async-request-api.

When should I use Server Actions vs Route Handlers in Next.js?▼

Use Server Actions for mutations triggered from your UI, such as form submissions, since they offer type safety and progressive enhancement. Use Route Handlers for external webhooks, public REST APIs, and GET endpoints that need HTTP caching.

Why does passing a Date object to a Client Component fail?▼

Props crossing the server-client boundary must be JSON-serializable, and Date objects lose their methods during serialization. Convert dates with .toISOString() on the server and reconstruct with new Date() inside the Client Component.

Can Client Components be async functions in Next.js?▼

No, Client Components cannot be async. Fetch data in a parent Server Component and pass it down as props, or fetch on mount inside the Client Component using useEffect.

Why does my Next.js modal route 404 on page refresh?▼

Parallel route slots like @modal require a default.tsx file that returns null. Without it, Next.js cannot determine what to render in the slot during hard navigation, causing a 404.

How do I deploy Next.js with Docker using standalone output?▼

Set output: 'standalone' in next.config.js to generate a minimal server.js with only production dependencies. Copy .next/static and public folders separately, and set HOSTNAME to 0.0.0.0 in the container.