Update Documentation
Update human-edited markdown documentation files after completing a piece of work.
When to Use
Only when the user explicitly requests documentation updates (e.g., "update the docs", "sync documentation", "refresh the readme").
Process
Ask what to review - Before analyzing code, ask the user:
- Uncommitted changes only (staged + unstaged)
- Committed changes (all commits on current branch)
- Both uncommitted and committed changes
- Whole repo (review entire codebase, not just recent changes)
For uncommitted/committed/both:
- Use
git diff for uncommitted changes
- For committed changes, review all commits unique to the current branch (use
git log main..HEAD or similar)
- Focus documentation updates on what changed
For "Whole repo" option:
- Explore the codebase structure (key directories, main files, entry points)
- Identify features, APIs, and components
- Compare existing documentation against actual code
- Look for undocumented features, outdated information, or missing sections
- This is useful for documentation audits or when docs have drifted significantly from code
Identify documentation files - Search for:
- README.md files (root and nested)
- docs/ or documentation/ folders
- agents.md, claude.md, or similar project-specific docs
- Any other .md files that appear to be human-edited
Filter out auto-generated and special files - Skip:
- Auto-generated documentation (look for generation comments/headers)
- LICENSE, LICENSE.md
- CONTRIBUTING.md
- CHANGELOG.md, HISTORY.md
- CODE_OF_CONDUCT.md
- Files with "auto-generated" or "do not edit" markers
If the user wants these files updated, ask for explicit confirmation first.
Review existing conventions - Before making changes:
- Read the existing documentation style and formatting
- Match the tone (formal vs casual)
- Follow existing heading structures
- Preserve any existing patterns for code examples, links, etc.
If no documentation exists - Work with the user to initialize:
- Ask what documentation they want to create
- Suggest a basic structure based on the project type
- Start minimal and expand based on feedback
Make targeted updates:
- For change-based reviews: only update sections relevant to the changes
- For whole repo reviews: address gaps, outdated info, and missing documentation
- Don't rewrite entire documents unnecessarily
- Add new sections for undocumented features
- Update existing sections if behavior differs from docs
- Remove outdated information
What to Document
Based on the work completed, consider updating:
- Features/Usage: New functionality, how to use it, examples
- Installation/Setup: New dependencies, configuration options
- API Reference: New endpoints, functions, parameters
- Architecture: Structural changes, new components
- Examples: Working code snippets demonstrating changes
Guidelines
- Keep documentation concise and scannable
- Use code blocks with appropriate language tags
- Prefer examples over lengthy explanations
- Link to related documentation rather than duplicating
- Maintain consistent formatting with existing docs
1---2name: update-docs3description: Updates documentation in the repository after completing work. Use when the user explicitly asks to update docs, refresh documentation, or sync docs with code changes.4---56# Update Documentation78Update human-edited markdown documentation files after completing a piece of work.910## When to Use1112Only when the user explicitly requests documentation updates (e.g., "update the docs", "sync documentation", "refresh the readme").1314## Process15161. **Ask what to review** - Before analyzing code, ask the user:17 - Uncommitted changes only (staged + unstaged)18 - Committed changes (all commits on current branch)19 - Both uncommitted and committed changes20 - Whole repo (review entire codebase, not just recent changes)2122 **For uncommitted/committed/both:**23 - Use `git diff` for uncommitted changes24 - For committed changes, review all commits unique to the current branch (use `git log main..HEAD` or similar)25 - Focus documentation updates on what changed2627 **For "Whole repo" option:**28 - Explore the codebase structure (key directories, main files, entry points)29 - Identify features, APIs, and components30 - Compare existing documentation against actual code31 - Look for undocumented features, outdated information, or missing sections32 - This is useful for documentation audits or when docs have drifted significantly from code33342. **Identify documentation files** - Search for:35 - README.md files (root and nested)36 - docs/ or documentation/ folders37 - agents.md, claude.md, or similar project-specific docs38 - Any other .md files that appear to be human-edited39403. **Filter out auto-generated and special files** - Skip:41 - Auto-generated documentation (look for generation comments/headers)42 - LICENSE, LICENSE.md43 - CONTRIBUTING.md44 - CHANGELOG.md, HISTORY.md45 - CODE_OF_CONDUCT.md46 - Files with "auto-generated" or "do not edit" markers4748 If the user wants these files updated, ask for explicit confirmation first.49504. **Review existing conventions** - Before making changes:51 - Read the existing documentation style and formatting52 - Match the tone (formal vs casual)53 - Follow existing heading structures54 - Preserve any existing patterns for code examples, links, etc.55565. **If no documentation exists** - Work with the user to initialize:57 - Ask what documentation they want to create58 - Suggest a basic structure based on the project type59 - Start minimal and expand based on feedback60616. **Make targeted updates**:62 - For change-based reviews: only update sections relevant to the changes63 - For whole repo reviews: address gaps, outdated info, and missing documentation64 - Don't rewrite entire documents unnecessarily65 - Add new sections for undocumented features66 - Update existing sections if behavior differs from docs67 - Remove outdated information6869## What to Document7071Based on the work completed, consider updating:7273- **Features/Usage**: New functionality, how to use it, examples74- **Installation/Setup**: New dependencies, configuration options75- **API Reference**: New endpoints, functions, parameters76- **Architecture**: Structural changes, new components77- **Examples**: Working code snippets demonstrating changes7879## Guidelines8081- Keep documentation concise and scannable82- Use code blocks with appropriate language tags83- Prefer examples over lengthy explanations84- Link to related documentation rather than duplicating85- Maintain consistent formatting with existing docs