Documentation audit
Agents read the READMEs before the code. A wrong line costs every future session; a missing one costs a search. This skill finds both, with evidence, and changes nothing.
Instruction files (AGENTS.md, CLAUDE.md, DESIGN.md, SKILL.md) are out of scope here: use
instruction-audit for them.
The scripts are in this plugin's scripts/ directory: two levels up from this skill's base
directory. Session evidence, the report and applying changes follow <plugin>/scripts/EVIDENCE.md;
read it before step 5.
1. Inventory
git ls-files '*.md' ':!:**/AGENTS.md' ':!:**/CLAUDE.md' ':!:**/DESIGN.md' ':!:**/SKILL.md' > $TMPDIR/docs.txt
List the docs with line count and last commit date (git log -1 --format=%cs -- <file>). Compare
that date with the last commit to the code the doc describes; a doc much older than its code is
the first place to look.
2. Stale
node <plugin>/scripts/refs.mjs --missing $(cat $TMPDIR/docs.txt)
Every path, link, make target and package script a doc names that no longer exists.
3. Wrong
A reference can exist and the claim still be false. Check by reading the code, one claim at a time:
- commands and make verbs: the flags, arguments and what the target does today
- environment variables: names against
.env.exampleand the code that reads them. Never open a real.env. - ports, URLs, versions, numbers, table and column names
- "how it works" sections against the code path they describe
Report only what you checked against source. Name the file and line that proves it wrong.
4. Missing
What the code has that no doc mentions: a component or top-level directory without a README, a
make target or package script no doc lists, an environment variable in .env.example that no doc
explains, a new step in a documented flow. Skip internals no reader needs.
5. Evidence from sessions
Gather the evidence as EVIDENCE.md says: this machine, then the team. Find sessions where an
agent read a doc and then hit trouble: a command from the doc that failed, a correction right
after, or a search for something the doc should have said. Attach the session ids to the matching
finding, or add a finding.
Report
As EVIDENCE.md says, to $TMPDIR/quesma/doc-audit.json with kind: "doc-audit", repo, scope
(docs, dates, sessions), one item per finding.
status:stale,wrong,missing,duplicateorvague.id:file:line, or the code path formissing.rule: the doc line, shortened; formissing, what is undocumented.detail: the problem in one sentence;evidence: the source line that proves it, session ids.action: the fix in one sentence, and which doc it goes in.
End your answer with the counts per status, on one line. Change no doc until the user approves,
then apply the approved fixes as EVIDENCE.md says.