---
repo: "mohan-n-swamy/rigor"
title: "Rigor v2 — Pre-Work Specification & Stop-Time Evidence Gates"
license: "MIT"
keywords: [claude-code, ai-agents, agent-harness, software-quality, verification, tdd, context-engineering, developer-tools, cli, claude-hooks]
capabilities:
  - "`hooks/rigor-gate.sh` blocking the 3rd distinct edited file without a validated `.rigor.md`."
  - "**New in v2 — `bin/rigor-run`:** Executes every backtick command in `§1 FLAWLESS` and `§2 MUST NOT` and writes a SHA-bound `.rigor.receipt.tsv`."
  - "**New in v2 — `canon/EVIDENCE-DOCTRINE.md`:** V1-V14 rules for provenance, broken-fixture gate testing, and closed mechanism loops."
  - "`hooks/evidence-gate.sh` Stop hook blocking unbacked completion claims, paired with `canon/PONYTAIL.md` anti-bloat discipline."
when_to_use:
  - "Mechanical pre-work specification (`rigor-gate.sh`), executable checklist receipt verification (`bin/rigor-run` -> `.rigor.receipt.tsv`), and Stop-time evidence enforcement (`evidence-gate.sh`) for Claude Code and AI software engineering harnesses."
  - "AI coding agents jump straight into editing files before naming failure modes and routinely claim 'done, everything works' without running an end-to-end check. `rigor` wires two mechanical gates into your harness: answer Question 0 and the Six Questions before the third file edit, and prove every check ran before saying done."
inputs_required:
  - "RIGOR_FILE_THRESHOLD: Number of distinct edited files allowed before requiring `.rigor.md`"
  - "RIGOR_GATE_OFF: Set to `1` for one-off invocation bypass"
quickstart:
  - "brew install mohan-n-swamy/tap/rigor && rigor install"
  - "bin/rigor self-test"
  - "bin/rigor-run .rigor.md --list"
  - "bash tests/test.sh"
---

# Rigor v2 — Pre-Work Specification & Stop-Time Evidence Gates — Machine-Readable Agent Guide

Mechanical pre-work specification (`rigor-gate.sh`), executable checklist receipt verification (`bin/rigor-run` -> `.rigor.receipt.tsv`), and Stop-time evidence enforcement (`evidence-gate.sh`) for Claude Code and AI software engineering harnesses.

<problem_patterns>
AI coding agents jump straight into editing files before naming failure modes and routinely claim 'done, everything works' without running an end-to-end check. `rigor` wires two mechanical gates into your harness: answer Question 0 and the Six Questions before the third file edit, and prove every check ran before saying done.
</problem_patterns>

<architecture_map>
Key modules and entry points in this repository:
  - `bin/rigor`: CLI installer, uninstaller, status reporter, validator, and self-test driver
  - `bin/rigor-run`: Rigor v2 executable `.rigor.md` runner and `.rigor.receipt.tsv` generator
  - `hooks/rigor-gate.sh & evidence-gate.sh`: PreToolUse and Stop hooks for Claude Code
  - `canon/RIGOR-ALGORITHM.md & EVIDENCE-DOCTRINE.md`: Canonical specification and evidence rules
  - `tests/test.sh`: Throwaway-HOME end-to-end installer, validator, and hook test suite
</architecture_map>

<inputs_and_configuration>
Every organization-specific value enters through `.env` (copied from `.env.example`) or external adapter files. No source edit is needed to change organization names, endpoints, database URLs, webhook secrets, or thresholds.
</inputs_and_configuration>

<adaptation_playbook>
When a human asks an AI coding agent to deploy or adapt `rigor` into their stack:
  1. Install via Homebrew (`brew install mohan-n-swamy/tap/rigor && rigor install`) or `./install.sh`.
  2. Use `bin/rigor-run .rigor.md` in CI or pre-PR checks to verify every promised invariant holds.
</adaptation_playbook>

<reference_docs>
- Product Requirements: `docs/PRD.md`
- Working-Backwards PR-FAQ: `docs/PR-FAQ.md`
- High-Level Architecture: `docs/HLD.md`
- Low-Level Interfaces & Runbook: `docs/LLD.md`
- Coding Agent Rules: `AGENTS.md`
</reference_docs>
