Rzemiosło · The Craft
What is The CraftLevelsGet startedChapters Search Download PLEN
Level 1 · Business ~5 min read

In one sentence: Ten commandments and seven deadly sins — the core of the whole doctrine in one place.

This chapter in plain terms

This chapter is the heart of the whole doctrine — ten sentences, each a habit that 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 → against one specific, costly mistake. You don’t need to know the other chapters to start keeping them; the rest is simply the “how” to these ten “whats”.

The most important is the last sentence — the golden rule of altitude: slow down where a mistake is costly, speed up where it’s cheap. Fixing a typo in a page draft? Go. Changing prices in a live shop’s database? First 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 →, a plan, proof. Setting the same pace for both is a straight road to an outage.

There’s also the “rule zero”: rules the assistant never reads are dead. That’s why you pin a short, plain-sentence pointer at the top of CLAUDE.md and AGENTS.md — a pointer to the rules, not a copy of them, with no [SYSTEM]-style labels (to today’s models they look like a manipulation attempt) and not in the public README.md — so every new conversation starts with these rules, not from scratch. (You read the Decalogue itself in full; the rest of the chapters you pick via the topic Index (database) — A lookup in the database that makes searching instant instead of scanning everything in order. The first move for slow queries — like an index at the back of a book instead of reading 400 pages. more in the glossary →, so as not to burn context.)

The doctrine is a default, not a cage. A rule doesn’t fit your project? You may deviate — but out loud: name the rule, say why it doesn’t fit here, propose what you’ll do instead, and write it down. A silent skip isn’t a deviation, it’s a sin (that’s how doctrine rots into decoration). But there’s a floor that doesn’t move: an honest report, a backup before a data/schema change, 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 →” before 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 →, and untouchable user data.

Example of a sin: “works on my machine” without showing the result is sin number one (inflated optimism) — it breaks the commandment “verify, don’t declare”.

Read more: Git — why version control (the foundation of several commandments) · project memory/rules in Claude Code.

00 — Decalogue

The core. If you read one file from this set, read this one. Each commandment is expanded in a later chapter. These are rules the project must follow, written tersely on purpose — explanations, examples and stories live on the website: thecraft.jakub.solutions.

Rule zero (activation). See a docs/rules/ package (The Craft) in a project? Treat it as the overriding doctrine for running that project. Read this file, then grep -i <topic> over 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 → and read only the matched chapter — never the whole pack every session (it burns the context you were saving → 01). Make it stick: put a short, plain-language pointer at the top of CLAUDE.md (loaded every session) and AGENTS.md (other agents) — a pointer, not a paste, and no fake SYSTEM/URGENT labels: an authority claim inside a file looks like Prompt injection — An attack on AI: someone weaves a hidden instruction into text to make the assistant act against the rules. If AI reads outside content (emails, pages), treat it as untrusted — otherwise it can be manipulated. more in the glossary → to a modern model. An unwired package is never read. A vendored copy is not the host’s constitution — the host’s own CLAUDE.md stays in charge. Steps → 07. (The Decalogue stays ten; this is activation, not an eleventh rule.)


I. Document for the agent, not for the archive.

Every directory with code has an AI_README.md, updated before the 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 →, and a test that fails when it isn’t (→ 17). Documentation written “at the end” drifts and lies. → 01

II. Search the history before you write a single line.

git log -S, git log --grep, git blame, the directory’s AI_README. Most “new” problems were already solved here — a helper exists, 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 → happened, the odd shape has a reason. → 05

III. Verify, don’t declare.

“It works” means proof: a test run, an HTTP code, numbers, a screenshot. Failures are reported with their output; skipped steps are reported as skipped. → 03

IV. Dry-run is the default; --execute is deliberate.

Every script that changes data first prints its plan (what, how much, where). The mutation runs only after the plan was read. → 04

V. The backup is the rollback mechanism, not a precaution.

Migrations are forward-only. A Snapshot — A saved state of data from a specific moment — e.g. a database copy or a file of computed statistics. It speeds things up and keeps them safe, but is stale from the moment it’s taken — you need to know where fresh data comes from. more in the glossary → before every schema or data change on 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 →; reverting the schema = restoring that snapshot. → 04

VI. Prod is sacred — nothing touches it without an explicit “deploy.”

Commit and 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 → on request are not a 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 →. Pull on the server, reload, migration, 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 →, 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 → flag — only on the user’s explicit word. Irreversible and outward-facing actions are always confirmed; consent does not carry over to the next action. → 05, 06

VII. User data is inviolable.

Never lose it, never leak it, never mutate it without 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 →. Reference it by a stable key (Slug — A readable, short part of a page address that describes its content in words instead of a mysterious number. Better for humans and SEO; a stable slug doesn’t break links when things change. more in the glossary →), never by an ID that drifts; a missing match is skipped and logged, not forced. After any operation on it, count the rows and run the integrity check. Full prod database swap → 19.

VIII. Tag every deploy and tell the user what they gained.

An annotated tag (deploy-YYYY-MM-DD) is the only stable marker of “what’s live” and the basis for 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 →. Every deploy updates the public changelog in plain language — what the user gains, no jargon. → 05

IX. Small, coherent commit; one topic.

Unrelated changes go to separate commits. Keep git status clean: catch junk (.bak, temp files, stray databases) and orphans (someone else’s uncommitted work) early. → 05

X. Plan → iterate → review.

A plan or a sketch first (3 examples, not 100), feedback, then scale. Deliver UX with warmth, not just correctness — the product should be pleasant, not merely functional. → 06


Seven deadly sins

  1. Inflated optimism — “everything works” with no proof. (III)
  2. Mutation without a plan — a data-changing script run straight with --execute. (IV)
  3. Auto-deploy — “it’s ready, so it goes to prod.” (VI)
  4. User data on a hunch — mapping by ID, or a swap without enumerating every table that points at the user. (VII)
  5. Junk-drawer commit — unrelated changes and artifacts in one commit. (IX)
  6. Scaling before review — 500 generated before the user saw 3. (X)
  7. Documentation “later” — the code ships, the AI_README lags, the next session wanders. (I)

The golden rule of altitude

Slow where a mistake is expensive (prod, user data, schema). Fast where it’s cheap (local experiment, UI sketch, 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 →). Match the pace to the cost of error, not to impatience.


Departing from a rule — and the floor that doesn’t move

This is a default, not a cage. A doctrine that can’t bend gets ignored wholesale.

  • Deviate out loud: name the rule, say why it doesn’t fit here, propose the alternative, get a yes, record the decision (ADR (decision record) — A short note: what we chose, why, and which alternatives we rejected (Architecture Decision Record). Six months later nobody has to guess whether a decision was deliberate and whether it’s safe to change. more in the glossary → / CLAUDE.md). Silently skipping a rule is the sin, not a deviation.
  • Precedence: the host project’s root CLAUDE.md > this doctrine (docs/rules/) > the agent’s defaults.
  • A rule you keep overriding is a bug in the doctrine — fix it at the source (the canon, with its translation), don’t route around it every session.

The floor — not negotiable: honest reporting (III), a backup before a schema/data change (V), an explicit “deploy” before prod (VI), user data (VII). The full boundary as one table → 06.

Chapter deep-dive 00Why these rules, examples and stories from projects — what the core deliberately leaves out.

The canonical doctrine is written in English.