Add a cross-model code-review gate to Claude Code — or any coding agent
rig-lite is the portable governance kit extracted from Turbo Flow. Your agents already plan, code, test, and revise — the kit adds the layer that decides whether any of it is allowed to ship: a fail-closed cross-model review gate, a written constitution, git-versioned memory, and a human holding the merge button.
Published Oct 7, 2026 · Updated Oct 8, 2026
The parts
| file | what it gives you |
|---|---|
| gate.sh | the cross-model review gate — deterministic checks first (they're free), then a reviewer from a different model family must return a parseable APPROVED / REVISE. Fail-closed; never merges. --pr <n> gates a GitHub PR and posts the verdict as a comment; --sweep gates every open PR without a verdict yet; -C <repo> gates another checkout. Every verdict lands in a local JSONL log. |
| constitution.md | the laws — builder ≠ reviewer, agents never merge, worktrees for parallel writers, secrets encrypted, state on disk. Ships as a fill-in template. |
| memory.md + memory/ | the git-versioned memory pattern: index, decisions, gotchas, project index, inbox. Agents forget; git doesn't. |
| self-test.sh | the kit's own fail-closed test suite — hundreds of checks. It proves the gate fails closed before you trust it with a real PR. |
| wt.sh | an isolated worktree per parallel writer — wt <name> creates the worktree + branch, --clean tidies up after merge. |
| init-repo.sh | one-command onboarding for any repo: a thin AGENTS.md (constitution pointer + cheat-sheet) and the CLAUDE.md → AGENTS.md symlink. Never clobbers existing files. |
| specs/ | spec + UAT contract templates — plan before build, verify behavior against the deployed app. |
| digest.sh | fleet health in one file: merge queue joined with gate verdicts, dirty checkouts, site liveness, stale codespaces. |
| automations/ | nine scheduled tasks as a portable prompt pack — morning digest, security scan, memory consolidation, weekly retro, and more. |
| secret.sh | encrypted-at-rest secrets with backend auto-detection (Keychain → libsecret → age → loudly-warned chmod-600). Listing shows names, never values. |
| tokens.py | a live token-burn dashboard across zcode + claude + codex + gate. Read-only by construction — the first open-core drop from Turbo Rig. |
| hooks/pre-commit | deletion guard: staged deletions print loudly instead of silently vanishing. Warn-only, fail-open. |
Bring your own harness
The kit ships no agent and no orchestrator. It names harnesses by role and works with anything
that reads AGENTS.md and can run bash:
| role | who | how the kit uses it |
|---|---|---|
| Builder | ZCode (GLM), Claude Code, Codex, Gemini, Grok | gate.sh --builder <cli> knows the family; anyone can build |
| Reviewer | Claude Code or Codex CLI — never the builder's family | the gate auto-detects and refuses same-family review |
| Orchestration | optional — Ruflo as a Claude Code mod | bring it if you want swarms; the kit doesn't care |
Ten-minute install
# from any repo you want to govern: bash /path/to/turbo-flow/rig-lite/init-repo.sh # writes AGENTS.md + symlink, never clobbers bash /path/to/turbo-flow/rig-lite/self-test.sh # prove the kit on your machine /path/to/turbo-flow/rig-lite/gate.sh --pr 1 --builder zcode # no Codespace? fine — it's bash. want the container tour anyway? # open the repo in a Codespace; postCreate runs the self-test.
Why trust it
- The gate survived 17 rounds of review by a model family that didn't write it — REVISE'd seventeen times before earning APPROVED, counted from the gate's own JSONL log. The findings were exactly the class the gate exists to catch: a prompt-injection hole that let a diff approve itself, a fail-open path that skipped review, a quoting bug that swallowed failing tests.
- Every fix became a self-test. 252 checks at v5.2, all passing under bash 5.3 and stock macOS 3.2; shellcheck clean at warning severity.
- Fail-closed is the design, not a setting. Ambiguity is REVISE; the gate never merges; the merge button is a human's. See the philosophy.
Where the rest lives
rig-lite is the portable extract of Turbo Rig — the same gate, constitution, memory and automations running as one integrated, always-on system. Turbo Rig is in private beta. The story of how the kit came to be is here.