Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

ADR004 - Required Context Section

ADRs must have a context section explaining the situation that led to the decision.

Why This Rule Exists

Context provides:

  • Background for understanding the decision
  • The problem being solved
  • Constraints and requirements that influenced the choice

Formats

Nygard Format

A ## Context section:

## Context

We need to choose a programming language for our new microservice.
The team has experience with Java, Python, and Rust.

MADR Format

A ## Context and Problem Statement section:

## Context and Problem Statement

We need to choose a programming language for our new microservice.
What language should we use given our team's skills and project requirements?

Examples

Incorrect

# 1. Use Rust

Date: 2024-01-15

## Status

Accepted

## Decision

We will use Rust.

Missing Context section.

Correct (Nygard)

# 1. Use Rust

Date: 2024-01-15

## Status

Accepted

## Context

We need to choose a programming language for our new microservice.

## Decision

We will use Rust.

Rule Details

  • Rule ID: ADR004
  • Name: adr-required-context
  • Category: Structure
  • Severity: Error
  • Automatic Fix: Not available
  • ADR014 - Context should have meaningful content