nextjs-best-practices

Define server and client component boundaries for Next.js App Router projects.

4|2|Updated Mar 16, 2026
One-click install
npx skills add https://github.com/0xKobold/0xkobolds --skill nextjs-best-practices-0xkobold
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nextjs-best-practices
Source: https://github.com/0xKobold/0xkobolds/tree/main/.agents/skills/nextjs-best-practices
Command: npx skills add https://github.com/0xKobold/0xkobolds --skill nextjs-best-practices-0xkobold

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This guide provides structured best practices for building Next.js apps using the App Router, clarifying when to use server vs client components, data fetching strategies, and routing conventions to improve performance and maintainability.

Core Features & Use Cases

  • Server vs Client Components: Establishes rules for when to mark a component as a client component and how to split server and client boundaries for performance and UX.
  • Data Fetching Patterns: Prescribes default static data fetching with ISR, and dynamic no-store options when interactivity requires fresh data.
  • Routing Principles: Documents file conventions and route organization techniques, including layout, loading, error, and 404 handling.
  • Performance & Metadata: Covers caching, image optimization, and server actions, with guidance on metadata generation for routes.

Quick Start

Set up a Next.js app with App Router, create server components for data fetching, add a client component for interactivity, and follow the recommended file naming conventions.

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 and client components in Next.js App Router?

Structure Next.js App Router components by defaulting to server components for data fetching, adding client components only when interactivity requires it. Split server and client boundaries to maximize performance and maintainability.

What is the best way to fetch data in Next.js App Router?

The best way to fetch data in Next.js is using default static fetching with ISR for cached performance. Switch to dynamic no-store options only when your component's interactivity requires fresh, real-time data.

When do I need to use client components in Next.js?

Use client components in Next.js when you need interactivity, state, or browser APIs. Keep the rest of your application as server components to ensure optimal data fetching and rendering performance.

How to organize routing and file conventions in Next.js App Router?

Organize Next.js App Router files using standard conventions for layouts, loading states, and error handling. Document route organization techniques and 404 handling to maintain clear component separation and structure.

How do server actions work with Next.js routing conventions?

Server actions in Next.js work by executing server-side mutations directly from components, integrated with standard routing conventions. They pair with metadata generation and image optimization to improve overall application performance.