docs: refactor CLAUDE.md Key Rules into a tiered rules index#710
Merged
Conversation
…index Tiered approach (Option C): inline Workflow essentials + Rules Index table + tripwire headlines in CLAUDE.md, with rule bodies extracted to 10 referenced .claude/rules/*.md files loaded on demand. Includes the lossless 62-rule mapping and migration plan. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Replace the 60-rule / ~29.5 KB Key Rules wall with three lean parts:
- Workflow essentials (inline) — the rules that apply to every change
- a Rules Index table (mirrors the Spec Document Index) pointing to
10 on-demand docs/rules/*.md domain files
- one-line tripwire headlines for the most surprising/destructive gotchas
All 60 rules moved losslessly into docs/rules/{cricket,x01,game-engine,
statistics,database,auto-scorer,ui-design,testing,git-ci-release,e2e}.md.
Adds a maintenance convention so the section stays lean.
CLAUDE.md 42 KB -> 18 KB; Key Rules section 29.5 KB -> 5.4 KB inline,
back under the ~200-line always-loaded guidance.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Fix dangling "see Sentry note below" cross-reference in the Technology Decisions table (the Sentry rule moved to docs/rules/git-ci-release.md). - Restore the exact `git checkout pubspec.lock .flutter-plugins-dependencies` command + "regenerate on every pub get/run/build_runner" rationale that the inline condensation had dropped. - Add a GameConfig-dispatch tripwire (`maybeMap` not `maybeWhen`) and widen the game-engine index label so the rule is discoverable. - Correct the design-doc rule-count mapping (statistics.md 9, git-ci-release.md 7; clarify the 3 double-placed rules; 60 distinct rules, lossless). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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
CLAUDE.md's## Key Rulessection had grown to 60 dense prose rules (~29.5 KB ≈ 70% of the file), all loaded into every session. That hurt on four axes: token cost (~7K tokens always-on), readability (60 unsorted paragraphs), reliability (past the ~150–200 instruction ceiling, adherence dilutes), and maintainability (no stated home/format for new rules).Design doc:
docs/plans/2026-06-25-claude-md-key-rules-refactor-design.md.What
Tiered structure ("map, not territory" — progressive disclosure):
docs/rules/*.mddomain files, with aAll 60 rules moved losslessly into
docs/rules/{cricket,x01,game-engine,statistics,database,auto-scorer,ui-design,testing,git-ci-release,e2e}.md(substance-verified per rule).Results
Notes
docs/rules/(tracked, alongside other spec docs) rather than.claude/rules/—.claude/is gitignored, so files there would never reach the repo/CI.🤖 Generated with Claude Code