An architecture decision record (ADR) is a short document that captures an architectural decision, the context behind it and its consequences. ADRs have been a popular way to document decisions in software architecture for years, and many teams write them.
Most ADRs live in a Git repository or a Confluence space. They explain why things are the way they are, and people read them when they remember to. What they're rarely used for is checking that the code still follows them.
I believe AI agents can change this, and open up new patterns for how we use ADRs. What if you could use your ADRs as context for an agent that reviews every pull request, and flags the changes that go against the decisions your organization has already made?
Getting more value from your ADRs
I think ADRs can offer much more value than most of us get from them today. They sit there, they're recorded, and sometimes they're forgotten. An ADR only helps when someone knows it exists, finds the right one and reads it before writing or reviewing code. That's a lot to ask of a team.
It's always felt strange to me that we check so much else automatically. Linters check formatting, tests check behaviour, and type checkers check types, but nothing checks code against the decisions we've spent time making.
I think that's starting to change. What if we could use our ADRs as part of our automation workflows?
AI is very good at reasoning over text and language, and that's exactly what our ADRs are made of. So what if we used them as context to help enforce our decisions downstream? I see two ways this helps:
- As checks. The decisions you've already written down become checks that run on every pull request.
- As a way to keep them current. If a check keeps flagging a decision that no longer fits, that tells you the ADR is out of date.
For me, that's the shift: your ADRs stop being a history of what you meant to do, and start shaping what you're doing.
How to review pull requests against your ADRs
Here's the idea: use your ADRs in an agentic workflow that reviews code changes, and checks they follow the ADRs you select.
When a pull request opens, the workflow goes like this:
- A pull request opens. The agent runs in CI, like any other check.
- Select the ADRs that apply. Only accepted decisions, not proposed, rejected or superseded ones. Ideally scoped to the repository too: an Orders service cares about organization-wide decisions and the Orders domain's decisions, not the ones written for the data platform.
- Find the ones relevant to this change. You don't want to put two hundred ADRs into one prompt. Compare the ADR summaries against the changed files and keep the ones on the same topic. A change to a messaging client doesn't need the ADR about front-end state management.
- Review the diff against them. Look at the changed lines only, and report clear conflicts only.
- Verify each conflict. This step matters most for trust. Check that the line it points to is one the pull request changed, and that the sentence it quotes is in the ADR. If the agent can't back up a finding, drop it.
- Comment on the pull request. Cite the line, quote the decision, and suggest a fix. Update the same comment on every push, so it doesn't pile up.
- A human decides. The comment is input to the review, not the review.
That's the whole pattern.
Getting started
You don't need to start from scratch. There are now agent frameworks that let you build your own agents and agentic workflows, and run them where you need them. Two I'd look at:
- Flue, from the Astro team. You write agents in TypeScript, keep skills and context in Markdown, and deploy them anywhere, including GitHub Actions and GitLab CI/CD.
- eve, from Vercel. An open-source TypeScript framework where each agent is a directory of files: instructions and skills in Markdown, tools in TypeScript.
With a framework like these, you can build your own ADR review agent and add it to your CI/CD pipeline as another check on your pull requests. You bring your own model and API keys, so your code only goes to the model provider you choose.
EventCatalog users are already doing this with our EventCatalog Agents, which are built on Flue and run in GitHub Actions and other CI/CD pipelines. They're already reviewing hundreds of pull requests a week. If you want to learn from how we do it, or fork the code and build your own, it's all source available on GitHub. Feel free to take a look.
If you want to try this with EventCatalog, document your ADRs in your catalog, then set up ADR Compliance to check your pull requests against them in GitHub Actions, Azure Pipelines or Bitbucket Pipelines. I wrote more about the agent in Turn your ADRs into automated checks.
I'd love to hear how you're using ADRs with AI agents. Come and say hello on Discord, or open an issue on GitHub.
