documentation-audit
Skill3 starsChanged 4 months agoMITView on GitHub
Use when documentation drifts from code — syncs PRD/TECH/API/FLOW/TODO to the codebase and produces an audit report. Triggers on "docs out of date", "documentation drift", "sync docs", "文档同步", "写文档", "写 README", "文档化这个功能", "文档审计".
4 other projects use a version of this.
Adopted by
Most recently taken up by
- kontourai/stationtheir own version, first seen Oct 4, 2026
- Blandskron/agents-first-repo-docstheir own version, first seen Jul 29, 2026
- DojoGenesis/openclaw-plugintheir own version, first seen Feb 13, 2026
- troykelly/claude-skillstheir own version, first seen Jan 2, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- troykelly/claude-skills★ 11same name
- Blandskron/agents-first-repo-docs★ 3same name
- kontourai/station★ 2same name
- DojoGenesis/openclaw-plugin★ 0same 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.
In this repository49 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- brainstormSkill
- oss-strategySkill
- specSkill
- researchSkill
- api-designSkill
- architectureSkill
- codebase-designSkill
- design-researchSkill
- domain-modelingSkill
- frontend-designSkill
- imagegenSkill
- image-to-codeSkill
- prompt-engineeringSkill
- prototypeSkill
- schema-designSkill
- auth-implementationSkill
- breakdownSkill
- context-engineeringSkill
- error-handlingSkill
- i18nSkill
- implementSkill
- multi-agent-orchestrationSkill
- cost-optimizationSkill
- performanceSkill
- refactoringSkill
- simplifySkill
- api-testingSkill
- e2e-testingSkill
- load-testingSkill
- tddSkill
- test-generationSkill
- a11y-reviewSkill
- code-reviewSkill
- debuggingSkill
- lintingSkill
- security-reviewSkill
- ci-cdSkill
- deprecation-migrationSkill
- git-workflowSkill
- oss-polishSkill
- shippingSkill
- handoffSkill
- incident-responseSkill
- observabilitySkill
- purity-auditSkill
- skill-authoringSkill
- using-skillsSkill
The file
We split this skill into the rules it gives an agent
3 rules. 0 are common, 1 is distinctive, and 2 are very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 38
Read the code's actual behavior and compare against PRD/TECH:
- Very specific: line 58
Every endpoint in code with no matching docs/API/ entry is a drift gap.
- Very specific: line 83
Write docs/audit/YYYY-MM-DD-documentation.md using the template in references/templates.md:
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Documentation Audit
Sync the five formal docs (PRD/TECH/API/FLOW/TODO) to the code, then produce an audit report. Documentation must reflect reality — this skill brings drifted docs back into alignment and records what changed.
When to use
- A formal doc (PRD/TECH/API/FLOW/TODO) contradicts the current code
- Documentation is stale or out of sync after a feature ship
- Manual request to synchronize all documentation with the codebase
- Writing new documentation from scratch (see
references/writing-docs.md)
Not for: open source GitHub presence polishing (use oss-polish); designing API contracts (use api-design); writing the PRD/TECH themselves (use spec/architecture).
Steps
1. Discovery — locate the five formal docs and code structure
Find every formal doc and map the codebase layout so later steps know where to look.
# Locate the five formal docs (project-level)
ls docs/PRD.md docs/TECH.md docs/TODO.md docs/API/*.md docs/FLOW/*.md 2>/dev/null
# Version-level variants (if multi-version project)
ls docs/v*/*.md 2>/dev/null
# Detect API framework for the API drift step
grep -Ei "express|fastify|@nestjs|fastapi|flask|django|gin|echo" package.json requirements.txt go.mod 2>/dev/nullRecord which docs exist and which are missing. Missing docs are gaps to flag — not to create here (creation belongs to spec/architecture/api-design).
2. PRD & TECH drift — implementation vs spec
Read the code's actual behavior and compare against PRD/TECH:
- Features in code but not in PRD — shipped without spec; flag for
spec. - Features in PRD but not in code — spec aspirational or feature removed; update PRD to match reality.
- Components in TECH but not in code — planned but not implemented; update TECH.
- Components in code but not in TECH — undocumented; add to TECH.
3. API drift — endpoints vs docs/API/*.md
Extract every route declaration from code and match against docs/API/:
- express:
grep -rh "\(app\|router\)\.\(get\|post\|put\|delete\|patch\|all\)" --include="*.ts" --include="*.js" - fastify:
grep -rh "\(app\|fastify\)\.\(get\|post\|put\|delete\|patch\|all\)" --include="*.ts" --include="*.js" - nestjs:
grep -rh "@\(Get\|Post\|Put\|Delete\|Patch\|All\)" --include="*.ts" - fastapi / flask:
grep -rh "@app\.\(get\|post\|put\|delete\|patch\)" --include="*.py"
Express routers register on router.get (not just app.get); Fastify often names the instance
fastify rather than app; NestJS @All is a catch-all route — the patterns above cover these.
For chains like app.route('/x').get(handler), the .get match still catches it.
Every endpoint in code with no matching docs/API/ entry is a drift gap. For each gap, add to the API doc: method, path, parameters, request/response shape, errors. If no docs/API/ exists yet, flag for api-design.
4. FLOW drift — data flow vs docs/FLOW/*.md
For each business flow, trace the code path and compare against docs/FLOW/:
- Function call chains in code but not in the FLOW doc — add them.
- FLOW doc references functions that no longer exist — update or remove.
- New flows with no FLOW doc — flag for creation (use the workflow-prompts FLOW prompt).
5. TODO drift — code TODOs vs docs/TODO.md
grep -rn "TODO" --include="*.ts" --include="*.js" --include="*.py" --include="*.go" src/ | grep -v node_modules- TODOs in code but not in
docs/TODO.md— add them (merged by business area). - TODOs in
docs/TODO.mdalready resolved in code — remove from TODO.md and delete the code TODO comment.
6. Sync — fix every drift
For each gap found in steps 2–5, update the doc to match the code (or flag for the owning skill if creation is needed). Docs reflect reality; reality is not edited to match docs.
7. Produce the audit report
Write docs/audit/YYYY-MM-DD-documentation.md using the template in references/templates.md:
- Scope — which docs were audited
- Before/after — drift counts per doc type
- Fixed — every sync applied
- Needs manual review — items requiring a human decision or another skill
Output: docs/audit/YYYY-MM-DD-documentation.md — audit report (scope, before/after, fixed, needs review). The synced docs are the primary product; the report is the trail.
Verify
- All five formal docs discovered; missing ones flagged
- Every endpoint in code has a
docs/API/entry (or flagged forapi-design) docs/TODO.mdmatches code TODO comments (both directions)- PRD/TECH reflect current implementation
- Audit report produced at
docs/audit/YYYY-MM-DD-documentation.mdwith before/after + needs-review
References
- ${CLAUDE_PLUGIN_ROOT}/references/engineering-principles.md — shared discipline (verify don't assume, surgical scope)
- references/templates.md — audit-report template
- references/writing-docs.md — writing new documentation from scratch (README, feature docs, API docs)
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.

