nextjs-app-router-patterns

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

3|2|Updated Aug 31, 2025
One-click install
npx skills add https://github.com/donggyun112/ai-librarian --skill nextjs-app-router-patterns-donggyun112
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nextjs-app-router-patterns
Source: https://github.com/donggyun112/ai-librarian/tree/main/.claude/skills/nextjs-app-router-patterns
Command: npx skills add https://github.com/donggyun112/ai-librarian --skill nextjs-app-router-patterns-donggyun112

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides comprehensive patterns and best practices for building modern web applications using the Next.js 14+ App Router, enabling efficient Server Component implementation, advanced data fetching, and streamlined routing.

Core Features & Use Cases

  • Server Components & Client Components: Understand and implement the correct rendering modes for optimal performance.
  • App Router Conventions: Learn file-based routing, layout management, and special files like loading.tsx and error.tsx.
  • Data Fetching & Caching: Master various data fetching strategies including static generation, dynamic rendering, and Incremental Static Regeneration (ISR).
  • Server Actions: Implement mutations and form submissions securely on the server.
  • Parallel & Intercepting Routes: Utilize advanced routing patterns for complex UIs and modal experiences.
  • Streaming: Improve perceived performance by streaming UI components.
  • Route Handlers: Create API endpoints within the App Router.
  • Metadata & SEO: Configure dynamic metadata for improved search engine visibility.

Quick Start

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

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 fetch data in Next.js 14 App Router using Server Components?

Data fetching in the Next.js App Router uses Server Components to fetch data directly on the server. You can implement static generation, dynamic rendering, and Incremental Static Regeneration strategies to optimize performance and caching behavior.

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

Use Client Components instead of Server Components when you need interactivity, state, or browser-only APIs. Server Components handle data fetching and static rendering, while Client Components manage event listeners and UI updates.

How do I implement mutations and form submissions securely in Next.js App Router?

Implement mutations and form submissions securely using Server Actions in the Next.js App Router. This allows you to write server-side mutation functions callable directly from client components without separate API endpoints.

What are parallel and intercepting routes in Next.js used for?

Parallel and intercepting routes are advanced routing patterns used for complex UIs and modal experiences in Next.js. They allow rendering multiple routes simultaneously within a layout and intercepting paths for modals.

How do I configure dynamic metadata for SEO in Next.js App Router?

Configure dynamic metadata for SEO in the Next.js App Router by exporting a metadata object or function from layout and page files. This generates optimized meta tags for improved search engine visibility.

Does the Next.js App Router still support custom API endpoints?

The Next.js App Router supports custom API endpoints through Route Handlers. You create API endpoints by defining route.js files within your app directory, enabling server-side logic processing for your web application.