adr-check

A read-only command that checks a plan or current code changes against the project’s architecture decisions. It can use a plan document, named paths, or all tracked and untracked changes in the working tree.

In plain words
What is it for?
Use it before implementing or reviewing work to identify which architecture decisions apply and whether the proposed changes follow them.
Why use it?
It finds conflicts with recorded design rules, including new files that ordinary change checks might miss. It avoids incomplete results from manually reading decision files.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/mbeacom/adrkit/adr-check
Clone the repo
git clone --depth 1 https://github.com/mbeacom/adrkit
Per session 25 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 898 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00025 $0.00898
Opus 5 $0.00013 $0.00449
Sonnet 5 $0.00005 $0.00180
Haiku 4.5 $0.00003 $0.00090

Measured 2d ago against content hash f89a9451b69f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

adr-check scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

packages/adapters/agent-plugin/commands/adr-check.md · 79 lines

What it actually says

Resolve the CLI first

Try, in order: $ADRKIT_CLI, then ./node_modules/.bin/adr, then adr on PATH. @adrkit/cli is normally a dev dependency, so a bare adr is not on PATH in most projects — trying only that and concluding "no CLI is available" is a false negative. If all three fail, say so and tell the user to install @adrkit/cli. Never fall back to reading ADR frontmatter by hand: it cannot expand glob matchers, cannot read inbound @adr markers, and has no exit code, so it produces an answer that looks complete and is not.

Reconcile $ARGUMENTS against the decision record that governs it.

  1. Establish the target paths.

    • Arguments that are paths are the target set.

    • An argument that is a plan or spec document: read it and extract the paths it touches.

    • No arguments: use the working tree's changed paths — both tracked and untracked:

      git diff --name-only HEAD
      git ls-files --others --exclude-standard
      

      The second command is not optional. git diff reports only tracked files, so a brand-new source file — the case most likely to introduce something a decision governs — is invisible to it, and the check would report a clean result for a change it never looked at.

      If both are empty, say the check is unscoped and ask for paths rather than checking everything and reporting noise.

  2. Run the check.

    adr check <paths...> --json
    

    Or call get_decision_context(files: [...]) on the adrkit MCP server.

  3. Add the non-binding context: adr queue for decisions still proposed, and search_decisions with status: ["rejected"] for anything already ruled out. Do not use list_superseded for that — it returns only records whose status is superseded, never a rejected one, so it answers the rejected-option question with a well-formed empty result. Re-proposing a rejected option is a finding even when it conflicts with nothing currently binding.

  4. Run adr lint before you report anything as ungoverned. adr check reports findings only for the paths you passed it, and a record that fails to parse or validate is dropped from the corpus entirely — so a malformed ADR that intends to govern your path yields "No decisions govern the changed files" at exit 0. Treat "nothing governs this" as unverified whenever adr lint is not clean, and name the broken records.

  5. Give one verdict per governing decision, never one verdict for the whole change: complies, departs, supersedes, unreconciled, or re-proposes-rejected. For anything other than complies, state what the decision requires, what the work does instead with a path:line, and which resolution applies — comply, justify the departure in the plan, or supersede the record.

  6. Close with the honest gaps: paths that resolved to nothing, affects matchers too coarse to be conclusive, and whether a corpus error finding is polluting the result.

Interpret the exit code rather than collapsing it: 0 clean; 1 findings, with a complete report still worth reading — for check that means a changed ADR record carries an error-severity finding, since a governed source file changing is reported rather than failed; 2 usage error or unreachable corpus.

Read-only. If the answer is "this needs a new ADR," say so and stop — use /adr-draft deliberately rather than writing a record as a side effect.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 79 lines · 25 tokens per session scan A f89a9451b69f

Subscribe to this mod's changes

adr-check is a command published in the GitHub repository mbeacom/adrkit (11 stars, last pushed 3d ago), licensed Apache-2.0. It adds 25 tokens to every session and 898 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.