Engineering standards
The rules are written down, every change is held to them and most of them are enforced by the build, which is why the result is consistent.
Most codebases keep their conventions in people's heads. This one has a rulebook.
A single document is the canonical source of the rules: how an aggregate is written, where business logic may live, how features may talk to each other, how a command gets its permission, how a setting becomes a vocabulary, when a comment is allowed. Beside it sit the shared standards, the domain language, the safety and refactoring rules, and the architecture. Every assistant and every person reads them before changing anything, and the architecture tests fail the build when a change breaks one.
9
hard stops: rules whose breach is a build failure, a security gap or a silent data defect
623
architecture tests that hold the code to the rulebook on every build
883
decision records: the reasons behind the rules, in the repository
198
guide articles, written in the same bite as the screen they explain
Features never reach into each other
A feature project may not reference another feature project's implementation, so everything crosses through contracts, and the build fails if it doesn't.
State changes only through events
An aggregate's state changes only when it applies its own events. There is no other door, so every change is on the record.
No business logic outside the domain
Endpoints, handlers, projections and screens dispatch and display, but they never decide anything. A rule lives in one place, on the aggregate that owns it.
Typed identifiers, never primitives
An account id is never a plain string, so the compiler catches the wrong id in the wrong place, which a test might miss.
Every operation is in the permission catalogue
A command, query or endpoint with no entry fails the build rather than leaving a hole, because everything is denied by default.
Every handler is reached by a test
A handler that no test dispatches fails the gate, unless it is named on a shrink-only baseline that says plainly it ships untested.
Product behaviour is configuration
A field named after one product on a shared aggregate is refused. The general concept is modelled once, and each product is a configuration of it.
Names carry the meaning
A comment is for a non-obvious why, in one line. Identifiers and structure do the rest, because comments rot while names get refactored with the code.
Public names do not move
Events, contracts, namespaces and feature folders are not renamed on a whim, because the event stream outlives every refactor.
Consistency
A slice written this year looks like one written two years ago, so a new engineer, or a new assistant, can read one and write the next. A periodic audit of the whole codebase checks that the rules are being kept, and its grade is published. The last one →
The configuration-first shape
The rules refuse the shortcut of a product-specific field, so the configuration surface keeps growing and the engine stays generic. We've built it the other way, with custom code for each client under time pressure, and ended up with a version per client. That bit us down the line.
The boundaries between components
Contracts are the only way across, so a feature can be replaced, sold on its own or switched off without pulling on the others.
The audit trail
State only moves through events and public names never move, so the history stays readable and replayable for as long as the book exists.
Then change it, and hold your code to the new version.
The rulebook, the standards and the tests that enforce them ship with the source as ordinary files. Your team can relax a rule, tighten one or add its own, and the same tests will hold your code to your version. What you can't do is drift by accident, because the rules are code rather than a wiki page that was true at go-live.
The result is consistent and of a high quality whoever wrote the last change, and the rulebook is yours from the day you take the source.