doc-update
Use when code has changed and documentation may be out of date — identifies stale docs, finds gaps between implementation and docs, and applies targeted updates.
Best use case
doc-update is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Use when code has changed and documentation may be out of date — identifies stale docs, finds gaps between implementation and docs, and applies targeted updates.
Teams using doc-update should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/doc-update/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How doc-update Compares
| Feature / Agent | doc-update | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Use when code has changed and documentation may be out of date — identifies stale docs, finds gaps between implementation and docs, and applies targeted updates.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Documentation Update
## When to Use
- After making code changes that affect documented behavior
- During periodic documentation maintenance
- When onboarding reveals gaps or inaccuracies in docs
- Before a release to ensure docs match the current state
- When users report confusing or incorrect documentation
## Prerequisites
- Access to the project's documentation files (README, docs/, wiki)
- Understanding of recent code changes or current behavior
- Ability to run the project to verify documented examples
## Workflow
### 1. Inventory Existing Documentation
```powershell
# Find all documentation files
glob pattern="**/*.md"
# Find inline documentation (JSDoc, docstrings)
grep -rn "/\*\*" src/ --include="*.ts" | Measure-Object -Line
grep -rn '"""' src/ --include="*.py" | Measure-Object -Line
# List docs by last modified date
Get-ChildItem -Recurse -Include *.md | Sort-Object LastWriteTime | Select-Object LastWriteTime, FullName
```
### 2. Identify Stale Documentation
```powershell
# Find docs that reference renamed or deleted files
grep -rn "import.*from\|require(" docs/ --include="*.md" 2>$null
# Find docs referencing old function names or APIs
grep -rn "function_name\|ClassName\|/api/v1" docs/ --include="*.md"
# Compare documented CLI flags with actual implementation
grep -rn "\-\-[a-z]" README.md | Select-Object -First 20
```
Use the `explore` agent for deeper analysis:
```text
task agent_type: "explore"
prompt: "Compare the README.md setup instructions with the actual package.json scripts and config files. Identify any mismatches."
```
### 3. Update Content
For each stale section:
1. **Read the current code** to understand actual behavior
2. **Update the doc** to match reality using `edit`
3. **Test any code examples** to verify they work
```powershell
# Verify a documented command still works
npm run documented-command 2>&1 | Select-Object -First 5
```
### 4. Check Links
```powershell
# Find all markdown links
grep -rn "\[.*\](.*)" docs/ --include="*.md" | Select-String "http"
# Find internal links and verify targets exist
grep -rn "\[.*\](\./\|\.\./" docs/ --include="*.md"
```
### 5. Improve Structure
- Add a table of contents for long documents
- Break monolithic docs into focused pages
- Add "Last updated" dates to critical docs
- Ensure consistent formatting and heading levels
### 6. Validate the Update
```powershell
# Check for broken markdown syntax
grep -rn "]\s*$" docs/ --include="*.md" # Unclosed links
# Verify code blocks have language tags
grep -n '```$' docs/**/*.md # Code blocks without language specifier
# Run any doc-specific tests or linters
npx markdownlint docs/ 2>&1 | Select-Object -First 20
```
## Examples
### Update README After API Change
```powershell
# 1. Find what changed
git --no-pager log --oneline -10 -- src/api/
# 2. Check if README references the changed API
grep -n "api\|endpoint\|route" README.md
# 3. Update the relevant section
# Use edit tool to modify the specific outdated section
```
### Sync JSDoc with Implementation
```powershell
# Find functions where JSDoc params don't match actual params
grep -B 5 "function " src/utils.ts | Select-String "@param|function"
# Update JSDoc to match the current signature
```
### Bulk Fix Renamed References
```powershell
# If a module was renamed from 'utils' to 'helpers'
grep -rn "utils" docs/ --include="*.md"
# Use edit tool on each file to update references
```
## Common Rationalizations
| Rationalization | Reality |
|----------------|---------|
| "The code is the documentation" | Code explains *what*. Documentation explains *why*. They're complementary, not interchangeable. |
| "Too busy, I'll update docs later" | Context is lost by the next PR. Update docs alongside the change. |
| "It's an internal API, no docs needed" | Your future self in 3 months is also an internal API consumer. |
| "The README is already up to date" | Compare the last README update timestamp to the last code change. |
## Red Flags
- Code change PRs with no documentation update
- README examples that don't match the current API
- Breaking changes not recorded in the CHANGELOG
- Removed features still present in the documentation
## Verification
- [ ] Documentation update exists for every changed public API
- [ ] README code examples run successfully on the current version
- [ ] Breaking changes are recorded in the CHANGELOG
- [ ] New environment variables or configuration options are documented
## Tips
- Update docs **in the same PR** as code changes — don't defer it
- Write docs for your audience: READMEs for users, inline docs for developers
- Include **working** code examples — broken examples are worse than no examples
- Use `task` agent to run documented commands and verify they produce expected output
- Keep a CHANGELOG.md updated with each release
- If a doc is consistently wrong, consider generating it from code (e.g., API docs from schemas)Related Skills
verification-before-completion
Use before claiming any task is done — run the exact command that proves the fix works, read the output, and only then report success.
using-git-worktrees
Use when you need multiple branches checked out at once — create isolated working directories for parallel development without cloning the repository repeatedly
triage
Use when a single issue needs structured triage — classify it, reproduce if needed, request missing information, and leave a durable brief or close-out note in the tracker.
to-issues
Use when a plan, spec, or PRD must become an actionable backlog — break it into thin dependency-aware issues that each deliver a verifiable vertical slice
sprint-workflow
Use when starting a new feature, refactor, or multi-step dev task — runs the full sprint cycle (Think → Plan → Build → Review → Test → Ship → Monitor) using Copilot CLI's plan/autopilot modes.
sprint-retro
Use at the end of a sprint to run a data-driven retrospective — analyzes session history and git metrics to surface what shipped, what slowed you down, and concrete improvements.
security-audit
Use when a codebase needs a formal security audit beyond a quick scan — applies OWASP Top 10 and STRIDE threat modeling from a CSO perspective to surface systemic vulnerabilities.
release
Use when a sprint or feature is complete and ready to ship — tags the version, generates GitHub Release notes, runs rollout or smoke verification, and publishes to npm/PyPI/Docker registries.
prompt-optimizer
Use when a rough prompt, vague idea, or task description needs to become a finished copy-pasteable prompt for a chat-based LLM - rewrite it into one ready-to-send prompt with no blanks, no placeholders, and a clear output shape.
outside-voice
Use when you need an independent second opinion before, during, or after implementation — run challenge, consult, or review mode in a direct builder-to-builder voice
llm-wiki
Use when research or domain knowledge keeps getting rediscovered across sessions — build a supplementary markdown wiki that compounds synthesized knowledge without replacing GitHub or committed project guidance
interview-me
Use when a request is underspecified and you need to discover what the user actually wants before writing a plan, spec, or code - ask one question at a time, attach your current hypothesis, and stop only after the intent is explicitly confirmed.