BACKEND: THE RULES FILE The file every agent reads before it does anything. Copy everything between COPY FROM HERE and COPY TO HERE, then edit it for your project. WHERE IT GOES Claude Code: save the part you copied as CLAUDE.md in your project's top folder, the root. Claude Code reads that file at the start of every session. To check it loaded, type /context in a session and look for CLAUDE.md under Memory files. Another agent or AI tool: paste it into the place for standing instructions. Tools call it the system prompt, custom instructions or project instructions. Menu names change, so go by the words on your own screen. HOW TO EDIT IT 1. Fill in every [blank in square brackets]. Delete any line that doesn't fit your project. 2. The Never section is filled in as an example. Keep the lines that fit and change the rest. 3. Write each rule so you could check it. "Never edit anything in source/" works better than "be careful with files". 4. Keep it short. Claude Code's own guide suggests under 200 lines. 5. When the agent makes the same mistake twice, add a line so it can't happen a third time. A rules file is read, not enforced. The agent can still get a rule wrong. That's why the check (check-lines.txt) and your own approval come after it. ============ COPY FROM HERE ============ # [Project name]: the rules every agent follows This project is [what it does, in one line], for [who it is for]. I'm [your name]. I approve everything before it goes out. ## Read first Before any job, read these, in this order: - This file, all of it. - The skill file for the job, if there is one: .claude/skills/[job-name]/SKILL.md - check-lines.txt: the lines that must never reach a customer. - [facts.md]: the only place prices, client names and results come from. If two files disagree, stop and ask me which one is right. ## Never - Never invent a client, a result, a quote or a testimonial. If one is needed and none is on file, write [PROOF NEEDED] and tell me. - Never edit anything in [source/]. Those files are the originals, kept as they came in. Copy what you need into a new file. - Never put a key, token or password in the code or in any file you write. Keys live in [.env], and that file is never shared or uploaded. - Never publish, post, send or deploy anything without my approval in writing. Draft it and hand it to me. - Never quote a price that isn't in [facts.md]. - Never delete a file you didn't create in this job. ## Always - Say where every number came from: the file, and the date it was checked. No source, no number. - Mark made-up sample data as EXAMPLE. - Ask me when you're unsure. A question is better than a guess. - Before you show me anything you wrote, run the check in check-lines.txt and tell me what it found. - Finish one thing before you start the next. Hand me one finished piece, not a trail of drafts. - Write in plain language, in short sentences. ## Where things live - [source/]: the originals. Read only. - [drafts/]: your work, waiting for my approval. - .claude/skills/: one skill file per job. - [facts.md]: prices, client names and results, each with where it came from. ## When you finish a job Tell me in three lines: what you made, where it is, and what the check found. ============ COPY TO HERE ============