Every project that lasts more than a few months piles up code that looks odd. A duplicated table, a library nobody would pick today, a service that could have been a function. There was almost always a reason, but the reason lived in a meeting, a Slack thread or the head of someone who has left the team.
That problem existed long before AI. What changed is who reads the code: an agent opens the repository without the team’s history and, if nothing tells it why something is the way it is, it “fixes” it. ADRs are an old and very simple way to leave that reason written down where the agent can find it.
What an ADR is
An ADR (Architecture Decision Record) is a short file that documents one decision: the context, what was decided and what it implies.
Michael Nygard popularized the idea in 2011 with Documenting Architecture Decisions. His proposal: keep a record of “architecturally significant” decisions, the ones that affect structure, non-functional characteristics, dependencies, interfaces or construction techniques. Each one is a text file inside the repository, with five sections:
# 1. Postgres as the main database
## Status
Accepted
## Context
The forces at play: what the problem is, the constraints, what we know today.
## Decision
We will use Postgres for ... (full sentences, active voice).
## Consequences
Everything that changes, good and bad.Two details from Nygard are still the most useful part of the format. The consequences list all of them, not just the positive ones. And when a decision is reversed, the old ADR isn’t deleted: it’s marked as superseded and points to the new one.
How AWS defines it
AWS has a full guide on the ADR process. Its definition:
An architectural decision record (ADR) is a document that describes a choice the team makes about a significant aspect of the software architecture they’re planning to build.
So far, the same as Nygard. What AWS adds is process:
- Lifecycle. An ADR starts as Proposed. In a review meeting the team accepts it, asks for changes (it stays proposed) or rejects it, and a rejection needs a written reason. On acceptance it gets a timestamp, a version and the list of stakeholders.
- Owner. Anyone can write an ADR, but the team defines who owns each one, and that person maintains and communicates it.
- Immutable. “When the team accepts an ADR, it becomes immutable.” If the decision changes, a new one is written and the previous one becomes Superseded.
The template in the appendix grows too: title, status, date, context, decision, consequences split into positive and negative, a compliance section (how you check the code follows it) and notes with author, version and changelog.
The AWS Architecture Blog has a post with lessons from over 200 ADRs across several projects. The points that stand out: one decision per ADR, meetings of 30 to 45 minutes at most, separating design from decision, and not getting stuck, because most decisions can be reversed.
How others define it
adr.github.io, the site that gathers the community around ADRs, separates three concepts. An architectural decision (AD) is a justified design choice that addresses a significant requirement. An architecturally significant requirement (ASR) is one with a measurable effect on the architecture. And an ADR captures a single AD with its rationale. A project’s set of ADRs is its decision log.
That’s where MADR comes from, the most widely used Markdown template. Its main contribution is making you write down the options you considered, with pros and cons for each, not just the winner. It also adds frontmatter for who decided, who was consulted and who was informed, and names files 0001-title-with-dashes.md.
| Nygard | AWS | MADR | |
|---|---|---|---|
| Sections | 5 | 8, with compliance and notes | Options with pros and cons |
| Process | None | Owner, review, states | None, just a template |
| If the decision changes | New ADR, the old one is marked superseded | Same, an accepted one is immutable | Status superseded by ADR-NNNN |
ADRs as context for an agent
A coding agent sees the what with great precision. What it doesn’t see is the why. Without that piece two things happen: the agent “corrects” a deliberate decision because it looks like a mistake, or it proposes again the alternative the team ruled out months ago.
An ADR solves both, and it has exactly the shape an agent consumes well: a short Markdown file, inside the repository, with a predictable name. No new tool required.
How Matt Pocock does it
Matt Pocock publishes his skills for coding agents in an open repository, and ADRs show up in several of them.
The one that writes them is domain-modeling. It stores them in docs/adr/ with sequential numbering (0001-slug.md), creates the folder only when the first one is needed, and the template is minimal: a title and one to three sentences with the context, the decision and the reason. Status, considered options and consequences are optional.
The most interesting part is the filter. It only offers to write an ADR when three things are true at once:
- The decision is hard to reverse.
- Without context, it would surprise whoever reads the code.
- It was the result of a real trade-off.
If the decision is easy to undo, there’s no ADR. That keeps the folder short and every file worth reading.
grill-with-docs combines that skill with another one that interrogates you about what you want to build. As you answer, it writes the ADRs and a GLOSSARY.md with the domain terms, which holds no implementation details.
On the reading side, the instruction for the agent is: before working in an area, read the ADRs that touch it. And if what it’s about to propose contradicts one, say so explicitly instead of silently overriding it. improve-codebase-architecture follows that rule before suggesting refactors, and offers to write an ADR when you reject a proposal, so the next review doesn’t suggest it again.
An honest note is worth adding: on the skill’s page on AI Hero he acknowledges that writing ADRs is the weakest part of the flow, because the model sometimes skips that step.
How I use them
I have a skill for landing issues before planning them that starts from the same idea. It interrogates me in rounds, with a recommendation on every question. Whatever can be learned by reading (the code, the issue, its comments) it looks up on its own instead of asking me. And as we go, it writes two things to a domain folder: a glossary, where each term says what it is and lists under Avoid the synonyms we ruled out, and the ADRs.
It uses the same three-condition filter, but I changed a few things on purpose:
- Date instead of number. Files are named
YYYY-MM-DD-slug.md. I work on several issues in parallel, each in its own worktree, and two branches looking for “the next number” end up with two0007s. - It asks before writing. It doesn’t create an ADR on its own: it proposes it in the next round and I decide.
- Rewritten, not superseded. If a new decision cancels an ADR, the file is rewritten with the new decision and its reason. The history stays in the issue. It’s the opposite of AWS’s immutability, and it’s deliberate: an agent reading the folder should find how things are today, not rebuild it by following a chain of supersessions.
- Nothing from the session. Neither the glossary nor the ADRs hold the plan, the acceptance criteria or notes from the conversation. Those go in the issue.
An ADR in that format looks like this:
# Sessions live in the database, not in a JWT
We need to end a person's session the moment their access is removed.
A stateless JWT was ruled out because it can't be revoked before it
expires, and in exchange we pay one query per request.Three lines. Enough for the agent not to propose “simplifying” to JWT.
How to start in your repo
You don’t need skills to start. Three things are enough:
- A
docs/adr/folder and the short template: a title and a few sentences with the context, the decision, the rejected alternative and the reason. - The three-condition filter, so it doesn’t fill up with decisions that don’t matter.
- An instruction in the file your agent always reads:
## Decisions
Before changing an area, read the ADRs in `docs/adr/` that touch it.
If what you're about to propose contradicts one, say so explicitly and
explain why it would be worth reopening. Don't change it silently.The same works in an AGENTS.md or your tool’s rules file.
The summary
An ADR is a short file that says what was decided and why. Nygard proposed the five-section format, AWS added a process with owners, reviews and states, and MADR insisted on writing down the rejected options. They all agree on what matters: context, decision and consequences, next to the code.
With coding agents, the value goes up. The agent doesn’t have the team’s memory, and an ADR is the cheapest way to give it one. Write few of them and keep them short, only for what’s hard to reverse, surprising and chosen between real alternatives, and tell your agent to read them before touching anything.