feat(proof): add rig-proof, the gate for the writing style STYLE.md defines - #75
Merged
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.mdhasrig-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-taskruns 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.tsharvests its rules from the guide. The banned filler and jargon terms already live inSTYLE.mdas backticked words — inInstead of | Writetables 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.
Precision details
Word-spotting is only useful if it stays quiet on things that aren't prose:
descriptionis a trigger list, not a sentence.leveragealso catchesleveragedandleveraging, andeasycatcheseasily. The guide needn't list every form.write X, not Ybans 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.scope-reviewer.ts);--strictexits 1 for future CI use.The skill's half
rig-proof find/fixcovers what no grep can: buried conclusions, passive voice where the actor matters, hedge stacks, claims with nofile:linebehind them, guesses presented as observations, structure that wants a table. It treats mechanical hits as candidates needing triage, not verdicts —justandobvioushave legitimate uses, and a 34-word sentence is sometimes the clearest option.fixmust 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:
rig-taskStep 5gh pr createrig-issue createrig-spikeDefault 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
STYLE.mdstill yields a substantial term list — a silently-empty parse would look exactly like clean prose, which is the one failure mode that hides itself.install.shproject: it finds.claude/STYLE.mdthroughstyle.guideFilewith no flags.check-style.tsandrig-proof/while excludingcheck-style.test.ts.Dogfooding found three self-violations in
STYLE.mditself. Two were real slips (actually, and calling somethingobvious) 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