| name | mcaf-adr-writing |
| description | Create or update an ADR (Architecture Decision Record) under `docs/ADR/` using `docs/templates/ADR-Template.md`: context, decision, alternatives, consequences, rollout, and verification. Use when changing architecture, boundaries, dependencies, data model, or cross-cutting patterns; ensure it is self-contained, has a Mermaid diagram, and defines testable invariants. |
| compatibility | Requires repository write access; produces Markdown docs with Mermaid diagrams. |
MCAF: ADR Writing
Outputs
docs/ADR/ADR-XXXX-<short-title>.md(create or update)- Update
docs/Architecture/Overview.mdwhen boundaries/interactions change
Decision Quality (anti-guesswork checklist)
Before writing, make the ADR executable (no placeholders, no hand-waving):
- Decision: one sentence. If you can’t write it, you don’t have a decision yet.
- Scope: what changes / what does not + which module(s) are affected (match
docs/Architecture/Overview.mdnames). - No invented reality: every component you mention exists in the repo today, or is explicitly part of this change (named + where it will live).
- Invariants: write as MUST / MUST NOT statements and say how we prove each (test or static analysis).
- Verification: use exact commands from
AGENTS.mdand link scenarios → test IDs. - Stakeholders: Product / Dev / DevOps / QA — what each role must know to execute safely.
Workflow
- Confirm the decision scope:
- what changes (and what does not)
- what module(s) are affected
- follow
AGENTS.mdscoping rules: Architecture map → linked ADR/Feature → entry points (do not scan everything)
- Start from
docs/templates/ADR-Template.md.- keep the ADR’s
## Implementation plan (step-by-step)updated while executing
- keep the ADR’s
- Write the ADR as a decision record:
- Context: constraints + why this is needed now
- Decision: a short, direct statement
- Diagram (mandatory): include at least one Mermaid diagram for the decision (boundaries/modules/interactions)
- Alternatives: 1–3 realistic options with pros/cons
- Consequences: trade-offs, risks, mitigations
- Make it executable for the team:
- follow
AGENTS.mdTask Delivery rules (analysis → plan → execute → verify) - include the invariants that must be proven by tests
- include verification commands copied from
AGENTS.md - include rollout/rollback and “how we know it’s safe”
- follow
- Make impacts explicit:
- code/modules affected
- data/config changes (including migration/rollback)
- backwards compatibility strategy
- Add verification that proves the decision:
- which tests must exist/change
- which suites must stay green
- If the decision changes boundaries, update
docs/Architecture/Overview.md(diagram, modules table, dependency rules).
Guardrails
- ADRs are self-contained: no hidden context, no “as discussed”.
- ADRs justify why; feature docs describe what the system does.
- If you can’t state the decision in 1–2 sentences, the ADR is not ready.