next-best-practices

Guides Next.js developers on file conventions, RSC boundaries, and data fetching patterns.

2|Updated Feb 15, 2026
One-click install
npx skills add https://github.com/Crokily/pi-backup --skill next-best-practices-crokily
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: next-best-practices
Source: https://github.com/Crokily/pi-backup/tree/main/external-skills/next-best-practices
Command: npx skills add https://github.com/Crokily/pi-backup --skill next-best-practices-crokily

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a comprehensive guide to implementing Next.js best practices, ensuring code quality, performance, and maintainability in your applications.

Core Features & Use Cases

  • Code Quality: Enforces conventions for file structure, RSC boundaries, and data patterns.
  • Performance: Offers guidance on image/font optimization, bundling, and runtime selection.
  • Error Handling: Details strategies for robust error management and debugging.
  • Use Case: A developer building a new Next.js application can use this Skill to ensure they are following optimal patterns from the start, avoiding common pitfalls and improving the overall quality of their codebase.

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

Next.js best practices for React Server Component boundaries involve structuring your RSC boundaries to clearly separate server-side data fetching from client-side interactivity. This ensures optimal data patterns and maintains code quality across your application architecture.

How do I fix hydration errors in Next.js?

To fix hydration errors in Next.js, you need to ensure that the server-rendered HTML matches the client-side rendered output exactly. Common debugging tips include checking for browser-only APIs and verifying that dynamic data rendering is consistent between server and client environments.

How do I optimize images and fonts in Next.js for better performance?

To optimize images and fonts in Next.js, you should utilize the built-in optimization features and bundling strategies provided by the framework. This approach automatically handles responsive sizing, lazy loading, and font preloading to significantly improve web performance.

When should I use route handlers and how do I manage metadata in Next.js?

Use route handlers in Next.js to manage API endpoints, and leverage the built-in metadata generation API to define dynamic titles and descriptions. Following these conventions ensures proper runtime selection and robust error handling for your web application.

Does this Next.js guide cover runtime selection and bundling strategies?

Yes, this Next.js guide covers runtime selection and bundling strategies to help you choose the optimal execution environment. It provides conventions for file structures and directives that ensure efficient code bundling and improved application performance.