Install any skill in seconds. Free to start, no credit card required.
Get Started Free →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.
.claude/skills/borghei-doc-drift-detector/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 36% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 11% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 47% | 0% |
| case-10 | ✗→✓ | ▲ Improved | 102% | 0% |
| case-12 | ✗→✓ | ▲ Improved | 148% | 0% |
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.
[AUTO]/[SEMI]/[MANUAL] for fix routing.Before running detection, confirm these inputs. If any is unknown or vague, ASK — do not assume:
drift_analyzer.py vs doc_staleness_scorer.py vs api_doc_validator.py vs link_checker.py)--min-severity/--threshold and the exit-code gate)Stop rule: ask only the 2-3 that most change the output. If the user says "just draft it," proceed and list your assumptions at the top of the artifact.
| Tool | Purpose | Command | |------|---------|---------| | drift_analyzer.py | Full drift analysis between code and docs | python scripts/drift_analyzer.py <repo> --min-severity high --json | | doc_staleness_scorer.py | Score documentation freshness 0-100 | python scripts/doc_staleness_scorer.py <repo> --threshold 60 | | api_doc_validator.py | Validate API docs against Python source (AST) | python scripts/api_doc_validator.py <src> <docs> --recursive | | link_checker.py | Audit all markdown links and anchors | python 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.
Load the reference that matches the task — keep this file lean and pull detail on demand:
| Asset | Description | |-------|-------------| | Drift Report Template | Template for drift analysis reports | | Sample Drift Data | Sample JSON for testing and demonstration |
Covers:
Does NOT cover:
--check-external performs one-shot HEAD requests but does not provide continuous monitoring; use the senior-devops skill for uptime dashboards[AUTO], [SEMI], or [MANUAL] but do not generate replacement text; use the code-reviewer skill for AI-assisted doc suggestions| Skill | Integration | Data Flow | |-------|-------------|-----------| | code-reviewer | Include drift report in PR review comments | drift_analyzer.py --json output feeds into review checklists as a documentation health section | | senior-devops | Add staleness gate to CI/CD pipelines | doc_staleness_scorer.py --threshold 50 returns exit code 1 on failure, blocking deploys | | senior-qa | Documentation quality as part of QA acceptance | link_checker.py --json output merges into QA dashboards alongside test coverage metrics | | senior-fullstack | Validate generated project docs post-scaffold | Run api_doc_validator.py against scaffolded docs/ directory to confirm generated API docs match source | | senior-secops | Audit security documentation currency | drift_analyzer.py --scope security/ detects when security docs fall behind policy changes | | senior-architect | Architecture decision record (ADR) freshness | doc_staleness_scorer.py --required-sections "Status,Context,Decision,Consequences" validates ADR completeness |
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 17,705 | 14,607 | -17% | 1 | 1 | 0% | 3,127 | 4,259 | +36% | 0 | 0 | — |
case-02 | pass→pass | 16,777 | 11,895 | -29% | 1 | 1 | 0% | 2,796 | 3,505 | +25% | 0 | 0 | — |
case-03 | fail→fail | 3,873 | 8,699 | +125% | 1 | 1 | 0% | 532 | 2,968 | +458% | 0 | 0 | — |
case-04 | fail→fail | 12,163 | 9,042 | -26% | 1 | 1 | 0% | 2,023 | 3,136 | +55% | 0 | 0 | — |
case-05 | fail→fail | 12,507 | 19,249 | +54% | 1 | 1 | 0% | 2,452 | 4,916 | +100% | 0 | 0 | — |
case-06 | fail→fail | 3,976 | 19,416 | +388% | 1 | 1 | 0% | 434 | 2,762 | +536% | 0 | 0 | — |
case-07 | fail→fail | 13,772 | 26,041 | +89% | 1 | 1 | 0% | 1,911 | 6,054 | +217% | 0 | 0 | — |
case-08 | fail→pass | 14,162 | 6,074 | -57% | 1 | 1 | 0% | 2,392 | 2,662 | +11% | 0 | 0 | — |
case-09 | fail→pass | 9,832 | 4,610 | -53% | 1 | 1 | 0% | 1,574 | 2,314 | +47% | 0 | 0 | — |
case-10 | fail→pass | 18,938 | 6,055 | -68% | 1 | 1 | 0% | 1,322 | 2,670 | +102% | 0 | 0 | — |
case-11 | pass→pass | 6,110 | 6,391 | +5% | 1 | 1 | 0% | 937 | 2,807 | +200% | 0 | 0 | — |
case-12 | fail→pass | 19,625 | 6,407 | -67% | 1 | 1 | 0% | 1,014 | 2,517 | +148% | 0 | 0 | — |
case-13 | pass→pass | 14,572 | 12,401 | -15% | 1 | 1 | 0% | 2,378 | 3,550 | +49% | 0 | 0 | — |
case-14 | fail→pass | 16,607 | 21,697 | +31% | 1 | 1 | 0% | 2,602 | 5,749 | +121% | 0 | 0 | — |
case-15 | pass→pass | 13,116 | 7,817 | -40% | 1 | 1 | 0% | 2,195 | 2,867 | +31% | 0 | 0 | — |
case-16 | fail→pass | 10,646 | 3,595 | -66% | 1 | 1 | 0% | 1,681 | 2,189 | +30% | 0 | 0 | — |
case-17 | fail→pass | 8,673 | 3,296 | -62% | 1 | 1 | 0% | 1,567 | 2,061 | +32% | 0 | 0 | — |
case-18 | pass→pass | 14,051 | 6,538 | -53% | 1 | 1 | 0% | 2,471 | 2,710 | +10% | 0 | 0 | — |
case-19 | pass→pass | 6,529 | 2,833 | -57% | 1 | 1 | 0% | 970 | 2,051 | +111% | 0 | 0 | — |
case-20 | pass→pass | 14,989 | 4,299 | -71% | 1 | 1 | 0% | 2,356 | 2,163 | -8% | 0 | 0 | — |
case-21 | fail→pass | 5,555 | 2,069 | -63% | 1 | 1 | 0% | 840 | 1,936 | +130% | 0 | 0 | — |
case-22 | fail→pass | 7,916 | 7,710 | -3% | 1 | 1 | 0% | 1,302 | 2,991 | +130% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 21 counted toward the lift figure. The other 1 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +45 percentage points is the difference between those two pass rates over the 21 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.