StoicBuilder

HandbookXV the PantheonDesign docs and ADRs

XVthe Pantheon, Design the system

Design docs and ADRs

1 min readUpdated 28 November

In plain words

A design doc proposes how to build something, with options and trade-offs, before the work starts; an architecture decision record, or ADR, is a short note recording one decision and why it was made.

Where you see it

A new engineer asks why Harbor's deploy logs live in ClickHouse instead of Postgres, and nobody remembers. A one-page ADR from two years ago answers in a minute: the options considered, the write volume that ruled out Postgres, and what the team gave up.

docs/adr/014-deploy-logs-in-clickhouse.mdagent
# ADR 014: Store deploy logs in ClickHouseStatus: accepted, 2024-03-12Context: 40k log lines a second at peak; Postgres write load at 80%.Options: partitioned Postgres; ClickHouse; a hosted log service.Decision: ClickHouse, keeping 30 days.Consequences: no joins with app tables; one more system to run and back up.
Context, options, decision, consequences. Short enough that people write them, and specific enough to be useful later.

What goes wrong

  1. Writing the doc after the decision

    A doc that describes what was already built invites no real review. Write it while the options are still open, and ask reviewers to challenge the choice.

  2. Only one option considered

    A design with one option is a plan, not a decision. List at least two real alternatives, including doing nothing, and why each lost.

  3. Editing old ADRs when things change

    Rewriting a past decision erases the record of why it made sense. Leave the old ADR, mark it superseded, and write a new one that links to it.

What to tell your agent

Copy this into Lovable, Bolt, Cursor or any agent
Before writing code, draft a design doc for this change: the problem and goals, non-goals, two or three options with trade-offs, the one you recommend and why, risks, and how we'd roll it out and back. Keep it under two pages, mark every number you estimated, and wait for my review.

Quick check

Sign in to earn +10 XP for it

Harbor later moves deploy logs off ClickHouse. What should happen to ADR 014?

Got a prompt that touches design docs and ADRs?

Paste it. You get a better prompt first, then the cards that explain it.

Check your own prompt

Free, no sign-up.