ShallGuard GitHub

Write the rule once. The build enforces it forever.

ShallGuard links each written requirement to the code that makes it true and to the test that proves it. If a link breaks, the check fails — deterministic, offline, no language model.

docs/requirements.md
REQ-AUTH-003 — The session store SHALL reject an expired token.
*Enforced:* src/session.rs (create) · *Verified:* [test] rejects_expired_token
enforced by verified by

Three files, one contract. The requirement document, the code, and the test each point at the same ID.

An agent deletes the test. Every unit test still passes. CI stays green — until the check runs:

$ cargo shallguard check
…
errors (2):
  docs/requirements.md:
        4  [hard-area verification-anchor] REQ-AUTH-003 "The session store SHALL reject an expired token." - claims automated-test evidence but no test anchor verifies it
        4  [hard-area evidence-citation] REQ-AUTH-003 - cited evidence tests/session.rs (rejects_expired_token) does not resolve to a #[shallguard::verifies] anchor for this requirement

The same happens when somebody weakens the assertion, removes the anchor, or edits the requirement away. A person or an agent can change anything — but not in silence.

1Why write requirements now

When a person wrote the code, a requirement was a document about the work. Now an agent writes the code — and the requirement is the work. It tells the agent what to build, the reviewer what to check, and the next agent what it must not break.

A specification that you throw away after the code is generated is a prompt. A specification that a tool enforces forever is a contract.

You do not need to describe your whole system. Start with the few rules you are afraid to lose — one SHALL sentence each. Read the full argument.

2Start in five minutes

cargo install cargo-shallguard --locked
cargo shallguard install-skill  # teach your coding agent the workflow

cargo shallguard fmt --check    # requirement-document format
cargo shallguard check          # the traceability gate

The skill is the manual of ShallGuard for a coding agent. It holds the requirements-first workflow, the anchor rules, and the evidence rules. The command finds the agents on your machine and writes the skill for Claude Code and for Codex. The agent loads it when it works in a repository with a shallguard.toml file. Without the skill, the agent does not know the rules that the check enforces. Options for one agent, a project, or another directory.

Rust today; the specification defines what every future language implementation shares. An existing codebase adopts gradually: the baseline records historical gaps once and only ever shrinks.

3Proven on one real workspace

The workspace belongs to the author — read the numbers as a best case, not an independent benchmark. Full case study.