/rulebook:rulebook-syncfrom rulebook
Syncs rulebook cards with code changes by processing CLI detections. Classifies entries as changed, unchanged, removed, or new, then proposes updates for user validation before applying.
Ships in rulebook. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
The CLI detects; you judge. Each inbox entry says where the code moved. Decide what it means for the rule, propose it, and apply it only after the human validates. Never rewrite a card silently.
CLI. rulebook … below means the rulebook CLI: rulebook, or npx --yes rulebook-cli@latest. Without Node, use the manual column of references/cli.md.
Data. If config.json declares data sources, re-check the data evidence of the cards
you touch (references/data.md, read only). Do not ask the data question here: sync stays
quick; the next extraction asks it.
Collect. Run rulebook check (fallback: read rulebook/inbox.md). Work on the
- [ ] lines. A - [x] line is a past dismissal: leave it.
Classify each entry — open the diff (git diff, or git diff <sha>) and the card:
| Entry | Classification | What to propose |
|---|---|---|
modified? | changed — the behaviour moved | new Rule. sentence, updated values everywhere in the card (title, parameters, edge cases), confidence re-checked |
modified? / removed? | unchanged — refactor, rename, move | same statement, evidence re-pointed to the new lines and symbol |
removed? | removed — the behaviour is gone | Status: retired, keep the card and its ID |
new? | new — rule-bearing code with no card | a candidate card in the right domain, next free ID |
new? | not a rule — exports, logging, wiring | dismiss |
A test that still asserts the old behaviour lowers confidence to read (or conflicting
if it contradicts the code) and becomes an open question — never a reason to keep the old text.
Checkpoint — stop here. Show one line per entry: classification, before → after. Ask the user to validate, correct or dismiss. Apply nothing before the answer.
Apply, in the formats of references/card-template.md:
<sha> below is the short sha of HEAD (git rev-parse --short HEAD) — the CLI only
accepts a hex sha. For uncommitted changes it is the commit the change is based on; say
"uncommitted" in the history note.Rule. (the statement readers see), set Status: changed, add
- <today> · <sha> · changed · <old> → <new> to History.- <today> · <sha> · reanchored.Status: retired; add - <today> · <sha> · retired · <why>.Status: candidate, Confidence honest, no Audit yet (it is
audited when a human promotes it), History created.Verified at: <sha> (<today>) on every card you touched.Clean the inbox: delete the line of every entry you processed, including every
modified?/removed? entry. Tick - [x] only new? entries the user dismissed as
"not a rule" — a tick tells the CLI never to raise it again.
Verify: rulebook index --strict (no unresolved evidence, no warnings), then
rulebook check must add nothing (without the CLI: re-open every cited line and compare
with git diff). Report what changed, card by card.
Write only under rulebook/. Never edit source or tests, never commit unless asked.
rulebook/rulebook.html exists, finish with rulebook build so the document matches the cards. Never edit the HTML yourself (references/cli.md).| Mistake | Instead |
|---|---|
| Ticking processed entries | Delete them; tick only dismissals |
Editing title or parameters but not Rule. | The Rule. sentence is what readers see — update it first |
No History line | Every change, re-anchor and retirement gets one |
New rule written as active | candidate until a human validates it in a later review |
| Applying, then asking | Checkpoint at step 3 |
references/audit.md (opens in a new tab)references/card-template.md (opens in a new tab)references/cli.md (opens in a new tab)references/data.md (opens in a new tab)references/hotspots.md (opens in a new tab)references/ids.md (opens in a new tab)references/okf.md (opens in a new tab)references/policy-vs-rule.md (opens in a new tab)references/vocabulary.md (opens in a new tab)references/writing-style.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub gregorybabonaux/rulebook --plugin rulebook5 skills in this plugin
/rulebook-edge-casesUse when asked for the edge cases, boundary conditions, corner cases or "cas limites" of a documented business rule or domain in rulebook/, or when a rule card has no Edge cases section and someone asks what happens at its limits./rulebook-extractUse when rulebook/index.md exists and the business rules of one or more domains must be written down — "extract the rules", "document the business rules of ORD", "règles de gestion", "règles métier" — or when a domain listed in the map has no rulebook/<CODE>-*.md file yet./rulebook-mapUse when a codebase's business rules are to be documented and no rulebook/index.md exists yet, or when asked to map, list or split the business domains of an application ("what are the domains", "cartographie des domaines", first step of a rulebook)./rulebook-publishUse when asked to publish, share, export, regenerate or send the rulebook / business-rules reference ("publier le référentiel") — as an HTML page, a PDF, or to Notion, Google Drive, Confluence or another documentation tool.Other plugins' skills for the same job