Next.js Template
A minimal CLAUDE.md template for Next.js 15 projects using App Router.
Template (27 lines)
Section titled “Template (27 lines)”# Project Context
## What This Is[One sentence describing your project]
## Tech StackNext.js 15 + TypeScript + Tailwind CSS + Prisma
## Commands- `npm run dev` - Start dev server- `npm test` - Run tests- `npm run lint` - ESLint + Prettier- `npm run build` - Production build- `npx prisma db push` - Sync schema
## Architecture- `/app/` - App Router pages and layouts- `/app/api/` - API route handlers- `/components/` - React components- `/lib/` - Utilities, server actions, db client- `/prisma/` - Database schema
## Gotchas- [Add project-specific gotchas here]- Example: Use Server Components by default- Example: Add 'use client' only when needed for interactivity
## Code Style- Server Components by default- Server Actions for mutations (in `/lib/actions/`)- Named exports, not default exports- Tailwind for styling- Copy the template above
- Save as
CLAUDE.mdorAGENTS.mdin your project root - Review and update the Tech Stack to match your project
- Replace
[One sentence describing your project]with your description - Add your project-specific gotchas
App Router Gotchas
Section titled “App Router Gotchas”Common issues with Next.js App Router:
## Gotchas- Server Components by default - add 'use client' only for interactivity- Server Actions go in `/lib/actions/`, not inline- Use `next/navigation` not `next/router`- Dynamic routes: `app/posts/[id]/page.tsx`- Layouts persist across navigation - don't put ephemeral state there