nextjs-app-router-fundamentals

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

109|21|Updated Oct 23, 2025
One-click install
npx skills add https://github.com/wsimmonds/claude-nextjs-skills --skill nextjs-app-router-fundamentals-wsimmonds
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nextjs-app-router-fundamentals
Source: https://github.com/wsimmonds/claude-nextjs-skills/tree/main/nextjs-app-router-fundamentals
Command: npx skills add https://github.com/wsimmonds/claude-nextjs-skills --skill nextjs-app-router-fundamentals-wsimmonds

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a solid foundation for Next.js App Router, including migration, layout, routing, metadata, and common patterns like route groups and parallel routes.

Core Features & Use Cases

  • Migration from Pages Router: Convert pages to app structure
  • Layout, Metadata: Root layout, metadata exports
  • Routing Patterns: dynamic routes, catch-all, route groups

Quick Start

Initialize a Next.js app, create root layout.tsx with metadata export, and create a simple page.tsx.

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

App Router migration converts your pages directory structure to the app directory with layout.tsx and page.tsx files. Move existing pages, update imports, and configure root layout with metadata exports. The migration enforces Next.js 13+ conventions including proper file placement and TypeScript typing.

What's the correct way to structure layouts and metadata in Next.js App Router?

Create a root layout.tsx at app/layout.tsx that wraps your entire application and exports metadata configuration. Nested layouts apply to specific route segments. Metadata exports replace next/head, defining title, description, and Open Graph tags at the layout or page level.

How do I set up dynamic routes and catch-all routes in App Router?

Dynamic routes use bracket syntax: app/posts/[id]/page.tsx captures individual posts. Catch-all routes use app/docs/[[...slug]]/page.tsx to match multiple segments. App Router handles nested routes automatically based on folder structure and applies route group patterns with parentheses for logical organization.

Can I use server actions and TypeScript best practices with App Router?

Yes. App Router is server-first by default, supporting server actions for mutations and data fetching. TypeScript best practices include strict typing for route parameters, metadata exports, and layout props. The Skill enforces proper conventions for type safety across your routing structure.

What are the key differences between Pages Router and App Router routing patterns?

App Router replaces file-based routing with a directory structure using layout.tsx and page.tsx files. It supports nested layouts, parallel routes, and route groups for complex UIs. Metadata and server actions are native; Pages Router required separate configuration and the next/head component.

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

No. Next.js supports both routers simultaneously during migration. You can incrementally move pages from pages/ to app/ directory while keeping existing Pages Router pages functional. This allows gradual adoption of App Router conventions without full project rewrites.