next-best-practices

Guide Next.js development with best practices for file conventions and data fetching.

42|11|Updated Dec 26, 2025
One-click install
npx skills add https://github.com/petekp/claude-code-setup --skill next-best-practices-petekp
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: next-best-practices
Source: https://github.com/petekp/claude-code-setup/tree/main/skills/next-best-practices
Command: npx skills add https://github.com/petekp/claude-code-setup --skill next-best-practices-petekp

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides comprehensive guidance and best practices for developing robust and efficient applications using the Next.js framework, ensuring optimal performance, maintainability, and adherence to modern web development standards.

Core Features & Use Cases

  • Code Quality: Enforces best practices for file conventions, RSC boundaries, and data fetching patterns.
  • Performance Optimization: Offers strategies for image and font optimization, bundling, and runtime selection.
  • Error Handling & Debugging: Guides on effective error handling, debugging techniques, and Suspense boundaries.
  • Use Case: A developer building a new Next.js application can use this Skill to ensure their project is set up with the latest best practices from the start, avoiding common pitfalls and maximizing performance.

Quick Start

Review the Next.js best practices for file conventions and RSC boundaries.

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 React Server Component boundaries in Next.js?

Next.js best practices for React Server Component boundaries dictate separating server-only data fetching from client interactivity, ensuring efficient data fetching patterns and optimal performance. Directives help enforce these boundaries.

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

To optimize images and fonts in Next.js, apply built-in best practices for automatic asset optimization, ensuring minimal bundling sizes and efficient runtime selection to maximize web performance.

What is the best way to handle errors and Suspense boundaries in Next.js?

The best way to handle errors and Suspense boundaries in Next.js involves implementing structured error handling and leveraging Suspense for streaming, ensuring maintainable and performant web applications.

How do I use parallel and intercepting routes in Next.js?

Using parallel and intercepting routes in Next.js requires following specific file conventions to render multiple route segments simultaneously or intercept navigation, creating advanced routing patterns.

Why am I getting hydration errors in my Next.js project and how do I debug them?

Hydration errors in Next.js occur when server-rendered HTML mismatches client rendering; debugging tricks involve checking browser extensions and ensuring consistent rendering logic between server and client.

Do I need specific configurations for self-hosting a Next.js application?

Self-hosting a Next.js application requires following best practices for runtime selection and image optimization configurations, ensuring the server environment supports the framework's advanced bundling and routing features.