Audits and refreshes stale AGENTS.md/CLAUDE.md/REVIEW.md files after refactors. Verifies file:line references, updates counts, drops landed stubs, and adds missing folder docs.
Ships in use-sentry. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Refresh a mature AGENTS.md hierarchy that has drifted from current code. Audit first, in evidence. Then dispatch parallel writers fed by the audit. Add files only for code-bearing folders that genuinely lack one. Preserve voice, structure, length — patch, do not rewrite.
This skill assumes the AGENTS hierarchy already exists. For greenfield creation of root + folder AGENTS.md files, route to init-agent-config.
file:line reference in src/AGENTS.md is correct"src/AGENTS.md"AGENTS.md and write one" (expect mostly skips — see Phase 0 selection test)NOT YET LANDED for files that now exist — fix the manifest tables"init-agent-configrun-review Mode Abuild-skillinit-agent-config Step 12 covers that| Surface | Purpose | Update-mode concern |
|---|---|---|
AGENTS.md | How agents should work, where code lives, what local boundaries exist | Refresh refs, recount tables, drop "NOT YET LANDED" stubs that landed |
CLAUDE.md | Compatibility companion symlink → AGENTS.md | Verify symlink integrity; create for new gap folders |
REVIEW.md | What diffs should be flagged, protected, or held to a higher bar | Update severity refs; drop trigger phrases for rules that became false |
Folder AGENTS.md | Local delta only — never restate root | Same; add for newly-discovered code-bearing folders |
Hard guardrails — read every run.
file:line, a function/symbol/CLI flag, or a count is verified by grep -n / sed -n / wc -l against current HEAD before correction. Drift is a fact, not a guess.AGENTS.md is the model — its tone, density, and section structure transfer.CLAUDE.md symlinks intact. Verify post-edit. Create for new gap folders. Fallback to @AGENTS.md wrapper only when symlinks are forbidden — call it out.scripts/audit-agents-md.sh runs once before edits and once after. Diff the surface counts.| Derail | Correction |
|---|---|
| Editing the doc before the audit completes | Audit-first is the contract; the Quality Report ships first |
| Rewriting from memory ("I recall the file changed") | Always re-grep / re-sed; cite line numbers from the actual file |
| Auditor agent also edits | Auditors produce findings only; writers act |
| Writer agent re-runs the audit | Writers trust the brief; re-grep only for the specific recount they're applying |
| Frequency tables left untouched because "they're roughly right" | Recount every numbered table via grep — the cascade of additions silently shifts counts |
| "NOT YET LANDED" stub claims left in place | ls the alleged-missing files; if they exist, document them and remove the stub line |
| Internal contradictions silently surviving (§1 row vs §8 prose) | Cross-check the rule in §N against every later reference to the same symbol/file |
| Voice rewrite ("I made it more readable") | Patch in place; if you can't make a surgical edit, the change isn't ready |
| Auditing only headlines, missing prose claims | Every paragraph with a file.ext:line token is in scope |
| Adding new sections during update | Update mode only — new content goes to a separate init-agent-config pass |
| One AGENTS.md per directory ("coverage looks thorough") | Most folders are skips; a file needs invariants, not just code. 2–4 new files per pass is healthy |
| Paging through build noise in the tree scan | Use treezip (or prune by hand), find where real source resumes, read that — never script around it |
| Verifying claims inside a stale worktree / vendored copy | Resolve every path against the repo's live source tree before grepping |
Resolve script paths relative to this skill directory.
| Script | Use when | Mutates |
|---|---|---|
scripts/audit-agents-md.sh | Phase 0 inventory + post-edit re-audit: existing surfaces, line counts, companion symlink status, folder coverage map (src-files / LOC / AGENTS.md per code folder), duplicate-source risk. See scripts/audit-agents-md.sh.md. | No |
The init-only scaffold-agents-md.sh was dropped — update-mode never emits greenfield skeletons.
mature AGENTS hierarchy with drift after code churn
│
Phase 0 — Scan + Gap detection + Last-edit churn signal
│
Phase 1 — Quality Report (BEFORE any edit; ask user)
│
Phase 2 — Parallel Opus auditor dispatch (falsifiable claims)
│
Phase 3 — Triage findings + scope confirmation
│
Phase 4 — Parallel Opus writer dispatch (patch in place + author gap files)
│
Phase 5 — Post-edit re-audit + commit + push
│
refreshed hierarchy
Each phase has a gate. Do not skip forward. See references/audit-and-update.md for the per-phase detail and Quality Report format.
Three reads, no writes:
Existing surfaces + coverage map. bash scripts/audit-agents-md.sh from the repo root — lists every AGENTS.md, CLAUDE.md (with symlink target), REVIEW.md, native adapter, current line counts, and a folder coverage map: each code-bearing directory (depth ≤ 2) with its source-file count, source LOC, and whether it has its own AGENTS.md (with line count). This table is the gap-detection input — read it, don't recompute it by hand.
Tree scan. Prefer treezip . (compressed, AI-readable tree; npm i -g treezip) over raw tree — it brace-groups siblings and hardcodes an aggressive noise filter (VCS dirs, node_modules, venvs, caches, DerivedData, worktrees under .claude/), so the structure fits in context without hand-filtering. Fall back to tree -dL 2 . (-dL 3 for monorepos) when treezip isn't installed. Either way, budget the read: if the output is dominated by one noisy subtree (vendored deps, build products, checked-in worktrees), locate where the real source tree resumes and read that section — never page through build noise, and never write a one-off script to parse the tree.
Gap folders — select, don't enumerate. From the coverage map, a folder is a gap candidate only when all of these hold:
AGENTS.md doesn't already carry the folder's rules. Prefer one file at the subsystem root (e.g. src/transcription/) over one per leaf (cloud/, engine/, streaming/).Expect to skip most folders. A healthy pass on a mid-size repo adds 2–4 folder files, not one per directory. In the Quality Report, list skipped candidates with a one-line reason each ("conventional UI code", "covered by root") so the user can veto.
Churn signal — the steering trick. For each existing doc, get its last edit timestamp:
git log -1 --format=%ct -- <doc>
Then for the source files that doc references (anything matching \b[\w./-]+\.[a-z]+:\d+\b in the doc), list commits since that timestamp:
git log --since=<timestamp> --oneline -- <referenced-file>
This is the audit scope. If the doc was last touched at T and styles.css has had 12 commits since T, that file's line refs and counts are guaranteed stale. Drive auditor focus there. Files with zero churn since the doc's last edit can be lower-priority.
Output the report — no edits yet. Format in references/audit-and-update.md. Headline rows:
| Surface | Count | Avg score | Stale-ref count | Notes |
|---|---|---|---|---|
AGENTS.md | N | X/10 | M lines flagged | … |
CLAUDE.md symlinks | N | ✅ / ⚠ | — | … |
REVIEW.md | N | X/10 | M | … |
| Gap folders | N | — | — | List |
| Native adapters | N | — | — | List |
Then the coverage table — every code-bearing folder from the Phase 0 map, so the user sees what exists, how big it is, and what you propose:
| Folder | Src files | Src LOC | AGENTS.md | Decision |
|---|---|---|---|---|
src/api/ | 41 | 7,200 | yes (65 lines) | audit for drift |
src/transcription/ | 29 | 4,800 | — | author (invariant-dense) |
src/components/ | 76 | 13,000 | — | skip: conventional UI, covered by root |
src/utils/ | 8 | 400 | — | skip: small utility folder |
Every skipped row carries its one-line reason. Per-file: score + 5-line summary of what's drifted (line refs / invalidated rules / missing content / internal contradictions). Then ask the user:
After user confirms scope. Dispatch 3–5 parallel Opus agents, one per logical group of files. Sample grouping for a typical repo:
AGENTS.md + REVIEW.md + scripts/AGENTS.md + scripts/REVIEW.md (orchestration + pipeline)src/AGENTS.md + src/REVIEW.md (design system / styles)src/services/AGENTS.md + src/stores/AGENTS.md + their REVIEW.md (TypeScript code refs)src/ui/AGENTS.md + src/ui/REVIEW.md (UI module contract)Each auditor follows the falsifiable-claim discipline — see references/agent-dispatch.md Auditor section. They:
file:line / symbol / countgrep -n / sed -n / wc -l / lsUse the churn signal from Phase 0 to focus their attention.
Classify the returned findings:
$playback.set must live in audio-player.ts" is no longer true). These are dangerous; future agents will misroute work.Decide which to fix this pass vs. defer. Default: fix high + medium; fix low only in surrounding edits.
Dispatch 3–5 parallel Opus writers with the same grouping. Each writer gets:
AGENTS.md (cite which one)Each writer applies Edit calls in place. They do not add new sections. They report which paths they touched and a 3-line summary per file. See references/agent-dispatch.md Writer section.
bash scripts/audit-agents-md.sh — diff against the Phase 0 snapshot. Surface counts should match (or +N for gap folders newly created). No new orphan symlinks.docs(agents): refresh stale refs + counts after <churn-event>docs(<folder>): add AGENTS.md + REVIEW.md (separate commit per gap folder if substantial)These are the under-used patterns. Reach for them when the audit feels generic.
git log since doc's last edit (Phase 0) — drives scope toward files that have actually churned. Don't audit the whole tree blindly; audit where the diff is.styles.css 2,679 → 5,138 lines), every line ref is stale by definition.ls against "NOT YET LANDED" stubs. A doc's stub-table is a falsifiable claim too. ls each alleged-missing file; if it exists, the stub is wrong.grep -c. Recount before correcting.foo no longer exists at the cited line", run git log -S 'foo' -- <file> to find the rename commit. Update to the new name.ls-based audit.ls <module>.test.*.git log --grep=fix -- <folder>). Verify each against HEAD before encoding it — a review finding may have been fixed differently than described.Read the smallest reference set that unblocks the current decision.
| Need | Reference |
|---|---|
| Quality Report format, drift categories, post-edit verification, falsifiable-claim discipline | references/audit-and-update.md |
| Auditor + writer prompt scaffolds (parallel-Opus dispatch) | references/agent-dispatch.md |
| AGENTS authoring, folder scoping, WHAT/WHY/HOW filter (applies to in-place edits too) | references/agents-md-format.md |
Companion CLAUDE.md symlinks, native review adapter rules, cross-agent surfaces | references/agent-entrypoints.md |
REVIEW.md purpose, root/scoped split, severity tagging | references/review-context.md |
| Situation | Start with | Then read |
|---|---|---|
| Big refactor just landed; sweep all docs | references/audit-and-update.md | references/agent-dispatch.md |
| Just need to refresh frequency tables | references/audit-and-update.md (recount section) | — |
| Add AGENTS.md for newly-discovered code folder | references/agents-md-format.md | references/agent-entrypoints.md |
| REVIEW.md needs severity refresh after rule changes | references/review-context.md | references/audit-and-update.md |
When you finish a run, return:
[unverified] markers left in place, whyagents/openai.yaml (opens in a new tab)references/agent-dispatch.md (opens in a new tab)references/agent-entrypoints.md (opens in a new tab)references/agents-md-format.md (opens in a new tab)references/audit-and-update.md (opens in a new tab)references/review-context.md (opens in a new tab)scripts/audit-agents-md.sh (opens in a new tab)scripts/audit-agents-md.sh.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
agent-config, documentation-audit, drift-detection, agents-md, claude-md
/yigitkonur-use-sentry:update-agent-configfrom use-sentry
Generated from the plugin's indexed repository (yigitkonur/skills-by-yigitkonur) — no native marketplace selected
npx claudepluginhub p/yigitkonur-use-sentry31 skills in this plugin
/audit-agentic-cliUse if auditing or designing a CLI for agent/LLM use — JSON output, exit codes, non-interactive./audit-agentic-mcpUse if auditing or designing an MCP server for agent-readiness — framework, security, context./audit-completionUse if verifying claimed-done work or auditing session/plan/branch completion with evidence./audit-skill-by-derailmentUse if testing a skill with an agent execution trace; never for ordinary code, PR, or workflow review.Other plugins' skills for the same job