CLAUDE.md / AGENTS.md — AI Coding Agent Playbook

Copy this template into the root of your repository as CLAUDE.md or AGENTS.md to give coding agents clear architecture boundaries, commands, and safety rails.


1. Repository Overview


2. Hard Operational Rules

[!CAUTION] Agents MUST NEVER run production deploys, mutate production databases, print secret environment variables, or force-push to main.

  1. Never edit generated files (packages/db/migrations/meta/*, dist/*, *.lock unless installing a requested dependency).
  2. Always run targeted tests before reporting a task complete.
  3. Keep diffs minimal: Do not reformat unrelated files or rename public exports without explicit approval.
  4. Ask before destructive actions: Dropping tables, deleting migrations, or changing auth middleware requires human sign-off.

3. Standard Agent Workflow

[Diagram]

4. Essential Commands

Task Command Notes
Install dependencies pnpm install Uses workspace lockfile
Dev server (all apps) pnpm dev Web :5173, API :8080
Typecheck pnpm typecheck Must pass with zero errors
Unit tests pnpm test Runs Vitest across workspaces
Single test file pnpm vitest run path/to/file.test.ts Preferred during iteration
Lint & format check pnpm lint Biome / ESLint
DB migration generate pnpm --filter @app/db drizzle-kit generate Review SQL before committing

5. Code Conventions

TypeScript & Modules

Error Handling

Testing Expectations


6. Pull Request & Handoff Format

When finishing a task, summarize: