nextjs-app-router-patterns

Structure Next.js 14+ App Router projects with server components and file conventions.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides patterns for structuring Next.js 14+ App Router projects, including server components, streaming, parallel routes, and advanced data fetching, to help you build scalable, high-performance web apps.

Core Patterns & Use Cases

  • Rendering Modes: Server/Client/Static/Dynamic/Streaming
  • File Conventions: layout.tsx, page.tsx, route.ts, etc.
  • Patterns: Server Components, Streaming, Parallel Routes, Intercepting Routes, Server Actions

Quick Start

Create an app with the App Router layout and a server component-based page, then progressively add streaming, parallel routes, and server actions as needed.

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 a Next.js 14 App Router project with server and client components?

App Router uses file conventions like layout.tsx and page.tsx to define routes. Server Components are the default; mark client-side code with 'use client' directive. Organize by route segments, placing shared layouts at appropriate nesting levels to separate server and client logic cleanly.

What's the best way to implement streaming in Next.js App Router?

Streaming in App Router progressively sends HTML to the browser using React Server Components and Suspense boundaries. Wrap async data fetches in Suspense, define fallback UI, and Next.js streams completed chunks immediately rather than waiting for all data, improving perceived performance.

Can I use parallel routes and intercepting routes in Next.js App Router?

Yes. Parallel Routes let you render multiple segments simultaneously within the same layout using the @folder convention. Intercepting Routes intercept navigation to show modals or alternate views. Both use file-system conventions to control rendering without extra configuration.

How do I choose between static generation, ISR, and server-side rendering in App Router?

Static generation (default) pre-builds pages at build time for fastest performance. ISR revalidates cached pages at intervals. Server-side rendering generates pages per request for dynamic content. Choose based on data freshness needs: static for unchanging content, ISR for periodic updates, SSR for real-time data.

What data fetching patterns work best with Next.js App Router Server Components?

Fetch directly in Server Components—no API route needed for internal data. Use async/await, caching via fetch options (revalidate, tags), and co-locate fetches with components. Combine with Server Actions for mutations. Avoid waterfalls by fetching in parallel; use Promise.all or layout-level fetches.

Do I need to migrate from Pages Router to App Router, and what's the migration path?

Migration is optional but recommended for new projects. Both routers coexist in Next.js 14+. Incrementally move routes by creating app/ directory, converting pages to layouts and pages using file conventions, updating data fetching to work in Server Components, then remove old pages/ routes.