nextjs-best-practices

Guide Next.js App Router development with component and data fetching patterns.

Updated Mar 2, 2026
One-click install
npx skills add https://github.com/vitoropereira/claude-starter-kit --skill nextjs-best-practices-vitoropereira
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nextjs-best-practices
Source: https://github.com/vitoropereira/claude-starter-kit/tree/main/.claude/skills/frontend/nextjs-best-practices
Command: npx skills add https://github.com/vitoropereira/claude-starter-kit --skill nextjs-best-practices-vitoropereira

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides clear guidelines and best practices for developing efficient and maintainable applications using the Next.js App Router, helping developers avoid common pitfalls and optimize performance.

Core Features & Use Cases

  • Component Strategy: Understand when to use Server vs. Client Components.
  • Data Fetching: Implement effective data fetching patterns with caching and revalidation.
  • Routing: Leverage advanced routing features like route groups and parallel routes.
  • Performance Optimization: Apply techniques for image optimization and bundle splitting.
  • Use Case: A developer is unsure whether to fetch data in a Server Component or a Client Component for a dashboard page. This Skill clarifies the decision-making process and provides the optimal pattern.

Quick Start

Explain the difference between Server Components and Client Components in Next.js.

Frequently Asked Questions about nextjs-best-practices

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

FAQPage Schema
When should I use Server vs Client Components in Next.js App Router?

Next.js App Router uses Server Components by default for data fetching and rendering. You should use Client Components only when you need interactivity, state, or browser APIs, ensuring efficient and maintainable React application development.

What is the best way to fetch data in Next.js App Router?

The best way to fetch data in Next.js App Router is directly inside Server Components. This approach leverages server-side execution, integrates seamlessly with caching and revalidation patterns, and avoids sending large payloads to the client.

How do I optimize performance and bundle splitting in Next.js?

Optimize Next.js performance by applying built-in techniques for image optimization and strategic bundle splitting. Separating Server and Client Components correctly also minimizes the JavaScript shipped to the browser, boosting overall application performance.

Does Next.js App Router support advanced routing features like parallel routes?

Yes, Next.js App Router supports advanced routing features including parallel routes and route groups. These principles allow you to build complex layouts and render multiple pages simultaneously within the same view.

What are common anti-patterns when using Next.js Server Actions?

Common Next.js anti-patterns include overusing Client Components for static data, bypassing built-in caching mechanisms, and improperly structuring API routes. Following App Router principles helps avoid these pitfalls to maintain scalable applications.