Why
Every product hides its rules in code: a refund window, a lock after five failed logins, a discount cap. Nobody can list them, the comments lie, and the specs are out of date. rulebook gives your coding agent the skills to read the code, write those rules in plain language with the proof attached, and notice when a change in the code touches one of them.
- Readable by everyone. Each rule says what the product does, why, and the exceptions, for product owners and developers alike.
- Proven. Each rule cites the exact lines and tests that decide it, with a confidence level. The code wins over comments.
- Alive. A companion watches your edits and flags the rules that may have changed. Nothing is rewritten without your approval.
- Any agent. Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Mistral Vibe, and any agent that reads
SKILL.md files, alongside superpowers, spec-kit or BMAD.
One document, three views
The result is a single HTML file: it works offline, you can email it, and it prints to PDF.
| Map | Dashboard (dark mode) |
|---|
 |  |
| Unfold domains, policies, rules and edge cases. Drag a node to move its branch. | Key figures, confidence per domain, recent changes, open questions. |
The screenshots come from a fictional shop with planted traps: a comment that announces 30 days while the code applies 7, and dead code. The sample document is in French; yours is written in your project's language.
How it works
| Level | Skill | What you get |
|---|
| 1 | rulebook-map | the business domains, with what each covers and where its code lives |
| 2 | rulebook-extract | the rules of one domain: policies (why) and operating rules (how), checked by a blind audit |
| 3 | rulebook-edge-cases | what happens at the limits of a rule (Given… when… then…) |
| — | rulebook-sync | processes the inbox after code changes |
| — | rulebook-publish | builds the HTML document and, if you have a connector (Notion, Drive…), offers to publish it |
Each level stops for your validation before it writes. rulebook never touches your source code or your tests.
The skills do the judging: your agent reads the code. The companion does the detecting: a small CLI with no AI, run by your agent's hooks and by a git pre-commit hook.
Installation guide
Requirements: git, and Node.js 22 or later for the companion and the HTML. The skills work without Node; you then get the Markdown only.
Step 1 — Install the skills (choose one)
| You use | Run | You get |
|---|
| Claude Code (recommended) | /plugin marketplace add GregoryBabonaux/rulebook
/plugin install rulebook@rulebook | skills + companion hooks |
| Any agent (Codex, Cursor, Gemini, Copilot, Vibe…) | npx skills add GregoryBabonaux/rulebook | skills, in the project or globally (-g) |
| No skills.sh | npx rulebook-cli skills --yes | skills copied to ~/.agents/skills and ~/.claude/skills |
Step 2 — Turn on the companion in your project
In the project folder:
npx rulebook-cli init
The command shows what it will write: hooks for the agents it detects, an AGENTS.md block and a git pre-commit hook. Nothing is written until you confirm: