nextjs-app-router-patterns

Provide Next.js 14+ App Router patterns for Server Components, Server Actions, and streaming.

1|Updated Feb 19, 2026
One-click install
npx skills add https://github.com/yusufcmg/Antigravity-Agents-Workflows --skill nextjs-app-router-patterns-yusufcmg
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nextjs-app-router-patterns
Source: https://github.com/yusufcmg/Antigravity-Agents-Workflows/tree/main/.agent/skills/frontend/nextjs-app-router-patterns
Command: npx skills add https://github.com/yusufcmg/Antigravity-Agents-Workflows --skill nextjs-app-router-patterns-yusufcmg

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, full-stack applications using Next.js 14+ with the App Router, enabling efficient development of server-rendered, client-interactive, and API-driven features.

Core Features & Use Cases

  • Server Components: Leverage Server Components for data fetching and server-side logic.
  • Client Components: Implement interactivity with 'use client' directives.
  • Server Actions: Handle data mutations securely and progressively enhance forms.
  • Routing: Utilize parallel and intercepting routes for complex UI patterns like modals.
  • Streaming: Improve perceived performance with Suspense and streaming data.
  • SEO: Optimize metadata generation for search engines.
  • Caching: Implement effective data caching strategies.

Quick Start

Use the nextjs-app-router-patterns skill to generate a basic Next.js App Router page with server-side data fetching and client-side interactivity.

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 use React Server Components for data fetching in Next.js App Router?

React Server Components allow direct data fetching in Next.js App Router by executing server-side logic asynchronously. This approach eliminates client-side fetching boilerplate and securely retrieves data before rendering.

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

Server Actions provide the best way to handle data mutations in Next.js 14 by securely processing form submissions on the server. This technique progressively enhances forms without requiring separate API endpoints.

How do parallel and intercepting routes work for complex UI patterns?

Parallel and intercepting routes in Next.js work by rendering multiple pages simultaneously and intercepting navigation events. This mechanism enables advanced UI patterns like dynamic modals while preserving the original route context.

Can I improve perceived performance with Suspense and streaming in Next.js?

You can improve perceived performance in Next.js by wrapping slow components in Suspense boundaries to enable streaming. This immediately sends static HTML while streaming deferred server-rendered data as it resolves.

Do I need 'use client' directives for all interactive components in Next.js?

You need the 'use client' directive only for Next.js components requiring browser interactivity like state or event handlers. Server Components remain the default for static rendering and efficient server-side data fetching.

How to optimize metadata generation for SEO in Next.js App Router?

To optimize metadata generation for SEO in Next.js App Router, export a static metadata object or a dynamic generateMetadata function from your route files. This natively injects search engine tags directly into the server-rendered HTML.