beta

Next.js + TypeScript for Claude Code

Rules

Production-ready CLAUDE.md for Next.js App Router projects with TypeScript, Tailwind, and shadcn/ui.

3003/23/2026

Version 1

Published

Initial version

Created 3/23/2026

Initial version — no previous version to compare

CLAUDE.md
# CLAUDE.md

## Project
Next.js 15 App Router with TypeScript, Tailwind CSS v4, and shadcn/ui.

## Commands
- `pnpm dev` — start dev server
- `pnpm build` — production build
- `pnpm lint` — run ESLint
- `pnpm test` — run tests

## Code Style
- Use functional components with TypeScript
- Prefer server components; add "use client" only when needed
- Use `cn()` from @/lib/utils for conditional classes
- Use shadcn/ui components from @/components/ui/
- Follow the @ path alias convention

## File Structure
- app/ — App Router pages and layouts
- components/ — React components
- lib/ — Utilities, database, auth
- hooks/ — Custom React hooks

## Git
- Conventional commits: feat:, fix:, chore:, docs:
- Always run lint before pushing
- Keep PRs focused and small

## Testing
- Use Vitest for unit tests
- Use Playwright for E2E tests
- Test files live next to the code they test