doc-cleanup
Skill42 starsChanged 4 months agoMITView on GitHub
Audit and clean Markdown documentation for context rot. Use when docs may contain completed-work logs, executed plans, stale claims, contradictions, dead paths, or drifted authorities, especially in agent-required reading.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- park-jongbeom/patrick-work-harnesstheir own version, first seen Nov 5, 2026
- dakcoe/agent-doc-guardtheir own version, first seen Oct 8, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- dakcoe/agent-doc-guard★ 5same name
- park-jongbeom/patrick-work-harness★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 8 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Remove context rot from Markdown without erasing load-bearing rules or useful history.
- Distinctive: line 25
Follow the reading pointers in every entry doc.
- Distinctive: line 33
Read every in-scope doc deeply enough to test it for these rot patterns:
- Distinctive: line 77
Stop for approval. The diagnostic pass must leave the worktree unchanged.
- Very specific: line 87
Archive history that must remain conveniently discoverable: Put a verbatim copy or clearly bounded extract in docs/archive/ with a …
- Distinctive: line 91
Verify a full-file archive against the captured pre-edit source.
- Distinctive: line 94
Rewrite live guidance as current facts: Add a short archive pointer when one was created.
- Distinctive: line 116
every relative link in each touched file resolves
- Distinctive: line 121
no new contradiction was introduced across touched docs
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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.
Files
Doc cleanup
Remove context rot from Markdown without erasing load-bearing rules or useful history. Treat every doc claim as a hypothesis and the repository as evidence.
Work in two passes: diagnose and report without editing, then execute only after the user approves the proposed cleanup. Approval to edit does not imply approval to commit.
1. Inventory the full scope
Enumerate every in-scope *.md file, excluding generated, dependency, VCS, and
user-excluded paths. Record each file's line count and role:
- entry:
AGENTS.md,CLAUDE.md, or equivalent - required: an entry doc instructs agents to read it
- reference: consulted conditionally
- historical: retained for lookup, not current guidance
Follow the reading pointers in every entry doc. Weight findings by reading frequency: rot in required reading costs more than rot in an archive.
Inventory is complete when every in-scope Markdown file has a role and every entry-doc reading pointer is accounted for as resolved, dead, or external.
2. Diagnose without editing
Read every in-scope doc deeply enough to test it for these rot patterns:
- Completed-work logs — finished checklists, phase logs, implementation narratives, post-mortems, and verification transcripts presented as live guidance.
- Executed plans — shipped plans still written as intent, including superseded analysis and rejected options.
- Internal contradictions — competing values, corrections below stale tables, or dated addenda that reverse earlier guidance.
- Stale claims — references to renamed symbols, changed constants, wrong line numbers, or work described as unmerged after it landed.
- Dead paths — missing files, obsolete machine paths, moved repositories, or removed tools.
- Authority drift — a purported source of truth that no longer matches the implemented behavior or a later authoritative decision.
For each suspected hit, capture:
- exact file and line location
- the claim or content at issue
- repository evidence from file lookup, search, configuration, tests, or Git history
- confidence and any unresolved ambiguity
- the smallest safe disposition: keep, correct, condense, archive, or banner
Code proves implemented behavior, not necessarily intended behavior. When a doc may define the intended contract, report the mismatch as unresolved authority drift unless repository evidence establishes which authority superseded it.
Mark load-bearing content that must survive: hard rules, active decisions, recurring traps, do-this guidance, and domain vocabulary. A trap remains current even when the story of discovering it is historical.
Diagnosis is complete when every inventoried file is either represented by at least one evidence-backed finding or explicitly marked clean, and every factual finding has been checked against repository evidence.
3. Report and stop
Present findings from highest to lowest reading frequency × misdirection risk.
For each one, show the claim, evidence, consequence, and proposed disposition.
Then give a per-file cleanup plan, list unresolved decisions separately, and
state which load-bearing content will remain.
Stop for approval. The diagnostic pass must leave the worktree unchanged.
Reporting is complete when the user can approve, reject, or amend every proposed file change without additional investigation.
4. Execute the approved plan
Re-check each factual claim immediately before writing it. Apply only approved changes, using this per-file playbook:
- Archive history that must remain conveniently discoverable. Put a verbatim
copy or clearly bounded extract in
docs/archive/with a collision-resistant source-and-date name. Record its source path and Git blob or content hash in the cleanup report or a sidecar manifest, leaving verbatim content untouched. Verify a full-file archive against the captured pre-edit source; verify an extract against its recorded source bounds. Git history alone is sufficient when discoverability does not justify a live archive. - Rewrite live guidance as current facts. Add a short archive pointer when one was created. Derive every retained factual claim from current evidence, rather than carrying it forward unchecked.
- Point to authorities. Name the owning schema, configuration, or source file instead of duplicating volatile values.
- Condense completed work. Replace finished checklists with a short outcome; preserve open items in their original wording.
- Preserve traps. Turn recurring gotchas into short imperative guidance before moving their historical narrative.
- Banner unresolved drift. State the mismatch and the currently operative authority; avoid silently rewriting a contract whose ownership is unclear.
- Repair entry docs. Fix dead reading pointers and stale feature claims, and keep the required-reading set minimal.
Execution is complete when every approved finding has a corresponding diff or a documented reason no change was needed, and every retained factual claim touched by the rewrite has fresh evidence.
5. Verify and hand off
Verify that:
- every relative link in each touched file resolves
- full-file archives match their captured pre-edit sources byte-for-byte, and extracts match their recorded source bounds
- load-bearing content identified during diagnosis survives in live guidance
- the diff contains only approved Markdown changes
- no new contradiction was introduced across touched docs
Report the changed files, archive mappings, corrected contradictions, unresolved authority decisions, and verification performed. Offer a docs-only commit with a specific message; create it only when the user authorizes the commit.
The cleanup is complete when every approved finding is accounted for, all checks pass, and the user has a reviewable diff plus any remaining decisions.
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
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.

