nextjs-app-router-fundamentals

Guide migration from Pages Router to Next.js App Router with layouts and routing.

Updated Mar 11, 2026
One-click install
npx skills add https://github.com/sckroll/nextjs-mariadb-sample --skill nextjs-app-router-fundamentals-sckroll
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nextjs-app-router-fundamentals
Source: https://github.com/sckroll/nextjs-mariadb-sample/tree/main/.agents/skills/nextjs-app-router-fundamentals
Command: npx skills add https://github.com/sckroll/nextjs-mariadb-sample --skill nextjs-app-router-fundamentals-sckroll

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill provides comprehensive guidance for migrating to and developing with the Next.js App Router, simplifying complex routing, layout management, and data fetching patterns.

Core Features & Use Cases

  • App Router Migration: Guides users from the Pages Router to the App Router.
  • Routing & Layouts: Explains file conventions, nested layouts, and dynamic routing.
  • Data Fetching: Covers Server Components, Client Components, and static generation.
  • Use Case: A developer needs to refactor an existing Next.js application from the Pages Router to the App Router, ensuring all routes, layouts, and data fetching mechanisms are correctly implemented.

Quick Start

Use this skill to understand how to create a new layout file in the app directory.

Frequently Asked Questions about nextjs-app-router-fundamentals

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

FAQPage Schema
How do I migrate my Next.js application from the Pages Router to the App Router?

Next.js App Router uses a file-based routing convention where you define routes by creating folders and special files like page.tsx and layout.tsx inside the app directory. This structure automatically handles nested routing and persistent layouts across page navigations.

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

In the Next.js App Router, components are Server Components by default for performance. You must add the 'use client' directive to files that require client-side interactivity or state, separating data fetching from interactive UI elements.

How do I generate static pages and dynamic metadata in the Next.js App Router?

You generate static pages in the Next.js App Router using the generateStaticParams function for dynamic routes. For metadata, you can export a static metadata object or dynamically generate metadata using the generateMetadata function.

Do I need TypeScript to use the Next.js App Router?

TypeScript is not strictly required to use the Next.js App Router, but it is highly recommended. The App Router conventions integrate smoothly with TypeScript, providing strong typing for your layouts, routes, and generated metadata.