Home › Next.js › Next.js CLAUDE.md

Next.js CLAUDE.md

A CLAUDE.md for Claude Code working in a Next.js + Prisma + Tailwind codebase.

Claude Code (CLAUDE.md)Next.js

How to use

Save this as CLAUDE.md in your repository root, commit it, and your agent will pick it up automatically. Edit the commands to match your project.

CLAUDE.mdDownload  
# 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.

Related rules

AWS CDK (TypeScript) CLAUDE.md

CLAUDE.md for AWS CDK v2 apps in TypeScript: constructs, least-privilege grants, snapshot tests, and safe deploys.

Claude Code (CLAUDE.md)AWS CDK

Bun runtime CLAUDE.md

CLAUDE.md for TypeScript projects on Bun 1.2+: bun test, Bun.serve, built-in SQLite/Postgres, and bundling.

Claude Code (CLAUDE.md)Bun

Claude Agent SDK CLAUDE.md

CLAUDE.md for building agents with the Claude Agent SDK (Python/TypeScript): options, tools, permissions, and hooks.

Claude Code (CLAUDE.md)LLM apps & agents

Code reviewer subagent (Claude Code)

A Claude Code subagent definition that reviews the current diff for bugs, security, and tests, reporting by severity.

Claude Code (CLAUDE.md)Agent workflows

Get new rules weekly

One email a week: fresh rule files, agent tips, and what's changing in Cursor, Claude Code and Copilot. Free, unsubscribe anytime.

Opens the Rulestack Newsletter on beehiiv in a new tab. Or subscribe directly on beehiiv.