doc-manager
Doc Manager
Keep a project's Markdown documentation true to the code. Every run ends with each doc updated, verified-current, or flagged — and every non-obvious claim traced to a source. Scope is Markdown only (README.md, docs/*.md, per-component READMEs); docstrings and comments are read as source-of-truth but not rewritten.
Prime directive — never invent. If the code does not show it and the user has not stated it, do not write it. For code-provable facts, reconcile the docs to the code and cite path:line; ask the user only when code cannot settle an intent or fact, then record the resolution in docs/DECISIONS.md. Preserve user-authored prose unless the user approves its deletion. A guess is a defect here, not a convenience.
Repo Sync Before Edits (mandatory)
Before creating/updating/deleting any file in the repo, sync the current branch:
branch="$(git rev-parse --abbrev-ref HEAD)"
git fetch origin && git pull --rebase origin "$branch"
If the tree is dirty: git stash push -u -m "pre-sync" → sync → git stash pop. If origin is missing, or rebase/stash conflicts occur, stop and ask before continuing.