Back to Skills

nextjs-app-router

verified

Complete Next.js App Router fundamentals system (Next.js 15.5/16). PROACTIVELY activate for: (1) App directory structure and conventions, (2) Layouts and templates, (3) Loading and error boundaries, (4) Route groups and organization, (5) Parallel routes setup, (6) Metadata and SEO, (7) Server vs Client Components, (8) Navigation and View Transitions, (9) Async params pattern (Next.js 16 breaking change). Provides: File conventions, layout nesting, streaming UI, error handling, metadata templates, View Transitions API. Ensures correct App Router architecture with proper component boundaries.

View on GitHub

Marketplace

claude-plugin-marketplace

JosiahSiegel/claude-plugin-marketplace

Plugin

nextjs-master

Repository

JosiahSiegel/claude-plugin-marketplace
7stars

plugins/nextjs-master/skills/nextjs-app-router/SKILL.md

Last Verified

January 20, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/JosiahSiegel/claude-plugin-marketplace/blob/main/plugins/nextjs-master/skills/nextjs-app-router/SKILL.md -a claude-code --skill nextjs-app-router

Installation paths:

Claude
.claude/skills/nextjs-app-router/
Powered by add-skill CLI

Instructions

## Quick Reference

| Convention | File | Purpose |
|------------|------|---------|
| Page | `page.tsx` | Route UI (required for route) |
| Layout | `layout.tsx` | Shared UI (persists across navigations) |
| Loading | `loading.tsx` | Loading UI with Suspense |
| Error | `error.tsx` | Error boundary (must be 'use client') |
| Not Found | `not-found.tsx` | 404 UI |
| Template | `template.tsx` | Re-renders on navigation |

| Pattern | Syntax | Example |
|---------|--------|---------|
| Dynamic Route | `[slug]` | `/blog/[slug]/page.tsx` |
| Catch-all | `[...slug]` | `/docs/[...slug]/page.tsx` |
| Optional Catch-all | `[[...slug]]` | `/shop/[[...slug]]/page.tsx` |
| Route Group | `(name)` | `/(marketing)/about/page.tsx` |
| Parallel Route | `@slot` | `/@analytics/page.tsx` |

## When to Use This Skill

Use for **App Router fundamentals**:
- Setting up new Next.js 15 projects with App Router
- Understanding file-based routing conventions
- Creating layouts that persist across navigation
- Implementing loading states and error boundaries
- Organizing routes with groups

**Related skills:**
- For data fetching: see `nextjs-data-fetching`
- For advanced routing: see `nextjs-routing-advanced`
- For caching strategies: see `nextjs-caching`

---

# Next.js App Router Fundamentals

## Project Structure

### App Directory

```
app/
├── layout.tsx              # Root layout (required)
├── page.tsx                # Home page (/)
├── loading.tsx             # Loading UI
├── error.tsx               # Error boundary
├── not-found.tsx           # 404 page
├── global-error.tsx        # Global error boundary
├── template.tsx            # Re-renders on navigation
│
├── (marketing)/            # Route group (no URL impact)
│   ├── about/
│   │   └── page.tsx        # /about
│   └── contact/
│       └── page.tsx        # /contact
│
├── dashboard/
│   ├── layout.tsx          # Dashboard layout
│   ├── page.tsx            # /dashboard
│   ├── loading.tsx         # Dashboard loading
│   ├── @a

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
11263 chars