Document every function, class and helper — hover docs (JSDoc/TSDoc/
docstrings) plus module markdown in docs/ — and keep them honest with a
hash-based drift tracker. When code changes under documented files,
docmap.sh check fails: stale docs become a CI signal, not silent rot.
Note
Install in one line — then ask your agent "document this project":
npx skills add KloutDevs/docs-sync-skill- Why
- See it work
- Install
- The two layers
- How drift detection works
- Commands
- Design principles
- Roadmap
- Requirements
- Contributing & Security
Documentation has two failure modes: it never gets written, or it gets written once and silently diverges from the code. This skill attacks both — an initializer for the first full pass over an undocumented project, and a docmap that turns "did the docs keep up?" into a command with an exit code.
Real output of the fixture flow in fixtures/demo-project:
As an agent skill (skills.sh)
npx skills add KloutDevs/docs-sync-skillThen ask your agent: "document everything in src/" or "check if the docs are still in sync".
git clone https://github.com/KloutDevs/docs-sync-skill
cd your-project
sh ../docs-sync-skill/scripts/docmap.sh init src/| Layer | Where | What the reader gets |
|---|---|---|
| Hover | Doc comments on exported symbols (TSDoc/docstrings) | Purpose, params, returns, example — right in the editor tooltip |
| Module | docs/<mirror-of-src>.md |
What the module is for, its public API map, invariants |
Style guides: references/doc-style.md ·
references/module-doc-template.md
docs/.docmap is a versioned, tab-separated manifest:
src/services/tickets.ts <sha256-of-file> docs/services/tickets.md
check re-hashes every tracked source file. Hash mismatch → STALE (the
code changed after the docs were registered). File gone → MISSING. Exit
code 1 on any drift, so it slots into CI or a pre-push hook (pairs well
with husky-skill).
Important
A passing check means the docs are fresh, not good. Freshness is
mechanical; quality is the agent's and reviewer's job. And drift is
per-file: figuring out which symbol changed inside a stale file is done
with git diff, by design.
sh scripts/docmap.sh init [paths] # list source files with no docs entry
sh scripts/docmap.sh add SRC DOC # register SRC as documented at DOC
sh scripts/docmap.sh check # exit 1 if any documented file drifted
sh scripts/docmap.sh update SRC # re-sync SRC's hash after fixing docs
sh scripts/docmap.sh status # tracked count + check summary- Drift must be loud. An exit code beats a wiki page nobody re-reads.
- The manifest is boring on purpose. Plain TSV, hand-editable, diff-friendly, zero parser dependencies.
- Docs describe the present. History lives in git; "previously…" paragraphs are noise (see the sibling comment-audit-skill).
- Symbol-level drift (per-function hashing) for TS/JS via a small extractor.
docmap.sh report— markdown coverage report (documented vs total).- Optional pre-push hook drop-in for husky-skill.
POSIX sh, awk, find, sha256sum (or shasum). Git recommended for
interpreting drift, not required.
- Contributions welcome — see CONTRIBUTING.md.
- Found a vulnerability? See SECURITY.md.
MIT © KloutDevs