← ClaudeAtlas

docs-synclisted

Sync documentation files with code changes — detects what changed, finds affected docs, and applies surgical updates so docs never drift from code. Works in any repo.
manastalukdar/ai-devstudio · ★ 1 · Data & Documents · score 75
Install: claude install-skill manastalukdar/ai-devstudio
# Documentation Sync I'll detect what changed in the codebase and surgically update every affected documentation file — README, CHANGELOG, API docs, architecture docs, and any files under `docs/` or `documentation/` — so docs never drift from code. ## Token Optimization **Expected range**: 800–2,500 tokens (initial), 100–200 tokens (no-op when docs are already current) **Patterns used**: Grep-before-Read, git diff scope, early exit, progressive disclosure **Early exit**: If no code files changed since the last doc update, report "docs are current" and stop immediately. ## Step 1 — Detect Changed Files ```bash # Use staged changes if available, otherwise last commit, otherwise working tree if ! git diff --cached --quiet; then CHANGED=$(git diff --cached --name-only) SCOPE="staged changes" elif [[ -n "$ARGUMENTS" ]]; then # Support: /docs-sync HEAD~3..HEAD or /docs-sync <commit> CHANGED=$(git diff --name-only $ARGUMENTS) SCOPE="$ARGUMENTS" else CHANGED=$(git diff HEAD~1 --name-only 2>/dev/null || git diff --name-only) SCOPE="last commit" fi echo "Scope: $SCOPE" echo "$CHANGED" ``` If no files changed, report "Nothing to sync" and stop. ## Step 2 — Discover Documentation Files Scan the repo for doc files without reading them: ```bash # Find all markdown/rst/txt documentation files find . -type f \( -name "*.md" -o -name "*.rst" -o -name "*.txt" \) \ -not -path "*/node_modules/*" \ -not -path "*/.git/*" \ -not -path "*/vendor/*" \ |