# CLAUDE.md

## Commands
- Dev: `pnpm dev` · Build: `pnpm build` · Lint: `pnpm lint` · Types: `pnpm typecheck`
- Tests: `pnpm test` (Vitest), single file: `pnpm test path/to/file.test.ts`
- DB: `pnpm prisma migrate dev --name <change>`; never edit generated migrations by hand.

## Code map
- `app/` routes (App Router) · `components/ui/` primitives · `lib/` shared logic · `prisma/schema.prisma` data model

## Rules
- Server Components by default; client components only when interactive.
- All DB access lives in `lib/db/*`. Pages never import `@prisma/client` directly.
- Validate external input with zod at the boundary.
- Prefer editing existing files over creating new ones. Don't add dependencies without saying why.

## Workflow
1. Read the relevant files before editing.
2. Make the smallest change that solves the task.
3. Run typecheck + tests for touched areas, then summarize what changed and why.

## Don't
- Don't commit `.env*`. Don't run `prisma migrate reset`. Don't disable lint rules to pass CI.
