Home / All Skills / Docs & Knowledge / docs-cleaner
Docs & Knowledge · daymade/claude-code-skills

docs-cleaner

Consolidates redundant documentation while preserving all valuable content; keeps a doc set truthful after things change. Modes: (1) POST-CHANGE GOVERNANCE — when code, scripts, config, env vars, ports, paths, deployment, auth, tests, or a documented procedure changed; also "which docs are now wrong", "check docs for inconsistencies", "过时的命令/路径", "文档同步". Use it even when the user mentions only the change and never the docs — updating them is part of the change, not optional cleanup. (2) CONSOLIDATION — "clean up docs", "documentation bloat", "reduce documentation sprawl", "consolidate documentation", "too many doc files", "merge redundant docs", "merge these docs", "文档太多/太乱", multiple files covering the same topic, or documentation exceeding 500 lines across multiple files on similar topics. Finds stale copies of a fact changed in only one place, values that should never have been persisted (counts, totals, "N items", restated summaries), rival definitions that drift apart, and orphaned cross-references.

L4 High-Privilege · Graded auth & full auditV1 Commit-PinnedExecute CommandNetwork AccessWrite FileDual-pass Audit
Author daymadeGitHub daymade/claude-code-skills ↗Stars 1385License MIT(仓库根 LICENSE;Copyright (c) 2025 daymade;GitHub API spdx MIT)Commit d5c4678cb5
Control levels describe skill capabilities and suggested control measures; they do not represent quality or safety certifications, nor do they dictate usability. Usage decisions rest entirely with users and administrators. Different agent hosts apply varying constraints; do not assume hosts provide automatic protection. Third-party skill copyrights belong to their original authors. Use at your own risk.

1How It Works & Mechanism

This is a purely instruction-based skill (zero scripts): all mechanisms are defined in the body of SKILL.md. Its core value lies in a taxonomy of 'why documentation rots' and the corresponding remediation workflows, executed directly by the agent itself.

daymade-docs/docs-cleaner/SKILL.md
They trace to one root cause: **a fact was written down in more places than it was defined.** Everything below follows from fixing that.
The directory contains only SKILL.md + references/value_analysis_template.md, with no scripts/ directory. All documentation operations (rg/git/lychee/file rewrites) are executed directly in the host environment by the agent following the documented commands.

The core discriminator is the three-question Drift Test (evaluated sequentially, halting on the first match): Can the value be computed from already recorded details? → derived, do not record; Can it not be computed, but an authoritative definition exists elsewhere? → copy, convert to link; Otherwise, is it a 'record of fact at a specific point in time'? → recordable, and must not be cleared as drift.

daymade-docs/docs-cleaner/SKILL.md
ask these three questions **in order, and stop at the first hit**: **1. Can this be computed from details already recorded here or in the authoritative source?**
Question 3 (historical/audit records take precedence) is repeatedly emphasized and granted counter-intuitive priority: changelogs and decision records must not be recomputed or replaced with links, even if they match questions 1 or 2.

Mode 1 (Post-Change Governance) executes in a strict 7-step sequence where the order itself forms the core argument: Enumerate affected facts from changes → Determine SSOT → Resolve drift between implementation and docs → Assign disposition (update or archive) for each doc → Search the entire repository for copies of each fact before modifying → Clean up derived values along the way → Report back following a fixed structure.

daymade-docs/docs-cleaner/SKILL.md
**2. Identify the authoritative source (SSOT) for each affected fact.** Which file *defines* this port / path / procedure — as opposed to mentioning it?
'Find copies before modifying' (step 5) and the leak-prevention search strategy for 'renumbered fact families' (rg patterns for textual count words, alias lists, explicitly calling out uncovered scopes) form the most engineered part of the document.

Deletion is transformed into a disciplined ritual: Archiving = moving out of the reader's path while preserving history (git mv to _archive/ and repointing all incoming links); status: deprecated tags left in-place are prohibited, and archiving documentation not owned by the user without explicit confirmation is banned.

daymade-docs/docs-cleaner/SKILL.md
"Archive" means: out of the reader's path, still in history. Concretely: look for a convention the project already has (`_archive/`, `archive/`, `deprecated/`, or whatever it uses) and follow it; if there is none, create `_archive/` at the same level as the file. Either way move it with `git mv` so history follows
Unattended deletion or archiving is strictly prohibited: 'leave the document untouched and report it as needing retirement'—encoding 'no deletion without authorization' as a hard rule.

Content-loss prevention gate for Mode 2 (Consolidation): Before rewriting, produce a granular 'load-bearing items list' (consequence clauses, symptom→cause mappings, sequencing constraints, scope qualifiers, and thresholds must be isolated), which becomes the specification for post-rewrite verification before deletion.

daymade-docs/docs-cleaner/SKILL.md
**The consequence clause.** "Roll back before retrying" is an instruction; "retrying on a half-applied migration corrupts the `events` table and there is nothing that repairs it automatically" is the reason anyone obeys it.
The same section explicitly acknowledges that this list prevents recall failures but cannot prevent judgment failures (the self-evaluation gap is explicitly documented); verification relies on rg -U -F matching original sentences line by line.

Verification commands contain extensive empirical pitfall logs: rg searches stdin when no path is provided; -F and -U are required for literal and multi-line matching; trade-offs between --no-ignore --hidden and -g '!.git'; git grep only inspects tracked files; lychee reporting '0 Total' does not constitute a pass.

daymade-docs/docs-cleaner/SKILL.md
`rg` skips VCS-ignored files *and* hidden ones by default, and `.github/` — full of documented commands — is hidden. A search without them is looking at a strict subset of the docs (measured: 4 files instead of 6).
Every assertion includes 'measured:' empirical figures—the document treats 'search tool failure modes' as a first-class knowledge asset.

Built-in functional boundaries: Hierarchical compression for single files that grow too large is delegated to claude-md-progressive-disclosurer (daymade-claude-code suite); this skill focuses exclusively on truthfulness and deduplication.

daymade-docs/docs-cleaner/SKILL.md
That is what daymade-claude-code's `claude-md-progressive-disclosurer` skill is built for; prefer it when the problem is size and layering rather than truth or duplication.
This is an explicit division of responsibilities within the suite ecosystem, reflecting the same design philosophy seen in the routing tables of docx-creator/pdf-creator.

2Core Capabilities

01Doc drift tripartite classification (derived value / copy / historical record) to determine remediation only after categorization
02Mode 1 Post-Change Governance: SSOT identification, document disposition (update/archive), repo-wide copy search before editing, leak-proof renumbered fact families
03Mode 2 Consolidation: Section-by-section value analysis (Keep/Condense/Delete/Archive), human approval gate for Phase 3 plans
04Pre-deletion load-bearing items list + post-rewrite line-by-line preservation check
05Bidirectional incoming/outgoing link verification: multi-pattern incoming link search via rg (.md/[[/ (/ prefixes), outgoing links delegated to lychee
067-point structured reporting (inconsistencies, SSOT rationale, modifications, deletions, search evidence, revised procedures, open items)
07Reference/template assets: references/value_analysis_template.md provides the section-by-section analysis table format

3External Dependencies

KindDependency / Endpoint
cliripgrep (rg)
clilychee(可选外链检查器,brew/cargo install)
cligit(git grep / git mv / git show 归档与恢复)

4Recommended Governance & Evidence

Suggested Controls for Safe Operation
For Agent Runtime
Graded/per-use authorization, sandbox recommended
For Administrators
Approval workflow, rollback support, full audit
Evidence & Triggers (File Paths & Excerpts)
  • scripts/: Local script or command execution: The skill contains no scripts; SKILL.md instructs the agent to execute read-only search tools (rg, git grep, lychee) and git mv/file rewrites in the host environment.
  • 网络端点: External network access declaration: None by default; lychee will send requests to external URLs found in docs when run without --offline (the documentation notes 'also checks external URLs').
  • 本地工作目录: File I/O and artifact output: Modifies, consolidates, or deletes document files according to the Phase 3 plan; archives files via git mv to _archive/; rewrites governance files such as CLAUDE.md/AGENTS.md under the same governance rules.
Audit Notes: No network egress, credential access, or bundled script execution. However, execution involves destructive write operations (Mode 1 archiving, Mode 2 source file deletion) on user documentation. The skill itself enforces human sign-off for Phase 3 plans and halts when unattended. The primary reason for a yellow rating is that this write surface requires a human gate and git protection, rather than posing code-level security risks. lychee performs external URL checks in full mode, so --offline is recommended by default.

5Second-Pass Verification

  • [ok] 纯指令无脚本(资产面) — glob 全量文件:SKILL.md + references/value_analysis_template.md,无 scripts/ 目录。
  • [ok] Drift Test 三问与顺序规则 — 原文 'in order, and stop at the first hit' 与 Q1/Q2/Q3 全在;第 3 问优先级说明亦逐字存在。
  • [ok] Mode 1 七步与 SSOT 判定 — 步骤编号 1-7 与 SSOT 'defines vs mentioning' 判据原文在。
  • [ok] 归档纪律(git mv + 不就地 deprecated) — 'out of the reader's path, still in history'、'git mv'、'do **not** settle for adding status: deprecated frontmatter' 均命中。
  • [ok] 删除需人门 / 无人值守停手 — 'Present the Phase 3 plan and get agreement before step 3' 与 'Running unattended and cannot ask: leave the document untouched and report it' 存在。
  • [ok] preservation check 防 recall 不防 judgment 的自评缺口 — 'It catches *recall* failures ... It cannot catch *judgment* failures' 原文在,未见自我拔高。
  • [ok] 搜索命令面防坑(rg/lychee) — pathless-rg/stdin 陷阱、-F -U、--no-ignore --hidden、lychee '0 Total' 各段均在,附 measured 数字。
  • [ok] 网络面仅 lychee 外链可选检查 — 代码零命中;唯一网络点是 SKILL 对 lychee 非 --offline 模式的说明,且推荐先 --offline。

6Verdict & Scenarios

  • Formalizes 'why docs rot' into a decidable tripartite classification (derived/copy/history), allowing remediation rules to be executed almost mechanically.
  • Extremely disciplined deletion culture: Phase 3 plans require prior human approval, unattended execution halts, and archiving preserves history—exactly how a tool designed to prevent accidental deletion should be built.
  • Pre-rewrite load-bearing items list combined with post-rewrite rg verification transforms 'fidelity preservation' from a slogan into a verifiable process.
  • Search command failure modes are empirically tested and documented (stdin trap, false greens, hidden files), minimizing false negatives caused by tool misuse.
  • Best for: Ideal for maintainers of medium-to-large repositories synchronizing docs after code, configuration, or workflow changes, or consolidating doc sprawl; also well-suited for teams integrating 'doc consistency' into CI/change management. Requires a capable host model, a git-backed repository, and a user willing to perform human sign-off on Phase 3 plans.
    Not for: Not suitable for unattended automated execution (the skill explicitly requires human approval prior to deletion); not suitable for directories without git history protection; single files that are too large and require layered compression should be handled by claude-md-progressive-disclosurer; not suitable for tasks that require modifying code instead of documentation (Mode 1 explicitly forbids turning a doc task into an implementation project).
    Install Agent-Ready
    ① Verified Mirror 2026-09-09
    Option A · Direct DownloadDownload docs-cleaner.tar.gz
    sha256: 91fa2a6f6082c893…
    Option B · Copy Guide for Agent
    install.json
    Agents automatically download and verify mirrors from this JSON guide.
    ② Upstream GitHub
    GitHub Repo ↗
    Pinned to commit d5c4678cb5.