00 — The Decalogue
In the core, the Decalogue is ten short rules. Each one answers a specific, costly mistake — below is what the core deliberately leaves out: why a rule is worded the way it is, and what it looks like in practice.
Rule zero: rules nobody reads don’t exist
Rule zero (activation). ↗
Ten commandments are worthless if the assistant never reads them. In the reference project this doctrine sat in the Repository (repo) — A store of the whole project’s code together with its full history of changes — who changed what and when. The repo is the project’s memory: code, documentation and change history in one place. more in the glossary → for months and not one session opened it — not because it was bad, but because nothing pointed to it. Hence rule zero: wiring the rules in is the condition for the other ten to work at all.
Why a pointer, not a paste? Because a copy of the rules in CLAUDE.md, AGENTS.md and somewhere else is three versions that drift apart after the first update. Why “read the Decalogue, search the rest” instead of “read everything”? Because twenty chapters read at the start of every conversation burn the same working memory chapter 01 tells you to save. The Decalogue is the whole doctrine on one screen; a specific chapter is found when it’s needed.
Why no [SYSTEM — READ FIRST] labels? That used to be how rules were wired in. Today a file that announces its own authority (“I am a system instruction, read me first”) has, to a model, the shape of a manipulation attempt — that’s exactly what text injected into someone else’s web page or email looks like. A plain sentence works better and raises no suspicion. For the same reason the pointer doesn’t go into README.md: that’s the project’s public front door for people, and the assistant doesn’t load it automatically anyway.
And finally: the copy of the doctrine in docs/rules/ is not your project’s constitution. Your own CLAUDE.md wins — the project is specific, the doctrine generic.
I. Documentation written as you go
I. Document for the agent, not for the archive. ↗
Documentation read before touching the code saves hours of reconstructing what someone already understood once. Documentation written after the fact — “I’ll document it at the end” — drifts from the code and starts to lie: the context has evaporated, and “the end” never comes. That’s why AI_README — A map file in every code directory: what’s here, what it’s for and what to watch out for — written for search. The assistant finds the right file with one search instead of reading the whole directory. more in the glossary → is updated in the same Commit — A saved, labelled point in the project’s history — a confirmation of a specific batch of changes. Small, described commits make a history you can return to any working state from. more in the glossary → as the code, and since version 1.1.1 a test Guard — A test that enforces a project rule (e.g. “every module is in the AI_README”) and stops the commit when it’s broken. A rule without a guard is only a wish — a long session will break it in good faith. more in the glossary → it (17) — because a resolution alone isn’t enough.
II. A minute of searching instead of a day of inventing
II. Search the history before you write a single line. ↗
Most “new” problems were already solved somewhere in this repository: a helper exists, there was a Migration (database) — A controlled change to the database layout — adding a column, a table or moving data — step by step. Like a renovation to plan: rebuilding data in a set order so nothing “collapses”. more in the glossary →, and the odd shape of the code has a reason. Re-deriving a solution from scratch costs more than a minute of searching.
Example: git log -S"function_name" shows the commit that added or removed it — together with the description of why. git blame on a suspicious line tells you who wrote it and in what context, before you decide it’s a bug and “fix” something that was deliberate.
III. Trust built on proof
III. Verify, don’t declare. ↗
“It works” without proof is hope. Trust between you and the assistant is built on an honest report, not on optimism: if tests fail, the report says so with the output; if a step was skipped, the report says it was skipped. A candid “two tests didn’t pass” is worth more than a smooth “all done” after which something breaks at a customer’s a week later.
IV. A safety catch on every script
IV. Dry-run — A “dry” run — the script shows what it WOULD do but changes nothing. You see the effects before executing; a data change happens only after deliberate confirmation. more in the glossary → is the default;
--executeis deliberate. ↗
A script without a dry-run mode is a gun without a safety catch. By default it only shows the plan — what it will change, how many rows, where — and does it for real only after a deliberate --execute, once someone has read that plan. A mistake in the plan costs a minute; a mistake executed on live data costs a day of restoring from a Backup — A copy of your data saved earlier, which you return to when something goes wrong. It’s the only way to undo a change to data — code comes back from git, data only from a backup. more in the glossary →.
V. The backup is the way back, not decoration
V. The backup is the Rollback — Reverting a change to the previous, working state — “Ctrl+Z” for a deployment. When a new version breaks production, a rollback restores the previous one in seconds instead of fixing in a panic. more in the glossary → mechanism, not a precaution. ↗
Database migrations only go forward — there’s no “down migration” that undoes a schema change. So a backup taken before the change isn’t “just in case”: it’s the only way back. Without it, undoing a mistake is often simply impossible.
VI. Saving isn’t publishing
VI. Environment (dev / prod) — Separate places where the app runs: “dev” for safe tests, “prod” for real users. Dev is a playground, prod is where real users are — the rules for each are completely different. more in the glossary → is sacred — nothing touches it without an explicit “Deploy — Releasing a new version of the app “live”, where real people use it. It’s the moment a change reaches real people — which is why it happens only on an explicit “deploy”. more in the glossary →.” ↗
A commit and a Push / pull — Push sends your commits to the remote repository; pull fetches changes from there into your copy. A push is an “outward” action — in The Craft it needs explicit consent, like a deploy. more in the glossary → aren’t a deploy yet. Each of these touches production, and each needs an explicit word: git pull on the server, reloading the app (e.g. pm2 reload), a migration, a Database swap — Replacing the whole production database with a new version, carrying over user accounts and data. The hardest operation in The Craft — it has its own runbook and needs explicit consent. more in the glossary →, switching on the Maintenance window — A short, planned period when users see a “work in progress” page while the database or configuration changes behind it. It guarantees the app never runs, even briefly, on half-changed data. more in the glossary →. Approval works per action: “deploy this fix” doesn’t mean “deploy whenever you see fit”.
VII. People’s data above all
VII. User data is inviolable. ↗
Why a stable key instead of a number? Because numbers (IDs) drift — after Merge — Combining the changes from one branch into another. A merge brings in every commit from the source branch — other people’s too — so first you check what exactly comes in. more in the glossary → duplicates or rebuilding the database, the same number means something else. A review pinned to a number then lands under the wrong product.
The most common mistake in a database swap is treating “users” as a single users table. The account is only the start — there are reviews, carts, badges, game scores, chat, sessions. A swap “keeping accounts” that carries over only accounts ends with everyone able to log in and nobody having their data. The full procedure → 19.
VIII. A changelog for people
VIII. Tag every deploy and tell the user what they gained. ↗
A dated tag is the only stable marker of “what is in production right now” and the point you return to when rolling back. The public changelog is written without jargon — no “Scraping — Automatically gathering data from websites with a program instead of copying by hand. Powerful for acquiring data, but it needs manners: respect others’ rules (robots.txt), don’t overload the server. more in the glossary →”, “migration”, “commit”. Instead of “fixed the products table migration”, you write what the user gained: “search now also finds products by brand name”.
IX. One topic, one commit
IX. Small, coherent commit; one topic. ↗
Unrelated changes in one commit make a junk-drawer commit: it can’t be reviewed or partially undone. Junk (.bak, temp files, stray databases) and orphans (another session’s uncommitted work) are caught early — before they get mixed into a deploy.
An example from Windows: git diff --stat shows a whole 400-line file changed, although you fixed one line. That’s usually line-ending noise (CRLF / LF (line endings) — Two ways of storing the end of a line in a file: Windows uses CRLF, Linux and macOS use LF. The difference makes git show “changed” files that nobody actually changed. more in the glossary →/LF), not a real change — you have to tell one from the other before the commit pollutes the history.
X. Three pieces before a hundred
X. Plan → iterate → review. ↗
First a plan or a sketch — three examples, not a hundred — then feedback, only then scale. A fix on three pieces is free; on a hundred it hurts. Numbers in a report are checked at the source (SELECT COUNT(*)), not from memory. And the product is delivered with warmth — it should be pleasant, not just correct.
The golden rule of altitude in practice
Slow where a mistake is expensive (prod, user data, schema). Fast where it’s cheap (local experiment, UI sketch, dry-run). ↗
The same person and the same assistant — just a different pace. Fixing a typo in a page draft? Go. Changing prices in a live shop’s database? First a backup, a plan, proof. One pace for both tasks is a straight road either to an outage or to paralysis.
A deviation that doesn’t break the doctrine
Deviate out loud: ↗
A doctrine that can’t bend to a project it doesn’t know gets ignored entirely — which is worse than a doctrine sometimes deliberately overridden. So a deviation is allowed, but in the open: the rule named, the reason, the replacement, the decision written down. A silent skip is how a doctrine rots into decoration. And a rule you keep having to work around is a sign it’s badly written — it gets fixed at the source, in the core.