Skip to content

About

Two-layer code documentation (JSDoc/TSDoc/docstrings + module markdown) with hash-based drift detection — stale docs become a CI signal. Zero-dependency POSIX shell. Agent skill: npx skills add KloutDevs/docs-sync-skill

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

docs-sync-skill — document once, never let it rot

English · Español

Version License: MIT Shell: POSIX npm dependencies: 0 Agent Skill PRs welcome

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

Table of contents

Why

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.

See it work

Real output of the fixture flow in fixtures/demo-project:

docmap.sh detecting a stale documented file and re-syncing it

Install

As an agent skill (skills.sh)

npx skills add KloutDevs/docs-sync-skill

Then ask your agent: "document everything in src/" or "check if the docs are still in sync".

Manual (just the tracker)

git clone https://github.com/KloutDevs/docs-sync-skill
cd your-project
sh ../docs-sync-skill/scripts/docmap.sh init src/

The two layers

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

How drift detection works

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.

Commands

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

Design principles

  • 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).

Roadmap

  • 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.

Requirements

POSIX sh, awk, find, sha256sum (or shasum). Git recommended for interpreting drift, not required.

Contributing & Security

License

MIT © KloutDevs

About

Two-layer code documentation (JSDoc/TSDoc/docstrings + module markdown) with hash-based drift detection — stale docs become a CI signal. Zero-dependency POSIX shell. Agent skill: npx skills add KloutDevs/docs-sync-skill

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages