nextjs-app-router-patterns

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

38.6k|4.1k|Updated Jul 24, 2025
One-click install
npx skills add https://github.com/wshobson/agents --skill nextjs-app-router-patterns-wshobson
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nextjs-app-router-patterns
Source: https://github.com/wshobson/agents/tree/main/plugins/frontend-mobile-development/skills/nextjs-app-router-patterns
Command: npx skills add https://github.com/wshobson/agents --skill nextjs-app-router-patterns-wshobson

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides comprehensive patterns and best practices for building modern, performant web applications using the Next.js 14+ App Router, simplifying complex features like Server Components, streaming, and advanced data fetching.

Core Features & Use Cases

  • Server Components & Client Components: Understand and implement the correct rendering modes for optimal performance.
  • Data Fetching & Caching: Master various strategies including ISR and tag-based invalidation.
  • Routing Patterns: Implement parallel routes, intercepting routes (modals), and route handlers.
  • Server Actions: Securely handle data mutations and form submissions.
  • Streaming & Suspense: Improve perceived performance by streaming UI elements.
  • Metadata & SEO: Configure dynamic metadata for improved search engine visibility.
  • Use Case: When building a new e-commerce site with Next.js, use this Skill to implement efficient product listing pages with dynamic filtering, user reviews streamed in, and secure add-to-cart functionality via Server Actions.

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 implement Server Actions in Next.js App Router for form mutations?

Server Actions in Next.js securely handle data mutations and form submissions directly within Server Components. This pattern eliminates manual API endpoint creation, streamlining secure full-stack data updates.

What is the difference between Server Components and Client Components in Next.js?

Server Components render on the server for optimal performance, while Client Components enable interactivity. Choosing the correct rendering mode ensures a modern, performant React application architecture.

How do I use parallel routes and intercepting routes in Next.js 14?

Parallel routes render multiple pages simultaneously, and intercepting routes handle modals. Implementing these advanced routing patterns builds complex layouts and dynamic UI interactions in Next.js.

What's the best way to handle data fetching and caching in Next.js App Router?

Data fetching in Next.js App Router supports various caching strategies, including ISR and tag-based invalidation. Mastering these techniques ensures efficient, fresh data delivery for full-stack applications.

How does streaming with Suspense improve Next.js performance?

Streaming with Suspense improves perceived performance by progressively rendering UI elements. This Next.js pattern allows users to see and interact with page sections before all data loads.

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

Dynamic metadata configuration in Next.js App Router improves search engine visibility. You can generate metadata based on route parameters to optimize SEO for modern web applications.