criv connects your architectural decisions (ADRs) to the code they govern, and blocks changes that break them.
Decision records drift because nothing checks them against the code. criv does:
- An ADR names the source paths it governs and links to files and symbols.
criv checkfails when a link no longer resolves. - An ADR can carry ast-grep policies.
criv enforceblocks the commit, push, or CI run that breaks one. criv queryanswers which decisions govern a file, and which code has no decision.
criv runs locally, with no server and no network access.
Add criv to the mise.toml of your repository:
[tools."github:TudorAndrei/criv"]
version = "latest"Then run:
mise install
criv initcriv init writes criv.toml, the docs/adr/ folder, and agent skills. Keep
.criv/ out of Git.
criv adr new "Cache compiled policies" # draft a decision
criv check # validate decisions and their links
criv enforce --stage commit # block changes that break a policy
criv query governing src/main.rs # which decisions govern this file?An ADR declares its scope and policies in its frontmatter:
governs:
- src/**/*.rs
policy:
patterns:
- id: no-println
language: rust
pattern: "println!($$$ARGS)"
message: Prefer structured diagnostics.Each diagnostic prints the fix: that repairs it. Run criv <command> --help
for every flag, or criv --usage-json for the full command tree.
- Hook runner setup for hk and lefthook.
- Configuration, queries, and local State.
- Elixir source support.
- Editor viewer:
criv install-editor --editor code. - Architecture diagrams and Gherkin integration live in Concord.
- Decision index.