Skip to content
0degrees.ai
Tooling

Using AI to Write Architecture Decision Records That Actually Get Read

How to draft ADRs during the decision itself, link them into your project instructions, and use them as context for future AI coding sessions.

0degrees Team6 min read

Architecture Decision Records have a reputation problem. The idea is excellent — a short document per significant decision, capturing what was chosen, what was considered, and why — but most teams that try ADRs abandon them after a few months. The reason is consistent: writing them is a separate task that happens after the decision, when the rationale has faded and other work is waiting.

AI coding assistants change this. When you’re in a session making an architectural decision, the full context — the alternatives you explored, the constraints you hit, the tradeoffs you reasoned through — is live in the conversation. That’s the ideal moment to capture a decision record, and AI can draft it faster than you can context-switch away.

What belongs in a decision record

An ADR doesn’t need to be long. The standard Nygard format covers everything that matters:

# ADR-0012: Use Drizzle ORM instead of Prisma

## Status
Accepted — 2026-11-20

## Context
We're adding database access to the project for the first time. The main
contenders are Prisma (schema-first, with a generated client) and Drizzle
(query-builder, TypeScript-native, no generated step).

## Decision
We'll use Drizzle ORM with direct SQL migrations.

## Consequences
- Positive: No codegen step, schema is plain TypeScript, queries are type-safe at the call site
- Positive: Smaller bundle, no Prisma binary to manage in production
- Negative: SQL must be written manually — no auto-migration from schema diffing
- Ruled out: Prisma — adds a build step that conflicts with our monorepo CI setup

The “Ruled out” note is the most underrated section. It answers the question the next developer will ask — “did anyone consider Prisma?” — and saves them from reopening a closed discussion.

Writing ADRs live in the session

The key insight is timing. Don’t write an ADR after the decision — write it at the moment the decision is made, while the rationale is still in context.

When you’re at the point in a session where you’ve just settled on an approach, prompt directly:

We just decided to use Drizzle ORM instead of Prisma for the reasons above.
Write an ADR in the standard Nygard format capturing:
- The context (what we're building, why we needed to choose)
- The decision (Drizzle, with direct migrations)
- The consequences (positives, negatives, and explicitly that Prisma
  was ruled out and why)

Save it as docs/decisions/0012-use-drizzle-orm.md

The model has everything it needs. It was present for the whole discussion, it knows the alternatives you explored, and it knows the constraints that drove the final call. The draft it produces at this point will be far better than anything you’d write two weeks later from memory.

One adjustment worth making: always tell the model to include an explicit “Ruled out” entry for each alternative you seriously considered. Left to its own formatting, it may omit alternatives that weren’t chosen, and that’s the information most likely to be needed six months from now.

Connecting ADRs to your project instructions

A decision record is only useful if it influences future behavior — both yours and the model’s. The simplest integration is a standing entry in your CLAUDE.md per significant decision:

## Architectural decisions
See docs/decisions/ for the full ADR log. Key decisions:
- ADR-0012: Drizzle ORM (not Prisma) — no codegen step, SQL migrations
- ADR-0015: React Query for data fetching (not SWR) — team familiarity
- ADR-0019: { error: string } with HTTP status for all API errors

This gives every new session the settled decisions as axioms. The model stops suggesting Prisma not because you told it to in this session, but because the project context says the decision is closed.

For decisions with more nuance, link to the full ADR:

- ADR-0023: Auth architecture — see docs/decisions/0023-auth-architecture.md
  (JWT tokens, no sessions, refreshed via /api/auth/refresh)

When a task involves that boundary, paste the ADR directly into your session prompt: “Here’s the auth decision record — make sure your implementation matches it.” A Nygard-format ADR is 10–15 lines. The five seconds it takes to paste eliminates an entire category of suggestions that contradict settled decisions.

This approach pairs directly with the constraint-first philosophy in Writing a CLAUDE.md That Actually Changes How Your AI Codes: high-level constraints go in CLAUDE.md, session-specific decision context goes in the session prompt. The two layers together keep suggestions consistent with your architecture.

Reviewing ADRs for staleness

Decisions go stale. A constraint that drove a choice disappears; a dependency changes; the codebase grows in a direction that makes the original reasoning obsolete. This is where most ADR programs collapse — there’s no lightweight process for reviewing and superseding old records.

AI is useful here as a staleness checker. Once every few months, give the model the ADR log alongside the current codebase state:

Here are our current ADRs (docs/decisions/). Here's our package.json
and the contents of src/lib/db/.

For each ADR, tell me:
1. Whether the decision is still reflected in the codebase
2. Whether any "ruled out" options have since been added to the project
3. Whether any ADR should be marked Superseded

Be specific — name the file and the line where the codebase diverges
from an ADR if you find one.

The model will catch things like an ADR that says “no inline queries in routes” when three route files have them. It will notice that a “ruled out” library has since appeared in package.json. It won’t catch everything, but it catches the obvious drift you’d otherwise miss until someone asks why the code doesn’t match the docs.

When a decision genuinely changes, have the model draft the superseding ADR the same way you drafted the original — in the session where the new decision was made.

ADRs as context injection for future sessions

The least obvious use of a good ADR log is treating each record as a reusable context snippet. When you’re starting a session that touches an architectural boundary — auth, data access, error handling, API shape — read the relevant ADR into your session at the start:

Before we begin: here's our decision record on auth architecture.

# ADR-0023: JWT auth, no server sessions
...

This is the settled approach. Don't suggest sessions or cookie-based auth.
Now let's add token refresh to the mobile client.

This kind of explicit anchoring is what keeps long feature branches consistent. Without it, the model has no reason not to suggest a session-based approach on day 10 of a sprint when it only sees the new file you’re working in.

The connection to context hygiene is direct: a compact ADR carries the most important architectural signal in the fewest tokens. For more on keeping sessions coherent as work accumulates, see Managing Context in Long AI Coding Sessions.

What made ADRs stick for us: The turning point wasn’t the format or the tooling — it was writing the first draft in the session. The first time we prompted the model to draft an ADR while the decision was fresh and had it committed in the same PR as the code, the whole thing became a habit instead of a chore. The barrier had always been the gap between making the decision and documenting it. Closing that gap is what AI is for.

Suggested file structure

A simple layout that scales well:

docs/
  decisions/
    0001-use-nextjs-app-router.md
    0012-use-drizzle-orm.md
    0019-api-error-format.md
    0023-jwt-auth-no-sessions.md
    README.md   ← index with one-line summaries of each record

Have the model maintain the README.md index as an ADR is added or superseded. With the index in CLAUDE.md, every session starts knowing which decisions exist and can ask for the full record on demand.

The habit, not the system

Teams that succeed with ADRs don’t have better tooling — they have a habit of capturing decisions at the moment they’re made. AI removes the main friction: the blank-page cost of writing a coherent record while the session is still live.

The workflow is: make a decision, prompt the model to draft the ADR, review the draft for accuracy, commit it in the same PR as the code. That’s two minutes of overhead per significant decision. The return compounds every time a new session asks “why was this done this way?” and finds the answer already in the repo.

[ Related ]

Keep reading