ADR-FORMAT.md
| source_url | https://github.com/mattpocock/skills/blob/f72828b1963140a33111a18bb3c4c64ebac305bc/skills/engineering/domain-modeling/ADR-FORMAT.md |
|---|
ADR Format
ADRs live in docs/adr/ and use sequential numbering: 0001-slug.md, 0002-slug.md, etc.
Create the docs/adr/ directory lazily: only when the first ADR is needed.
Template
# {Short title of the decision}
{1-3 sentences: what's the context, what did we decide, and why.}
That's it. An ADR can be a single paragraph. The value is in recording that a decision was made and why, not in filling out sections.
Optional sections
Only include these when they add genuine value. Most ADRs won't need them.
- Considered Options: only when the rejected alternatives are worth remembering
- Consequences: only when non-obvious downstream effects need to be called out
When a decision changes
The code says what the app does, and stays the source of truth for it. An ADR adds why. When the code moves on from an ADR, write a new ADR for the new decision, list the old approach in its Considered Options ("we did this, and dropped it, because..."), and delete the old ADR. Git keeps it. Also delete any ADR that fails the bar below.
Numbering
Scan docs/adr/ for the highest existing number and increment by one.
When to offer an ADR
All three of these must be true:
- Hard to reverse: the cost of changing your mind later is meaningful
- Surprising without context: a future reader will look at the code and wonder "why on earth did they do it this way?"
- The result of a real trade-off: there were genuine alternatives and you picked one for specific reasons
If a decision is easy to reverse, skip it: you'll just reverse it. If it's not surprising, nobody will wonder why. If there was no real alternative, there's nothing to record beyond "we did the obvious thing."
What qualifies
- Architectural shape. "We're using a monorepo." "The write model is event-sourced, the read model is projected into Postgres."
- Integration patterns between contexts. "Ordering and Billing communicate via domain events, not synchronous HTTP."
- Technology choices that carry lock-in. Database, message bus, auth provider, deployment target. Not every library: just the ones that would take a quarter to swap out.
- Boundary and scope decisions. "Customer data is owned by the Customer context; other contexts reference it by ID only." The explicit no-s are as valuable as the yes-s.
- Deliberate deviations from the obvious path. "We're using manual SQL instead of an ORM because X." Anything where a reasonable reader would assume the opposite. These stop the next engineer from "fixing" something that was deliberate.
- Constraints not visible in the code. "We can't use AWS because of compliance requirements." "Response times must be under 200ms because of the partner API contract."
- Rejected alternatives when the rejection is non-obvious. If you considered GraphQL and picked REST for subtle reasons, record it; otherwise someone will suggest GraphQL again in six months.
MIT license
MIT License
Copyright (c) 2026 Matt Pocock
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Children
No children yet.
Like how this is organised?
Build your own Memory tree on knowen.md: notes, decisions and tasks in one connected markdown graph, shared with your team and your AI agents.