rig
Skill3 starsChanged 11 days agoMITView on GitHub
Wire the enforcing harness into this project — runtime, blocking PreToolUse gates, band path map, and the audit journal.
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 1 is distinctive, and 10 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
10
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 30
Read the context through the runtime — .buildcli/runtime/bcx band verify and .buildcli/runtime/bcx header, never by opening the file — and …
- Very specific: line 34
Read any existing .claude/settings.json.
- Very specific: line 35
Write .buildcli/bands.json — the band path map the write gate reads.
- Very specific: line 47
Write .buildcli/enforce.json so the gates can be tuned without editing settings.json:
- Very specific: line 62
Every key is defaulted in the runtime, so an older enforce.json keeps working.
- Very specific: line 69
Write the hooks into .claude/settings.json (see below).
- Very specific: line 70
Create .buildcli/journal/ with a .gitkeep and a .gitignore that keeps the directory and ignores *.log.
- Very specific: line 72
Run .buildcli/runtime/bcx doctor and report what it says.
- Distinctive: line 147
Every gate fails open. Malformed input, a missing map, an internal error — the call is allowed.
- Very specific: line 183
Never add a deny rule over a path a band skill legitimately needs.
- Very specific: line 185
Test command still NEEDS CLARIFICATION → leave verify_on_stop false and say why.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Rig
Arguments
(optional) --minimal (journal only) | --full (default: journal + permissions) | --enforce (adds the blocking gates)
Output
.claude/settings.json | .buildcli/bands.json | .buildcli/enforce.json | .buildcli/journal/.
Goal
Turn the band rule from a convention the model is asked to follow into a constraint the runtime applies. Three levels, each additive:
| Level | What it does |
--minimal | journals every edit |
--full | journal + scoped permissions (default) |
--enforce | the above, plus PreToolUse gates that block out-of-band reads and writes |
Steps
- Confirm the runtime is present at
.buildcli/runtime/bcx. Missing → tell the user to re-run the bootstrap script; the gates cannot work without it. - Read the context through the runtime —
.buildcli/runtime/bcx band verifyand.buildcli/runtime/bcx header, never by opening the file — and extract:- the test command from
[band:verify] - the source directories per band, from the Stack and Architecture blocks
- the test command from
- Read any existing
.claude/settings.json. Merge into it; never overwrite it. - Write
.buildcli/bands.json— the band path map the write gate reads. Derive the globs from the real directory layout, and show them to the user for confirmation. A band with no entry is simply not enforced.{ "service": ["src/api/**", "src/services/**"], "interface": ["src/components/**", "src/pages/**"], "store": ["migrations/**", "src/models/**"], "verify": ["tests/**", "**/*.test.*"], "delivery": [".github/workflows/**", "Dockerfile", "infra/**"] } - Write
.buildcli/enforce.jsonso the gates can be tuned without editingsettings.json:
Every key is defaulted in the runtime, so an older{ "enabled": true, "context_gate": true, "search_gate": true, "write_gate": true, "verify_on_stop": false, "session_start": true, "journal_max_kb": 256, "routing": {}, "lock_timeout_s": 10, "journal_commands": ["test", "lint", "build"] }enforce.jsonkeeps working.session_startcontrols the resume digest andjournal_max_kbthe journal's rotation size.routingmaps a band to the agent best suited to it — read only bybcx next, and an empty table simply means no recommendation.lock_timeout_sis how long a unit transition waits for the worklist mutex before giving up; it is not a staleness threshold, and the runtime derives that separately on purpose.journal_commandslists the words that get a shell command journaled — add the project's lint and build tools here. The test command needs no entry; it is matched from[band:verify]. - Write the hooks into
.claude/settings.json(see below). - Create
.buildcli/journal/with a.gitkeepand a.gitignorethat keeps the directory and ignores*.log. - Run
.buildcli/runtime/bcx doctorand report what it says. - Return: files touched, the level applied, and anything the user must decide.
settings.json — with --enforce
{
"permissions": {
"allow": [
"Bash(.buildcli/runtime/bcx *)",
"Bash(git log *)",
"Bash(git diff *)",
"Bash(git status)",
"Bash(<test-command>)",
"Bash(<lint-command>)"
]
},
"hooks": {
"PreToolUse": [
{
"matcher": "Read|Bash|Grep",
"hooks": [{ "type": "command", "command": ".buildcli/runtime/bcx gate pre-read" }]
},
{
"matcher": "Write|Edit|MultiEdit|Bash",
"hooks": [{ "type": "command", "command": ".buildcli/runtime/bcx gate pre-write" }]
}
],
"PostToolUse": [
{
"matcher": "Write|Edit|MultiEdit|Bash",
"hooks": [{ "type": "command", "command": ".buildcli/runtime/bcx gate post" }]
}
],
"Stop": [
{ "hooks": [{ "type": "command", "command": ".buildcli/runtime/bcx gate stop" }] }
],
"SessionStart": [
{ "hooks": [{ "type": "command", "command": ".buildcli/runtime/bcx gate session-start" }] }
]
}
}SessionStart carries no matcher on purpose. It accepts startup, resume, clear, compact,
and fork; omitting it covers all five, and a compaction is exactly when restating the pointers is
worth the thirty lines.
Without --enforce, omit the PreToolUse block and keep the rest.
What each gate does
pre-read— blocks a raw read of.buildcli/context.md— aReadorGrepaimed at it, directly or through a symlink, or aBashcommand that names it — and points at.buildcli/runtime/bcx band <name>. This is what makes band scoping real: the whole file cannot be loaded. It also blocks a recursivegrep, agit grep, or anrgwith ignore files disabled whose reach includes.buildcli/, unless the command excludes it (--exclude-dir=.buildcli,-g '!.buildcli',':!.buildcli'). It follows file lists intoxargs,find -exec, andfd -x, judgesackandag, and resolves globs, symlinks, and line variables that land on the file.search_gate: falseturns the search part off.pre-write— while exactly one unit is claimed (.buildcli/runtime/bcx claim <id>), blocks writes to paths thatbands.jsonassigns to a different band. Paths no band claims are always allowed, so docs and root config stay editable.Bashis judged by the files the command would write — redirections,tee,sed -i,cp,mv,rm, and the like.post— appends to.buildcli/journal/session.log, rotating it pastjournal_max_kb: every edit, every run of the project's test command, and every command matchingjournal_commands.stop— journals a checkpoint naming the active blueprint, the claimed units, how many units completed during the session, and the verify outcome. Runs.buildcli/runtime/bcx verifyfirst whenverify_on_stopis true.session-start— prints.buildcli/runtime/bcx resumeon stdout, which Claude Code adds as context, so a new session opens knowing where the pipeline stands. Pointers only, never band content — a digest carrying band text would defeatpre-readfrom the inside. That takes two mechanisms: the digest never readscontext.md, and VERIFY journal lines are trimmed before the command, because that command was read out of[band:verify]. Silenced withsession_start: false.
Every gate fails open. Malformed input, a missing map, an internal error — the call is allowed. A harness that breaks the session on its own bug is worse than no harness.
Journal format
2026-08-22 14:32:01 | EDIT | Edit src/api/checkout.ts
2026-08-22 14:32:40 | DONE | W03 -> done (service)
2026-08-22 14:33:02 | VERIFY | PASS exit=0 :: npm test
2026-08-22 14:33:05 | STOP | blueprint=blueprints/features/checkout claimed=- completed=3 verify=passThe STOP line is what the next session reads back. CLAIM, DONE, and BLOCK carry the unit
transitions, so completions can be counted between two STOP lines without parsing prose.
For the human
The hooks and skills all use .buildcli/runtime/bcx. Offer the user the shim so they can type
bcx themselves:
.buildcli/runtime/bcx shim --installTurning it off
.buildcli/enforce.json is the switch — set enabled: false to disable every gate without
touching settings.json, or turn off context_gate / write_gate individually.
Re-running
Safe at any time. Merges with existing config and never drops hand-written entries. Run --enforce
on top of a --full base to add the gates later.
Rules
- Never add a
denyrule over a path a band skill legitimately needs. - The write gate only fires while a single unit is claimed. Ambiguity means no enforcement, by design.
- Test command still
NEEDS CLARIFICATION→ leaveverify_on_stopfalse and say why. - Permissions are additive. Append; never replace.
- Claude Code only. Codex has its own
rigcommand that writes.codex/hooks.json; Gemini and Copilot use the runtime, but have no blocking hooks.
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- with-pebbly/aseprite-ai-artist★ 473same name
- githubnext/rig★ 14same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository19 other files it gives its agents.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

