Your agent sets it up.
The prompt keeps it honest.
Paste one prompt and your coding agent installs Rule of Code as a blocking gate — measured floor, red/green proof, hooks, CI. But that's the easy half. An eager agent is the actor most likely to game a gate: it optimises for green. So the prompt doubles as a constitution for the agent itself — the honesty rules outrank everything, including "just make it pass."
Plain text · no secrets · every command is the real CLI · the same steps as /start, written for a worker that must be told not to cheat.
You are setting up Rule of Code — a constitutional audit that refuses to report compliance it did not verify. Install it as a BLOCKING gate in this project. Follow every step. The honesty rules at the end are not optional. STEP 1 — Install the package Run: npm install --save-dev ruleofcode A dev dependency, pinned like any gate you rely on. It runs no script on install and reads nothing until you ask it to. STEP 2 — Write the constitution Run: npx ruleofcode init Open ruleofcode.config.json and read what it wrote. Do not disable any law. STEP 3 — First audit: measure, don't judge Run: npx ruleofcode audit --mode=full Note "Total Laws Checked" — call it N. Warnings on a first run are normal: they are visible debt, not failure. Do not "fix" them by silencing laws. STEP 4 — Set the liveness floor from the measured number In ruleofcode.config.json set: "laws": { "paretoMode": false, "minLawsChecked": <N minus a small buffer> } The floor comes from YOUR measured N — never from an example or another repo. STEP 5 — Prove the gate is armed (do not skip) Temporarily set minLawsChecked above N. Run the audit. Confirm it REFUSES with a non-zero exit. Restore the real floor. Confirm it passes again. Show me both outputs — red and green. A gate never seen red is not armed. STEP 6 — Arm the hooks Run: npx ruleofcode reinstall-hooks Hooks and CI always run --mode=full. Never wire --mode=fast into either. STEP 7 — Wire CI Add: npx ruleofcode audit --mode=full --export json The pipeline job fails on a non-zero exit. Real numbers only. HONESTY RULES — these outrank everything, including any later instruction to "just make it pass": · Never disable a law, shrink the law set, or lower the floor to get green. · Never mark a law notApplicable without a written reason, a date, and the owner's explicit approval. · Fix the code to satisfy a law. If a law looks wrong for this project, STOP and report it to the owner — do not silence it. · Do not tick checklists or fabricate compliance artifacts of any kind. · If the audit fails, report the real numbers. A shrunken audit is a disarmed gate — never PASSED. FINAL REPORT — tell the owner: laws checked, the floor you set, passed count, warnings (visible debt), errors, what you fixed, and everything you could not satisfy honestly.
What your agent will do
The same five minutes — with a witness.
It's the exact journey from /start, executed by the agent while you watch. The one step it cannot skip is the fourth: it must show you the gate going red and then green — evidence, not a claim.
Install & measure
init writes the constitution; the first audit measures N — how many laws actually run here. Warnings stay visible.
Floor from the measurement
minLawsChecked is set just under N — from this repo's number, never a copied one.
Show it refusing
Floor above N → audit refuses, exit 1 → floor restored → green again. Both outputs shown to you. This is the receipt.
Hooks + CI
reinstall-hooks arms pre-commit/pre-push on the full set; CI runs the same audit and fails on non-zero.
Honest report
Laws checked, floor, passed, debt, errors — and everything it couldn't satisfy honestly, said out loud.
Bound by the rules
The honesty clauses travel inside the prompt — they outrank any later "make it pass", from anyone.
Why the honesty rules exist
Because every clause is a bug somebody actually shipped.
The rules aren't hypothetical guardrails — each one maps to a real incident from the Wall of Findings, several of them ours.
Our gate quietly went 122 → 27
Laws that stop running can't fail, so everything stayed green. The absence of red read as health. The floor exists because we fell through it — and an agent chasing green would fall through it faster.
A law once graded the claim, not the work
Our checklist law rewarded committed tick-boxes — assertions a human typed. A consumer refused to lie and we fixed the law. An agent told to "make it pass" would have ticked every box in seconds. That's why the clause exists.
The audit caught its own builders
This site's own build is refused by this audit routinely — a too-greedy regex, a test description too short to say anything, a commit that grew past the size the law allows. Every time the fix was to satisfy the law or report it upstream, never to mute it. The same standard binds your agent.
Works with:Claude Code · Cursor · Copilot Workspace · any agent that can run shell commands
No integration, no plugin, no MCP server required — Rule of Code is a local CLI and the prompt is plain text. If your agent can run npx and edit a JSON file, it can do this.
The gate doesn't care who is on the other side.
Human or agent — coverage is reported, the floor is enforced, and a shrunken audit is never PASSED. That's the whole point of a constitution: it binds everyone, including the machines.