nextjs-app-router-patterns

Implements Next.js App Router patterns for Server Components, streaming, and data fetching.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Building modern Next.js applications requires navigating complex App Router concepts like Server Components, streaming, parallel routes, and caching strategies, which often leads to architectural mistakes and suboptimal rendering choices. ## Core Features & Use Cases - Server and Client Component Patterns: Provides production-ready code for data fetching in Server Components, interactivity with 'use client', and mutations via Server Actions. - Advanced Routing: Covers parallel routes, intercepting routes for modal patterns, and route handlers for API endpoints. - Caching and Streaming: Demonstrates ISR, tag-based revalidation, and Suspense-based streaming for progressive page loads. - Use Case: When building a product dashboard that needs independent loading states for analytics and team panels, use the parallel routes pattern with slot-based layouts and per-slot loading.tsx files. ## Quick Start Ask the AI to scaffold a Next.js App Router page that fetches products with ISR caching and streams in reviews using Suspense boundaries.

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 in 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 you can access databases and secrets without exposing them to the client.

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

Use Server Components by default for data fetching, heavy computation, and accessing secrets. Add 'use client' only when you need interactivity, React hooks like useState, or browser APIs, keeping client boundaries as small as possible.

How do Server Actions work in Next.js 14?

Server Actions are async functions marked with 'use server' that run on the server for mutations like form submissions. They support revalidateTag and revalidatePath for cache invalidation, and can be called from Client Components within startTransition.

Does Next.js App Router support streaming with Suspense?

Yes, App Router supports streaming by wrapping slow data-fetching components in Suspense boundaries with skeleton fallbacks. The page shell renders immediately while slower sections like reviews or recommendations stream in progressively.

How do I build modal routes with intercepting routes in Next.js?

Use the (.)folder convention inside a @modal slot to intercept a route and render it in a modal, while keeping the original route as a full page for direct navigation. Add a default.tsx in the slot to handle cases where no modal is active.

Why is my Next.js fetch not revalidating cached data?

Fetch requests are cached by default in App Router, so stale data persists until revalidation. Set next.revalidate for time-based ISR, use cache: 'no-store' for always-fresh data, or call revalidateTag from a Server Action after mutations.