nextjs-app-router-patterns

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

1|Updated Jan 24, 2026
One-click install
npx skills add https://github.com/andymsun/lawvics --skill nextjs-app-router-patterns-andymsun
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nextjs-app-router-patterns
Source: https://github.com/andymsun/lawvics/tree/main/.cursor/skills/nextjs-app-router-patterns
Command: npx skills add https://github.com/andymsun/lawvics --skill nextjs-app-router-patterns-andymsun

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides comprehensive patterns and best practices for building modern Next.js applications using the App Router, enabling efficient Server Component implementation, data fetching, and full-stack development.

Core Features & Use Cases

  • Server Components & Client Components: Understand rendering modes and when to use each.
  • Data Fetching & Caching: Implement various strategies including ISR and tag-based invalidation.
  • Server Actions & Mutations: Handle data mutations securely and with progressive enhancement.
  • Parallel & Intercepting Routes: Structure complex UIs and implement modal patterns.
  • Streaming: Improve perceived performance with Suspense and progressive loading.
  • Use Case: When starting a new Next.js project or migrating an existing one, use this Skill to ensure you are leveraging the latest App Router features for optimal performance and developer experience.

Quick Start

Use the nextjs-app-router-patterns skill to create a basic Next.js page with Server Components and Suspense for data fetching.

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 using React Server Components?

Fetch data directly inside Next.js App Router Server Components to execute securely on the server. This approach simplifies data fetching by eliminating client-side fetching boilerplate and enables automatic request memoization.

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

Use Server Components by default for static rendering and direct data fetching. Add Client Components only when you need interactivity, state, or browser APIs like event listeners, keeping your JavaScript bundle minimal.

What is the best way to handle data mutations in Next.js 14?

Handle data mutations in Next.js 14 using Server Actions. They allow you to write server-side mutation logic directly, supporting progressive enhancement and secure form submissions without creating dedicated API endpoints.

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

Use parallel routes in the App Router to render multiple pages simultaneously in named slots. Intercepting routes allow you to load contextual UI like modals by intercepting the default navigation path.

Can I use Suspense for streaming and progressive loading in Next.js?

Yes, you can wrap dynamic Server Components in React Suspense to enable streaming in Next.js. This progressively sends HTML to the client, improving perceived performance by showing fallback UI while data loads.

How does tag-based cache invalidation work for ISR in Next.js?

Tag-based invalidation in Next.js associates cached ISR data with specific tags. You call revalidateTag to purge associated cache entries on demand, ensuring users receive fresh content immediately after mutations.