Skip to content

archgate review-context

Pre-compute review context with ADR briefings for changed files. Designed for CI and editor plugin integrations that need a summary of which ADRs apply to the files being changed.

Terminal window
archgate review-context [options]
OptionDescription
--stagedOnly include git-staged files
--base [ref]Compare changed files against a base ref (auto-detects when omitted)
--run-checksInclude ADR compliance check results
--domain <domain>Filter to a single domain
--verboseInclude each ADR’s Decision and Do’s/Don’ts prose
--strictExit 1 when briefings were truncated, or (with --run-checks) when check found strict-relevant findings
Terminal window
archgate review-context --staged

Pass --strict to make this command fail (exit 1) rather than just report: it fails when truncatedBriefings is non-empty (requires --verbose to have anything to truncate), or, with --run-checks, when the reused checkSummary.warningsExceeded or checkSummary.strictAdvisoryExceeded is true. --strict does not fail on ordinary rule violations (checkSummary.failed/ruleErrors) — this command stays a context generator for agents, not a second compliance gate; use archgate check to gate on rule violations. A --strict failure prints the full JSON payload first, then logs the reason to stderr before exiting.

--strict resolves the same way as archgate check --strict: CLI flag, then a strict: boolean key in .archgate/config.json, then off.

By default each ADR is identified by id, title, domain, files, and rules only — enough to know which ADRs apply to the changed files. Read the ones you need with archgate adr show <id>.

Pass --verbose to embed every applicable ADR’s Decision and Do’s/Don’ts prose in the response instead. That prose grows with the number of matched ADRs and dominates the payload — large enough on a repository with many ADRs that agent harnesses stop displaying the result inline. Prefer the default and drill down; reach for --verbose only when a single self-contained payload is genuinely required.

Briefing prose is capped per section. When a Decision or Do’s and Don’ts section exceeds the cap it is cut, and the omission is reported four ways:

  • The cut point is marked inline with [... truncated — read full ADR via adr://<id>].
  • The ADR’s own briefing lists the affected section names in truncatedSections.
  • Every affected ADR id is collected in the top-level truncatedBriefings array. It is populated after --domain filtering, so it names only ADRs present in the response.
  • A warning naming those ADRs is written to stderr, leaving stdout valid JSON.

Treat any of these as meaning the ADR’s governing text is incomplete: the rules it states may sit in the part that was cut. Read the full document with archgate adr show <id> before relying on the briefing.

Two other limits truncate this payload, each with its own stderr warning. truncatedFiles is set when the changed-file list exceeds its cap, so files beyond it are absent from every domain. With --run-checks, checkSummary.truncated is set when a rule reported more violations than the per-rule cap — run archgate check for the complete list.

When --run-checks is passed, checkSummary follows the same rule as archgate check --output json: its results array carries only rules with something to report, while the counts beside it still cover every rule that ran.