next-best-practices

Provide best practices for developing Next.js applications with performance and code quality.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This Skill provides best practices and guidelines for developing and maintaining Next.js applications, optimizing performance, and ensuring code quality.

Core Features & Use Cases

  • File Conventions: Outlines file and directory structures for Next.js projects, including best practices for organization and naming.
  • RSC Boundaries: Explains the limitations and best practices for Server Components to avoid common pitfalls.
  • Data Patterns: Details the recommended patterns for data fetching and handling in Next.js.
  • Error Handling: Covers techniques for error handling, including error boundaries and custom error pages.
  • Image Optimization: Provides guidelines for optimizing images in Next.js applications.
  • Font Optimization: Offers best practices for using fonts in Next.js with zero layout shift.
  • Bundling: Discusses common bundling issues with third-party packages and solutions.
  • Scripts: Details the use of next/script for loading third-party scripts with performance considerations.
  • Self-Hosting: Explains how to self-host Next.js applications for deployment on any platform.
  • Hydration Errors: Offers solutions for common React hydration mismatch errors.
  • Parallel & Intercepting Routes: Describes the implementation of modal patterns with parallel and intercepting routes.
  • Route Handlers: Covers creating API endpoints with route.ts files and managing different HTTP methods.

Quick Start

Use the next-best-practices skill to review the file conventions for a Next.js project.

Frequently Asked Questions about next-best-practices

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

FAQPage Schema
What are the best practices for organizing files and directories in a Next.js project?

Next.js best practices for file conventions involve structuring project directories and naming files to maximize maintainability and code quality across the application.

How do I optimize images and fonts in Next.js to prevent layout shift?

Next.js image and font optimization guidelines provide techniques for loading assets efficiently to achieve zero layout shift and improve overall application performance.

What are the recommended data fetching patterns for Next.js Server Components?

Next.js data patterns outline recommended approaches for fetching and handling data within React Server Component (RSC) boundaries to avoid common pitfalls and maintain performance.

Why does my Next.js application throw React hydration mismatch errors and how do I fix them?

React hydration errors in Next.js occur when server-rendered HTML mismatches client rendering, and you can resolve them using specific error handling solutions and boundaries.

How do I implement parallel and intercepting routes for modal patterns in Next.js?

Parallel and intercepting routes in Next.js enable the implementation of modal patterns by routing specific segments simultaneously without unmounting the underlying UI.

Can I self-host a Next.js application on any platform without vendor lock-in?

Self-hosting Next.js applications is fully supported through specific deployment strategies that enable running the framework on any platform without relying on proprietary infrastructure.