nextjs-app-router-patterns

Provide Next.js 14+ App Router patterns for Server Components and data fetching.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/mhbdev/git-pal --skill nextjs-app-router-patterns-mhbdev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nextjs-app-router-patterns
Source: https://github.com/mhbdev/git-pal/tree/main/.agents/skills/nextjs-app-router-patterns
Command: npx skills add https://github.com/mhbdev/git-pal --skill nextjs-app-router-patterns-mhbdev

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides comprehensive guidance and practical examples for building modern web applications using the Next.js 14+ App Router, enabling developers to leverage advanced features like Server Components, streaming, and parallel routes effectively.

Core Features & Use Cases

  • Server Components & Client Components: Understand and implement the correct rendering modes for optimal performance and interactivity.
  • App Router Conventions: Learn file-based routing, layout management, and special files like loading.tsx and error.tsx.
  • Advanced Patterns: Implement Server Actions for mutations, parallel and intercepting routes for complex UIs, and streaming for improved perceived performance.
  • Use Case: When starting a new Next.js project or migrating an existing one to the App Router, use this Skill to quickly understand and apply best practices for data fetching, rendering, and routing.

Quick Start

Use the nextjs-app-router-patterns skill to generate a basic Next.js App Router layout and page component.

Frequently Asked Questions about nextjs-app-router-patterns

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

FAQPage Schema
How do I structure Server Components and Client Components in the Next.js App Router?

To structure Server and Client Components in the Next.js App Router, you must identify rendering boundaries by adding the 'use client' directive only when interactivity or browser APIs are required, optimizing performance.

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

The best way to fetch data in the Next.js 14 App Router is directly inside Server Components, which allows you to securely access back-end infrastructure and stream responses to improve perceived loading performance.

How do parallel and intercepting routes work in Next.js?

Parallel and intercepting routes in Next.js work by rendering multiple pages simultaneously within a layout and intercepting route navigation to display content modally, enabling complex user interfaces without full page transitions.

When should I use Server Actions for mutations in a React application?

You should use Server Actions for mutations in a React application when you need to securely write data directly to your database from the Next.js App Router without creating separate API endpoints.

How do I handle loading and error states with App Router conventions?

To handle loading and error states with App Router conventions, you implement special 'loading.tsx' and 'error.tsx' files to instantly render streaming fallbacks and gracefully catch uncaught exceptions for your route segments.