beta

Next.js + TypeScript for Claude Code

Rules

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

2903/23/2026
markdown1 file
CLAUDE.md895 B

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