/docs-hygiene:audit-noise [audit] [target] [--persist-findings] [--repo <repo> ...]from docs-hygiene
Read-only audit of tracked markdown files for nine noise shapes: stale historical citation, ghost ref, preamble, tracker back-ref, negation without positive, conversational residue. Use when 'audit markdown noise', 'find ghost refs', 'declutter', or 'sweep for noise'.
Ships in docs-hygiene. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Run each command below as its own Bash call, all sent together in one message (worktree isolation).
Keep any bound in the command's own pipe (output limits).
Unless this section says otherwise, treat a failure (not a repository, git unavailable) as an unknown value and carry on. Keep these as body calls, never ## Pre-computed context lines (gather-block convention).
git branch --show-currentgit status --porcelain | grep -E '\.md"?$' | head -10Noise findings (sample): !${CLAUDE_SKILL_DIR}/scripts/detect.sh 2>/dev/null | grep -E '^(status:|Summary total:|Finding shape:)' | head -20 || echo "none"
Tracked markdown (rules, skill bodies, CLAUDE.md, AGENTS.md, docs/, READMEs) accumulates nine NOISE shapes, distinct from FLAVOR, which the sibling /docs-hygiene:compress owns. Every reader pays to read past noise in every file that carries it. This skill is a read-only classifier: it surfaces candidates with treatment guidance; the author hand-applies every edit.
Three shapes, plan-reference, conversational-antecedent, and ticket-pr-residue, share names with the code-side sibling /code-tidying:remove-comments audit (if enabled) because they are the same authoring failure in a different file type. Ownership splits by file type, not shape: markdown is this skill's, everything else is the sibling's, and neither scans the other's files. The patterns are not shared code: the sibling classifies only a line's extracted comment portion, while this skill classifies whole prose, where the same words carry meaning far more often, so its patterns are tighter and several of the sibling's cues are deliberately not carried over.
Before classifying in-page noise, ask the whole-page admission question: could a reader with repository search derive this page's content from the code itself? A failing page is a deletion candidate. Its finding recommends relocate-then-delete (salvage anything admissible first), never a line-level noise treatment, and never auto-delete (this skill stays read-only).
Four categories always pass admission regardless of derivability: decisions,
domain language, thin navigation, and policy/wiring. For the four-factor
scoring behind a contested call, reuse /docs-hygiene:audit-derivability's
rubric by reference: invoke it via the Skill tool when available; otherwise
apply the admission question standalone.
Org override. This pre-check is a portable-baseline default. When the
consuming repository declares its own documentation-existence convention,
defer to it, resolved via the resolution ladder of
/discipline:follow-our-standards (if enabled): repo-declared source → repo's own conventions → this portable
baseline.
Only a page that passes admission proceeds to the nine in-page NOISE shapes below.
| Shape | What it looks like | Default tier | Treatment |
|---|---|---|---|
citation, historical citations | Dated incident citations, inline origin notes ("ported from X", "Merged 2026-07-24 from Y"), migration/rename narration ("Empirically observed 2026-…", "was renamed to", "we pivoted from") when the current form suffices | 1 | Relocate to a per-file ## Sources / ## History footer; strip when non-load-bearing (version control preserves history). Keep inline only when the date is load-bearing (methodology or freshness stamp). Origin cues are clause-anchored on both sides plus a list-bullet anchor, require column 0 (the code-side sibling allows leading whitespace), and stand down on a line carrying a link (inline or reference-style) or a bare URL, because a pointer is what /attribution:audit (if enabled) asks an author to write. The stand-down covers only a pointer, not the other two sanctioned forms: an attribution naming a work rather than a location ("Copied from Kent Beck, Tidy First?, chapter 3") is matched, as is a clause-leading descriptive use ("Copied from the source buffer, the bytes are then hashed"). Both land on relocate, not delete, and ## Sources is an exempt section, so relocating either is terminal |
ghost-ref, refs into slice-scoped working paths | Concrete paths into a memory work slice (.work/<slug>/) and concrete children of the concern-scoped roots, cited from durable surfaces, plus any citation of the retired .claude/notes/ location. The citing document outlives the slice, so slice retirement breaks the reference, whether or not the consumer's memory tier is gitignored | 2 | 3-way classify: promote the content to a durable home, replace with a durable pointer (a commit-SHA permalink or the carrying PR number), or strip. Exemptions apply per matched path, never per line: slot-variable forms (<slug> as a schema placeholder, not a literal name) and the bare concern-scoped roots (.work/handoffs/, .work/reviews/, .work/running-retros/, .work/overengineering/, .work/enforceability/, .work/exports/, .work/lanes/, reserved first-level names under the memory root, with nothing concrete after) are not ghost refs. A concrete child under a concern root flags |
preamble, "Why this file exists" openers | Opening section explaining motivation/history/rationale | 2 | Diataxis classify: KEEP on Explanation-quadrant files (rule bodies, ADRs, convention rationale); STRIP on Reference-quadrant files (data tables, registries, cheat-sheets), replacing with a 1-sentence orientation |
enum-list, hard-coupled consumer lists | Tables/lists hardcoding N specific consumers that drift on every add/remove ("the following five skills…", bulleted /skill — role rosters) | 1 | Replace with a runtime derivation (a grep/list command cited inline) or a category citation; hardcode only when both fail |
scope-meta, scope/loading meta-commentary | Body prose restating loading mechanics that config/frontmatter already owns ("Path-scoped to X", "Loads on Read of Y", "Auto-loads when…") | 1 | Strip the clause; the frontmatter/config is the single source of truth. Keep a genuine cross-ref riding the same sentence. Files with no scoping frontmatter may state scope in one sentence |
plan-reference, plan/changeset narration | Prose pointing at the work that produced the page instead of its subject: replaces the old …, in this PR we …, Task 2 of the plan | 1 | Delete the plan/changeset frame and keep what the sentence asserts about the present subject, rewritten without it. A doc citing a plan artifact that still exists is a live cross-reference, not this shape. Matching requires a first-person actor behind in this PR, so the files changed in this PR is not flagged |
conversational-antecedent, asides to the requester | Prose addressed to the person who asked for the page or to the conversation that produced it: As you asked, …, As requested, …, Per our discussion, …, per your request, like you said | 1 | Delete the address. The conversation is invisible to every future reader, and the assertion survives verbatim once the clause is cut. Two follower classes stand the shape down, because both name something a future reader can still open: an anaphoric adverb (as we discussed above), and in / under / at / on ahead of a document locator, meaning a § or #anchor, a section/chapter/step/table, a link or path, or a named durable document (as we decided in §3, in the ADR, on the ADR's recommendation). Those prepositions ahead of anything else are matched, so as we discussed in yesterday's meeting, as we decided in favor of X, as we agreed on Tuesday, and as we decided at the standup are residue. Tracker nouns are deliberately not locators: decided in issue 88 is a back-reference that ticket-pr-residue owns. The actor-less as requested matches only as a clause-final adverbial, so the attribution as requested by the client is not matched |
ticket-pr-residue, tracker/PR back-references | A bare back-reference offered as the reason the prose says what it says: See PR #45 for the rationale, Tracked in JIRA-123, decided in issue 88, from the feature branch | 2 | Review: delete a bare back-reference, or relocate it to the ## Sources / ## History footer (an exempt section, so a relocated reference stops flagging). Carve-out: a markdown task-list item (- [ ] … #123, - [x] … #123) and a TODO(#123)-family marker are never flagged: both denote outstanding tracked work, where the reference is the actionable part of the line (the markdown form of the sibling's sanctioned-TODO exception). Nothing else is carved out: an inline parenthetical (… (tracked in #482)) stays Tier 2 so a reviewer rules on it, not the scanner. Routed, not flagged: in a SKILL.md this shape belongs to /skill-quality:check (if enabled), and in an agents/*.md to /harness-config:audit-instructions (if enabled) |
negation, imperative prohibition with no positive alternative | An imperative prohibition (never, do not, don't, avoid, must not, should not) opening the sentence, with no positive alternative stated in that sentence ("Do not use markdown."). Soft-wrapped sentences are accumulated across paragraph lines before classification. Descriptive prose ("Older versions do not support this flag"), a mid-sentence cue (already-paired "Prefer X; never Y"), and a table row are out of scope | 2 | Rewrite to the positive target the prohibition implies ("Do not use markdown" → "Compose your response as smoothly flowing prose paragraphs"). Keep a negation only where the positive form genuinely loses the constraint, and then pair it with the positive in the same sentence. Never a deletion: the constraint survives; only its framing changes. This completes the write-side rule /docs-hygiene:write-for-agents "Prompt the positive". A hard guardrail that cannot be phrased positively is not a finding and is never flagged (carve-outs in Hard rules) |
Consumers with their own ephemeral-path or noise conventions can refine these defaults in their repo's CLAUDE.md / rules; the shapes and tiers above are the built-in baseline.
| Action | Args | Behavior |
|---|---|---|
<target> (default, no action keyword) | empty → uncommitted .md files from git; file path → single-file; dir path → batch | run ${CLAUDE_SKILL_DIR}/scripts/detect.sh on targets; map the emitted facts to the per-file tier table using the treatments above |
audit [target] | same target rules | explicit form of the default; same behavior |
One action; the author's hand-edits from audit output cover the sweep workflow.
--persist-findings (off by default) additionally writes the run's negation findings as a
type: review-findings file for review:fanout's fix relay, per
context/persist-findings.md, which owns every mechanic (destination
resolution, the read-and-refuse gate, the self-ignore guard, which findings enter the file, and
what each cell says). A bare invocation reports and stops. negation is the only shape with a
severity-crosswalk row; every other shape audit_noise_detect_shapes_into in
scripts/lib/noise-shapes.sh appends stays in the human report and
is counted as declined.
Several repositories. A target form (--repo <repo> and the others) runs the action once per
repository, per ${CLAUDE_PLUGIN_ROOT}/reference/target-scope.md
and ../../context/clean-tree-fallback.md "Several
repositories". With no path, each repository's corpus is rule 1's below, minus the offer. Under
--persist-findings, each repository gets its own findings file, resolved and guarded in that
repository's memory slice under the clone's own root (git -C <clone root>), never under a
scratch worktree the pass ran in, which is removed after the pass. Call emit-findings.sh with
--out set to that path and --branch set to the branch the pass read (origin/HEAD's, unless
it is the session's own checkout): a detached scratch worktree has no current branch, so the
script's default refuses to write.
Shared clean-tree / no-scope shape: ../../context/clean-tree-fallback.md.
The rules below are what this skill runs; open the shared file only when editing them, for the
sibling divergences it owns.
.md minus every fixtures/ directory (**/fixtures/**), testdata/, __fixtures__/
and CHANGELOG.md; slice-scoped files (contract and
memory tiers) sectioned separately in the report; scan via a chunked detect.sh pass
(detect.sh --paths-file <list> --offset N --limit M, one process per chunk, no
per-file shell loop); judge every scanner-flagged file and a bounded sample of
scanner-negative files (enough that a fresh full-corpus judgment pass cannot find
real drift this report called clean). Never report a fully-clean result from
scanner-flagged files alone: the scanner is a structural matcher, not a complete
reading of the shape table, and judgment is required for the paraphrases it misses.
Size the judgment pass to the corpus. When every file fits one inline reading (tens of files,
not the hundreds that make a fan-out pay), read every file in the main session and skip both
the fan-out and the verification pass: a full reading already covers the scanner-negative
sample, and subagent verdicts would need re-reading anyway. Above that, fan out a small number
of concurrent subagents with one fresh-context verification pass over the merged verdicts.
The verification level changes that pass: resolve it once with
bash "${CLAUDE_PLUGIN_ROOT}/lib/read-verification.sh" --plugin docs-hygiene --skill audit-noise --file docs/conventions/docs-hygiene.yaml
and report its line (levels). This skill's allowed-tools does not grant the reader, so the call may prompt; a refused or denied call resolves light.
strict runs the pass at every corpus size, over the inline verdicts too. Under light, and
off, which acts as light here, dispatch no verification pass and never re-grade the
verdicts inline in its place: the report carries verification: skipped (<level>).
Report first. The skill stays read-only either way, and the author applies treatment edits only
after reviewing the report (report-vs-fix-as-you-go is the author's call; report-first is the
accuracy-preferred default because repeating shapes get one corpus-wide treatment decision).
Unattended (no human to confirm), surface the offer as blocked and stop. Never launch the
repo-wide run on silence..md files → batch audit over those filesaudit → audit on rest (explicit form)Edit, no Write, no mutating Bash op against any
file this skill audits; the author owns every treatment edit. Emitting the findings artifact is
the one write this skill performs, and it is not an exception: "read-only" forbids target
mutation, not artifact emission. The artifact is a new file in the gitignored memory tier,
never an audited target, written only under --persist-findings, and a proposal for a
human-gated relay, not an applied edit. Describing it to an operator as a change that has been
made is wrong. No audited file becomes writable, and a bare invocation still writes nothing.## Recheck triggers, ## Cross-references, ## Sources / ## History / ## External authority footers (any ATX heading level, so ### Sources counts; a later non-exempt heading of any level ends the exemption), ADR amendment blocks, CHANGELOG.md entries and release notes (detect.sh skips CHANGELOG.md by basename), YAML frontmatter (--- … ---), and fenced code blocks. Inline `code` spans are stripped before every shape match except ghost-ref, which still sees unwrapped path text. A shape-definition or worked example written in backticks does not self-match; one written in plain quotes does.negation candidate, each only with its evidence present on the
sentence: a paired positive (instead, rather than, prefer, in place of, in favor of, or a bare imperative after a separator such as an em dash, semicolon, or colon, looking through a
leading adverb such as just / simply), a hard guardrail whose constraint a positive form cannot carry (secret, credential,
token, password, api key, force-push, --force, rm -rf, destructive, irreversible,
data loss, production, security, vulnerab, rewrite history), or a worked example
(a -> / → demonstration). Absent evidence selects the finding: a judgment call can make a
run noisier but never silently withhold one. The carve-out lives in the shared scanner, so the
human report and any persisted findings file give one candidate one disposition. Every marker
matches as a whole word: a bare substring would let a longer word (secretary for
secret, preferentially for prefer) satisfy a withholding boundary and lose a real
finding silently.negation selects only an imperative, and classifies the accumulated sentence. Two scope
gates; without them the shape fires on most descriptive prose in an instruction corpus and buries
every real finding. (1) The cue must open the sentence, after list, blockquote,
task-list-checkbox and emphasis markers. "Prompt the positive" is a rule about instructions,
so descriptive prose is out of scope, and a mid-sentence cue is already the paired form
("Prefer X; never Y"). The stated cost: a subject-led instruction ("The agent must not emit a
bare summary") is not selected. (2) Soft-wrapped sentences are accumulated across paragraph
lines before the classifier runs, so a wrapped prohibition is judged as one sentence. A finding
is attributed to the sentence's first physical line, where the cue opens, so the fix action
lands on the instruction's start, not its continuation. The other eight shapes stay
line-scoped. A table row still does not select: a row begins with |.<!-- markdown-discipline-ignore --> covers the next paragraph, through the next blank line or heading. <!-- markdown-discipline-ignore-line --> covers exactly the next physical line; a blank line consumes it, so place it directly above the content line. Both skip the wrapped content. A prose mention of the marker name is not a live marker..work/<slug>/…) is a schema placeholder, not a literal path; the reserved concern-scoped roots in the ghost-ref row are citable only bare or with a placeholder child, and a concrete child under them flags. A convention token on a line never exempts a concrete ghost ref sharing that line. Exception: the retired .claude/notes/ location flags even in placeholder form./docs-hygiene:audit-noise <file> is identical to /docs-hygiene:audit-noise audit <file>.Two writers, one report. detect.sh emits File: / Finding *: / Summary *:
lines only. It does not emit admission verdicts, and does not emit
Tier 3 for any of the nine named shapes (each has a fixed default tier in
audit_noise_shape_tier); a scanner T3= count is reserved for an
unrecognized shape name, which should not occur. Admission and any Tier 3
"likely legitimate" row are judgment-pass rulings the operator writes after
reading the scanner facts. Do not treat scanner stdout as if it contained
admission PASS / admission FAIL.
A run that scanned nothing is distinct on stdout from one that scanned files
and found nothing: detect.sh prints status: no-targets in the first case
(even when stderr is discarded, as the pre-computed context above does). A
clean audit prints Summary total: files=<N> with N>0 and zero findings.
Per target file, the judgment-pass existence pre-check precedes the in-page findings:
<file>: admission PASS
<file>: admission FAIL — deletion candidate (relocate-then-delete recommended)
A FAIL skips the in-page tier table below; a PASS proceeds to it:
<file>: N finding(s) — T1=<n>, T2=<n>, T3=<n>
| Tier | Shape | Line | Excerpt | Treatment |
|------|-------|------|---------|-----------|
| 1 | citation | 42 | "Empirically observed 2026-..." | Relocate to a ## Sources / ## History footer |
| 2 | ghost-ref | 87 | ".work/foo-slice/PLAN.md cites..." | 3-way classify (promote / SHA-permalink / strip) |
| 2 | preamble | 7 | "## Why this file exists" | Diataxis classify (KEEP if Explanation; STRIP if Reference) |
| 3 | preamble | 1 | (top-of-file orientation paragraph) | Likely legitimate; surfaced for awareness |
| 1 | conversational-antecedent | 9 | "As you asked, this section..." | Delete the address to the requester |
| 2 | ticket-pr-residue | 55 | "See PR #45 for the rationale" | Review (delete a bare back-reference / relocate to ## Sources) |
Batch aggregate at end:
Total: <N> file(s) audited, <T1> Tier 1, <T2> Tier 2, <T3> Tier 3 findings.
shape values: citation, ghost-ref, preamble, enum-list, scope-meta, plan-reference, conversational-antecedent, ticket-pr-residue, negation.
/docs-hygiene:compress. The sibling /docs-hygiene:compress owns FLAVOR (filler, hedging, redundant restatement, and articles when compress_articles is cut); /docs-hygiene:audit-noise owns NOISE (the nine shapes above). Both may apply to the same target iteratively./code-tidying:remove-comments audit (if enabled). The boundary is the file type, not the shape vocabulary (see Purpose): each file type keeps exactly one owner, so no dedup or precedence rule is needed. The code skill is not simply widened to .md because on markdown its history-narration and origin-note would fire on the same lines as this skill's citation with the opposite treatment (delete vs. relocate to a ## Sources footer), and a conflict between two treatments is resolved by ownership, not by scope./docs-hygiene:audit-noise is semantic noise classification./docs-hygiene:extract-ssot's territory at any multiplicity. Sub-three repetition lands in its non-abstracting buckets, and only minting a new SSOT artifact waits for 3+.--persist-findings: /review:fanout fix./docs-hygiene:audit-derivability./docs-hygiene:compress.context/persist-findings.md (opens in a new tab)evals/evals.json (opens in a new tab)evals/fixtures/legit-optouts.md (opens in a new tab)evals/fixtures/negation-shapes.md (opens in a new tab)evals/fixtures/negation-trigger-fence.md (opens in a new tab)evals/fixtures/noisy-rule-snippet.md (opens in a new tab)evals/fixtures/origin-notes.md (opens in a new tab)evals/fixtures/recall-paraphrases.md (opens in a new tab)scripts/detect.sh (opens in a new tab)scripts/detect.test.sh (opens in a new tab)scripts/emit-findings.sh (opens in a new tab)scripts/emit-findings.test.sh (opens in a new tab)scripts/lib/noise-shapes.sh (opens in a new tab)scripts/lib/opt-value.sh (opens in a new tab)scripts/lib/parse-concern-value.sh (opens in a new tab)scripts/lib/yaml-subset.awk (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
bashThree short reads, in order
markdown-noise, ghost-refs, declutter, documentation-hygiene
10 skills in this plugin
/audit-derivabilityAudit derivabilityRead-only audit of whether a doc earns its existence or an agent can re-derive it from code, config, and structure: verdict per file (delete, convert-to-pointer, keep-as-derivation-cache, keep-owns-facts). Use when: 'is this doc worth keeping', 'audit doc value', 'prune redundant docs', or derivability. Not for noise: /docs-hygiene:audit-noise. Load it before judging whether a doc should stay or go./audit-encapsulationAudit encapsulationAudit skill encapsulation and boundary leak where external citation reaches private skill surface (.claude/skills/X/, plugins/*/skills/X/) beyond slash invocation; read-only, explicit fix FILE:LINE. Use when 'audit encapsulation', 'find skill leaks', 'check skill boundaries', skill boundary violation, reaching into SKILL, API drift, refactor skill. Load it to ask what depends on another plugin's internals. Load it too before publishing plugins as separate installs./audit-progressive-disclosureAudit progressive disclosureRead-only progressive-disclosure audit of agent instruction markdown: grades file and context loading across always-loaded, invocation-loaded, on-demand tiers; flags split, hub-and-spoke, disclosure defect. Use when 'progressive disclosure', 'split this file', 'too much context'. Not for noise: /docs-hygiene:audit-noise; QA: /skill-quality:check. Load it before advising what in a CLAUDE.md or rule stays loaded.npx claudepluginhub melodic-software/claude-code-plugins --plugin docs-hygieneOther plugins' skills for the same job