Rzemiosło · The Craft
What is The CraftLevelsGet startedChapters Search Download PLEN
Level 3 · Codex ~3 min read

In one sentence: Code always in English, prose in the project’s language — and every important rule gets a guard, because a rule without a guard is a wish.

This chapter in plain terms

This chapter splits two languages by who reads them. Everything a machine and the next developer read — names in code, test names too, database tables and columns, flags, keys, 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 → messages — is written in English, always. Everything a person reads — documentation, comments, text in the app — is in the project’s language, declared once in CLAUDE.md.

Why so strict? English is the language of the tools: autocomplete, error messages, search. A name in another language gets spelled three ways (with diacritics, without, with a typo), and a name mixing two languages can’t be searched at all. Names a tool prints (commit, --dry-run, migrate.py) stay in English even inside prose in another language — because those are what you grep for. A plain word for the action itself can be in the prose language.

The second half of the chapter is about 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 →. A rule written only in CLAUDE.md is a wish — in the reference project one session shipped 95 of 98 commits without updating the 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 → it was supposed to keep current. An important rule is kept by a test that fails when someone breaks it. The Craft pack ships two (guards/): one checks that every code folder has an 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 → listing every module, the other that names in code are in English.

Example of a Ratchet — A way to bring a rule into old code: today’s state is frozen, and the number of violations can only fall. Nobody has to fix everything at once, but nobody adds new violations. more in the glossary →: you wire the rules into an old project that has 40 non-English names. You don’t rename everything at once — the guard records “40” today, from now on that number can only go down, and new files must be clean. Raising it by hand “to make the test green” weakens the guard — the same sin as skipping a test.

Read more: the guards in The Craft repo (guards/) · PEP 8 — naming conventions · pytest — get started.

17 — Language of code, and guards that keep rules alive

Commandments I and III applied to names: a rule that lives only in someone’s head is not a rule, and a rule without a test is a wish.

Two languages, split by reader

LayerLanguage
Code — identifiers (modules, classes, functions, variables, Fixture — Prepared data or state a test runs against (e.g. a small database with a few records). A test is only repeatable if it always starts from the same point. more in the glossary →, test names), code file names, DB tables and columns, CLI (command line) — Using a program by typing commands in a terminal instead of clicking. Commands can be saved, repeated and automated — which is why the assistant mostly works this way. more in the glossary → flags, config and API — An agreed way for two programs to talk to each other — one asks, the other answers in a set format. Through an API your app connects to outside services (payments, maps, AI). Treat an API key like a password. more in the glossary → keys, enum/state values, log keys, 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 → messagesEnglish, always
Prose — docs, plans, 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 →, comments, docstrings, user-facing textthe project’s language, declared once in CLAUDE.md
# CLAUDE.md
Code: English (identifiers, tests, DB, CLI, keys). Prose: Polish (docs, comments, docstrings, UI).

Rules

  1. English code is the ecosystem’s language — tooling, autocomplete, errors and the next engineer all speak it; a native-language identifier is transliterated three different ways.
  2. Tests are code. test_<subject>_<condition>_<expected> in English; the why (the incident, the date, the cost) goes into the docstring, in the prose language.
  3. No mixed identifiers (test_cost_NIE_ISTNIEJE_in_window) — unreadable and ungreppable.
  4. Names a tool prints stay English inside prose — a command, flag, status, file or tag (commit, --dry-run, migrate.py, deploy-*): that is what you grep for. The everyday word for the activity may be in the prose language (“wdrożenie” for deploying).
  5. A rule without a 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 → is a wish. One session shipped 95 of 98 commits without touching the 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 → it was told to update. Rules that must survive a long session are enforced by the test suite.

The two guards (ready-made in guards/)

Copy them into the project’s tests/ as test_ai_readme.py and test_code_language.py, adjust the directory lists, run them, commit the Baseline — A recorded “as of today” state — a measurement or a count of violations — later results are compared against. Without a reference point you can’t see whether things got better or worse — and in a ratchet it lets numbers only fall. more in the glossary → — in the first commit (→ 07). They are pytest reference implementations: a Python — A popular, readable programming language — The Craft’s default for scripts, data and the back end. A proven default: lots of ready tools and libraries, easy to drive with AI. more in the glossary → project copies them; a Go, Rust, Kotlin or TypeScript project ports the same spec to its own test runner (the index guard needs only file globs; the language guard needs that language’s identifier parser or linter). The rule is the spec, not the Python file.

  • guards/ai_readme_guard.py — every directory with code has an AI_README.md; every module is named in it; a 20 kB ceiling (past it the index stops being an index — split the directory, not the file); the list of guarded directories guards itself. It cannot tell whether a description is current — that stays the writer’s duty.
  • guards/code_language_guard.py — flags identifiers that look like the prose language (stop-list of function words + letter shape); a Ratchet — A way to bring a rule into old code: today’s state is frozen, and the number of violations can only fall. Nobody has to fix everything at once, but nobody adds new violations. more in the glossary → with a per-file baseline.

The ratchet — introducing any rule into an old codebase

  1. Freeze today’s count per file in a committed baseline (empty on a new project).
  2. New files must be clean from the day the rule is written.
  3. Counts may only fall; when one falls, lower the baseline on command (--write-baseline), never silently.
  4. Raising a baseline by hand is weakening the guard — the same sin as skipping a test.
  5. Exceptions are dated, capped at today’s size, and tied to the backlog item that removes them.

Vendoring into an existing project: run the code-language guard once, commit the baseline as it is, and put “rename foreign identifiers — N left” into the backlog with the number.

Anti-patterns

  • 🚫 “Test names don’t count as code.”
  • 🚫 Mixed-language identifiers.
  • 🚫 Translating a name the tool prints (--dry-run written as “próba”).
  • 🚫 A rule in CLAUDE.md with no test behind it.
  • 🚫 Raising the baseline to make the suite green.
  • 🚫 An AI_README past the ceiling “because everything here matters”.
Chapter deep-dive 17Why these rules, examples and stories from projects — what the core deliberately leaves out.

The canonical doctrine is written in English.