Audit and fix agent-facing documentation. Use when CLAUDE.md may be stale, docs don't match code, or undocumented conventions exist.
64
76%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Fix and improve this skill with Tessl
tessl review fix ./tiles/crafter/skills/tidy/SKILL.mdInspired by Kent Beck's Tidy First? philosophy: make small structural improvements before behavioral changes. This skill targets the documentation layer that AI agents depend on — CLAUDE.md, cross-references, and implicit conventions.
AI agents perform better when their working context is accurate. Over time, agent-facing documentation drifts from reality as code evolves. This skill audits and fixes that drift by:
Output: Tidy report artifact at docs/plans/YYYY-MM-DD-tidy-report.md
Use this skill when:
Don't use for:
/refactor)CRITICAL: Dispatch ALL 3 agents in a SINGLE message using multiple Task tool calls with run_in_background: true.
Three agents run in parallel — see agent prompts for full templates:
| Agent | Type | Investigates |
|---|---|---|
| CLAUDE.md Auditor | Explore | Structure, sections, best practices, cross-references |
| Reference Checker | Explore | Broken links, stale paths, outdated code references |
| Context Scout | Explore | Undocumented env vars, naming conventions, architectural patterns |
Example dispatch:
# ALL in a single message:
Task(Explore): "Audit CLAUDE.md structure against best practices for [project]"
Task(Explore): "Check all markdown files for broken internal links and stale references in [project]"
Task(Explore): "Scout for undocumented conventions and patterns in [project]"TaskOutput block: false to check progressTaskOutput block: trueCross-reference agent results and deduplicate. For each finding, assign:
| Severity | Definition |
|---|---|
| must-fix | Actively misleading. Agent will make wrong decisions based on this. |
| should-fix | Missing or outdated but won't cause incorrect behavior. Reduces agent effectiveness. |
| nice-to-have | Would improve agent experience but absence isn't harmful. |
Write the tidy report using the report template.
Save the report to: docs/plans/YYYY-MM-DD-tidy-report.md
REQUIRED: Use AskUserQuestion to present findings and let the user choose which to address. Do NOT skip this step or auto-select findings. The user MUST have the opportunity to review and select.
Use AskUserQuestion to present a summary of findings by severity:
Found N findings:
- X must-fix (actively misleading)
- Y should-fix (outdated/missing)
- Z nice-to-have (improvements)
Which findings should I address?Options:
If the user picks individually, list each finding with its severity and let them select via AskUserQuestion with multiSelect: true.
For each approved finding, in order of severity (must-fix first):
Write or Edittidy: <description>One fix per commit. This mirrors Beck's philosophy of keeping tidying commits separate and small.
Examples of commit messages:
tidy: add missing build commands to CLAUDE.mdtidy: fix broken link to architecture.md in READMEtidy: document DATABASE_URL env var in CLAUDE.mdtidy: remove reference to deleted utils/helpers.tsAppend a "Fixes Applied" section to the tidy report (docs/plans/YYYY-MM-DD-tidy-report.md). This serves as a git-fallback audit trail when commits cannot be verified:
## Fixes Applied
| # | Severity | Fix | Commit Message |
|---|----------|-----|----------------|
| 1 | must-fix | {description} | `tidy: {message}` |
| 2 | should-fix | {description} | `tidy: {message}` |After all fixes are applied, present a brief summary:
Checks against CLAUDE.md best practices:
Scans all markdown files in the project:
[text](path/to/file.md) where target doesn't existExplores the codebase for patterns that should be documented:
process.env.X, os.environ) but not listed in docs*Repository, *UseCase, *Controller) with no documentationOnce the tidy report is addressed:
/research, /draft, and /craft sessions work from reliable context/tidy again periodically or after major refactors2a98cc1
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.