0%

Three-role partition lint

Goal

Enforce the taxonomy mechanically: every .claude/rules/*.md is in exactly one role; every PROTOCOL rule is scoped away from unconditional load AND has a state->slice mapping entry AND keeps its @-include declaration; no rule is both always-global and banner-fed (the anti-duplication invariant).

Implementation Sketch

  • Author the three-role partition lint (a rule in exactly one role; PROTOCOL => scoped-away-from-always-load + has a mapping entry + declaration intact + not also always-global).
  • Wire the lint into the pre-commit / scripts/skill_audit gate.
  • Negative pins: a mis-classified rule, a PROTOCOL rule missing its mapping entry, a deleted @-include declaration, and a rule both always-global and banner-fed each fail the lint.

Spec References

  • S2 (taxonomy + mapping), S4 (de-global).
  • .claude/rules/script-first.md §9 (skill_audit lint integration).
  • .claude/rules/skill-template.md §2 (declaration invariant).

Work Items

  • Author the three-role partition lint enforcing the exactly-one-role + PROTOCOL-invariants + anti-duplication partition
  • Wire the lint into the pre-commit / skill-audit gate
  • Negative pins: each of the 4 partition violations fails the lint; the correct partition passes

Test strategy / acceptance

Pin: the lint fails on each of the 4 partition violations and passes on the correct partition. ENGINE-GATED (depends on S4’s de-global landing).