|
| 1 | +# ADR Formats (templates) |
| 2 | + |
| 3 | +This file is for **copy/paste**. Pick one of the templates below and fill it with real repo facts. |
| 4 | + |
| 5 | +Rules (MCAF): |
| 6 | + |
| 7 | +- ADRs are self-contained (no “as discussed”). |
| 8 | +- At least one Mermaid diagram is mandatory. |
| 9 | +- ADRs define testable invariants + verification commands (not vibes). |
| 10 | + |
| 11 | +--- |
| 12 | + |
| 13 | +## Template 1: MCAF ADR (full) |
| 14 | + |
| 15 | +Use this as the default template. Save as `docs/ADR/ADR-XXXX-title-in-kebab-case.md`. |
| 16 | + |
| 17 | +````md |
| 18 | +# ADR-XXXX: Title |
| 19 | + |
| 20 | +Status: Proposed | Accepted | Implemented | Rejected | Superseded |
| 21 | +Date: YYYY-MM-DD |
| 22 | +Related Features: `docs/Features/...` (recommended) |
| 23 | +Supersedes: `docs/ADR/ADR-....md` (delete if none) |
| 24 | +Superseded by: `docs/ADR/ADR-....md` (delete if none) |
| 25 | + |
| 26 | +Rules: |
| 27 | + |
| 28 | +- This ADR is **self-contained** — avoid “as discussed”; include all critical context and links. |
| 29 | +- At least **one Mermaid diagram is mandatory** (boundaries/modules/interactions for this decision). |
| 30 | + |
| 31 | +--- |
| 32 | + |
| 33 | +## Context |
| 34 | + |
| 35 | +- Current situation (what exists today). |
| 36 | +- Constraints (tech/legal/time/org constraints that matter). |
| 37 | +- Problem statement (what is failing / what you must enable). |
| 38 | +- Goals (what success looks like). |
| 39 | +- Non-goals (what this ADR is not trying to solve). |
| 40 | + |
| 41 | +--- |
| 42 | + |
| 43 | +## Stakeholders (who needs this to be clear) |
| 44 | + |
| 45 | +| Role | What they need to know | Questions this ADR must answer | |
| 46 | +| --- | --- | --- | |
| 47 | +| Product / Owner | User/business impact, scope, rollout risk | What changes for users? What’s out of scope? | |
| 48 | +| Engineering | Boundaries/modules, data/contract changes, edge cases | What do we change, where, and why? | |
| 49 | +| DevOps / SRE | Deployability, config, monitoring, rollback | How do we ship safely and observe it? | |
| 50 | +| QA | Test scenarios + environment assumptions | What must be proven by automated tests? | |
| 51 | + |
| 52 | +--- |
| 53 | + |
| 54 | +## Decision |
| 55 | + |
| 56 | +- One sentence decision statement. |
| 57 | + |
| 58 | +Key points: |
| 59 | + |
| 60 | +- Key point 1 |
| 61 | +- Key point 2 |
| 62 | + |
| 63 | +--- |
| 64 | + |
| 65 | +## Diagram (Mandatory) |
| 66 | + |
| 67 | +```mermaid |
| 68 | +%% Show the boundaries/modules that change, and how they interact. |
| 69 | +%% Prefer 1 clear diagram over many noisy ones. |
| 70 | +``` |
| 71 | + |
| 72 | +--- |
| 73 | + |
| 74 | +## Alternatives considered |
| 75 | + |
| 76 | +### Option A |
| 77 | + |
| 78 | +- Pros: |
| 79 | +- Cons: |
| 80 | +- Rejected because: |
| 81 | + |
| 82 | +### Option B |
| 83 | + |
| 84 | +- Pros: |
| 85 | +- Cons: |
| 86 | +- Rejected because: |
| 87 | + |
| 88 | +--- |
| 89 | + |
| 90 | +## Consequences |
| 91 | + |
| 92 | +### Positive |
| 93 | + |
| 94 | +- Benefit |
| 95 | + |
| 96 | +### Negative / risks |
| 97 | + |
| 98 | +- Risk |
| 99 | +- Mitigation: |
| 100 | + |
| 101 | +--- |
| 102 | + |
| 103 | +## Impact |
| 104 | + |
| 105 | +### Code |
| 106 | + |
| 107 | +- Affected modules / services: |
| 108 | +- New boundaries / responsibilities: |
| 109 | +- Feature flags / toggles (names, defaults, removal plan): |
| 110 | + |
| 111 | +### Data / configuration |
| 112 | + |
| 113 | +- Data model / schema changes: |
| 114 | +- Config changes (keys, defaults, secrets handling): |
| 115 | +- Backwards compatibility strategy: |
| 116 | + |
| 117 | +### Documentation |
| 118 | + |
| 119 | +- Feature docs to update: |
| 120 | +- Testing docs to update: |
| 121 | +- Architecture docs to update: |
| 122 | +- `docs/Architecture/Overview.md` updates (what must change): |
| 123 | +- Notes for `AGENTS.md` (new rules/patterns): |
| 124 | + |
| 125 | +--- |
| 126 | + |
| 127 | +## Verification (Mandatory: describe how to test this decision) |
| 128 | + |
| 129 | +### Objectives |
| 130 | + |
| 131 | +- What behaviour / qualities must be proven. |
| 132 | +- Which invariants from this ADR must be encoded as tests (happy path + negative/forbidden + edge cases). |
| 133 | +- Link each objective/scenario to the specific automated test(s) that prove it. |
| 134 | + |
| 135 | +### Test environment |
| 136 | + |
| 137 | +- Environment (local compose / staging / prod-like): |
| 138 | +- Data and reset strategy (seed data, migrations, rollback plan): |
| 139 | +- External dependencies (real / sandbox / fake services required): |
| 140 | + |
| 141 | +### Test commands |
| 142 | + |
| 143 | +- build: (paste from `AGENTS.md`) |
| 144 | +- test: (paste from `AGENTS.md`) |
| 145 | +- format: (paste from `AGENTS.md`) |
| 146 | +- coverage: (paste from `AGENTS.md` if separate; otherwise delete) |
| 147 | + |
| 148 | +### New or changed tests |
| 149 | + |
| 150 | +| ID | Scenario | Level (Unit / Int / API / UI) | Expected result | Notes / Data | |
| 151 | +| --- | --- | --- | --- | --- | |
| 152 | +| TST-001 | Happy path / negative / edge | Integration | Observable outcome | Fixtures / seed data | |
| 153 | + |
| 154 | +### Regression and analysis |
| 155 | + |
| 156 | +- Regression suites to run (must stay green): |
| 157 | +- Static analysis (tools/configs that must pass): |
| 158 | +- Monitoring during rollout (logs/metrics/alerts to watch): |
| 159 | + |
| 160 | +--- |
| 161 | + |
| 162 | +## Rollout and migration |
| 163 | + |
| 164 | +- Migration steps: |
| 165 | +- Backwards compatibility: |
| 166 | +- Rollback: |
| 167 | + |
| 168 | +--- |
| 169 | + |
| 170 | +## References |
| 171 | + |
| 172 | +- Issues / tickets: |
| 173 | +- External docs / specs: |
| 174 | +- Related ADRs: |
| 175 | + |
| 176 | +--- |
| 177 | + |
| 178 | +## Filing checklist |
| 179 | + |
| 180 | +- [ ] File saved under `docs/ADR/ADR-XXXX-title-in-kebab-case.md` (not in `docs/templates/`). |
| 181 | +- [ ] Status reflects real state (`Proposed`, `Accepted`, `Rejected`, `Superseded`). |
| 182 | +- [ ] Links to related features, tests, and ADRs are filled in. |
| 183 | +- [ ] Diagram section contains at least one Mermaid diagram. |
| 184 | +- [ ] `docs/Architecture/Overview.md` updated if module boundaries or interactions changed. |
| 185 | +```` |
| 186 | + |
| 187 | +--- |
| 188 | + |
| 189 | +## Template 2: Mini ADR (small, safe decision) |
| 190 | + |
| 191 | +Use this when the decision is real but the scope is contained (still needs a diagram + verification). |
| 192 | + |
| 193 | +````md |
| 194 | +# ADR-XXXX: Title |
| 195 | + |
| 196 | +Status: Proposed | Accepted | Implemented | Rejected | Superseded |
| 197 | +Date: YYYY-MM-DD |
| 198 | +Related Features: `docs/Features/...` (delete if none) |
| 199 | + |
| 200 | +## Decision |
| 201 | + |
| 202 | +- One sentence. |
| 203 | + |
| 204 | +## Why (context + constraints) |
| 205 | + |
| 206 | +- Why now: |
| 207 | +- Constraints: |
| 208 | + |
| 209 | +## Diagram (Mandatory) |
| 210 | + |
| 211 | +```mermaid |
| 212 | +%% Boundaries/modules that change + their interaction. |
| 213 | +``` |
| 214 | + |
| 215 | +## Alternatives (at least one) |
| 216 | + |
| 217 | +- Alternative A (why not): |
| 218 | + |
| 219 | +## Consequences |
| 220 | + |
| 221 | +- Positive: |
| 222 | +- Negative / risks + mitigations: |
| 223 | + |
| 224 | +## Verification (Mandatory) |
| 225 | + |
| 226 | +- Invariants to test: |
| 227 | +- Tests to add/update: |
| 228 | +- Commands to run (from `AGENTS.md`): |
| 229 | +```` |
| 230 | + |
| 231 | +--- |
| 232 | + |
| 233 | +## Template 3: Options Matrix ADR (when choosing between 2–4 options) |
| 234 | + |
| 235 | +Use this when you need to evaluate trade-offs explicitly and keep the decision auditable. |
| 236 | + |
| 237 | +````md |
| 238 | +# ADR-XXXX: Title |
| 239 | + |
| 240 | +Status: Proposed | Accepted | Implemented | Rejected | Superseded |
| 241 | +Date: YYYY-MM-DD |
| 242 | + |
| 243 | +## Decision |
| 244 | + |
| 245 | +- One sentence. |
| 246 | + |
| 247 | +## Decision drivers (what matters) |
| 248 | + |
| 249 | +- Driver 1: |
| 250 | +- Driver 2: |
| 251 | + |
| 252 | +## Options |
| 253 | + |
| 254 | +| Option | Summary | Pros | Cons | Risk | Why/why not | |
| 255 | +| --- | --- | --- | --- | --- | --- | |
| 256 | +| A | | | | | | |
| 257 | +| B | | | | | | |
| 258 | + |
| 259 | +## Diagram (Mandatory) |
| 260 | + |
| 261 | +```mermaid |
| 262 | +%% Diagram the chosen option (and the most important alternative if helpful). |
| 263 | +``` |
| 264 | + |
| 265 | +## Verification (Mandatory) |
| 266 | + |
| 267 | +- Invariants to protect: |
| 268 | +- Test plan: |
| 269 | +```` |
0 commit comments