nextjs-app-router-fundamentals

Migrate Next.js projects from Pages Router to App Router conventions.

Updated Nov 18, 2025
One-click install
npx skills add https://github.com/mcclowes/puzzles --skill nextjs-app-router-fundamentals
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nextjs-app-router-fundamentals
Source: https://github.com/mcclowes/puzzles/tree/main/.claude/skills/nextjs-app-router-fundamentals
Command: npx skills add https://github.com/mcclowes/puzzles --skill nextjs-app-router-fundamentals

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides fundamentals for Next.js App Router, including migration guidance from Pages Router, file-based routing conventions, layouts, and metadata handling.

Core Features & Use Cases

  • Migration guidance: Move from Pages Router to App Router with minimal friction.
  • Layout & metadata basics: Create root layouts, nested layouts, and export metadata.
  • Routing patterns: Implement dynamic routes, catch-all routes, and route groups.

Quick Start

Start a new Next.js App Router project, create a root layout.tsx, add page.tsx routes, and export metadata for SEO and accessibility.

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 a Next.js project from Pages Router to App Router?

App Router migration involves moving your route files from the pages/ directory to app/, creating layout.tsx for shared UI, and replacing page components with page.tsx files. The App Router uses file-based conventions (layout.tsx, page.tsx, route.ts) and supports dynamic routes, route groups, and server actions for modern Next.js 13+ development.

What's the difference between Pages Router and App Router in Next.js?

App Router is Next.js 13+'s file-based routing system that replaces Pages Router with a more flexible structure. It introduces layouts for nested UI, improved metadata handling via metadata exports, route groups for organization, and built-in server actions, eliminating the need for API routes in many cases.

How do I set up metadata and SEO in Next.js App Router?

Export a metadata object from layout.tsx or page.tsx files to configure SEO and accessibility. App Router metadata handles title, description, and other head tags automatically, improving search visibility and Open Graph support across your application.

Can I use dynamic and catch-all routes with App Router?

Yes. App Router supports dynamic routes using [param] syntax and catch-all routes using [...slug] syntax in folder names. Route groups with (folderName) organize routes without affecting URL structure, enabling flexible routing patterns and layout nesting.

Do I need to rewrite my entire project to use App Router?

No. Next.js supports gradual migration—Pages Router and App Router can coexist in the same project. Start by creating new features in app/ while maintaining existing pages/ routes, then incrementally migrate page by page without stopping development.

What TypeScript setup is required for App Router development?

App Router enforces strict TypeScript by default with no implicit any. Use layout.tsx and page.tsx with proper type annotations, export typed metadata objects, and define route handlers with explicit parameter types to maintain type safety across your application.