gh 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 itsvalues for all paths, roles, and site config
mkdocs.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):
gh pr view --json files,title,body git diff --name-only git diff --name-only HEAD~1 (last commit)roles are affected:
features, architecturearchitecturefeaturesconventionschangelog (if tracking fixes)api, readme (if it's a headline feature)structure, and style
changelog: add entry under the appropriate version/sectionfeatures: add or update the feature entry, not rewrite the whole filearchitecture: update the affected section, preserve diagramsBefore 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" -- for last modified"Added sync settings with enable/disable toggle, status indicator, and Sync Now button"
both docs but keep the changes focused on what actually changed
and follow its branch naming, commit message, and PR conventions
共 1 个版本