nextjs-app-router-fundamentals

Guide Next.js 13+ App Router migration from Pages Router with TypeScript.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides essential guidance for effectively using the Next.js App Router, simplifying the transition from the Pages Router and enabling modern Next.js development practices.

Core Features & Use Cases

  • App Router Migration: Guides users migrating from the Next.js Pages Router to the App Router.
  • Routing & Layouts: Explains file-based routing conventions, nested layouts, and special file conventions (page.tsx, layout.tsx, loading.tsx, etc.).
  • Metadata Handling: Demonstrates static and dynamic metadata generation for SEO.
  • Server/Client Components: Differentiates and explains the usage of Server Components (default) and Client Components ('use client').
  • Data Fetching: Covers patterns for data fetching in Server Components, including parallel fetching and static generation with generateStaticParams.
  • Use Case: A developer needs to refactor an existing Next.js application from the Pages Router to the App Router. This Skill will guide them through the necessary steps, including setting up the root layout, migrating pages, and updating navigation.

Quick Start

Use the nextjs-app-router-fundamentals skill to understand how to create a new route segment with a nested layout 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 from Next.js Pages Router to App Router?

Migrating from Next.js Pages Router to App Router involves setting up the root layout, migrating existing pages into the app directory, and updating navigation conventions to utilize modern Next.js development practices.

How does file-based routing work in Next.js App Router?

File-based routing in Next.js App Router uses special file conventions like page.tsx, layout.tsx, and loading.tsx within the app directory. This structure enables nested layouts and automatically creates route segments based on your folder hierarchy.

When should I use Server Components vs Client Components in Next.js?

Server Components are the default in Next.js App Router for data fetching and static generation, while Client Components require the 'use client' directive for interactive client-side logic. Differentiating them ensures optimal data fetching patterns and performance.

What is the best way to generate metadata for SEO in Next.js App Router?

The best way to generate metadata for SEO in Next.js App Router is by using the built-in metadata API. It supports both static metadata objects and dynamic metadata generation functions to optimize search engine visibility.

How do I fetch data and generate static pages in Next.js App Router?

Data fetching in Next.js App Router occurs directly in Server Components, supporting patterns like parallel fetching. To generate static pages, you use the generateStaticParams function to define dynamic route segments at build time.

Does Next.js App Router work with TypeScript and what are common pitfalls?

Next.js App Router fully supports TypeScript for type-safe routing and component props. Common pitfalls include improper usage of Server vs Client Components and incorrect data fetching patterns, which can be avoided by following established TypeScript best practices.