wsimmonds avatar

Nextjs App Router Fundamentals

Migrating from Pages Router to App Router can be tricky, and this guide walks you through it systematically. It covers the full spectrum from understanding file conventions (layout.tsx, page.tsx, loading.tsx) to actually moving your routes and metadata over. The TypeScript guidance is strong, especially the hard rule against using `any` types since it'll break your build. I appreciate the side-by-side comparisons showing old Pages Router structure versus new App Router patterns. The migration steps are concrete: create root layout, move pages to the app directory, update navigation, clean up the old pages folder. It also covers metadata handling, nested layouts, and common routing patterns like dynamic routes and route groups.

skills.sh installs
2.2K
GitHub stars
110
last updated
Aug 21, 2026

Install

$ npx -y skills add wsimmonds/claude-nextjs-skills --skill nextjs-app-router-fundamentals --agent claude-code

Installs into .claude/skills of the current project.

Files

Next.js App Router Fundamentals

Overview

Provide comprehensive guidance for Next.js App Router (Next.js 13+), covering migration from Pages Router, file-based routing conventions, layouts, metadata handling, and modern Next.js patterns.

TypeScript: NEVER Use any Type

CRITICAL RULE: This codebase has @typescript-eslint/no-explicit-any enabled. Using any will cause build failures.

❌ WRONG:

function handleSubmit(e: any) { ... }
const data: any[] = [];

✅ CORRECT:

function handleSubmit(e: React.FormEvent<HTMLFormElement>) { ... }
const data: string[] = [];

Common Next.js Type Patterns

// Page props
function Page({ params }: { params: { slug: string } }) { ... }
function Page({ searchParams }: { searchParams: { [key: string]: string | string[] | undefined } }) { ... }

// Form events
const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => { ... }
const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => { ... }

// Server actions
async function myAction(formData: FormData) { ... }

When to Use This Skill

Sponsors

Details

Repository
github.com/wsimmonds/claude-nextjs-skills
Categories
Frontend Development, Documentation

More from wsimmonds/claude-nextjs-skills

All 9
1davila7 avatarsenior-frontenddavila7/claude-code-templatesComprehensive frontend development skill for building modern, performant web applications using ReactJS, NextJS, TypeScript, Tailwind CSS. Includes component sc2.1Kskills.sh installs
2mastra-ai avatartailwind-best-practicesmastra-ai/mastraTailwind CSS styling guidelines for Mastra Playground UI. This skill should be used when writing, reviewing, or refactoring styling code in packages/playground-2Kskills.sh installs
3davila7 avatarui-ux-pro-maxdavila7/claude-code-templatesUI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 9 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind,1.9Kskills.sh installs
4chakra-ui avatarchakra-ui-migratechakra-ui/chakra-uiMigrate Chakra UI projects from v2 to v3, covering package changes, codemods, provider setup, color mode, prop renaming, compound components, theming, recipes, 1.9Kskills.sh installs
5capawesome-team avatarionic-angularcapawesome-team/skillsGuides the agent through Angular-specific patterns for Ionic app development. Covers project structure, standalone vs NgModule architecture detection, Angular R1.8Kskills.sh installs
6starchild-ai-agent avatarui-designstarchild-ai-agent/official-skillsUI/UX quality gate and build guide for every visual output — landing pages, dashboards, web apps, portfolios, and tools. ui-design remains the main entry point.1.8Kskills.sh installs