next-best-practices

Codify Next.js App Router development best practices for developers and reviewers.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill consolidates Next.js development best practices to guide consistent, scalable, and reliable app architecture across projects, addressing common pitfalls in routing, data handling, and optimization.

Core Features & Use Cases

  • File conventions & routing patterns: Standardizes app structure, route segments, and middleware/directives usage to reduce ambiguity.
  • RSC boundaries & data patterns: Helps detect server/client boundaries, serializable props, and efficient data fetching to avoid waterfalls.
  • Metadata, error handling & route handlers: Provides guidance on dynamic/static metadata, error pages, and API patterns for robust UX.
  • Performance optimization: Covers image/font optimization, bundling considerations, and self-hosting strategies for production readiness.

Quick Start

Review a Next.js project against these guidelines and start applying the rules to improve structure, performance, and reliability.

Frequently Asked Questions about next-best-practices

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

FAQPage Schema
What are the Next.js App Router best practices for structuring server and client component boundaries?

Next.js App Router best practices for server and client boundaries involve standardizing file conventions, detecting serializable props, and structuring efficient data fetching to avoid waterfalls, ensuring scalable and reliable app architecture across projects.

How do I optimize images and fonts in a Next.js application for production readiness?

To optimize Next.js images and fonts, apply performance optimization strategies covering image/font handling, bundling considerations, and self-hosting techniques to achieve production readiness and robust user experience.

What is the best way to handle dynamic metadata and error handling in Next.js route handlers?

Handling dynamic metadata and errors in Next.js route handlers requires applying specific data patterns for dynamic/static metadata, structuring error pages, and using API patterns to maintain robust UX during route execution.

Does this Next.js best practices guidance apply to scalable apps using the older pages router?

This Next.js best practices guidance specifically applies to apps using the App Router, covering file conventions, middleware directives, and server/client boundaries, and does not target the older pages router architecture.

Why should I standardize Next.js routing patterns and middleware directives in my project?

Standardizing Next.js routing patterns and middleware directives reduces ambiguity in app structure and route segments, guiding consistent and reliable development across teams while preventing common architectural pitfalls.