agentleFS
ku5icku5ic/claude-kit/skills/audit-doc-drift/SKILL.md

audit-doc-drift

Skill2 starsChanged 14 days agoMITView on GitHub

Where markdown or inline docs no longer match the code

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read the code at $ARGUMENTS.

    line 26
  2. Distinctive:

    Do not edit documentation during the audit.

    line 72
  3. Distinctive:

    Do not flag "missing documentation" as drift.

    line 73
  4. Distinctive:

    If nothing drifted, the report says "No drift detected" and lists what was checked so the user knows the scope covered.

    line 74

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

/audit-doc-drift

Detect drift between code and markdown or inline documentation.

Run

With no target in the arguments, ask for one first, since the auditor can't ask. Resolve a linked ticket or doc as skills/investigate step 0 describes, then dispatch the auditor agent (subagent_type: kit:auditor, foreground) with this file's procedure and the resolved arguments. It writes the report. Then run the report-format skill's Runtime checks yourself, and reply per skills/kit-rules/reference/output.md section 3.

Prerequisites

$ARGUMENTS should point to the code surface to check. Required.

Procedure

  1. Stack is in the injected <repo-context> block.
  2. Read the code at $ARGUMENTS.
  3. Find relevant docs. Prefer targeted over exhaustive:
    • README.md at the project root if $ARGUMENTS is in src/ or equivalent
    • docs/ folder, but only files whose name or first heading mentions the target area
    • JSDoc, docstrings, and inline comments in the target files
    • CHANGELOG.md only if the task involves a version boundary
  4. If <root>/.claude/rules/conventions/*.md exists, check every path:line citation in it, whatever $ARGUMENTS names. Read the cited line with a few lines of context and confirm it still shows the convention its bullet states. Moved within the file: warning, with the new line. Gone, or now showing the opposite: failure against the rule file's line, since the rule now misleads.
  5. Skip the dirs skills/kit-rules/reference/tooling.md section 1 lists, and LICENSE.md.
  6. Accepted decisions: kit adrs <target> lists the ADRs that cite the target, and an accepted RFC or design doc in the project's design folder that names it counts too. Read each one's Decision, and check the code at the target still follows it. kit adrs failing means the project keeps no ADRs.
  7. Compare.

What counts as drift

  • Inline comments or JSDoc that describe code no longer present or that has changed behavior
  • Parameter descriptions that no longer match the signature
  • Return type docs that conflict with the code's declared types
  • External markdown with usage examples that would fail if run
  • Configuration instructions that reference renamed or removed options
  • Documented features that have been removed or renamed
  • Feature documented but no longer exists
  • Code that contradicts an accepted ADR, RFC, or design doc with nothing superseding it: failure against the code's file:line. The fix is the code, or a new ADR that supersedes the old one (/write-adr).
  • Requirements documented in README, CLAUDE.md, or design docs that no longer match the implementation. Examples: a "supports X" claim with no code implementing X; a "must validate Y" rule with no validation in the relevant handler; a documented invariant that the code violates.

What does not count as drift

  • Missing documentation for new features (that is a docs gap, not drift)
  • Stylistic differences (tone, format)
  • Out of date links to external sites, unless the target area depends on them

Proof

Each finding quotes both sides with file:line: the doc's claim and the code that contradicts it. For an example that would fail, name the line of code that makes it fail; never run it.

Output per finding

  • What it is, with the documentation's file:line
  • Evidence: what the documentation says (a short quote) and what the code does, with its file:line
  • Severity: failure when it actively misleads, warning when it's partly outdated, info for a cosmetic gap
  • Fix: the correction, noted and never applied

Output file

Load the report-format skill and use its format. Write to the path kit scratch-dir doc-drift <target-slug> prints.

Scope rules

  • Do not edit documentation during the audit.
  • Do not flag "missing documentation" as drift. Only flag documented claims that no longer hold.
  • If nothing drifted, the report says "No drift detected" and lists what was checked so the user knows the scope covered.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.