Architecture Decision Records
Capture architectural decisions as they happen during coding sessions. Instead of decisions living only in Slack threads, PR comments, or someone's memory, this skill produces structured ADR documents that live alongside the code.
When to Activate
- User explicitly says "let's record this decision" or "ADR this"
- User chooses between significant alternatives (framework, library, pattern, database, API design)
- User says "we decided to..." or "the reason we're doing X instead of Y is..."
- User asks "why did we choose X?" (read existing ADRs)
- During planning phases when architectural trade-offs are discussed
ADR Format
Use the lightweight ADR format proposed by Michael Nygard, adapted for AI-assisted development:
Workflow
Capturing a New ADR
When a decision moment is detected:
- Initialize (first time only) — if
docs/adr/ does not exist, ask the user for confirmation before creating the directory, a README.md seeded with the index table header (see ADR Index Format below), and a blank template.md for manual use. Do not create files without explicit consent.
- Identify the decision — extract the core architectural choice being made
- Gather context — what problem prompted this? What constraints exist?
- Document alternatives — what other options were considered? Why were they rejected?
- State consequences — what are the trade-offs? What becomes easier/harder?
- Assign a number — scan existing ADRs in
docs/adr/ and increment
- Confirm and write — present the draft ADR to the user for review. Only write to
docs/adr/NNNN-decision-title.md after explicit approval. If the user declines, discard the draft without writing any files.
- Update the index — append to
docs/adr/README.md
Reading Existing ADRs
When a user asks "why did we choose X?":
- Check if
docs/adr/ exists — if not, respond: "No ADRs found in this project. Would you like to start recording architectural decisions?"
- If it exists, scan
docs/adr/README.md index for relevant entries
- Read matching ADR files and present the Context and Decision sections
- If no match is found, respond: "No ADR found for that decision. Would you like to record one now?"
ADR Directory Structure
ADR Index Format
Decision Detection Signals
Watch for these patterns in conversation that indicate an architectural decision:
Explicit signals
- "We should use X instead of Y"
- "The trade-off is worth it because..."
Implicit signals (suggest recording an ADR — do not auto-create without user confirmation)
- Comparing two frameworks or libraries and reaching a conclusion
- Making a database schema design choice with stated rationale
- Choosing between architectural patterns (monolith vs microservices, REST vs GraphQL)
- Deciding on authentication/authorization strategy
- Selecting deployment infrastructure after evaluating alternatives
What Makes a Good ADR
Do
- Be specific — "Use Prisma ORM" not "use an ORM"
- Record the why — the rationale matters more than the what
- Include rejected alternatives — future developers need to know what was considered
- State consequences honestly — every decision has trade-offs
- Keep it short — an ADR should be readable in 2 minutes
- Use present tense — "We use X" not "We will use X"
Don't
- Record trivial decisions — variable naming or formatting choices don't need ADRs
- Write essays — if the context section exceeds 10 lines, it's too long
- Omit alternatives — "we just picked it" is not a valid rationale
- Backfill without marking it — if recording a past decision, note the original date
- Let ADRs go stale — superseded decisions should reference their replacement
ADR Lifecycle
- proposed: decision is under discussion, not yet committed
- accepted: decision is in effect and being followed
- deprecated: decision is no longer relevant (e.g., feature removed)
- superseded: a newer ADR replaces this one (always link the replacement)
Categories of Decisions Worth Recording
| |
|---|
| Framework, language, database, cloud provider |
| Monolith vs microservices, event-driven, CQRS |
| REST vs GraphQL, versioning strategy, auth mechanism |
| Schema design, normalization decisions, caching strategy |
| Deployment model, CI/CD pipeline, monitoring stack |
| Auth strategy, encryption approach, secret management |
| Test framework, coverage targets, E2E vs integration balance |
| Branching strategy, review process, release cadence |