Add bd rules audit + compact commands#2810
Open
anupamchugh wants to merge 1 commit intosteveyegge:mainfrom
Open
Add bd rules audit + compact commands#2810anupamchugh wants to merge 1 commit intosteveyegge:mainfrom
anupamchugh wants to merge 1 commit intosteveyegge:mainfrom
Conversation
Filesystem-only tooling to detect contradictions, near-duplicates, and merge opportunities in .claude/rules/*.md files. - `bd rules audit` scans rules for contradictions and merge candidates using Jaccard similarity, antonym detection, and scope analysis - `bd rules compact` merges related rules into composites (manual or auto) - 20 tests, no new dependencies (stdlib + cobra only) - CheckReadonly guard on compact for consistency with other write commands Resubmission of steveyegge#1625, rebased cleanly on current main. Co-Authored-By: Claude Opus 4.6 <[email protected]>
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.
Summary
bd rules audit— scans.claude/rules/*.mdfor contradictions, near-duplicates, and merge opportunities using Jaccard similarity, antonym detection, and scope analysisbd rules compact— merges related rules into composites (manual--groupor--automode, with--dry-run)CheckReadonlyguard to compact for consistency with other write commandsdocs/RULES_AUDIT_DESIGN.mdContext
Resubmission of #1625, which was closed pending the Dolt-native work (now landed in v0.62.0). This PR is rebased cleanly on current
main— exactly 3 new files, zero modifications to existing files.The commands are filesystem-only (no Dolt storage dependency). They address a real pain point: projects with 40+ rule files accumulate contradictions and duplicates that waste tokens on every Claude session.
Test plan
go build ./cmd/bd/succeedsgo test -v -run TestRules ./cmd/bd/— all 20 tests pass🤖 Generated with Claude Code