Changelog, Versioning, and MaintenanceLesson 6.5
How to keep documentation up to date with code changes
documentation maintenance workflow, docs in pull request process, documentation linting in CI, stale documentation detection, ownership assignment, documentation review checklist
Keeping Documentation Current
Documentation goes stale because code changes and docs don't. The fix is process, not motivation: make documentation updates a required part of the code change workflow.
PR Template with Docs Checklist
## Pull Request Checklist
- [ ] Code changes are tested
- [ ] CHANGELOG.md updated under [Unreleased]
- [ ] README updated if installation or usage changed
- [ ] API reference updated if endpoints or parameters changed
- [ ] Migration guide added for any breaking changes
- [ ] JSDoc/docstrings updated for changed functionsCI Documentation Checks
# .github/workflows/docs.yml
- name: Check for broken links
run: markdown-link-check docs/**/*.md
- name: Lint documentation
run: markdownlint docs/
- name: Check changelog updated
run: |
if git diff --name-only HEAD~1 | grep -q "src/"; then
git diff --name-only HEAD~1 | grep -q "CHANGELOG.md" || \
(echo "Source changed but CHANGELOG.md not updated" && exit 1)
fiAssign Documentation Ownership
In CODEOWNERS, assign documentation reviewers the same way you assign code reviewers. A documentation review from someone who didn't write the code is the best test of clarity — if they can't understand it, your users can't either.
