Install
openclaw skills install docs-syncKeep project documentation in sync with code changes. Identifies which docs need updating after a PR merges or code changes, drafts the updates, and manages doc site structure (mkdocs, docusaurus, vitepress). Use when: (1) a PR just merged and docs may need updating, (2) the user says "update the docs" or "sync docs", (3) a new doc was created and needs to be added to site navigation, (4) the user wants to audit which docs are stale. NOT for: writing docs from scratch for a new project (just write them), generating API reference docs from code comments (use typedoc/jazzy/etc.), or content that isn't developer documentation.
openclaw skills install docs-syncgh auth login)Keep project documentation current with code changes. Three modes:
Before doing anything, discover the project's documentation setup:
git rev-parse --show-toplevel to find the repo root.docs-sync.yml at the repo root — if it exists, read it and use its
values for all paths, roles, and site configmkdocs.yml, docusaurus.config.js, .vitepress/config.*docs/, documentation/, wiki/CLAUDE.md, AGENTS.md, CONTRIBUTING.mdgh repo view --json name,owner to confirm the repo.docs-sync.ymlOptional config file at repo root. All fields are optional — auto-discovery fills gaps.
See docs-sync.yml in the skill directory for a starter.
# Map your doc files to roles so the skill knows what content belongs where
docs:
- path: docs/features.md
role: features
- path: docs/architecture.md
role: architecture
- path: CHANGELOG.md
role: changelog
format: keep-a-changelog
- path: CLAUDE.md
role: conventions
- path: README.md
role: readme
# Doc site configuration (optional)
site:
engine: mkdocs # mkdocs | docusaurus | vitepress
config: mkdocs.yml # path to site config
auto_nav: true # update navigation when docs change
Roles tell the skill what kind of content a file contains, so it knows how to update it.
| Role | Content | Updated when... |
|---|---|---|
features | User-facing feature descriptions, shortcuts, status | New feature added, feature behavior changes |
architecture | App structure, data flow, patterns, diagrams | New components, changed patterns, refactors |
conventions | Dev setup, coding rules, build commands | Build process changes, new conventions adopted |
changelog | Version-based change history | Any significant change (follows format: keep-a-changelog, conventional, custom) |
readme | Project overview, install instructions, quick start | Major features, install process changes |
api | API reference, endpoints, function signatures | Public API changes |
guide | Tutorials, how-tos, walkthroughs | Workflow changes, new capabilities |
custom | Anything else — describe in the description field | Based on your description |
Without a config file, the skill detects roles by filename:
| Pattern | Inferred role |
|---|---|
*feature*, *capability* | features |
*architect*, *design*, *structure* | architecture |
CLAUDE.md, AGENTS.md, CONTRIBUTING.md, *convention* | conventions |
CHANGELOG*, CHANGES*, HISTORY* | changelog |
README* | readme |
*api*, *reference*, *endpoint* | api |
*guide*, *tutorial*, *howto* | guide |
Files not matching any pattern are skipped unless listed in the config.
When the user says docs need updating (or after a PR merge):
Identify what changed — determine the scope of code changes:
gh pr view <N> --json files,title,bodygit diff --name-only <range>git diff --name-only HEAD~1 (last commit)Map changes to affected docs — for each changed file, determine which doc roles are affected:
features, architecturearchitecturefeaturesconventionschangelog (if tracking fixes)api, readme (if it's a headline feature)Read current docs — read each affected doc file to understand current content, structure, and style
Draft updates — write the specific changes needed for each doc:
changelog: add entry under the appropriate version/sectionfeatures: add or update the feature entry, not rewrite the whole filearchitecture: update the affected section, preserve diagramsApply or propose — based on user preference:
Before committing doc updates:
When docs are added, moved, or deleted — keep the site structure current.
mkdocs.yml and parse the nav: sectionnav: in the right positionsidebars.js or sidebars.tssidebar_position, sidebar_label).vitepress/config.* for sidebar configurationindex.md with a list, update it tooWhen the user asks "which docs are stale?" or "audit my docs":
git log -1 --format="%ar" -- <path> for last modified