rule-effectivenesslisted
Install: claude install-skill luiseiman/dotforge
# Rule Effectiveness Analysis
Analyze the effectiveness of `.claude/rules/` in the current project by cross-referencing rule globs against actual file activity from git history.
## Step 1: Collect rules inventory
Read all `.md` files in `.claude/rules/`. For each:
1. Extract `globs:` value from YAML frontmatter
2. Count lines of content (excluding frontmatter)
3. Record filename and glob pattern
If a rule has no `globs:` or `paths:` frontmatter, classify as **always-loaded** (loads every session regardless of files touched).
Rules with `globs:` load eagerly at session start. Rules with `paths:` + `alwaysApply: false` load lazily (only when a matching file is touched). Note: `paths:` must be unquoted CSV — YAML arrays and quoted strings fail silently.
## Step 2: Collect file activity from git history
Run: `git log --name-only --pretty=format:'' --since='3 months ago'` (or configurable period).
Parse output to build:
- **session_files**: group files by commit date (approximate 1 day = 1 session)
- **total_sessions**: count distinct dates with commits
- **all_files_touched**: unique set of all files modified
If fewer than 5 sessions available, warn that results may not be representative and extend to `--since='6 months ago'`.
## Step 3: Cross-reference rules vs activity
For each rule with a glob pattern:
1. Match glob against **all_files_touched** using bash glob expansion or fnmatch logic
2. Calculate:
- `matched_files`: count of unique files that match the glob