built by aktagon.com

Your ADRs are AI context. Lint them like code.

Keep the markdown your agents retrieve correct, current, and groundable — checked in CI on every commit.

ctxgrd is a CLI linter for the structured markdown your team and your AI both depend on. ADRs, PRDs, runbooks — every .md file with frontmatter and an ID. Same input, same output, same exit code.

Lint your context. · Markdown only. On purpose.

It lints itself — every commit in CI MIT · cargo install ctxgrd

01 For the context engineer

Context rot fails the build.

  • A cross-reference points at an ADR you deleted.
  • A decision was superseded — but nothing downstream knows.
  • Your agent retrieves it anyway, and ships the wrong pattern.

ctxgrd catches broken references, tangled decision lineage, and duplicate IDs before they reach the model — and fails CI like a type error.

02 One contract, two readers

Built for humans and agents alike.

Every command emits --format json, keeps stdout a clean parseable stream, and returns documented exit codes. An agent can drive ctxgrd without screen-scraping — the same way your CI does.

0  clean1  diagnostics2  config error

init

Scaffold ctxgrd.toml and your first namespaces in one command.

lint

Check every claimed doc. Human output, or --format json for agents.

status

See the decision frontier — what's ready, what's blocked, what's stale.

pack add

Drop in reusable namespace bundles — agents, ops, project-docs, gdpr.

hooks install

Wire ctxgrd into pre-commit, CI, or a Claude stop-hook.

new

Generate a correctly-structured ADR, PRD, or runbook from a template.

Installone binary

A single Rust binary — no runtime, no daemon. Install from the public GitHub repo, or drop a prebuilt release binary on your PATH.

Bootstrap a configctxgrd init

One command writes a ctxgrd.toml that already passes its own validator, then lists every built-in pack — pick one to get a whole family of document types at once.

Scaffold a recordctxgrd new

Picks the next free ID for the namespace, slugifies the title, and writes the required-heading skeleton. Prints the path so you can pipe it to your editor.

Lint the whole treectxgrd

The default command. Walks the tree, lints every claimed document against its type, and points at the line. Exit 1 on errors — drop it straight into CI.

See your pipelinectxgrd status

Treats your document types as a dependency DAG and prints one aligned row per stage: namespace, state, doc count, and what it `needs`. The ready set — stages whose parents are all done — renders as `ready:`. Add --format json for agents.

Draw the pipelinectxgrd status --format mermaid|dot

The same per-namespace DAG as diagram source — Mermaid `flowchart LR` or Graphviz DOT, emitted as text (never rendered). Pipe it into a docs build or a PR comment to show the workflow shape and where you are in it.

Keep docs freshctxgrd pin

Pin a document to the commit of the code it documents. When that code moves, the doc is flagged stale — re-verify, then bless it back to green.

Adopt a packctxgrd pack

A pack is a reusable bundle of namespaces plus the rules they need. Adding one appends its blocks to ctxgrd.toml — it never clobbers what you already have.

Spot pack driftctxgrd pack outdated

Every block `pack add` writes is stamped with the pack version and a content fingerprint — `# pack: <name>@<version> sha:<hash>`. When the pack definition later evolves (a renamed namespace, a new rule), `pack outdated` reports the drift read-only: exit 0 when in sync, exit 1 when a block has fallen behind. Add --format json for agents.

Propagate a pack changectxgrd pack migrate

Pull a pack-definition change into your config. Migrate rewrites fingerprint-clean blocks to the pack's current shape and re-stamps them; a block you have hand-edited is left untouched and surfaced as a structured diff to resolve yourself. The change is idempotent and purely structural — it introduces no new diagnostics. Preview with --dry-run, script it with --format json.

Commercial packsctxgrd pack list --paid

Beyond the built-in packs, ctxgrd has room for commercial packs that bundle a specialised document standard. arc42 — the 12 canonical architecture-documentation sections as required headings — is the first. Commercial license, coming soon.

Wire into CIctxgrd hooks

Install a git pre-commit hook in one command — a lint failure aborts the commit. The same binary and exit codes drive your CI gate and editor LSP.

03 See it work

The error your agent would otherwise have trusted.

Before — ctxgrd off
After — ctxgrd in CI

Project docs6 namespaces

ADR, PRD, RFC, BUG doc types plus the TODO state file and the README front door — engineering doc lifecycle with status vocabularies, required headings, and a README that links the entry guide.

Agent context1 namespace

AGENTS — the AGENTS.md cross-tool instruction standard (agents.md).

Claude Code3 namespaces

CLAUDE/CLAUDESKILLS/CLAUDEAGENTS — the files proprietary to Claude Code: the CLAUDE.md instruction file, .claude/skills SKILL.md definitions, and .claude/agents subagent definitions.

OpenAI Codex1 namespace

CODEXSKILLS — OpenAI Codex SKILL.md definitions (.codex/skills).

Gemini CLI1 namespace

GEMINI — the GEMINI.md instruction file Gemini CLI reads.

opencode1 namespace

OPENCODEAGENTS — opencode agent definitions (.opencode/agent/*.md), linted via the opencode.frontmatter rule.

Agent workflow3 namespaces

SPEC/TASK/PROMPT — ctxgrd's harness-neutral agent-development document pipeline: a SPEC is implemented via TASKs, and reusable PROMPTs are versioned.

Operations2 namespaces

RUN (runbooks) and PMR (postmortems) — the incident-management doc lifecycle, grounded in Google's SRE Book.

Security7 namespaces

Security-document lifecycle (THREAT/VULN/RISK/SECREV/DEPAUDIT) plus neutral governance (POLICY/ASSET) — framework-neutral evidence discipline, no certification intent.

GDPR3 namespaces

GDPR documentary artifacts (ROPA/DPIA/DPA) over the security base — Regulation (EU) 2016/679 Arts. 28/30/35. Paperwork existence/metadata/freshness only, never legal adequacy.

HIPAA2 namespaces

HIPAA Security Rule safeguard register (SAFEGUARD) and Business Associate Agreement register (BAA) over the security base — 45 CFR 164.308/310/312, Security Rule as in force 2026. Paperwork existence/metadata/freshness only, never legal adequacy.

Design system1 namespace

DESIGN.md structural linting — section order and token reference checks

Persona2 namespaces

SOUL.md/STYLE.md persona linting — section presence, order, and pairing

Guide1 namespace

GUIDE — end-user documentation typed by the Diátaxis taxonomy (tutorial/how-to/reference/explanation) with a required title, kept discoverable from the README.

Lint your context like you lint your code.

The core tool and every built-in pack are free and MIT-licensed, forever. Commercial packs (arc42, GDPR, HIPAA) are optional add-ons.