nextjs-app-router-fundamentals
Guide for working with Next.js App Router (Next.js 13+). Use when migrating from Pages Router to App Router, creating layouts, implementing routing, handling metadata, or building Next.js 13+ applications. Activates for App Router migration, layout creation, routing patterns, or Next.js 13+ development tasks.
Security Assessment
About nextjs-app-router-fundamentals
The `nextjs-app-router-fundamentals` skill provides comprehensive guidance for developers working with Next.js 13+ and its modern App Router system. It addresses the transition from the legacy Pages Router to the App Router, covering essential topics such as file-based routing, nested layouts, metadata handling, and routing conventions. By using this skill, developers can avoid common pitfalls and streamline the migration process, ensuring their applications adhere to the latest Next.js best practices. It also emphasizes strict TypeScript usage, enforcing type safety to prevent build failures due to the use of `any` types.
This skill equips developers with detailed insights into Next.js App Router features, including layout creation, page organization, error handling, loading states, and API route definitions. It highlights the differences between legacy Pages Router and modern App Router structures, explains special files such as `layout.tsx`, `page.tsx`, `route.ts`, and demonstrates common TypeScript patterns for handling page props, form events, and server actions. It also covers colocation principles, ensuring that only specific files create public routes while other supporting files remain non-routable.
The skill is particularly useful for developers migrating existing applications to Next.js 13+, building new projects from scratch, or implementing advanced routing patterns like route groups, parallel routes, and intercepting routes. Target users include front-end developers familiar with React and TypeScript who want to adopt modern Next.js patterns efficiently, maintain scalable code structures, and optimize SEO and metadata handling within their applications.
FAQ
When should I use the nextjs-app-router-fundamentals skill?
Use this skill when migrating from Pages Router to App Router, creating new Next.js 13+ applications, implementing layouts and nested routing, handling metadata, or adopting App Router routing conventions.
Is this skill compatible with Next.js versions earlier than 13?
No, this skill is specifically designed for Next.js 13 and later, as it focuses on the App Router which is not available in earlier versions.
What are the TypeScript requirements when using this skill?
This skill enforces strict TypeScript usage with `@typescript-eslint/no-explicit-any` enabled. Using `any` will cause build failures, so proper type definitions for page props, form events, and server actions are required.
Can I colocate components and utilities within the app directory?
Yes, components, tests, and utility files can be colocated within the `app/` directory. However, only `page.tsx` and `route.ts` files create public routes; other files remain non-routable.
Does this skill cover error and loading states?
Yes, it explains special files like `error.tsx` for error boundaries and `loading.tsx` for React Suspense loading states within the App Router.
Install nextjs-app-router-fundamentals
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
wsimmonds/claude-nextjs-skills