next-best-practices

Guide Next.js file conventions, RSC boundaries, data fetching, and optimization.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides comprehensive guidance and checks for adhering to Next.js best practices, ensuring code quality, performance, and maintainability.

Core Features & Use Cases

  • File Conventions: Understand project structure and routing.
  • RSC Boundaries: Detect invalid Server Component patterns.
  • Data Patterns: Choose the right data fetching strategy (Server Components, Server Actions, Route Handlers).
  • Optimization: Guidance on image, font, and bundling optimization.
  • Error Handling: Implement robust error handling with error.tsx and global-error.tsx.
  • Use Case: A developer wants to ensure their new Next.js application follows optimal patterns for performance and scalability, avoiding common pitfalls.

Quick Start

Review the next-best-practices skill to understand how to correctly implement data fetching patterns in Next.js.

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 Server Components?

Next.js data fetching best practices involve choosing the right strategy among Server Components, Server Actions, and Route Handlers to ensure optimal performance and maintainability.

How do I implement robust error handling in Next.js applications?

Robust error handling in Next.js is implemented using `error.tsx` and `global-error.tsx` file conventions to catch and manage errors gracefully across your application routes.

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

Invalid React Server Component (RSC) boundaries are detected by checking your project patterns against established Next.js best practices to identify and correct improper component usage.

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

Next.js optimization best practices provide specific techniques for images, fonts, and bundling to improve application performance, code quality, and overall maintainability.

What are the Next.js file conventions for routing and project structure?

Next.js file conventions dictate project structure and routing, providing a comprehensive guide to organizing your application for optimal performance and scalability.