Package docgen renders the CLI (cobra tree) and policy (JSON Schema)
reference pages for the docs site. Output is deterministic: sorted, no
timestamps.
CLI writes one page per command under dir (index.md for the root) and
returns the number of pages. Existing *.md files in dir are removed first so
renamed commands leave nothing stale.