Reconcile repository documentation, examples, and skill metadata with the code and contracts they describe. Use only when the user explicitly invokes $x-tidy-docs.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of X Tidy Docs?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/ttstack-x-tidy-docs)
---
name: x-tidy-docs
description: Reconcile repository documentation, examples, and skill metadata with the code and contracts they describe. Use only when the user explicitly invokes $x-tidy-docs.
---
# Tidy documentation
Before preflight, read `.agents/skill-rules/common.md` and then
`.agents/skill-rules/x-tidy-docs.md` from the Git root if present.
Use the skill-specific rules for repository details such as checks or release
criteria. Apply them within the selected scope and the user's authorization.
Continue with the available rules when either file is absent.
Resolve all paths from the Git top level; Markdown links are relative to this
file. Read the invocation arguments from the user prompt.
Documentation-only workflow. It may delete, rewrite, and move documentation
and must update every incoming reference in the same change. It does not
commit, push, or bump a version; a composing workflow owns those.
## Input
Optional paths. With no paths, inventory all tracked documentation: the root
README and contributor guidance, the documentation tree, examples, and project
skill instructions, repository skill rules and UI metadata, and include intended new documents.
With paths, follow those topics and their incoming references.
## Preflight
Run `git status --short --branch` and record the baseline; freeze the
documented paths this pass may change and preserve unrelated edits. Identify
the documentation's owner — the guide or contract that is authoritative for
each topic — before editing.
## Protocol
1. **Inventory.** Start at the documentation index or map. List each page, its
owning topic, and its intended readers. Mark stale, duplicated, orphaned,
and unreferenced pages, and list intended new ones.
2. **Verify claims.** Check every disputed statement against its source: the
implementation, the tests, the manifests and build files, recorded
measurements, and the contracts. Preserve the measured revision,
configuration, units, and limits of historical results; do not restate old
results as current guarantees. When the implementation contradicts an
intended guarantee, report the discrepancy for review instead of silently
rewriting the guarantee.
3. **Consolidate at the owner.** Keep each explanation with the page that owns
the topic and replace duplicated instructions elsewhere with links. Remove
obsolete material only after checking every caller: Markdown links and
anchors, doc includes, manifest and build paths, scripts, and skill prompts.
Update navigation, incoming paths, and heading anchors in the same change.
4. **Preserve executables.** Keep runnable examples, fixtures, reproduction
steps, and exact identifiers (paths, flags, version strings, API names) that
a reader needs to reproduce a result.
5. **Validate.** Run `git diff --check`; resolve every changed relative link
and `#anchor`; check affected examples against their source or a real
command; validate changed YAML front matter and skill metadata. Report what
moved or changed and any claim that still lacks evidence.
## Stop conditions
Stop when a page's owner is ambiguous, when a stale claim cannot be verified
against current code, or when a consolidation would move content required by a
contract into a page that does not own it. Report rather than guess.