By hagaybar
Tracks code changes and notifies when documentation in docs/current/ may need updating
A Claude Code plugin that detects documentation drift after commits and helps sync docs with code changes.
docs-sync watches your git commits and tells you when documentation may be out of date. It works in three stages:
git commit, the plugin matches changed files against a topic map to identify which documentation files might be affected.docs-sync/artifacts/<sha>.json and surfaces a notification in your next Claude Code interaction./docs-sync:update-docs to review affected docs and apply targeted updates based on the actual git diff.Add this repo as a plugin marketplace in your Claude Code settings:
{
"marketplace": "https://github.com/hagaybar/docs-sync-plugin"
}
plugins/docs-sync/ to your Claude Code plugins directoryscripts/docs_sync_hook.pyAfter installing the plugin, initialize docs-sync in any project:
/docs-sync:update-docs --init
This scans your project structure and generates a docs-sync/topic-map.json that maps code file patterns to documentation files. The topic map tells the hook which docs to flag when specific code areas change.
Each project needs a docs-sync/topic-map.json. Example:
{
"config": {
"docs_root": "docs",
"code_extensions": [".py", ".ts", ".tsx", ".js", ".jsx"],
"skip_prefixes": ["docs:", "chore:", "style:", "test:"]
},
"mappings": [
{
"doc": "api.md",
"globs": ["src/api/**", "app/api/**"],
"notes": "API endpoints and interfaces"
}
]
}
A template is provided in plugins/docs-sync/templates/topic-map-template.json.
| Command | Description |
|---|---|
/docs-sync:update-docs | Process pending artifacts and update affected docs |
/docs-sync:update-docs --init | Bootstrap docs-sync for a new project |
/docs-sync:update-docs --since <sha> | Sync docs for all commits since a SHA |
/docs-sync:update-docs --doc <file> | Update a specific doc file |
Git commit (any source: terminal, IDE, Claude Code)
-> post-commit hook
-> docs_sync_hook.py
-> writes docs-sync/artifacts/<sha>.json
-> appends to docs-sync/artifacts/.pending-notification
Next Claude Code tool call
-> PreToolUse hook (hooks.json)
-> reads .pending-notification
-> displays content in conversation
-> truncates the file
.claude-plugin/
marketplace.json # Plugin marketplace definition
plugins/
docs-sync/
.claude-plugin/
plugin.json # Plugin metadata
hooks/
hooks.json # PreToolUse hook for notifications
scripts/
docs_sync_hook.py # Post-commit analysis script
skills/
update-docs/
SKILL.md # Skill definition for /update-docs
templates/
topic-map-template.json # Template for project topic maps
README.md # Plugin-level documentation
docs/
TEST-FLOW.md # End-to-end test guide
MIT
Matches all tools
Hooks run on every tool call, not just specific ones
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
npx claudepluginhub hagaybar/docs-sync-plugin --plugin docs-syncCross-references docs against actual source. Flags drift, missing params, dead references.
Automatically update project documentation based on code changes
llmdoc Claude Code plugin with init, update modes, temporary investigation cache, and use
Lightweight documentation memory for AI coding agents: scaffold a docs tree, validate it, and auto-load recent context each session.
Generate and maintain documentation from code with drift detection. Validates docs against source, auto-generates from code patterns, syncs outdated content, and provides reusable templates for consistent documentation.
Automatically update CLAUDE.md file based on recent code changes