next-best-practices

Guide Next.js development with best practices for file conventions, RSC boundaries, and data patterns.

Updated May 30, 2026
One-click install
npx skills add https://github.com/kaiomaced0/hackamarh --skill next-best-practices-kaiomaced0
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: next-best-practices
Source: https://github.com/kaiomaced0/hackamarh/tree/main/front-gestao/.agents/skills/next-best-practices
Command: npx skills add https://github.com/kaiomaced0/hackamarh --skill next-best-practices-kaiomaced0

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This Skill provides a comprehensive guide to applying best practices in Next.js development, ensuring optimal performance, maintainability, and user experience.

Core Features & Use Cases

  • File Conventions: Learn the recommended file structure and naming conventions for Next.js projects.
  • RSC Boundaries: Understand how to properly use Server and Client components to prevent errors and optimize performance.
  • Async Patterns: Apply efficient data fetching and processing techniques with Next.js 15+ async APIs.
  • Data Patterns: Choose the right data fetching pattern for your specific use case, optimizing for performance and maintainability.
  • Error Handling: Implement robust error handling strategies for a better user experience and easier debugging.
  • Route Handlers: Create API endpoints using route.ts files for external integrations and public APIs.
  • Metadata & OG Images: Add SEO-friendly metadata and Open Graph images to your pages.
  • Image Optimization: Optimize images for Next.js to reduce load times and improve performance.
  • Font Optimization: Leverage the next/font API for efficient font loading and optimization.
  • Bundling: Manage package bundling effectively to reduce load times and improve performance.
  • Hydration Errors: Identify and fix hydration errors in Next.js applications.
  • Suspense Boundaries: Properly use Suspense boundaries to prevent CSR bailout and improve performance.
  • Parallel & Intercepting Routes: Implement modal patterns and other advanced routing techniques.
  • Self-Hosting: Deploy Next.js applications outside of Vercel with confidence.

Quick Start

Run the 'next-best-practices' skill to learn about Next.js best practices and how to apply them in your project.

Frequently Asked Questions about next-best-practices

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

FAQPage Schema
How do I fix hydration errors in Next.js applications?

To fix Next.js hydration errors, you must properly manage Server and Client component boundaries and ensure consistent rendering between server and client. This guide helps identify mismatched HTML and apply correct async patterns to resolve hydration issues.

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

The best way to optimize Next.js images and fonts is leveraging built-in image optimization features and the `next/font` API. This ensures efficient font loading and reduces image load times for better overall performance.

How do I use Server and Client components correctly in Next.js?

Using Server and Client components correctly in Next.js requires understanding RSC boundaries to prevent errors and optimize performance. You should isolate interactivity on the client and apply async data fetching patterns on the server.

How do I implement parallel routes and Suspense boundaries in Next.js?

Implementing parallel routes and Suspense boundaries in Next.js allows advanced routing techniques like modal patterns and prevents CSR bailout. Proper Suspense placement improves loading states and application performance.

Can I self-host a Next.js application outside of Vercel?

Yes, you can confidently self-host Next.js applications outside of Vercel. This requires applying specific configurations for bundling, route handlers, and metadata to ensure the application maintains optimal performance in custom environments.