Create a new Architecture Decision Record with the next sequential number, register it in the AgentDB graph, and link it to related ADRs.
When a significant architectural decision needs to be recorded -- new technology adoption, API design choices, data model changes, infrastructure decisions, or any cross-cutting concern that affects multiple components.
-
Find next number -- Glob for docs/adr/ADR-*.md and parse the 4-digit number following the ADR- prefix in each filename to determine the next sequential ID (e.g. 0042). Filter out non-ADR files (README.md, INDEX.md, _template.md). Create docs/adr/ if it does not exist.
-
Slugify title -- Convert the title argument to a lowercase, hyphen-separated slug (e.g., "Use PostgreSQL for persistence" becomes use-postgresql-for-persistence). Drop punctuation; collapse runs of hyphens.
-
Create ADR file -- Write the file at docs/adr/ADR-NNNN-<slug>.md using the canonical MADR template:
---
status: proposed
completed: false
date: <today's date YYYY-MM-DD>
tags: []
supersedes: []
depends-on: []
implements: []
---
# <Title>
## Context and Problem Statement
<!-- What is the issue that motivates this decision? Describe the situation and the question. -->
## Decision Drivers
<!-- Optional. Forces shaping the decision: constraints, qualities, stakeholder concerns. Bullet list. -->
* <driver 1>
* <driver 2>
## Considered Options
<!-- Bullet list of alternatives evaluated. One option per line. -->
* <Option A> — <brief description>
* <Option B> — <brief description>
## Decision Outcome
Chosen option: "<Option A>", because <justification — why this option meets the decision drivers, satisfies the K.O. criteria, or comes out best>.
### Consequences
<!-- Flat bullet list. Use canonical phrasing: "* Good, because …" / "* Bad, because …" / "* Neutral, because …" -->
* Good, because <positive consequence>
* Bad, because <negative consequence>
* Neutral, because <neutral consequence>
### Confirmation
<!-- Optional. How compliance with this decision is verified (review, ArchUnit test, lint rule, etc.). -->
## Pros and Cons of the Options
<!-- Optional. Per-option deliberation detail. H3 per option. -->
### <Option A>
* Good, because <argument>
* Bad, because <argument>
### <Option B>
* Good, because <argument>
* Bad, because <argument>
## More Information
<!-- Optional. Links, related ADRs, supporting evidence. -->
-
Store in AgentDB -- Call mcp__ruflo__agentdb_hierarchical-store with (the live schema's required fields are key + value; optional tier):
- key:
adr/ADR-NNNN
- value:
{ "id": "ADR-NNNN", "title": "<title>", "status": "proposed", "completed": false, "date": "<today>", "tags": [], "supersedes": [], "depends-on": [], "implements": [], "file": "docs/adr/ADR-NNNN-<slug>.md" }
-
Find related ADRs -- Call mcp__ruflo__memory_search with the title as query in namespace adr-patterns to find related decisions. If matches found, add them to the ## More Information section and create causal edges with relation depends-on.
-
Store pattern -- Call mcp__ruflo__memory_store in namespace adr-patterns with key ADR-NNNN and the title + context as value for future semantic search.
-
Report -- Output the created file path, ADR number, and any related ADRs found.