nextjs-app-router-patterns

Implements Next.js App Router patterns with Server Components, data fetching, and route structure.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Frontend teams working with Next.js App Router often struggle with deciding where components should render, how to structure routes, and how to handle data loading without leaking sensitive logic to the client. This Skill provides repo-aligned patterns and review heuristics to keep App Router code consistent, secure, and maintainable. ## Core Features & Use Cases - Server-first architecture guidance: Enforces Server Components by default, with Client Components scoped only to genuine interactivity. - Data loading and mutation patterns: Covers server-side fetching, caching, revalidation, Server Actions, and loading/error/empty states. - Route and feature structure: Guides layouts, parallel routes, intercepting routes, and domain-driven segment organization. - Use Case: When building a new dashboard screen, activate this Skill to structure the route with server-side data fetching, isolated Client Components for interactive widgets, and proper loading and error boundaries. ## Quick Start Ask the assistant to review or scaffold a Next.js App Router page following the repo's Server Components and data-loading patterns.

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 App Router page with Server Components?

Fetch data in Server Components by default and keep pages as async server functions. Add 'use client' only to small components that need interactivity, local state, or browser APIs, keeping them close to the point of interaction.

When should I use Client Components in Next.js App Router?

Use Client Components only for forms, interactive widgets, local state, or browser APIs. Avoid marking entire pages with 'use client' when only a fragment needs interactivity, since that ships unnecessary JavaScript to the browser.

How do Server Actions work for mutations in Next.js?

Server Actions are async functions marked with 'use server' that run on the server for mutations like form submissions. They can call revalidateTag or revalidatePath to refresh cached data and return results or errors to the calling Client Component.

Does Next.js App Router support streaming with Suspense?

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

What are common Next.js App Router anti-patterns to avoid?

Avoid applying Pages Router habits, moving whole screens to the client, mixing domain logic with UI in giant files, and skipping loading or error states. Also avoid serializing sensitive logic or tokens to the client.