next-best-practices

Guide Next.js developers through modern best practices for application development.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides comprehensive guidance to ensure Next.js code adheres to optimal patterns, improving performance, maintainability, and developer experience.

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 pattern for data fetching (Server Components, Server Actions, Route Handlers).
  • Error Handling: Implement robust error boundaries and graceful error management.
  • Optimization: Leverage image, font, and bundling optimizations.
  • Use Case: A developer is unsure about the correct way to fetch data in a new Next.js 15+ application, or how to handle errors in a production environment. This Skill provides clear, actionable advice.

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's the best way to fetch data in Next.js App Router?

The best way to fetch data in the Next.js App Router depends on your use case, utilizing React Server Components, Server Actions, or Route Handlers. This Skill guides you in selecting the optimal pattern for performance and maintainability.

How do I handle invalid React Server Component boundaries in Next.js?

To handle React Server Component boundaries, you must correctly separate server and client directives to prevent invalid patterns. This Skill helps detect and resolve boundary violations to ensure modern Next.js standards.

How do I implement error handling and error boundaries in a Next.js application?

Implementing error handling in a Next.js application requires robust error boundaries and graceful error management. This Skill provides actionable guidance for handling production environment errors effectively.

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

To optimize images and fonts in Next.js, leverage built-in image and font optimization features alongside bundling techniques. This Skill ensures adherence to modern performance standards for optimal loading.

When should I use parallel and intercepting routes in Next.js?

Using parallel and intercepting routes in Next.js is ideal for advanced routing scenarios like modals. This Skill covers these special file conventions alongside route handlers to structure complex application flows.

Does this Next.js best practices guidance cover self-hosting and runtime selection?

Yes, this Next.js best practices guidance covers self-hosting, runtime selection, and directives. It provides comprehensive standards for configuring your deployment and choosing the correct execution environment.