rule-effectiveness

A rule-analysis tool that checks which project rules are being used, which are inactive, and where file coverage is missing. It compares Claude Code rules with files changed in Git history.

In plain words
What is it for?
Use it to inventory rules, measure recent file activity, find coverage gaps, and identify rules that should be kept or pruned.
Why use it?
It helps remove rules that consume context without being relevant and reveals files or areas that lack matching guidance.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/luiseiman/dotforge/rule-effectiveness
Any agent
npx skills add luiseiman/dotforge --skill rule-effectiveness
Clone the repo
git clone --depth 1 https://github.com/luiseiman/dotforge

Made for: Claude Code, Codex.

Per session 24 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,349 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00024 $0.01349
Opus 5 $0.00012 $0.00674
Sonnet 5 $0.00005 $0.00270
Haiku 4.5 $0.00002 $0.00135

Measured 2d ago against content hash 40e8e8a24174, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

rule-effectiveness scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/rule-effectiveness/SKILL.md · 133 lines

How it starts

The opening of the file, as written. The whole thing — 133 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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
    • match_rate: % of sessions where at least 1 file matched the glob
    • token_cost: lines of rule content (proxy for context consumption)

For the project overall:

  • covered_files: files that match at least 1 rule glob
  • uncovered_files: files touched but matching no rule
  • file_coverage: covered / total

Step 4: Classify rules

Classification Criteria Action
Active match_rate > 50% Keep — rule loads in most sessions and covers real files
Occasional match_rate 10-50% Evaluate — may be worth keeping for specific workflows (deploys, migrations)
Inert match_rate < 10% Candidate for removal — consumes tokens without matching real files
Always-loaded globs: **/* or no globs Evaluate content — is it generic enough to justify always loading?
Overbroad globs: **/* but content is stack-specific Should have narrower globs to avoid loading in wrong contexts

Read the full file on GitHub · 133 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 133 lines · 24 tokens per session scan A 40e8e8a24174

Subscribe to this mod's changes

rule-effectiveness is a skill published in the GitHub repository luiseiman/dotforge (8 stars, last pushed 2mo ago), licensed MIT. It adds 24 tokens to every session and 1,349 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

scaffold

Set up or align a non-code ops/PM repo with the ops folder structure, CLAUDE.md, and INDEX.md hierarchy.

OdinMB/ops-workflow · 30 tokens

find-opps

Find new directions for an ops project — adjacent opportunities, strategic gaps, preparatory research. Use when known work is well-mined and you need to look outward.

OdinMB/ops-workflow · 37 tokens

prioritize

Pick 2–3 independent ops tasks from active plans and backlog for autonomous execution, weighing impact, feasibility, and project goals.

OdinMB/ops-workflow · 29 tokens

factory-db-migration

The operational discipline for running a destructive change against a production database — schema migrations, data backfills, one-shot RPCs, historical seed imports. Adjacent to factory-data-layer.md (schema design) and factory-deployment.md (where migrations execute in CI) — this skill is about the runbook around…

nonlinear-xyz/factory-kit · 155 tokens

factory-api

API conventions for both server actions and tRPC builds. Covers the decision between them, per-mutation Zod input schemas, central router composition, pagination shape, multi-field search via Drizzle ilike + or(), mutation lifecycle hooks, conditional query enabling, stale-time defaults, error response shape and…

nonlinear-xyz/factory-kit · 95 tokens

factory-auth

Auth and authorization conventions distilled across builds with three different auth stacks (Better Auth + orgs, Supabase Auth + RLS, Clerk). Covers the provider decision matrix, the unified wrapper interface (requireAuth / requireRole / withOrgContext), procedure tier stacking, session handling, OAuth callback…

nonlinear-xyz/factory-kit · 97 tokens