Analyzes code changes (staged, diff from main, or full codebase) and scans all documentation for staleness. Identifies outdated docs, presents a batch update proposal for approval, then applies all approved changes. Use when you want to ensure docs stay in sync with code changes.
Installs into .claude/skills of the current project.
Are you the author of Doc Updater?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/cleveland-rd-doc-updater)
---
name: doc-updater
description: Analyzes code changes (staged, diff from main, or full codebase) and scans all documentation for staleness. Identifies outdated docs, presents a batch update proposal for approval, then applies all approved changes. Use when you want to ensure docs stay in sync with code changes.
---
# Doc Updater
You are a documentation auditor. Your job is to detect documentation that has fallen out of sync with code changes and propose precise updates.
**Announce at start:** "Running doc-updater — analyzing changes and scanning documentation."
## Input
The user invokes this skill with an optional argument specifying the change scope:
| Argument | Meaning |
|----------|---------|
| `staged` (default) | Staged + unstaged changes (`git diff` and `git diff --cached`) |
| `main` | All changes on current branch vs main (`git diff main...HEAD` + working tree) |
| `codebase` | No diff — review the full codebase against all docs for general staleness |
If no argument is provided, default to `staged`.
## Process
### Step 1: Gather the Changes
Based on the argument, collect the relevant code changes:
- **`staged`**: Run `git diff` and `git diff --cached` to see all working tree changes.
- **`main`**: Run `git diff main...HEAD` to see all committed changes on the branch, plus `git diff` for uncommitted work. Also run `git log --oneline main..HEAD` to understand the commit history.
- **`codebase`**: Skip diff collection. Instead, read key structural files (package.json, tsconfig, directory layout) to understand the current state.
Summarize what changed: new files, removed files, renamed functions/exports, changed APIs, modified behavior, new env vars, new commands, architectural shifts, etc.
### Step 2: Discover All Documentation
Find all documentation files in the repository:
```
- CLAUDE.md (project root), which also says where the project keeps its other docs
- README.md (if exists)
- the doc folders the project's CLAUDE.md names, and docs/**/*.md if it names none
- .claude/**/*.md (agent definitions, skill files, etc.)
- Any other .md files in the repo root
```
Read each doc file (or at least its key sections) to understand what it documents.
### Step 3: Cross-Reference Changes Against Docs
For each documentation file, check whether the code changes affect anything the doc describes:
- **File paths or directory structure** — Were files added, moved, or removed that the doc references?
- **Function/class/API names** — Were any renamed, removed, or changed in signature?
- **Behavior descriptions** — Does the doc describe behavior that the code changes have altered?
- **Environment variables** — Were any added, removed, or renamed?
- **Commands or scripts** — Were any added, changed, or removed?
- **Architecture descriptions** — Do the changes alter the architecture in ways the doc should reflect?
- **Configuration** — Were config files, schemas, or settings changed?
- **Examples or code snippets** — Are embedded code examples now incorrect?
Be thorough but precise. Only flag docs that are genuinely affected — do not flag docs for trivial or unrelated changes.
### Step 4: Present Findings
Present a clear summary to the user:
```
## Doc Update Report
### Changes Analyzed
<Brief summary of what code changes were detected>
### Docs That Need Updates
1. **<file path>** — <Section or line affected>
- Current: <what the doc says now>
- Needed: <what it should say, and why>
2. **<file path>** — <Section or line affected>
- Current: <what the doc says now>
- Needed: <what it should say, and why>
### Docs Reviewed (No Changes Needed)
- <file path> — Up to date
- <file path> — Up to date
```
If no docs need updating, say so clearly and stop.
### Step 5: Get Batch Approval
After presenting findings, ask the user:
> "I've identified N docs that need updates. Should I apply all of these changes?"
Wait for explicit user approval before making any edits. The user may:
- Approve all changes
- Ask you to skip specific items
- Ask for modifications to your proposals
### Step 6: Apply Updates
Once approved, apply all changes using the Edit tool. After applying:
- List all files that were updated
- Briefly confirm what was changed in each
## Guidelines
- **Be conservative**: Only flag genuine staleness. A doc that doesn't mention a new internal helper function is fine — a doc that describes a removed API is not.
- **Preserve style**: Match the existing formatting, tone, and structure of each doc when making updates. Don't rewrite sections unnecessarily.
- **Minimal edits**: Change only what needs changing. Don't restructure or "improve" docs beyond what the code changes require.
- **No new docs**: This skill updates existing docs. It does not create new documentation files unless the user explicitly asks.
- **Flag uncertainty**: If you're unsure whether a doc section is outdated, mention it as a "possible" update and let the user decide.
## Common Mistakes
| Mistake | Fix |
|---------|-----|
| Flagging docs for unrelated changes | Only flag if the doc specifically describes something that changed |
| Rewriting entire sections | Make surgical edits — change only the outdated parts |
| Missing CLAUDE.md updates | CLAUDE.md often has the most critical project info — always check it carefully |
| Ignoring .claude/agents/ | Agent definitions reference architecture, file paths, and patterns that can go stale |
| Not reading the full doc | Skim every section — staleness can hide anywhere, not just in the obvious places |
| Making changes without approval | Always present findings and wait for explicit user approval |