ADR Manager
Overview
Handle the full ADR lifecycle through one entry point. Detect repository-specific ADR conventions first, then route to the right mode and fall back to bundled defaults only when the repository does not define its own template or workflow.
Mode Routing
Choose one mode before producing output:
decide
- Use for issue, PR, diff, review-thread, or design-change triage.
- Return whether an ADR is
required, recommended, or not-needed.
draft
- Use for creating a new ADR draft or proposing an update to an existing ADR.
- If the change is not ADR-worthy, return
ADR not needed instead of forcing a draft.
lint
- Use for structural validation of an ADR draft.
- Focus on status, required sections, evidence quality, and supersede linkage.
review
- Use for design review after
lint has no unresolved high or medium findings.
- Focus on decision quality, conflicts, rollout risk, and human-owned decisions.
audit
- Use for drift checks between ADRs and the current repository state.
- Compare ADR claims with docs, specs, tests, and source paths.
index
- Use only when the repository already has ADR index artifacts or an explicit ADR index spec.
- Do not invent derived index files for repositories that do not already use them.
If the user request is ambiguous, infer the mode from the artifact:
- existing ADR file ->
lint by default
- explicit request to review an existing ADR -> run
lint first when no prior clean lint result is available, then continue to review only if there are no unresolved high or medium findings
- issue / PR / diff asking "do we need an ADR?" ->
decide
- request to "write", "draft", or "update" an ADR ->
draft
- request to compare ADRs with implementation or find drift ->
audit
- request to refresh ADR map, README, or index ->
index
Repository Discovery
Before using bundled defaults, detect the repository's ADR convention.
Read in this order:
- ADR governance, criteria, workflow, or contributing docs that mention decision records
- ADR directories and templates
- Public docs and internal specs
- Existing ADRs
- Tests
- Source code
- Issue / PR / diff context
Search likely ADR roots first:
docs/adr
docs/decisions
adr
architecture/adr
dev-docs/adr
Search likely repo policy docs next:
adr-governance.md
adr-criteria.md
adr-workflow.md
contributing.md
- decision-record guidance under
docs/, specs/, or architecture/
Prefer repository-native conventions when they exist:
- path layout
- template headings and section names
- allowed status values
- naming and numbering scheme
- index artifact names and contract
- documentation language
If the repository does not define these, fall back to the bundled template and contracts in references/default-adr-template.md and references/output-contracts.md.
Common Rules
- Treat ADRs as decision records. Keep
why in the ADR and leave detailed how in specs or code.
- Build evidence from at least one concrete source. Prefer the full triad: docs/specs, tests, and src.
- Match the repository's language and formatting style. If there is no signal, write artifact bodies in English.
- When the change touches public API, CLI, MCP, schema, migration, fallback, or compatibility policy, include the corresponding public docs in scope.
- Do not silently rewrite accepted ADR text during
lint, review, or audit. Return findings or an update proposal.
- If the change is not ADR-worthy, say so explicitly and include a short rationale instead of drafting noise.
- Escalate decisions that AI should not settle alone, including security, license, legal/compliance, unresolved product direction, public breaking-change judgment, or major organization-wide restructures.
Mode Contracts
decide
Return:
verdict
rationale
affected domains
existing ADR candidates
suggested next action
evidence triad
Use required, recommended, or not-needed.
draft
Use the repository's existing ADR template when present. Otherwise use references/default-adr-template.md.
Return one of:
- new ADR draft
- update proposal for an existing ADR
ADR not needed
Include concrete evidence paths whenever the repository provides them.
lint
Return findings first, ordered by severity.
Check:
- valid status value
- required sections exist
- evidence is concrete rather than generic
- consequences include tradeoffs, not only benefits
- supersede references are present and internally consistent when claimed
Use severity high, medium, low.
review
Only run after the current draft has no unresolved lint high or medium findings.
If the user asks for review directly and no clean lint result is in evidence, perform lint first and treat unresolved high or medium findings as a blocker to review.
Return:
verdict
scope
findings
open questions
residual risks
Use verdicts ready, revise, escalate.
audit
Audit claim-level alignment between ADRs and the current repository.
Return:
Use finding types:
policy-drift
missing-adr-update
missing-evidence
stale-reference
Each finding should include a recommended action:
update-adr
new-adr
update-specs
add-tests
no-action
index
Only run if the repository already has ADR index artifacts or an explicit index spec.
Return:
updated artifacts
added or changed ADR entries
consistency findings
If no repository convention exists, return a concise no-op result that states the index convention was not found.
Review and Audit Heuristics
- If a mode or backend policy changes across multiple entry points, it leans ADR-worthy.
- If a default changes consumer-visible meaning, treat it as a likely ADR candidate.
- If the repository already has a relevant ADR, prefer updating or superseding it over creating overlapping policy.
- When compatibility, migration, fallback, or safety impact matters, require those consequences to be covered explicitly.
- For audits, compare claims against the current docs/specs/tests/src rather than relying on ADR text alone.
References
- Read
references/default-adr-template.md when no repository template or section contract is present.
- Read
references/output-contracts.md when you need exact output envelopes for decide, review, audit, or index.
1---2name: adr-manager3description: Unified ADR workflow for any repository. Use when Codex needs to determine whether a change needs an Architecture Decision Record, draft a new ADR or propose an update, lint or review an ADR draft, audit ADRs against docs/specs/tests/src for drift, or refresh ADR index artifacts in repositories that already define ADR indexing conventions. Trigger on requests about ADRs, architecture decisions, design rationale, issue/PR/diff policy changes, ADR review, ADR audits, or ADR index maintenance.4---56# ADR Manager78## Overview910Handle the full ADR lifecycle through one entry point. Detect repository-specific ADR conventions first, then route to the right mode and fall back to bundled defaults only when the repository does not define its own template or workflow.1112## Mode Routing1314Choose one mode before producing output:1516- `decide`17 - Use for issue, PR, diff, review-thread, or design-change triage.18 - Return whether an ADR is `required`, `recommended`, or `not-needed`.19- `draft`20 - Use for creating a new ADR draft or proposing an update to an existing ADR.21 - If the change is not ADR-worthy, return `ADR not needed` instead of forcing a draft.22- `lint`23 - Use for structural validation of an ADR draft.24 - Focus on status, required sections, evidence quality, and supersede linkage.25- `review`26 - Use for design review after `lint` has no unresolved `high` or `medium` findings.27 - Focus on decision quality, conflicts, rollout risk, and human-owned decisions.28- `audit`29 - Use for drift checks between ADRs and the current repository state.30 - Compare ADR claims with docs, specs, tests, and source paths.31- `index`32 - Use only when the repository already has ADR index artifacts or an explicit ADR index spec.33 - Do not invent derived index files for repositories that do not already use them.3435If the user request is ambiguous, infer the mode from the artifact:3637- existing ADR file -> `lint` by default38- explicit request to review an existing ADR -> run `lint` first when no prior clean `lint` result is available, then continue to `review` only if there are no unresolved `high` or `medium` findings39- issue / PR / diff asking "do we need an ADR?" -> `decide`40- request to "write", "draft", or "update" an ADR -> `draft`41- request to compare ADRs with implementation or find drift -> `audit`42- request to refresh ADR map, README, or index -> `index`4344## Repository Discovery4546Before using bundled defaults, detect the repository's ADR convention.4748Read in this order:49501. ADR governance, criteria, workflow, or contributing docs that mention decision records512. ADR directories and templates523. Public docs and internal specs534. Existing ADRs545. Tests556. Source code567. Issue / PR / diff context5758Search likely ADR roots first:5960- `docs/adr`61- `docs/decisions`62- `adr`63- `architecture/adr`64- `dev-docs/adr`6566Search likely repo policy docs next:6768- `adr-governance.md`69- `adr-criteria.md`70- `adr-workflow.md`71- `contributing.md`72- decision-record guidance under `docs/`, `specs/`, or `architecture/`7374Prefer repository-native conventions when they exist:7576- path layout77- template headings and section names78- allowed status values79- naming and numbering scheme80- index artifact names and contract81- documentation language8283If the repository does not define these, fall back to the bundled template and contracts in `references/default-adr-template.md` and `references/output-contracts.md`.8485## Common Rules8687- Treat ADRs as decision records. Keep `why` in the ADR and leave detailed `how` in specs or code.88- Build evidence from at least one concrete source. Prefer the full triad: docs/specs, tests, and src.89- Match the repository's language and formatting style. If there is no signal, write artifact bodies in English.90- When the change touches public API, CLI, MCP, schema, migration, fallback, or compatibility policy, include the corresponding public docs in scope.91- Do not silently rewrite accepted ADR text during `lint`, `review`, or `audit`. Return findings or an update proposal.92- If the change is not ADR-worthy, say so explicitly and include a short rationale instead of drafting noise.93- Escalate decisions that AI should not settle alone, including security, license, legal/compliance, unresolved product direction, public breaking-change judgment, or major organization-wide restructures.9495## Mode Contracts9697### `decide`9899Return:100101- `verdict`102- `rationale`103- `affected domains`104- `existing ADR candidates`105- `suggested next action`106- `evidence triad`107108Use `required`, `recommended`, or `not-needed`.109110### `draft`111112Use the repository's existing ADR template when present. Otherwise use `references/default-adr-template.md`.113114Return one of:115116- new ADR draft117- update proposal for an existing ADR118- `ADR not needed`119120Include concrete evidence paths whenever the repository provides them.121122### `lint`123124Return findings first, ordered by severity.125126Check:127128- valid status value129- required sections exist130- evidence is concrete rather than generic131- consequences include tradeoffs, not only benefits132- supersede references are present and internally consistent when claimed133134Use severity `high`, `medium`, `low`.135136### `review`137138Only run after the current draft has no unresolved `lint` `high` or `medium` findings.139If the user asks for `review` directly and no clean `lint` result is in evidence, perform `lint` first and treat unresolved `high` or `medium` findings as a blocker to `review`.140141Return:142143- `verdict`144- `scope`145- `findings`146- `open questions`147- `residual risks`148149Use verdicts `ready`, `revise`, `escalate`.150151### `audit`152153Audit claim-level alignment between ADRs and the current repository.154155Return:156157- `scope`158- `findings`159160Use finding types:161162- `policy-drift`163- `missing-adr-update`164- `missing-evidence`165- `stale-reference`166167Each finding should include a recommended action:168169- `update-adr`170- `new-adr`171- `update-specs`172- `add-tests`173- `no-action`174175### `index`176177Only run if the repository already has ADR index artifacts or an explicit index spec.178179Return:180181- `updated artifacts`182- `added or changed ADR entries`183- `consistency findings`184185If no repository convention exists, return a concise no-op result that states the index convention was not found.186187## Review and Audit Heuristics188189- If a mode or backend policy changes across multiple entry points, it leans ADR-worthy.190- If a default changes consumer-visible meaning, treat it as a likely ADR candidate.191- If the repository already has a relevant ADR, prefer updating or superseding it over creating overlapping policy.192- When compatibility, migration, fallback, or safety impact matters, require those consequences to be covered explicitly.193- For audits, compare claims against the current docs/specs/tests/src rather than relying on ADR text alone.194195## References196197- Read `references/default-adr-template.md` when no repository template or section contract is present.198- Read `references/output-contracts.md` when you need exact output envelopes for `decide`, `review`, `audit`, or `index`.