nextjs-app-router
Installation
SKILL.md
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 |