Doc update

From drvoss/everything-copilot-cli · View interactive version

Doc update is an AI agent skill from the GitHub repository drvoss/everything-copilot-cli. 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.

How to use this skill

Skill file

Documentation Update

When to Use

Prerequisites

Workflow

1. Inventory Existing Documentation

# Find all documentation files
# (Copilot glob tool) 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

# 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

To find which docs to re-read first, compare commits, not file dates (a checkout or copy resets

modification times). The order of commits is a signal, not a verdict: a doc committed later may

still describe old behavior, and code committed later may not touch what the doc says.

$code = git log -1 --format=%H -- src/rate-limiter.js
$doc  = git log -1 --format=%H -- docs/rate-limiter.md
if (-not $code -or -not $doc) { "no order: one of the files has no commits" }
elseif ($code -eq $doc) { 'changed together in one commit' }
else {
  git merge-base --is-ancestor $doc $code
  if ($LASTEXITCODE -eq 0) { 'code changed after the doc: review the doc first' }
  else {
    git merge-base --is-ancestor $code $doc
    if ($LASTEXITCODE -eq 0) { 'doc changed after the code' } else { 'no order: read both' }
  }
}

A shallow clone, a rebase, or commits on different branches can leave the two unordered. Whatever the

output, compare what the doc says with what the code does before calling it current.

Use the explore agent for deeper analysis:

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
# Verify a documented command still works
npm run documented-command 2>&1 | Select-Object -First 5

4. Check Links

# 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

6. Validate the Update

# 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

# 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

# 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

# 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" | Use commit order to decide what to re-read first (step 2), then check the README against what the code does now. |

Red Flags

Verification

Tips

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.