nextjs-app-router-patterns

Implements Next.js App Router patterns including Server Components, Server Actions, and streaming.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Developers building or migrating Next.js applications often struggle with App Router concepts like Server Components, data caching, parallel routes, and Server Actions, leading to incorrect rendering choices and poor performance. ## Core Features & Use Cases - Server Component Patterns: Fetch data directly in Server Components with ISR, tag-based revalidation, and Suspense streaming. - Routing Patterns: Implement parallel routes, intercepting routes for modals, route handlers, and dynamic metadata generation. - Server Actions: Handle mutations with progressive enhancement, revalidation, redirects, and error handling. - Use Case: When migrating a Pages Router e-commerce site to App Router, apply these patterns to convert product pages to Server Components with streaming reviews and cart mutations via Server Actions. ## Quick Start Ask the AI to scaffold a Next.js App Router product page using Server Components with Suspense streaming and a Server Action for adding items to the cart.

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 App Router Server Components?▼

Fetch data directly inside async Server Components using the fetch API with caching options like next.revalidate for ISR or next.tags for tag-based invalidation. Server Components run only on the server, so no useEffect or client-side fetching is needed.

How to migrate from Next.js Pages Router to App Router?▼

Migrate incrementally by moving pages into the app directory, converting getServerSideProps and getStaticProps into async Server Components, and replacing API routes with route handlers. The App Router supports both routers side by side during migration.

When should I use 'use client' in Next.js App Router?▼

Add 'use client' only when a component needs interactivity such as useState, useEffect, event handlers, or browser APIs. Start with Server Components by default and push client boundaries as far down the tree as possible.

How do Server Actions work in Next.js?▼

Server Actions are async functions marked with 'use server' that run on the server for mutations like form submissions. They support progressive enhancement, revalidateTag or revalidatePath for cache updates, and redirect for navigation after completion.

What are parallel and intercepting routes in Next.js?▼

Parallel routes use named slots like @analytics to render multiple pages simultaneously with independent loading states. Intercepting routes like (.)photos let you show a modal over the current page while keeping a full-page version for direct navigation.

Why is my Next.js page not streaming with Suspense?▼

Streaming fails when data fetching happens in the parent page component before rendering Suspense boundaries. Move slow fetches into child components wrapped in Suspense so the shell renders immediately while slow sections stream in.