agentleFS
Jia-ben00Jia-ben00/docs-drift/SKILL.md

docs-drift

Skill0 starsChanged 53 days agoMITView on GitHub

Detect documentation drift in pull requests — automatically identify code changes that require documentation updates (public API signatures, config options, CLI commands, database schema, behavior changes) and check whether the corresponding docs were updated. Use when the user says: check if docs need updating, is this PR documented, documentation drift, docs out of sync, did we update the docs, 文档检查, 文档同步, 文档漂移, PR文档更新检查, 代码改了文档没改.

6 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions6 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 6

    1. mongodb/docs★ 779same name
    2. gtapps/claude-code-hermit★ 84same name
    3. gtapps/hermitd★ 84same name
    4. ceptln/quota-burner★ 18same name
    5. mxrsv/agents-skills★ 11same name
    6. gonun13/agent-skills★ 0same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

The file

We split this skill into the rules it gives an agent

1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 6 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If a change touches both code and docs in the same diff, it's marked documented.

    line 50

“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

docs-drift

Detect documentation drift before it reaches users. The agent never just glances at a diff — it classifies every change, maps it to the docs that should change, and reports what's missing.

Workflow

  1. Analyze — get the diff: current branch vs base (git diff main...HEAD), a commit range, or a specific file. If the user gives a PR URL, fetch the diff via gh pr diff.
  2. Classify — run scripts/analyze_diff.py <diff-or-repo> to identify changes that require documentation:
    • Public API — added/removed/renamed functions, methods, classes, function signature changes
    • Configuration — added/removed/renamed config keys, env vars, default value changes
    • CLI — added/removed/renamed commands or flags
    • Database — migration files (schema changes)
    • Behavior — error message changes, return value changes, default behavior changes
    • Dependencies — major version bumps that may require migration docs
  3. Check — run scripts/check_docs.py <analysis-json> to verify whether corresponding docs were updated in the same diff: README, docs/, API references, docstrings, CHANGELOG.
  4. Report — present: changes that need docs but don't have them (high priority), changes that are well-documented, and suggested doc locations for missing items.

Quick commands

# Analyze the current branch's diff against main
python scripts/analyze_diff.py . > changes.json

# Check which changes need documentation
python scripts/check_docs.py changes.json

# One-liner for a PR
gh pr diff 123 | python scripts/analyze_diff.py - | python scripts/check_docs.py -

What the report contains

  • drift_score — 0–100, higher means more undocumented changes
  • needs_docs — list of changes classified as requiring documentation, with whether docs were found
  • documented — changes that have corresponding doc updates
  • suggestions — for each undocumented change, which file(s) should be updated
  • summary — counts by change type (API, config, CLI, DB, behavior, deps)

Classification rules

  • A change requires docs when it affects the public surface: exported symbols, config keys users set, CLI commands users run, schema changes users migrate, behavior users rely on.
  • Internal refactors, private method changes, test-only changes, and typo fixes do not require docs.
  • Docstrings count as documentation for API changes. README and docs/ count for config/CLI/behavior. CHANGELOG counts for any user-facing change.
  • If a change touches both code and docs in the same diff, it's marked documented. If it touches code only, it's marked drift.

When to read references

  • Language-specific API detection (Python decorators, TypeScript exports, Go exported functions, Java public methods): read references/api-detection.md.
  • Config/CLI format detection (YAML/TOML/JSON config, argparse/click/cobra CLI): read references/config-cli-patterns.md.
  • Writing the report for different audiences (PR comment vs. release notes vs. audit): read references/report-formats.md.

Exit codes

  • analyze_diff.py: 0 = changes found, 1 = no changes, 2 = invalid input
  • check_docs.py: 0 = report generated (may still contain drift), 1 = no drift found (clean), 2 = invalid input

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.