next-best-practices

Consolidate Next.js app router conventions into a reusable code quality guide.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Teams building Next.js projects often struggle to maintain consistency across app router conventions, data-fetching patterns, and metadata usage. This organized reference consolidates established conventions and reusable patterns into a single guide to improve code quality and onboarding speed.

Core Features & Use Cases

  • File conventions and project structure guidance for app router-based apps.
  • Server Component vs Client Component boundaries, data-fetching patterns, and error handling.
  • Metadata and routing guidance including generateMetadata, route handlers, and image/OG strategies.

Quick Start

Review the included sections and apply the recommended structure to a new Next.js project.

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 Next.js app router file structure and project conventions?

Next.js server components handle data fetching directly, while client components manage interactivity. Establishing clear boundaries between them optimizes performance and maintains a clean separation of concerns across your application architecture.

How do I implement error handling and metadata generation in Next.js route handlers?

Next.js route handlers require codified conventions for error handling and metadata usage. Implementing generateMetadata and standardizing error boundaries across APIs and pages ensures consistent performance optimizations and robust data patterns.

Does this Next.js best practices guide apply to existing projects or only new setups?

Next.js metadata best practices include using generateMetadata for dynamic routing and standardizing image and Open Graph strategies. Codifying these routing and metadata conventions into a single reference improves SEO consistency and performance.

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

Use Next.js Server Components for data fetching and static rendering, and Client Components for interactivity. Defining clear component boundaries prevents unnecessary JavaScript bundles and optimizes overall application performance.