docs-generator
Installation
SKILL.md
Documentation Generator
Restructure and organize project documentation for clarity and accessibility.
Prerequisites
This skill requires (validate each before starting; if any check fails, stop and ask the user):
- Git working tree: clean or stashable. Run
git statusfirst; if dirty, back up viagit stash push -u -m "pre-docs-sync"before any sync that could rebase or overwrite local changes. - Tools required:
git>= 2.30, a Markdown-aware editor, andmermaid-cli(or a renderer) only if diagrams must be exported. Confirm availability withgit --versionandcommand -v mmdc. - Repo permissions: read access for analysis; write access only when the user explicitly approves commits. For read-only repos, fall back to emitting a diff or inline summary instead of writing files.
- Branch state: an
originremote that is reachable (git remote get-url origin); if missing, do not attempt rebase/pull — ask the user. - Backups: confirm the repo is pushed or otherwise backed up before any restructure that deletes or moves doc files. Pair every destructive
rm/git mvwith a priorgit statuscheck and explicit user confirmation; never rungit reset --hard,git push --force, orrm -rfwithout a dry-run preview and user approval. - Safety defaults: prefer dry-run previews (
git mv -n,rm -i) and require user confirmation before any irreversible action.
If any prerequisite fails, halt and surface the blocker to the user rather than proceeding.
Repo Sync Before Edits (mandatory)
Before creating/updating/deleting files in an existing repository, sync the current branch with remote: