nextjs-best-practices

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

1|Updated Sep 25, 2025
One-click install
npx skills add https://github.com/arroschaves/brandaocontador-site --skill nextjs-best-practices-arroschaves
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nextjs-best-practices
Source: https://github.com/arroschaves/brandaocontador-site/tree/main/.agent/skills/nextjs-best-practices
Command: npx skills add https://github.com/arroschaves/brandaocontador-site --skill nextjs-best-practices-arroschaves

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a comprehensive guide to implementing best practices within the Next.js App Router, ensuring efficient, performant, and maintainable applications.

Core Features & Use Cases

  • Component Strategy: Understand when to use Server vs. Client Components.
  • Data Fetching: Learn optimal data fetching patterns and caching strategies.
  • Routing: Master file conventions and advanced routing techniques.
  • Performance: Implement image optimization and bundle analysis.
  • Use Case: A developer building a new Next.js application can use this Skill to structure their project correctly from the start, avoiding common pitfalls and maximizing performance.

Quick Start

Review the principles for Server vs 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 Components versus Client Components in the Next.js App Router?

Optimize Next.js performance by leveraging image optimization, analyzing bundle size, and applying proper caching strategies. Fetch data directly in Server Components to minimize client-side JavaScript and reduce waterfall requests.

What is the best way to structure routing and API routes in a new Next.js application?

Structure Next.js routing by mastering file conventions like nested layouts and dynamic segments. Define API routes using the App Router's route handlers to build maintainable backend endpoints within your application architecture.

How do server actions work for data fetching and mutations in Next.js?

Server actions in Next.js allow you to mutate data and handle form submissions directly on the server without creating separate API endpoints. They integrate tightly with App Router caching strategies to ensure efficient data updates.

How do I handle metadata and caching strategies in the Next.js App Router?

Implement dynamic metadata using the App Router's built-in metadata APIs for SEO optimization. Control data caching by configuring fetch requests and route segment configurations to balance freshness with rendering performance.