nextjs-best-practices

Guide Next.js App Router development with best practices for components, data fetching, and routing.

Updated Jan 20, 2026
One-click install
npx skills add https://github.com/yunaamelia/mcp-agent-memory-pro --skill nextjs-best-practices-yunaamelia
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nextjs-best-practices
Source: https://github.com/yunaamelia/mcp-agent-memory-pro/tree/main/.agent/skills/nextjs-best-practices
Command: npx skills add https://github.com/yunaamelia/mcp-agent-memory-pro --skill nextjs-best-practices-yunaamelia

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides clear, actionable guidance on implementing best practices for Next.js App Router development, helping developers build efficient, scalable, and maintainable applications.

Core Features & Use Cases

  • Component Strategy: Understand when to use Server vs. Client Components.
  • Data Fetching: Learn optimal patterns for fetching data in Next.js.
  • Routing: Master file conventions and advanced routing techniques.
  • Performance: Optimize images and bundle sizes.
  • Use Case: A developer is unsure about the best way to fetch data for a new feature in their Next.js application. They consult this Skill to understand caching strategies and Server Component data fetching patterns.

Quick Start

Explain the decision tree for choosing between Server 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
How do I choose between Server and Client Components in Next.js App Router?

To choose between Server and Client Components in Next.js App Router, evaluate whether the component requires interactivity or direct browser APIs. Server Components fetch data securely on the server, while Client Components handle state and user events.

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

The best way to fetch data in Next.js is by utilizing Server Components to fetch directly on the server. This approach leverages built-in caching strategies and reduces client-side bundle sizes, improving overall application performance.

How do I optimize images and bundle sizes in Next.js?

To optimize images and bundle sizes in Next.js, follow performance best practices specific to the App Router. This involves using built-in image optimization components and properly splitting code between Server and Client Components.

When should I use Server Actions in Next.js?

You should use Server Actions in Next.js when you need to handle form submissions or mutate data directly on the server without creating separate API routes. They streamline data mutations and maintain type safety across the stack.

What are common anti-patterns in Next.js App Router development?

Common Next.js App Router anti-patterns include unnecessary usage of Client Components, improper data fetching strategies, and ignoring caching principles. Avoiding these ensures your application remains efficient, scalable, and maintainable.