From pedantic-coder
Enforces CLAUDE.md guidelines and project conventions via inheritance hierarchy and directory walk-up algorithm. Audits repositories for systematic compliance including rule parsing and verification.
How this skill is triggered — by the user, by Claude, or both
Slash command
/pedantic-coder:guidelines-complianceThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Pedantic principles are universal. But every project also has its own rules — captured in CLAUDE.md files scattered across the repository. These files form an inheritance hierarchy, and every line of code must comply with every applicable guideline in its ancestor chain.
Pedantic principles are universal. But every project also has its own rules — captured in CLAUDE.md files scattered across the repository. These files form an inheritance hierarchy, and every line of code must comply with every applicable guideline in its ancestor chain.
A pristine codebase follows both universal principles AND its own documented rules. This skill teaches you how to find, parse, and enforce project-specific guidelines.
CLAUDE.md files follow a directory-scoped inheritance model:
CLAUDE.md applies to every file in the repositoryCLAUDE.md (e.g., src/CLAUDE.md) adds rules on top of its parent — it does NOT replace themsrc/features/auth/CLAUDE.md) adds more rules on top of both ancestorsRules are additive. A file at src/features/auth/LoginForm.tsx must follow:
CLAUDE.md (project-wide conventions)src/CLAUDE.md (source code conventions, if it exists)src/features/auth/CLAUDE.md (auth-specific conventions, if it exists)There is no override mechanism. If the root says "use snake_case" and a nested file says "use PascalCase for components," both rules apply in their respective contexts. If they genuinely conflict, that is a bug in the CLAUDE.md hierarchy — flag it.
To find all applicable CLAUDE.md files for a given source file:
CLAUDE.md exists in that directoryCLAUDE.md if it existsFor a file at src/features/auth/components/LoginForm.tsx, the walk produces:
CLAUDE.md ← root (project-wide)
src/CLAUDE.md ← source conventions (if exists)
src/features/CLAUDE.md ← feature conventions (if exists)
src/features/auth/CLAUDE.md ← auth conventions (if exists)
src/features/auth/components/CLAUDE.md ← component conventions (if exists)
Most repositories will have 1-3 CLAUDE.md files. Some well-structured monorepos may have more.
When auditing a repository, find all CLAUDE.md files first:
# Find all CLAUDE.md files in the repo
Glob pattern: **/CLAUDE.md
Map the hierarchy. Common patterns:
| Location | Typical Content |
|---|---|
CLAUDE.md (root) | Build commands, test commands, project structure, global conventions, architecture overview |
src/CLAUDE.md | Source code conventions, import rules, naming patterns, component patterns |
src/features/*/CLAUDE.md | Feature-specific patterns, data models, API contracts |
tests/CLAUDE.md | Test conventions, mocking patterns, fixture rules |
scripts/CLAUDE.md | Script conventions, deployment rules |
docs/CLAUDE.md | Documentation conventions, formatting rules |
Not everything in a CLAUDE.md is an enforceable rule. Distinguish:
Enforceable guidelines — statements that prescribe HOW code should be written:
any in TypeScript"Informational content — context that helps you understand the project but doesn't prescribe behavior:
When in doubt, treat it as a guideline. Better to flag a potential violation than to miss one.
**/CLAUDE.md)### Guidelines Compliance Report
**CLAUDE.md files found**: [list with paths]
#### [CLAUDE.md path] — [X violations, Y files checked]
**Guideline**: "[quoted rule from CLAUDE.md]"
**Status**: Violated in N files / Followed in M files
**Examples**:
- `path/to/file.py:42` — [specific violation]
- `path/to/other.py:17` — [specific violation]
**Fix**: [what to change]
#### Guideline Conflicts
- [Root CLAUDE.md says X, src/CLAUDE.md says Y — which applies?]
#### Stale Guidelines
- [CLAUDE.md references pattern/directory/command that no longer exists]
#### Summary
- Total guidelines checked: N
- Fully compliant: X
- Partially compliant: Y (followed in some files, violated in others)
- Widely violated: Z
- Stale/outdated: W
Bad — vague and unjustified:
The code doesn't follow project conventions in some places.
Consider reviewing the CLAUDE.md for guidance.
Good — specific, traced to source:
CLAUDE.md (root) states: "All Python files use Google-style docstrings."
Violated in 4 of 12 sampled files:
- src/services/auth.py:23 — missing docstring on public function `verify_token`
- src/services/auth.py:45 — NumPy-style docstring instead of Google-style
- src/models/user.py:12 — missing Args section in `create_user` docstring
- src/utils/crypto.py:8 — no docstring on module-level function `hash_password`
Working examples in examples/:
examples/claude-md-inheritance.md — Multi-level CLAUDE.md hierarchy showing how rules accumulate and how to check files at different depthsWhen checking guidelines compliance:
**/CLAUDE.md glob)npx claudepluginhub oborchers/fractional-cto --plugin pedantic-coderProvides best practices for creating, updating, and auditing CLAUDE.md files including constraints, commands, architecture overviews, and bloat reduction for projects.
Audits CLAUDE.md files in repositories: discovers files via find, evaluates quality against rubrics, generates reports, and applies targeted improvements after approval.
Generates, analyzes, and enhances CLAUDE.md files using best practices, modular architecture, and tech stack customization for new and existing projects.