doc-drift-detector
БесплатноЗапускает вложенные скриптыНе проверенDetect documentation drift against code changes, score staleness, validate API docs via AST parsing, and audit link integrity. Use when docs fall out of sync…
от borghei★ 1 250 звёзд на GitHubОб этом скилле
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.
Clarify First
Before running detection, settle the inputs below. When one is missing or vague and would change the result, ask about it; when it wouldn't, use a sensible default and say which one you used.
- Which check: full drift analysis, staleness score, API doc validation, or link audit (selects
drift_analyzer.pyvsdoc_staleness_scorer.pyvsapi_doc_validator.pyvslink_checker.py). - Repo & doc/source paths: the repository and which code and docs directories to compare (the input the tools scan).
- Threshold & gate: minimum severity or staleness threshold for CI failure (sets
--min-severity/--thresholdand the exit-code gate).
Ask about the two or three inputs that matter most for this request, not the whole list. If the user wants a result straight away, produce it and state your assumptions at the top.
Workflow
- Links first (fast, no git needed):
link_checker.py <docs-dir> --broken-only. Fix broken files and anchors. - API docs (Python):
api_doc_validator.py <src> <docs> --recursivelists documented-but-missing and undocumented functions and classes, and signature mismatches. - Drift against history:
drift_analyzer.py <repo>compares doc and code change history (needs a git checkout; on very large repositories use--scopeto limit it). - Score freshness:
doc_staleness_scorer.py <repo> --threshold 60for a 0-100 score per document and an aggregate gate. - Fix in order: broken links and wrong API signatures (readers act on them), then stale how-tos, then completeness.
- Verify that all four tools exit 0 at the gates you chose before merging.
Quick Start
python3 scripts/link_checker.py . --broken-only # this skill's own docs: clean (exit 0)
python3 scripts/api_doc_validator.py scripts references --recursive # undocumented helpers are reported
python3 scripts/drift_analyzer.py /path/to/repo --min-severity medium --fail-on high
python3 scripts/doc_staleness_scorer.py /path/to/repo --threshold 60 --json
Tools Overview
| Tool | What it does | Key flags | Exit codes |
|---|---|---|---|
link_checker.py <path> |
Local files, anchors (GitHub slug rules), cross-doc anchors, images, case mismatches, duplicate anchors; ignores fenced and inline code | --broken-only, --check-external, --json |
0 clean, 1 broken links or duplicate anchors, 2 bad path |
api_doc_validator.py <src> <docs> |
Python AST vs docs: missing, undocumented and mismatched functions/classes/parameters | --recursive, --include-private, --json |
0 no documented-but-missing items, 1 mismatches, 2 bad path |
drift_analyzer.py <repo> |
Structural, factual, referential, temporal and semantic drift from git history | --min-severity (what to report), --fail-on (what fails, default high), --scope, --doc-patterns, --json |
0, 1 issue at/above --fail-on, 2 not a directory or not a git checkout |
doc_staleness_scorer.py <repo> |
Weighted 0-100 freshness per doc (age, code alignment, links, completeness, accuracy) | --threshold, --readme-focus, --required-sections, --weight-*, --json |
0, 1 aggregate below threshold, 2 bad path |
All tools are Python stdlib only; drift_analyzer.py and the scorer read git history through the git c
Установить doc-drift-detector в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл doc-drift-detector?
Detect documentation drift against code changes, score staleness, validate API docs via AST parsing, and audit link integrity. Use when docs fall out of sync with code, preparing releases, running CI doc gates, or auditing doc accuracy.
Как установить скилл doc-drift-detector?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл doc-drift-detector запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic