Project rules file (AGENTS.md / CLAUDE.md / Cursor rules)
A starter rules file so your agent follows the same conventions every session.
Create a project rules file for this repo. Inspect package.json, the folder structure, and config files first, then write it in this structure: # Project overview - What the app does (2 lines), stack and versions actually in package.json. # Commands - install, dev, build, test, lint — exact commands. # Conventions - Folder layout, naming, styling approach, state management, data fetching pattern. # Rules for the AI - Make the smallest change that solves the task. Don't refactor unrelated code. - Never put secrets in client code; server-only env vars have no public prefix. - Run the build and tests before saying a task is done. - Ask before adding a new dependency. - When an error repeats twice, stop and diagnose instead of patching again. # Known gotchas - [leave placeholders for me to fill] Keep it under 80 lines. Save it as AGENTS.md (I'll copy it to CLAUDE.md or a Cursor rule if my tool needs that name).
Tips
- Codex reads AGENTS.md; Claude Code reads CLAUDE.md; Cursor supports project rules in .cursor/rules. Check your tool's docs for the current file names.
- Update the gotchas section every time you fix a weird bug.
Works with: Cursor, Claude Code, Codex, Replit, Lovable, Bolt, v0. Last reviewed 2026-11-13.