nextjs-app-router

Implements Next.js 13+ App Router patterns with Server Components, layouts, and streaming.

3|Updated Aug 26, 2026
One-click install
npx skills add https://github.com/Fabric-Pro/fabric-oss --skill nextjs-app-router-fabric-pro
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: nextjs-app-router
Source: https://github.com/Fabric-Pro/fabric-oss/tree/main/.cursor/skills/nextjs-app-router
Command: npx skills add https://github.com/Fabric-Pro/fabric-oss --skill nextjs-app-router-fabric-pro

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Building modern React applications with Next.js 13+ requires understanding the App Router paradigm shift: Server Components by default, file-based routing, streaming with Suspense, and new data fetching semantics. This Skill provides concrete patterns and code examples so you avoid common mistakes like overusing Client Components or mishandling server-side data fetching. ## Core Features & Use Cases - Server and Client Component Patterns: Guidance on when to use 'use client', how to compose server and client components, and how to minimize client-side JavaScript. - Routing and Layouts: File-based routing with dynamic segments, nested layouts, route groups, parallel routes, and route handlers for API endpoints. - Data Fetching and Streaming: Server-side fetching with cache controls and revalidation, plus progressive rendering using Suspense boundaries. - Use Case: When building a dashboard page that needs a persistent sidebar layout, server-fetched user data, and an interactive counter widget, this Skill shows exactly how to structure the app directory and split server/client responsibilities. ## Quick Start Ask the AI to scaffold a Next.js App Router page with a nested layout, server-side data fetching, and a Suspense-wrapped slow component.

Frequently Asked Questions about nextjs-app-router

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I use Server Components in Next.js App Router?▼

Server Components are the default in the App Router, so any component without a 'use client' directive renders on the server. You can fetch data directly with async/await inside them, and compose them with Client Components passed as children for interactivity.

When should I add 'use client' to a Next.js component?▼

Add 'use client' only when a component needs interactivity such as useState, event handlers, or browser APIs. Keeping Client Components small and at the leaves of the tree reduces the client JavaScript bundle.

How does data fetching caching work in Next.js App Router?▼

The fetch API in Server Components caches by default with 'force-cache'. Use next: { revalidate: seconds } for time-based revalidation or cache: 'no-store' for always-fresh data. Database queries via an ORM like Prisma run directly in async components.

How do I create API routes in the Next.js app directory?▼

Create a route.ts file inside app/api and export async functions named after HTTP methods like GET or POST. Return responses with NextResponse.json, and access dynamic segments through the params argument.

Why is my Next.js page not streaming with Suspense?▼

Streaming requires the slow async component to be wrapped in a Suspense boundary with a fallback. If the await happens in the parent page component itself, the entire page blocks until the data resolves instead of streaming progressively.