Help us improve
Share bugs, ideas, or general feedback.
From mtk
Audits existing CLAUDE.md files against quality rubric (commands, architecture, gotchas, conciseness, currency, actionability) and proposes minimal append-only diffs. Use periodically or when stale/drifts.
npx claudepluginhub moberghr/mtk-agent-toolkit --plugin mtkHow this skill is triggered — by the user, by Claude, or both
Slash command
/mtk:claude-md-auditThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
```!
Mandates invoking relevant skills via tools before any response in coding sessions. Covers access, priorities, and adaptations for Claude Code, Copilot CLI, Gemini CLI.
Share bugs, ideas, or general feedback.
echo "--- Existing CLAUDE.md files ---"
{ find . -maxdepth 6 -name CLAUDE.md -not -path "./.git/*" -not -path "*/node_modules/*" 2>/dev/null; \
find . -maxdepth 4 -name ".claude.local.md" 2>/dev/null; } | sort -u
echo "--- ~/.claude/CLAUDE.md ---"
test -f "$HOME/.claude/CLAUDE.md" && echo "$HOME/.claude/CLAUDE.md ($(wc -l < "$HOME/.claude/CLAUDE.md") lines)" || echo "(absent)"
echo "--- Tech stack ---"
cat .claude/tech-stack 2>/dev/null || echo "(not set)"
Audit existing CLAUDE.md files against a quality rubric, then propose minimal append-only diffs. This is a re-grade loop, not a regeneration. The skill honors rule S1.5 (CLAUDE.md is protected) — it never overwrites and never rewrites whole sections without explicit user approval.
This skill is distinct from setup-bootstrap (one-time creation of CLAUDE.md
from a fresh codebase scan) and setup-audit (refreshes
architecture-principles.md, not CLAUDE.md). Audit grades intent against
reality; bootstrap creates intent from scratch.
/mtk-setup (which runs setup-bootstrap)/mtk-setup --audit (which runs
setup-audit)The dynamic-context block at the top of this skill already lists target files.
Confirm the inventory before proceeding. If the project root has no CLAUDE.md,
stop and tell the user to run /mtk-setup first — there is no intent to
audit.
For each file found, record: absolute path, line count, last-modified date.
Currency is the most common rot. For the project-root CLAUDE.md, run these checks before scoring:
bash, dotnet, npm, pnpm,
python, make, pytest, or cargo lines from CLAUDE.md. For each:
scripts/foo.sh), confirm the file exists.npm run X), confirm X is in
package.json scripts.dotnet solution / project, confirm the file exists.src/..., tests/..., app/...). Confirm each path resolves. Stale
paths from old layouts are common rot..claude/tech-stack. If CLAUDE.md describes a
different stack, that is a Critical currency issue.Record each broken reference. These are evidence for the Currency criterion.
For each CLAUDE.md, score against six weighted criteria:
| Criterion | Weight | Definition |
|---|---|---|
| Commands & workflows | 20 | Are build / test / dev / lint commands documented and current? |
| Architecture clarity | 20 | Can a new agent understand the codebase shape in one read? |
| Non-obvious patterns | 15 | Are gotchas, conventions, and project-specific quirks captured? |
| Conciseness | 15 | Is the file dense — no verbose preamble, no restating the obvious? |
| Currency | 15 | Do all referenced commands and paths still resolve? (Phase 2 evidence) |
| Actionability | 15 | Are rules concrete enough to act on, vs. vague platitudes? |
Map total to grade: A 90-100, B 70-89, C 50-69, D 30-49, F 0-29.
Stop before any edit. Emit the report and wait for user approval.
## CLAUDE.md Quality Report
### Files audited
- ./CLAUDE.md — 142 lines, last modified 2026-03-12
### Project root: ./CLAUDE.md
**Score: 78/100 — Grade B**
| Criterion | Score | Notes |
|-----------------------|-------|-------|
| Commands & workflows | 14/20 | `npm run dev` no longer in package.json (now `pnpm dev`) |
| Architecture clarity | 18/20 | Clear, but does not mention the recent /workers split |
| Non-obvious patterns | 12/15 | Captures EF Core gotchas; missing the new auth middleware quirk |
| Conciseness | 14/15 | Tight; no obvious bloat |
| Currency | 9/15 | 1 broken script ref, 1 deleted file path |
| Actionability | 11/15 | Some rules are aspirational ("write good tests") |
**Broken references found:**
- Line 24: `npm run dev` — script no longer exists
- Line 91: `src/legacy/auth.ts` — file deleted in #1207
**Recommended additions (will show as diffs after approval):**
- Update line 24 build command to current pnpm script
- Add gotcha section for the new auth middleware
- Remove or rewrite line 91 path reference
**Recommended removals:**
- (none — biased against deletion without approval)
Then ask: "Approve these changes? (yes / partial / no)"
After explicit approval, emit one diff per accepted change. Bias toward append
or replace-single-line over rewrite. Never Write over CLAUDE.md. Always
use Edit with explicit old_string / new_string.
For each change, the diff block follows this shape:
### Change 1: ./CLAUDE.md line 24
**Why:** `npm run dev` no longer exists; `pnpm dev` is the current command.
**Before:**
\`\`\`
- Run dev server: `npm run dev`
\`\`\`
**After:**
\`\`\`
- Run dev server: `pnpm dev`
\`\`\`
If the user approved "partial", apply only the explicitly named subset.
After applying edits:
.claude/references/review-finding-schema.md applies.Edit, never Write. The protected-file rule (S1.5) means Write
on CLAUDE.md is a bug, even if the engineer asks for it.See .claude/skills/context-engineering/SKILL.md for the shared MTK
rationalization table. Audit-specific traps:
Edit tool with explicit old/new strings (never Write)