Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
borghei avatar

Doc Drift Detector

  • 82 installs
  • 451 repo stars
  • Updated July 21, 2026
  • borghei/claude-skills

Documentation Drift Detector is a Claude skill with four Python CLI tools that detect doc-vs-code drift, validate Python API docs via AST, score staleness, and audit markdown link integrity.

About

Documentation Drift Detector finds where documentation has fallen out of sync with code. It maps docs to code directories, compares git modification histories, extracts Python function signatures via AST to validate API docs, checks every markdown link and anchor, and scores freshness on a 0-100 scale. A developer uses it when docs go stale, before a release, or to enforce doc gates in CI. All four CLI tools use the Python standard library only.

  • Maps docs to code and compares git histories to detect drift, then classifies each issue by severity and fix type
  • AST-based Python API doc validation catches undocumented items, phantom docs, and parameter mismatches
  • Scores staleness 0-100 and audits markdown links/anchors, with non-zero exit codes for CI gates

Doc Drift Detector by the numbers

  • 82 all-time installs (skills.sh)
  • Ranked #683 of 1,879 Documentation skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
At a glance

doc-drift-detector capabilities & compatibility

Capabilities
database schema designer
Works with
github
Use cases
documentation · ci cd · code review
Platforms
macOS · Windows · Linux
Pricing
Free
From the docs

What doc-drift-detector says it does

Detect documentation drift against code changes, score staleness, validate API docs via AST parsing, and audit link integrity.
SKILL.md
All four CLI tools use the Python standard library only.
SKILL.md
All tools: Python 3.8+ stdlib only, `--json` and `--help`, non-zero exit codes for CI, any OS.
SKILL.md
npx skills add https://github.com/borghei/claude-skills --skill doc-drift-detector

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs82
repo stars451
Last updatedJuly 21, 2026
Repositoryborghei/claude-skills

What it does

Detect documentation drift against code, validate API docs, and gate doc freshness in CI.

Who is it for?

Teams that need to catch stale docs, validate API documentation, or gate PRs on doc freshness in CI.

Skip if: Non-Python API validation or rewriting docs; the AST validator only parses Python and tools do not generate replacement text.

When should I use this skill?

Docs have fallen out of sync with code, preparing a release, running CI doc gates, or auditing doc accuracy.

What you get

A drift report classifying each issue by severity and fix type, a 0-100 staleness score, and validated links that can fail CI.

  • drift analysis report
  • 0-100 staleness score
  • API-doc validation results

By the numbers

  • 4 CLI tools
  • 0-100 weighted staleness score across five dimensions
  • 5 drift categories (structural, factual, referential, temporal, semantic)

Files

SKILL.mdMarkdownGitHub ↗

Documentation Drift Detector

The agent detects documentation drift by mapping code directories to their docs, comparing git modification histories, extracting Python function signatures via AST, validating every markdown link and anchor, and scoring freshness on a weighted 0-100 scale. All four CLI tools use the Python standard library only.

Core Capabilities

  • Full drift analysis — map docs to code, compare git histories, detect renamed files, version drift, broken references, and structural gaps; classify each issue by category, severity, and fix type.
  • API doc validation — AST-based extraction of Python signatures/classes compared against markdown API docs (undocumented items, phantom docs, parameter mismatches, deprecations).
  • Staleness scoring — weighted 0-100 freshness score across five dimensions with CI threshold gates and README-focused mode.
  • Link integrity audit — validate local files, anchors, cross-document anchors, images, case-sensitivity, and duplicate anchors; optional external URL checks.
  • Drift classification — structural, factual, referential, temporal, semantic categories, each tagged [AUTO]/[SEMI]/[MANUAL] for fix routing.
  • CI/CD integration — non-zero exit codes, JSON output, GitHub Actions and pre-commit recipes for ongoing monitoring.

When to Use

  • Docs have fallen out of sync with code — run full drift analysis.
  • Preparing a release — gate on aggregate staleness score.
  • Running CI doc gates — fail PRs on high/critical drift or broken links.
  • Auditing API doc accuracy against Python source.
  • Checking README health and link integrity after refactors.

Tools

ToolPurposeCommand
drift_analyzer.pyFull drift analysis between code and docspython scripts/drift_analyzer.py <repo> --min-severity high --json
doc_staleness_scorer.pyScore documentation freshness 0-100python scripts/doc_staleness_scorer.py <repo> --threshold 60
api_doc_validator.pyValidate API docs against Python source (AST)python scripts/api_doc_validator.py <src> <docs> --recursive
link_checker.pyAudit all markdown links and anchorspython scripts/link_checker.py <repo> --broken-only

All tools: Python 3.8+ stdlib only, --json and --help, non-zero exit codes for CI, any OS.

References

Load the reference that matches the task — keep this file lean and pull detail on demand:

  • [references/workflows-and-tool-reference.md](references/workflows-and-tool-reference.md) — quick start, the 5 core workflows (full analysis, API validation, README health, link audit, CI monitoring) with output examples, GitHub Actions + pre-commit recipes, and the complete per-tool parameter/output/exit-code reference. Read when running tools or wiring CI.
  • [references/scoring-categories-and-troubleshooting.md](references/scoring-categories-and-troubleshooting.md) — the staleness scoring model and weights, the five drift categories, auto-fix vs manual-fix classification, detailed integration points, anti-patterns, troubleshooting table, and success criteria. Read when interpreting results or triaging drift.
  • [references/documentation_standards.md](references/documentation_standards.md) — README structure, API docs, changelogs, ADRs, docs-as-code standards.
  • [references/drift_prevention_guide.md](references/drift_prevention_guide.md) — coupling strategies, CI gates, review checklists, and prevention patterns.

Assets

AssetDescription
Drift Report TemplateTemplate for drift analysis reports
Sample Drift DataSample JSON for testing and demonstration

Scope & Limitations

Covers:

  • Detection of documentation drift against git history for any git repository
  • AST-based validation of Python API documentation (function signatures, class definitions, parameters, return types)
  • Internal link validation including local files, markdown anchors, cross-document anchors, images, and case-sensitivity checks
  • Multi-dimensional staleness scoring with configurable weights and CI/CD threshold enforcement

Does NOT cover:

  • Non-Python source code API validation -- the AST-based validator only parses Python; for TypeScript, Go, Rust, or Java APIs, use language-specific doc generators and pair with the link checker
  • External URL uptime monitoring -- --check-external performs one-shot HEAD requests but does not provide continuous monitoring; use the senior-devops skill for uptime dashboards
  • Automatic documentation rewriting -- tools classify issues as [AUTO], [SEMI], or [MANUAL] but do not generate replacement text; use the code-reviewer skill for AI-assisted doc suggestions
  • Content quality or readability assessment -- staleness scoring measures freshness and structural completeness, not prose quality; see the standards/communication library for writing guidelines

Integration Points

SkillIntegrationData Flow
code-reviewerInclude drift report in PR review commentsdrift_analyzer.py --json output feeds into review checklists as a documentation health section
senior-devopsAdd staleness gate to CI/CD pipelinesdoc_staleness_scorer.py --threshold 50 returns exit code 1 on failure, blocking deploys
senior-qaDocumentation quality as part of QA acceptancelink_checker.py --json output merges into QA dashboards alongside test coverage metrics
senior-fullstackValidate generated project docs post-scaffoldRun api_doc_validator.py against scaffolded docs/ directory to confirm generated API docs match source
senior-secopsAudit security documentation currencydrift_analyzer.py --scope security/ detects when security docs fall behind policy changes
senior-architectArchitecture decision record (ADR) freshnessdoc_staleness_scorer.py --required-sections "Status,Context,Decision,Consequences" validates ADR completeness

Related skills

FAQ

What tools does it include?

Four Python CLI tools: drift_analyzer.py, doc_staleness_scorer.py, api_doc_validator.py, and link_checker.py, all Python 3.8+ stdlib only.

Can it run in CI?

Yes. All tools support --json output and non-zero exit codes, with GitHub Actions and pre-commit recipes for gating PRs on drift or broken links.

Documentationdocsdevops

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.