| context | fork |
| user-invocable | true |
| name | claude-md-auditor |
| description | Audit CLAUDE.md files in a repository against a 6-criteria quality rubric, output a scored report and diff preview, and require user approval before any Edit. ์์ฐ์ด ํธ๋ฆฌ๊ฑฐ: 'CLAUDE.md ์ ๊ฒํด์ค', '๋ฉ๋ชจ๋ฆฌ ํ์ง ๊ฐ์ฌ', 'ํ๋ก์ ํธ ๋ฉ๋ชจ๋ฆฌ ๊ฒํ ํด์ค', 'claude.md audit'. |
| lang | ["en","ko"] |
| platforms | ["claude-code"] |
| level | 2 |
| triggers | ["claude.md","audit memory","memory quality","project context","๋ฉ๋ชจ๋ฆฌ ํ์ง"] |
| agents | ["orchestrator","doc-updater"] |
| tokens | ~3K |
| category | quality |
| whenNotToUse | Single CLAUDE.md edit requests where the user already specified the change. Skip when no CLAUDE.md file exists in the repository โ run `/learn` to bootstrap one instead. |
| tools | Read, Glob, Grep, Edit |
CLAUDE.md Auditor
Score every CLAUDE.md-style memory file in the repo against a 6-criteria rubric (max 100), produce a graded report (AโF), and propose minimal diffs that the user must approve before any Edit fires.
When This Skill Applies
- User says "audit CLAUDE.md", "score project memory", "memory quality", "๋ฉ๋ชจ๋ฆฌ ํ์ง"
- Discovery scan finds 2+ CLAUDE.md files with last-touched age > 30 days
- After a
/learn cycle persists patterns, to verify they didn't bloat any CLAUDE.md beyond the 200-line soft cap
- Nightly session rollup picks up
audit-cache.json โ metric feed into GRPO (no UI)
5-Phase Workflow
Phase 1 โ Discovery (Glob, not find)
Use Glob only โ find is rejected by the pre-bash guard on Windows and is not portable.
Patterns to scan, in priority order:
| Pattern | Type | Loaded |
|---|
CLAUDE.md | project | every session |
**/CLAUDE.md | subdir (per-package) | on package context |
CLAUDE.local.md | local override | every session, gitignored |
~/.claude/CLAUDE.md | global user | every session |
plugins/*/CLAUDE.md | plugin | when plugin active |
Skip any file whose first frontmatter line declares audit-skip: true.
Phase 2 โ Assessment (6-criteria rubric, 100 pts)
Score every discovered file independently. Each criterion has the listed max; partial credit allowed in 5-pt steps.
| # | Criterion | Max | Signals |
|---|
| 1 | Commands / Workflows | 20 | concrete npm / make / claude invocations; expected outputs; not just "run tests" |
| 2 | Architecture Clarity | 20 | module boundaries; data-flow arrows; named layers; one mermaid or table preferred |
| 3 | Non-Obvious Patterns | 15 | constraints that aren't visible in code (deadlock workarounds, vendor quirks, contractual SLAs) |
| 4 | Conciseness | 15 | โค 200 lines for project; โค 80 lines for subdir; no duplicated sections |
| 5 | Currency | 15 | last-touched โค 90 days OR explicit last-reviewed: field within 90 days |
| 6 | Actionability | 15 | every rule has a "when this applies" trigger; no vague "follow best practices" |
Grade thresholds (from total / 100):
- A 90+ โ load-bearing, do not block
- B 70โ89 โ minor polish suggestions only
- C 50โ69 โ actionable diff worth proposing
- D 30โ49 โ significant rewrite recommended
- F 0โ29 โ file is likely net-negative; propose archival or rewrite
Phase 3 โ Report (cache to disk for GRPO)
Emit a markdown table (one row per file). After printing, write the structured result to ~/.claude/artibot/audit-cache.json:
{
"auditedAt": "2026-05-14T10:00:00Z",
"files": [
{ "path": "CLAUDE.md", "score": 78, "grade": "B", "criteria": { "commands": 18, "architecture": 16, "patterns": 12, "conciseness": 12, "currency": 10, "actionability": 10 } }
],
"summary": { "avgScore": 78, "minScore": 78, "maxScore": 78, "count": 1 }
}
The nightly session rollup picks this file up next run and feeds summary.avgScore into GRPO as claudeMdQuality. When the cache is missing the metric falls back to null (zero-dimension contribution).
Phase 4 โ Diff Preview (no Edit yet)
For every file with grade โค C, propose one minimal diff (โค 40 lines changed). Use the same shape as commands/revise-claude-md.md โ a **File:** / **Why:** header followed by a diff block:
File: CLAUDE.md
Why: Currency criterion 5/15 โ last touched 2025-11 and references retired /old-cmd.
- /old-cmd run tests
+ npm test # vitest, 8K+ assertions, p95 30s
Group diffs by file. No Edit calls until Phase 5.
Phase 5 โ Apply with Approval (explicit yes only)
Prompt: "Apply the N diffs above? (yes / no / select N1,N2,...)"
yes โ fire Edit per diff, in order
no โ skip all, write nothing; report SKIPPED: N
select X,Y โ apply only the named indices
Silent assumption of approval is forbidden. If user input is missing, default to skip and emit SKIPPED (no explicit approval): N.
File Type Map
| Type | Path pattern | Owner | Frontmatter expected |
|---|
| project | CLAUDE.md (repo root) | repo | optional |
| local | CLAUDE.local.md | user (gitignored) | none |
| global | ~/.claude/CLAUDE.md | user (cross-repo) | none |
| package | packages/*/CLAUDE.md | package | recommended |
| subdir | apps/*/CLAUDE.md, services/*/CLAUDE.md | subteam | recommended |
Anti-Patterns
1. Obvious code info
Bad โ restates what the code already says:
The `parseArgs` function in cli.js parses CLI arguments.
Good โ captures the non-obvious constraint:
`parseArgs` swallows unknown flags for forward-compat โ DO NOT add strict validation here; downstream loaders rely on pass-through.
2. Generic best practices
Bad โ would apply to any project, gives no signal:
- Write tests
- Handle errors
- Document complex code
Good โ project-specific, actionable:
- Integration tests MUST hit the real Postgres (mocks masked the 2025-11 migration regression โ see PR #482)
- Errors that cross the swarm boundary must use `{ code: string, recoverable: boolean }` โ bare strings break the protocol
3. One-off fixes
Bad โ codifies a single incident as a permanent rule:
Always set `MAX_RETRIES=5` because of the 2025-04 outage.
Good โ describe the invariant, not the workaround:
Retry budget for outbound HTTP is the smaller of (caller budget, MAX_RETRIES env). The 2025-04 outage taught us callers MUST own the budget โ see lib/http/retry.js.
4. Verbose explanations
Bad โ prose that the model will re-tokenize every session:
This project uses a modular architecture with separate concerns for the
different layers of the application. The data layer is responsible for
all database operations and is kept strictly separate from the business
logic layer, which in turn does not know about the presentation layer...
Good โ one line + a code-reachable pointer:
3-layer separation: `lib/data/` โ `lib/domain/` โ `lib/http/`. Cross-layer imports fail lint (eslint-plugin-boundaries).
Output Format
CLAUDE.md AUDIT
===============
Files scanned: [N]
Avg score: [X / 100] Grade: [A-F]
| File | Grade | Score | Top issue |
|------|:-----:|:-----:|-----------|
| CLAUDE.md | B | 78 | Currency 10/15 โ last touched 2025-11 |
| apps/web/CLAUDE.md | D | 42 | Conciseness 6/15 โ 312 lines, mostly examples |
PROPOSED DIFFS (require approval)
---------------------------------
1. CLAUDE.md
Why: Currency criterion 5/15
```diff
- /old-cmd run tests
+ npm test
APPROVED: [n]
SKIPPED: [n]
Cache written: ~/.claude/artibot/audit-cache.json
## Quick Reference
- Glob (not find) โ Windows compat is non-negotiable
- 6 criteria, max 100 โ A/B/C/D/F thresholds at 90/70/50/30
- Never Edit without explicit `yes` or `select N,...`
- Cache to `~/.claude/artibot/audit-cache.json` for nightly GRPO ingestion