Add to Claude Code
308 addsInstall this CLAUDE.md template. Name: Next.js Project Template Save to: ./CLAUDE.md in the current project --- # CLAUDE.md — Next.js 15 App Router ## Project overview <!-- One-sentence description of what this app does --> ## Tech stack - **Framework**: Next.js 15 (App Router) - **Language**: TypeScript (strict mode) - **Styling**: Tailwind CSS v4 - **Database**: PostgreSQL via Prisma ORM - **Auth**: NextAuth v5 (next-auth@beta) - **Package manager**: npm ## Development commands ```bash npm run dev # start dev server on :3000 npm run build # production build npm run lint # ESLint npx prisma studio # open Prisma Studio npx prisma db push # push schema changes (dev only) npx prisma migrate dev --name <name> # create a migration ``` ## Project structure ``` app/ # Next.js App Router pages & layouts (auth)/ # auth-gated routes api/ # API route handlers components/ # shared React components lib/ db.ts # Prisma singleton utils.ts # shared helpers queries.ts # all DB queries prisma/ schema.prisma # data model seed.ts # seed script auth.ts # NextAuth root config middleware.ts # route protection ``` ## Coding conventions - Use **server components** by default; add `"use client"` only when needed - All DB access must go through `lib/queries.ts` — no raw Prisma in components - API routes live in `app/api/` and return `NextResponse.json()` - Environment variables: access via `process.env.VAR_NAME` (never import dotenv in app code) - Use the `cn()` helper from `lib/utils.ts` for conditional Tailwind classes - Prefer named exports; default export only for page/layout components ## Environment variables ``` DATABASE_URL= NEXTAUTH_SECRET= GITHUB_ID= GITHUB_SECRET= NEXTAUTH_URL=http://localhost:3000 ``` ## Common pitfalls - Do NOT use `export const dynamic = "force-dynamic"` unless you've confirmed the route actually needs it - Server Actions must be in files with `"use server"` at the top or inline in server components - Prisma client must be imported from `@/lib/db`, not instantiated directly - When adding a new Prisma model, run `prisma migrate dev` — never edit the DB directly
Paste into Claude Code to add this template. Back up any existing CLAUDE.md first.
How to add
Full guide →Click Add, then paste into Claude Code. Claude will save it as your project's CLAUDE.md.
Target: CLAUDE.md