Skip to content

feat(proof): add rig-proof, the gate for the writing style STYLE.md defines - #75

Merged
pgebheim merged 1 commit into
mainfrom
feat/rig-proof
Aug 18, 2026
Merged

pgebheim merged 1 commit into
mainfrom
feat/rig-proof

Conversation

@pgebheim

Copy link
Copy Markdown
Contributor

Why

STYLE.md (#73) shipped as pure instruction: personas are told how to write, and nothing checks whether they did. Rig pairs knowledge with a gate everywhere else — REVIEWER.md has rig-review — and generative instructions decay under load. An agent 40 tool-calls deep, writing the PR body last, has spent its attention elsewhere. Same reason /rig-task runs a pre-PR self-review instead of trusting that the coder internalized the review catalog.

The design decision that makes it work

scripts/check-style.ts harvests its rules from the guide. The banned filler and jargon terms already live in STYLE.md as backticked words — in Instead of | Write tables and in sentences that tell you to cut something. The script parses those and greps for them (34 terms from the shipped guide, each finding citing the guide's own rule number).

It carries no style opinions of its own, so it cannot drift from what the personas were told. Prune a rule from the guide and enforcement stops; add a table row and it starts.

$ bun scripts/check-style.ts --guide templates/STYLE.md draft-pr.md
14 mechanical style finding(s) — 34 terms from templates/STYLE.md

  3:1   50-word sentence — split it (limit 30)      [one idea per sentence]
  4:11  cut "basically"                             [8. Cut filler]
  6:23  "leverage" — write use                      [7. Concrete nouns, …]
  8:73  "blast radius" — write affected callers      [9. No jargon, …]

Precision details

Word-spotting is only useful if it stays quiet on things that aren't prose:

  • Masks fenced blocks, inline code spans including ones that wrap across lines, link targets, headings, table rows, and YAML frontmatter — a skill's description is a trigger list, not a sentence.
  • Matches inflections via the dropped-e and y-to-i rules, so a guide banning leverage also catches leveraged and leveraging, and easy catches easily. The guide needn't list every form.
  • Harvest respects direction. write X, not Y bans Y; `X` is `Y` bans X. Do/Don't examples are skipped entirely, so the guide's own recommended forms never end up on the banned list.
  • Long sentences are found across lines and broken on list markers. A 55-word sentence wrapped over four lines is exactly the case worth catching; a 12-column table row is not a run-on.
  • Informational by default (like scope-reviewer.ts); --strict exits 1 for future CI use.

The skill's half

rig-proof find / fix covers what no grep can: buried conclusions, passive voice where the actor matters, hedge stacks, claims with no file:line behind them, guesses presented as observations, structure that wants a table. It treats mechanical hits as candidates needing triage, not verdictsjust and obvious have legitimate uses, and a 34-word sentence is sometimes the clearest option.

fix must preserve meaning exactly, never touches code or code spans, and shows the rewrite for a yes before editing an already-published PR body or ticket.

Where it's wired

Before artifacts land, because proofreading a posted PR body helps nobody:

Flow Point
rig-task Step 5 the draft PR body, before gh pr create
rig-issue create the ticket body, before filing
rig-spike the writeup, before posting it back

Default scope is one named target — never the whole repo unless explicitly asked, and never source files. A proofreader pointed at every document in the tree produces a finding pile nobody wanted.

Test plan

  • 48 new tests (115 total, 0 fail), including a guard that the shipped STYLE.md still yields a substantial term list — a silently-empty parse would look exactly like clean prose, which is the one failure mode that hides itself.
  • Config-driven resolution verified end-to-end from a fresh install.sh project: it finds .claude/STYLE.md through style.guideFile with no flags.
  • Installer verified to ship check-style.ts and rig-proof/ while excluding check-style.test.ts.
  • Degraded paths covered: missing guide, explicitly-named guide that doesn't exist, malformed profile, zero harvested terms.

Dogfooding found three self-violations in STYLE.md itself. Two were real slips (actually, and calling something obvious) and are fixed here. The third was the tool's fault, not the guide's: a deliberately-bad **Don't:** example spanning three lines wasn't masked, which is what surfaced the multi-line code-span bug above. STYLE.md, the new skill, and the script now all pass clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_01MBaTgFSa8va6PTaFfuSRsz

…efines

STYLE.md shipped as pure instruction: personas are told how to write, and
nothing checks whether they did. Rig pairs knowledge with a gate everywhere
else — REVIEWER.md has rig-review — and generative instructions decay under
load. An agent 40 tool-calls deep, writing the PR body last, has spent its
attention elsewhere.

Adds rig-proof (find/fix, mirroring rig-review) plus the deterministic half
it runs first.

scripts/check-style.ts HARVESTS ITS RULES FROM THE GUIDE. The banned filler
and jargon terms live in STYLE.md as backticked words, in `Instead of | Write`
tables and in sentences that tell you to cut something; the script parses
those and greps for them (34 terms from the shipped guide). It carries no
style opinions of its own, so it cannot drift from what the personas were
told: prune a guide rule and enforcement stops, add a table row and it
starts. Findings cite the guide's own rule numbers.

Details that matter for precision:

- Masks fenced blocks, inline code spans (including ones wrapping across
  lines), link targets, headings, table rows, and YAML frontmatter — a
  skill's `description` is a trigger list, not a sentence.
- Matches inflections (leverage/leveraged/leveraging, easy/easily) via the
  dropped-e and y-to-i rules, so the guide needn't list every form.
- Harvest respects direction: "write X, not Y" bans Y, while "`X` is `Y`"
  bans X. Do/Don't examples are skipped, so the guide's own recommended
  forms never get banned.
- Long-sentence detection scans across lines and breaks on list markers; a
  55-word sentence wrapped over four lines is the case worth catching.
- Informational by default (like scope-reviewer.ts); --strict exits 1.

The skill's own half is what grep can't do: buried conclusions, passive
voice, hedge stacks, unanchored claims, unmarked guesses, structure. It
treats mechanical hits as candidates needing triage, not verdicts — `just`
and `obvious` have legitimate uses.

Wired in BEFORE artifacts land, since proofreading a posted PR body helps
nobody: rig-task Step 5 (before gh pr create), rig-issue create (before
filing), rig-spike (before posting the writeup). Default scope is one named
target — never the repo unless asked.

48 tests, including a guard that the shipped STYLE.md still yields terms: a
silently-empty parse would look exactly like clean prose. Dogfooding it
found three self-violations in STYLE.md itself; two were real slips and are
fixed, the third was the multi-line code-span masking bug above.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MBaTgFSa8va6PTaFfuSRsz
@pgebheim
pgebheim merged commit b2d55b5 into main Aug 18, 2026
2 checks passed
@pgebheim
pgebheim deleted the feat/rig-proof branch August 18, 2026 03:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant