← turboflow.online
~/turbo-flow/rig-lite MIT · bash · zero deps

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

no daemon no orchestration platform no vendor lock-in bash + python, that's it works in any repo

The parts

filewhat it gives you
gate.shthe 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.mdthe 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.shthe 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.shan isolated worktree per parallel writer — wt <name> creates the worktree + branch, --clean tidies up after merge.
init-repo.shone-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.shfleet 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.shencrypted-at-rest secrets with backend auto-detection (Keychain → libsecret → age → loudly-warned chmod-600). Listing shows names, never values.
tokens.pya live token-burn dashboard across zcode + claude + codex + gate. Read-only by construction — the first open-core drop from Turbo Rig.
hooks/pre-commitdeletion 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:

rolewhohow the kit uses it
BuilderZCode (GLM), Claude Code, Codex, Gemini, Grokgate.sh --builder <cli> knows the family; anyone can build
ReviewerClaude Code or Codex CLI — never the builder's familythe gate auto-detects and refuses same-family review
Orchestrationoptional — Ruflo as a Claude Code modbring 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.