req, in one page
Requirements that live next to your code, with a tool that knows when a rewording
changed what you promised. For people who decide, plan or explain; the engineering view is
docs/how-it-works.md.
Before and after, on one real edit
Without a tool that reads meaning
- The requirement says “respond within 200 ms”.
- A pull request changes it to “within 500 ms”, among other edits.
- Reviewers see changed words. The loosening is one number in a larger diff.
- It merges if nobody spots it. Nothing in the process failed.
With req
- The requirement is a file with a short list of pins: the numbers that matter.
- The same edit is made.
- The tool states the direction of the change and fails the check on the stale pin.
- A person decides, and the decision is recorded.
What that looks like (real output)
Every block below was produced by running req in a scratch corpus when
this page was built; none of it is typed in. The requirement is
The API shall respond to a health check within 200 ms.
1. The tool reads the sentence and checks what you pinned
$ req canon
REQ-0001 structured SHALL API op LE value 0.2 unit s lints -
pin operator LE: agrees
pin value 0.2: agrees
pin unit s: agrees
The line starting REQ-0001 is what the tool understood from the sentence;
each pin line is a number a person said must stay true, and the tool agrees.
2. A reword that keeps the promise is not noise
$ req compare claims/REQ-0001.yml reworded.yml
REQ-0001 -> REQ-0001: identical
cbece4455e74 -> cbece4455e74
“200 ms” and “0.2 s” are the same promise. Same fingerprint, nothing to review.
3. An edit that loosens it is named
$ req compare claims/REQ-0001.yml loosened.yml
REQ-0001 -> REQ-0001: numeric_loosening
this change permits strictly more than before
cbece4455e74 -> 7d235640e413
The tool classifies the direction. It does not approve it: ratification is a human act.
4. An edit that forgets the pin fails the check
$ req gate
# Release gate: 1 applying claim(s), 0 undecided (an undecided claim is never treated as absent)
[FAIL] pins_hold
every pin of every applying claim must agree with the derived parse (3 pin(s), 2 held, 1 flagged)
- REQ-0001: pin value 0.2 contradicts the parse (0.5)
The release gate fails, naming the claim and the pin. Exit code 1 stops the merge in CI.
Who it is for
- Teams that must show why a requirement is what it is (regulated work,
audits): each claim carries its source, date and rejected alternatives; a signed baseline freezes
the set a release was judged against;
req auditcompiles the packet. - A developer working with AI agents: the same files and exit codes an agent can read, with rules that stop it editing a pin to make a check green.
What it does not do
- It does not write your requirements or decide they are right. A person authors every statement.
- It is deliberately conservative: some rewordings it cannot prove equivalent come out as “different”. That is review noise, by design; the opposite error, merging two different requirements, is the one it is built to never make.
- That “never” is measured, on req’s own seed and trap corpora and on real requirements prose from other projects (pinned by commit). The pairs it is scored on are generated by the tool’s own transforms or are a handful of mutation classes, so independent human-written paraphrase is not yet measured: treat the bet as a claim under test, not a validated result.
- A pin is checked when the gate runs; the signed baseline does not yet cover pins (a named, recorded limit).