next-best-practices

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

6|47|Updated Dec 20, 2025
One-click install
npx skills add https://github.com/Neko-Protocol/Neko-DApp --skill next-best-practices-neko-protocol
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: next-best-practices
Source: https://github.com/Neko-Protocol/Neko-DApp/tree/main/.agents/skills/next-best-practices
Command: npx skills add https://github.com/Neko-Protocol/Neko-DApp --skill next-best-practices-neko-protocol

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 efficient, maintainable, and performant web 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.
  • Optimization: Optimize images, fonts, and bundling for performance.
  • Use Case: A developer is unsure about the correct way to fetch data in a new Next.js project, or how to structure their components for optimal performance and maintainability.

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 is the best way to structure data fetching in Next.js?

Next.js data fetching best practices dictate choosing between Server Components, Server Actions, and Route Handlers based on your execution context to ensure optimal performance and maintainability.

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

To prevent invalid React Server Component boundaries, follow Next.js best practices to correctly separate server and client directives, ensuring components execute in their intended runtime environment.

Does Next.js best practices guidance cover error handling and route segments?

Yes, Next.js best practices cover implementing robust error handling using error.tsx and global-error.tsx, alongside proper file conventions for structuring route segments and special files.

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

Next.js performance optimization involves applying built-in best practices for image and font loading, alongside bundling configurations, to reduce layout shift and improve web vitals.

When should I use Server Actions instead of Route Handlers in Next.js?

Server Actions are preferred for mutations tightly coupled with components, while Route Handlers handle Next.js data fetching patterns for external API endpoints and webhooks.

What are the Next.js file conventions for special files and metadata?

Next.js file conventions define special files like error.tsx and loading.tsx, and prescribe how to manage metadata within route segments to standardize application structure and behavior.