Skip to content
Architecture Decision Records (ADR) logo

Architecture Decision Records (ADR)

Documenting significant architectural decisions with context, consequences, and rationale for future reference.

SKILL.md

Full skill instructions

Architecture Decision Records (ADR)

Overview

Architecture Decision Records (ADRs) are lightweight documents that capture important architectural decisions, their context, and consequences. They create a historical record of why systems are built the way they are.

Core Principle: "Document the 'why' behind architectural decisions, not just the 'what'."


1. What is an ADR?

An ADR documents:

  • What decision was made
  • Why it was made (context)
  • What alternatives were considered
  • What the consequences are

When to Write an ADR

  • Choosing a database (PostgreSQL vs MongoDB)
  • Selecting an architecture pattern (microservices vs monolith)
  • Picking a framework (React vs Vue)
  • Defining API standards (REST vs GraphQL)
  • Security decisions (OAuth2 vs JWT)

2. ADR Template (MADR Format)

# ADR-001: Use PostgreSQL for Primary Database

## Status
Accepted

## Context
We need a database for our e-commerce platform that handles:
- Complex transactions (orders, payments, inventory)
- ACID compliance requirements
- Relational data (users, products, orders)
- Expected scale: 100K users, 10K orders/​day

## Decision
We will use PostgreSQL as our primary database.

## Alternatives Considered

### MongoDB
- **Pros**: Flexible schema, horizontal scaling
- **Cons**: Weaker transaction support, eventual consistency
- **Why rejected**: We need strong ACID guarantees for financial transactions

### MySQL
- **Pros**: Mature, widely used, good performance
- **Cons**: Less advanced features than PostgreSQL
- **Why rejected**: PostgreSQL's JSON support and advanced indexing better fit our needs

## Consequences

### Positive
- Strong ACID compliance for financial transactions
- Rich query capabilities (CTEs, window functions)
- JSON support for flexible product attributes
- Mature ecosystem and tooling

### Negative
- Vertical scaling limitations (can be mitigated with read replicas)
- More complex to operate than managed NoSQL solutions
- Learning curve for team members unfamiliar with SQL

## Implementation Notes
- Use Prisma ORM for type-safe database access
- Set up read replicas for scaling reads
- Use connection pooling (PgBouncer)

## Related Decisions
- ADR-002: Use Prisma ORM
- ADR-005: Database migration strategy

## Date
2024-01-15

## Authors
@alice, @bob

3. ADR Statuses

StatusMeaning
ProposedUnder discussion
AcceptedDecision made and approved
DeprecatedNo longer recommended
SupersededReplaced by another ADR
RejectedConsidered but not chosen

4. Directory Structure

docs/​adr/
├── README.md
├── 0001-use-postgresql.md
├── 0002-use-prisma-orm.md
├── 0003-adopt-microservices.md
├── 0004-use-react-frontend.md
└── template.md

5. ADR Tools

adr-tools (CLI)

# Install
npm install -g adr-log

# Create new ADR
adr new "Use PostgreSQL for primary database"

# List all ADRs
adr list

# Generate table of contents
adr generate toc

Log4brains (Web UI)

# Install
npm install -g log4brains

# Initialize
log4brains init

# Preview
log4brains preview

# Build static site
log4brains build

6. Lightweight ADR Template

For smaller decisions:

# Use Tailwind CSS for styling

**Status**: Accepted
**Date**: 2024-01-15

## Decision
Use Tailwind CSS for all component styling.

## Rationale
- Utility-first approach speeds up development
- Consistent design system
- Smaller bundle size with PurgeCSS
- Team already familiar with it

## Consequences
- Need to learn Tailwind conventions
- HTML can become verbose
- Harder to share styles across projects

7. Superseding an ADR

# ADR-003: Adopt Microservices Architecture

## Status
~~Accepted~~ **Superseded by ADR-010**

## Superseded By
[ADR-010: Return to Modular Monolith](0010-modular-monolith.md)

## Original Decision
[Keep original content for historical reference]

## Why Superseded
After 2 years of microservices:
- Operational complexity exceeded benefits
- Team size (5 engineers) too small to manage 12 services
- Network latency impacting user experience
- Distributed tracing and debugging challenges

See ADR-010 for new approach.

8. ADR Review Process

## ADR Review Checklist

- [ ] **Context Clear**: Is the problem well-defined?
- [ ] **Alternatives Listed**: Were other options considered?
- [ ] **Trade-offs Analyzed**: Pros and cons documented?
- [ ] **Consequences Identified**: Both positive and negative?
- [ ] **Stakeholders Consulted**: Relevant teams reviewed?
- [ ] **Implementation Plan**: Next steps clear?
- [ ] **Date and Authors**: Documented?

9. Common ADR Topics

Technology Choices

  • Database selection
  • Programming language
  • Framework selection
  • Cloud provider

Architecture Patterns

  • Microservices vs monolith
  • Event-driven architecture
  • CQRS and Event Sourcing
  • API design (REST vs GraphQL)

Security

  • Authentication method
  • Encryption standards
  • API security

Operations

  • Deployment strategy
  • Monitoring approach
  • Logging standards

10. ADR Best Practices

Do

✅ Write ADRs for significant decisions ✅ Include alternatives considered ✅ Document trade-offs honestly ✅ Keep ADRs immutable (don't edit, supersede instead) ✅ Make ADRs easy to find (in repo, searchable)

Don't

❌ Write ADRs for trivial decisions ❌ Make ADRs too long (aim for 1-2 pages) ❌ Skip the "why" (context is crucial) ❌ Delete old ADRs (mark as superseded) ❌ Write ADRs after the fact (document during decision)


11. ADR Integration with Development

In Pull Requests

## PR Description

This PR implements the decision from [ADR-005: Use Redis for caching](../​docs/​adr/​0005-redis-caching.md)

Changes:
- Add Redis client
- Implement cache layer
- Update documentation

In Code Comments

// Per ADR-003, we use JWT for authentication
// See: docs/​adr/​0003-jwt-authentication.md
export function verifyToken(token: string) {
  // ...
}

12. ADR Checklist

  • Template Available: ADR template in repository?
  • Directory Structure: Organized and numbered?
  • Review Process: Who approves ADRs?
  • Discoverability: ADRs linked in README?
  • Tooling: CLI or web UI for managing ADRs?
  • Integration: ADRs referenced in code/​PRs?
  • Maintenance: Old ADRs marked as superseded?
  • Culture: Team writes ADRs consistently?

Related Skills

  • 59-architecture-decision/​tradeoff-analysis
  • 59-architecture-decision/​tech-stack-selection
  • 59-architecture-decision/​architecture-review
  • 00-meta-skills/​decision-making

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View