Skip to content

Add bd rules audit + compact commands#2810

Merged
steveyegge merged 1 commit into
gastownhall:mainfrom
anupamchugh:feat/rules-audit-v2
Apr 3, 2026
Merged

Add bd rules audit + compact commands#2810
steveyegge merged 1 commit into
gastownhall:mainfrom
anupamchugh:feat/rules-audit-v2

Conversation

@anupamchugh

Copy link
Copy Markdown
Contributor

Summary

  • Adds bd rules audit — scans .claude/rules/*.md for contradictions, near-duplicates, and merge opportunities using Jaccard similarity, antonym detection, and scope analysis
  • Adds bd rules compact — merges related rules into composites (manual --group or --auto mode, with --dry-run)
  • Adds CheckReadonly guard to compact for consistency with other write commands
  • 20 tests, no new dependencies (stdlib + cobra only)
  • Design doc at docs/RULES_AUDIT_DESIGN.md

Context

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/ succeeds
  • go test -v -run TestRules ./cmd/bd/ — all 20 tests pass
  • PR diff shows exactly 3 new files, no existing files modified

🤖 Generated with Claude Code

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 gastownhall#1625, rebased cleanly on current main.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@steveyegge steveyegge merged commit 6863ca7 into gastownhall:main Apr 3, 2026
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.

2 participants