Audit noise

From melodic-software/claude-code-plugins · View interactive version

Audit noise is an AI agent skill from the GitHub repository melodic-software/claude-code-plugins. Read-only audit of tracked markdown for nine noise shapes, like historical citations, ghost refs, why-this-file-exists preambles, tracker back-references, and conversational residue, tiered by treatment. Use when: 'audit markdown noise', 'declutter', 'check for stale citations', 'find ghost refs', '

How to use this skill

Skill file

Repository context. Gather first

<!-- BEGIN GENERATED: gather-block. Edit docs/conventions/gather-block/block.md, then run scripts/sync-gather-block.py -->

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).

<!-- END GENERATED: gather-block -->

Pre-computed context

Noise findings (sample): !${CLAUDE_SKILL_DIR}/scripts/detect.sh 2>/dev/null | grep -E '^(status:|Summary total:|Finding shape:)' | head -20 || echo "none"

Purpose

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.

Existence pre-check (before in-page noise)

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.

Noise shapes and treatments

| 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 CODE7 "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 router

| 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

CODE0 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 CODE0

and CODE0 "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.

Auto-detect default

Shared clean-tree / no-scope shape: CODE0.

The rules below are what this skill runs; open the shared file only when editing them, for the

sibling divergences it owns.

  1. Empty arg AND clean tree → offer the repo-wide audit instead of silently no-opping; run only on

the user's confirmation. The offer carries prescribed defaults (overridable): corpus = all

tracked .md minus **/evals/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.

  1. Empty arg AND uncommitted .md files → batch audit over those files
  2. Single file path → single-file audit
  3. Directory path → batch audit (filenames sorted lexically for deterministic output)
  4. First positional == audit → audit on rest (explicit form)

Hard rules

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.

conditions suppress a 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.

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 |.

Output schema

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.

What this skill is not

Next

/docs-hygiene:audit-derivability.

Related

Sources

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.