nextjs-best-practices

Codify Next.js App Router conventions for server components, data fetching, and routing.

Updated Jan 21, 2026
One-click install
npx skills add https://github.com/ollieb89/orchestrator --skill nextjs-best-practices-ollieb89
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nextjs-best-practices
Source: https://github.com/ollieb89/orchestrator/tree/main/.cursor/skills/nextjs-best-practices
Command: npx skills add https://github.com/ollieb89/orchestrator --skill nextjs-best-practices-ollieb89

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Next.js App Router development often suffers from inconsistent patterns around server vs client components, data fetching, and routing. Establish a unified set of best practices that guide component ownership, data flow, and route structure.

Core Features & Use Cases

  • Server vs Client Components guidance to reduce unnecessary client rendering.
  • Data fetching strategies including where to fetch data and caching considerations.
  • Routing principles and file conventions for routes, layouts, and error handling.

Quick Start

Create a minimal Next.js App Router project and implement server components with routing patterns to illustrate best practices.

Frequently Asked Questions about nextjs-best-practices

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

FAQPage Schema
How do I structure server vs client components in Next.js App Router?

Next.js App Router components default to server-side rendering. You should keep components as server components by default and only add the 'use client' directive when you specifically need client-side interactivity or browser APIs.

What's the best way to handle data fetching in Next.js App Router?

Data fetching in the Next.js App Router should be performed directly inside server components. This approach leverages server-side execution to securely access databases and APIs while automatically caching requests for performance optimization.

How do I organize routes and layouts using Next.js App Router file conventions?

Next.js App Router uses file-based conventions where special files like 'layout', 'page', and 'error' define routing behavior. You structure your project by nesting folders to create route segments and using these files to manage shared UI and error boundaries.

When should I use 'use server' directives in my Next.js application?

The 'use server' directive defines server actions for Next.js applications. You need to use it when creating functions that execute exclusively on the server to handle form submissions or data mutations, ensuring sensitive logic never reaches the client.

Why does my Next.js App Router project have inconsistent rendering patterns?

Inconsistent Next.js App Router patterns usually occur when server and client component boundaries are unclear. Establishing unified best practices for component ownership, data flow, and file-naming conventions resolves these architectural inconsistencies.

Can I use these Next.js routing patterns for large frontend architectures?

Yes, these Next.js routing patterns are applicable to frontend teams building apps across project scopes. The guidelines scale by codifying server/client separation, data fetching strategies, and performance optimization for large frontend architectures.