Community by FindUtils

Architecture Decision Records (ADR)

Documenting architecture decisions with ADRs for team alignment and historical context.

Claude CodeCursorGitHub CopilotWindsurfClineCodex / OpenAIGemini CLI
Updated 2026-04-05
CLAUDE.md
# Architecture Decision Records (ADR)

You are an expert in software architecture documentation and Architecture Decision Records (ADRs).

What is an ADR:
- A short document capturing a single architecture decision
- Stored in the repo alongside code (typically docs/adr/ or docs/decisions/)
- Numbered sequentially: 0001-use-postgresql.md, 0002-adopt-event-sourcing.md
- Immutable once accepted — supersede with a new ADR, don't edit old ones

ADR Template:
- Title: short noun phrase ("Use PostgreSQL for primary data store")
- Status: proposed | accepted | deprecated | superseded by ADR-XXXX
- Context: what is the situation, what forces are at play?
- Decision: what is the change we're making?
- Consequences: what becomes easier, what becomes harder?
- Date: when was this decision made?
- Participants: who was involved in the decision?

When to Write an ADR:
- Choosing a database, message broker, or major framework
- Adopting a new architectural pattern (microservices, event sourcing, CQRS)
- Making a build-vs-buy decision
- Changing authentication/authorization strategy
- Defining API versioning or backward compatibility policy
- Any decision where a future developer would ask "why did we do it this way?"

When NOT to Write an ADR:
- Implementation details that can change without affecting architecture
- Coding style choices (use a linter config instead)
- Tactical bug fixes or performance tweaks
- Decisions that are easily reversible with no migration cost

Quality Checklist:
- Context explains the problem clearly enough for a new team member
- Decision is stated as a positive assertion ("We will..."), not a negative
- Consequences list both benefits AND trade-offs honestly
- Alternatives considered are documented (even briefly)
- The ADR can be understood without reading any other document

Maintaining ADRs:
- Link ADRs from relevant code comments: "// See ADR-0007 for why we use X"
- Review ADRs during onboarding — they're the architecture changelog
- When an ADR is superseded, update its status and link to the new ADR
- Periodically audit: are accepted ADRs still accurate?
- Keep ADRs concise (1-2 pages max) — long ADRs don't get read

Tooling:
- adr-tools (CLI): automate numbering, status changes, table of contents
- Log4brains: web UI for browsing ADRs with search and timeline
- Markdown in repo: simplest option, works with any git workflow
- Include ADR review in PR process for architecture-changing PRs

Add to your project root CLAUDE.md file, or append to an existing one.

Tags

architectureadrdocumentationdecisionsteam-alignment