next-best-practices

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

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

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).
  • Use Case: A developer is unsure about the correct way to fetch data in a new Next.js project and wants to ensure they are following modern best practices for performance and maintainability.

Quick Start

Review the best practices for Next.js data fetching patterns.

Frequently Asked Questions about next-best-practices

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

FAQPage Schema
What's the best way to fetch data in Next.js App Router?

Next.js data fetching is best handled through React Server Components for asynchronous fetching, Server Actions for mutations, or Route Handlers for building external API endpoints.

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

React Server Component boundaries separate server-only logic from client interactivity, requiring careful use of directives to prevent invalid patterns and ensure components render in the correct runtime environment.

When should I use Server Components versus Server Actions in Next.js?

Use Server Components for reading and rendering data without JavaScript overhead, and use Server Actions when you need to handle form submissions and data mutations directly on the server.

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

Next.js optimization involves using built-in components for automatic image resizing and font preloading, which reduces layout shifts and improves Core Web Vitals without external configuration.

Why are my Next.js App Router file conventions causing routing errors?

App Router file conventions require specific naming for route segments and special files; debugging tricks involve checking your folder structure to ensure segments align with expected routing behavior.

Does Next.js metadata handling support dynamic SEO tags?

Next.js metadata handling supports dynamic SEO tags through a specialized metadata API, allowing you to generate title and description outputs dynamically based on route parameters.