nulone

Claude Rules Doctor — Git skill for Claude Code

Git community intermediate

by nulone - CLI that detects dead .claude/rules/ files by checking if paths: globs actually match files in your repo.

How to install Claude Rules Doctor

This entry records only its repository, not the path inside it, so there is no exact command to give. Open nulone/claude-rules-doctor and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Claude Rules Doctor does

CLI that verifies `.claude/rules/*.md` `paths:` globs actually match files in your project.

Alternatives in Git

  • Harness Drift — Continuous-drift sweep — arch warnings, dead code, and Sonar drift outside the PR lifecycle 324 ★
  • Init Parallel — Initialize parallel git worktree directories 149 ★
  • Bm Init — Onboard (or refresh) basemind in this repo — write basemind.toml and inject a "prefer basemind over grep/read/ 94 ★

README

Catch dead Claude rules before they silently do nothing.

[](https://github.com/hesreallyhim/awesome-claude-code)

🩺 claude-rules-doctor

CLI that verifies `.claude/rules/*.md` `paths:` globs actually match files in your project.

Quickstart

# One-off
npx claude-rules-doctor check --root .

# Or install globally
npm install -g claude-rules-doctor
rules-doctor check --root .

Problem

Claude rules with `paths:` frontmatter can silently fail if:

  • The glob pattern doesn't match any files
  • File paths changed after the rule was created
  • Typos in glob patterns

This tool scans all your rules and tells you which ones are "dead" (not applying to any files).

Usage

Check current project

rules-doctor check

CI mode (exit 1 if dead rules found)

rules-doctor check --ci

JSON output

rules-doctor check --json

Verbose mode (show matched files)

rules-doctor check --verbose

Check specific directory

rules-doctor check --root /path/to/project

Output

  • ✅ OK — Rule is global (no paths) or paths match files
  • ⚠️ WARNING — Rule misconfigured: invalid YAML frontmatter, empty paths array, invalid types in paths, or invalid glob patterns
  • ❌ DEAD — Paths specified, but 0 files match

WARNING triggers

A rule gets WARNING status when:

  • Invalid YAML in frontmatter
  • Empty paths array (paths: [])
  • Non-string values in paths (numbers, booleans, null)
  • Invalid glob patterns

Example output (test-suite/6-mixed)

$ rules-doctor check

🔍 Rules Doctor - Check Results

✅ OK      /.claude/rules/valid.md
  Matches 1 file(s)

✅ OK      /.claude/rules/global.md
  Global rule (no paths specified)

❌ DEAD    /.claude/rules/dead.md
  No files match the specified paths

Summary:
  Total rules: 3
  ✅ OK: 2
  ⚠️  WARNING: 0
  ❌ DEAD: 1

⚠️  Found 1 dead rule(s). These rules won't apply to any files.

CI (GitHub Actions)


...