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. When a fact is unclear or docs conflict with code, ask the user, then record the resolution in docs/DECISIONS.md. 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.