next-best-practices

Guide Next.js development with file conventions, RSC boundaries, and data fetching patterns.

Updated Jan 26, 2026
One-click install
npx skills add https://github.com/TommyBez/open-rec --skill next-best-practices-tommybez
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: next-best-practices
Source: https://github.com/TommyBez/open-rec/tree/main/.agents/skills/next-best-practices
Command: npx skills add https://github.com/TommyBez/open-rec --skill next-best-practices-tommybez

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides comprehensive guidance and best practices for developing with Next.js, ensuring efficient, maintainable, and performant applications.

Core Features & Use Cases

  • File Conventions: Understand project structure, route segments, and special files.
  • RSC Boundaries: Detect and prevent invalid React Server Component patterns.
  • Data Patterns: Choose the right data fetching strategy (Server Components, Server Actions, Route Handlers).
  • Error Handling: Implement robust error handling with error.tsx and global-error.tsx.
  • Use Case: A developer starting a new Next.js project can use this Skill to establish optimal file structure, data fetching patterns, and error handling from the outset, preventing common pitfalls.

Quick Start

Review the best practices for handling data fetching in Next.js applications.

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 data fetching in Next.js?

Next.js data fetching best practices involve choosing the right strategy among Server Components, Server Actions, and Route Handlers to ensure efficient, maintainable application data flow.

How do I structure files and route segments in Next.js?

Next.js file conventions dictate project structure through route segments and special files, establishing an optimal architectural foundation from the outset to prevent common structural pitfalls.

How do React Server Component boundaries work in Next.js?

React Server Component boundaries in Next.js define the separation between server and client execution, helping developers detect and prevent invalid component patterns during development.

How should I handle errors in Next.js applications?

Next.js error handling is implemented robustly using error.tsx and global-error.tsx files, providing dedicated boundaries to catch and manage application failures gracefully.

What is the best way to optimize images and fonts in Next.js?

Next.js optimization best practices include specific bundling strategies for images and fonts, ensuring performant web development by reducing layout shift and automatically serving optimized assets.

How do I use route handlers and metadata in Next.js?

Next.js route handlers manage backend API endpoints while metadata conventions handle SEO, both essential best practices for comprehensive web application development.