Back to /coding
Generator

Generate CLAUDE.md / AGENTS.md / .cursorrules

Fill in your stack and conventions on the left. Get a tailored repo instruction file on the right. Copy or download — pure client-side, your inputs never leave your browser.

# Project: my-app

Stack: Next.js 16 (App Router) + PostgreSQL + Resend, Plausible.

## Commands
- npm install
- npm run dev
- npm run typecheck   # must pass before commit
- npm run lint        # autofix on save in editor
- npm test            # vitest
- npm run build       # CI runs this on every PR

## Layout
- src/app/        Routes
- src/lib/        Pure logic, DB, external API wrappers
- src/components/ UI primitives
- src/server/     Server-only utilities

## Architecture rules
- Server Components by default; 'use client' only when interactive
- DB access only inside src/lib/db/
- Named exports only (default exports allowed in route files)
- ISO strings at API/DB boundary, Date objects internally

## Tests
- Co-located: foo.ts -> foo.test.ts
- New code in src/lib/ requires a test
- vitest only — no other test runners

## Never do this
- Don't add a new ORM, HTTP client, or test runner without ADR
- Don't introduce client-side fetch for first paint
- Don't catch errors silently — log via src/lib/log.ts and rethrow
- Don't reformat unrelated code in unrelated PRs

## Style
- tailwind for styling
- Named exports only (default exports allowed in route files)
- ISO strings at API/DB boundary; Date objects internally

## Handoffs
- Plans live in /docs/plans/ as PLAN-<feature>.md
- Implementation notes in /docs/impl/ as IMPL-<feature>.md
- Reviews as /docs/review/REVIEW-<feature>.md

What goes in these files?

AI coding tools (Claude Code, Cursor, Codex, etc.) read these files at the root of your repo to understand your codebase: stack, conventions, what NOT to do, where things live. A short, specific file is the highest-ROI thing you can add to a repo for AI-assisted work.

Read more about the patterns at /coding — including good vs bad examples and the verification rules that go with them.