01Decisions decay faster than code

Frontend codebases are full of decisions that look strange without context: a wrapper around every library component, a ban on ::ng-deep, a rule that features never import each other. The code shows what was decided, not why, and without the why, the next developer either follows rules blindly or undoes them.

An Architecture Decision Record is a one-page note, kept in the repository, that captures one decision: the context, the options, the choice and its consequences.

02Making ADRs stick

  1. Rule 1

    Record decisions, not designs

    One decision per record. "Use PrimeNG behind a wrapper layer" is an ADR; "the billing module" is a design doc.

  2. Rule 2

    Keep them next to the code

    A docs/adr/ folder in the repo, numbered and reviewed in pull requests. Wikis drift; the repo doesn't.

  3. Rule 3

    Write the rejected options down

    The alternatives you didn't choose, and why, stop the same debate from happening again next quarter.

  4. Rule 4

    Never edit, supersede

    When a decision changes, write a new ADR that supersedes the old one. The history of why is valuable on its own.

  5. Rule 5

    Keep it to one page

    If an ADR takes more than half an hour to write, the template is too heavy and people will stop.

  6. Rule 6

    Link them from the code

    A comment like // see ADR-007 next to the lint rule turns a puzzling pattern into a documented one.

03What's worth an ADR in an Angular app

Anything that's expensive to reverse or that constrains everyone: component library choice and wrapping strategy, state management approach, folder and dependency rules, styling architecture, theming strategy, and the upgrade policy for framework versions.

Not worth one: a single component's API, a naming choice a lint rule already enforces, anything you'd happily change next week. ADRs are for the decisions people will otherwise keep re-arguing.

04A real-sized ADR

This is the length I aim for. Short enough to write in twenty minutes, specific enough that someone joining the team next year understands the decision without asking.

docs/adr/007-wrap-ui-components.md
# ADR-007: Wrap UI library components behind shared/ui
Status: Accepted · 2026-03-02 · Supersedes: —

## Context
Feature code imports the component library directly in every
feature folder, so the last library migration touched all of them.

## Decision
Feature code uses components from shared/ui only. Each wrapper exposes
our API and sets app-wide defaults (appendTo, sizes, theming).
Enforced with no-restricted-imports outside shared/ui.

## Options considered
- Use the library directly — fastest now, costliest at the next change.
- Wrap everything up front — too slow; wrappers nobody uses.
- Wrap on second use (chosen).

## Consequences
+ A future library or design change touches one folder.
− Wrappers must be kept in sync with library upgrades.

The takeaway

Write short, dated, one-decision records in the repo, include the options you rejected, supersede rather than edit, and link them from the code they explain. It's the cheapest way for a senior developer's reasoning to outlast their involvement.

Written by Jaymin Maheta Senior UI/UX Developer turning Figma designs into fast, accessible enterprise apps in Angular and React.
About me →