Doc Drift Detector logo

Doc Drift Detector

Community
borghei
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.

Overview

Publisherborghei
RepositoryClaude-Skills
Skill namedoc-drift-detector
Stars
856
Forks
154
Bundled files
10
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 10 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by borghei on GitHub. Read the source before you install it.

Installation

Install the Doc Drift Detector AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/borghei/Claude-Skills/tree/main/engineering/doc-drift-detector
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/borghei/Claude-Skills.git /tmp/Claude-Skills
mkdir -p .claude/skills
cp -r /tmp/Claude-Skills/engineering/doc-drift-detector .claude/skills/doc-drift-detector
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Doc Drift Detector in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Doc Drift Detector on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Doc Drift Detector is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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, confirm these inputs. If any is unknown or vague, ASK — do not assume:

  • Which check — full drift analysis, staleness score, API doc validation, or link audit (selects drift_analyzer.py vs doc_staleness_scorer.py vs api_doc_validator.py vs link_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/--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.

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 — 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 — 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 — README structure, API docs, changelogs, ADRs, docs-as-code standards.
  • 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

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Doc Drift Detector AI skill do?

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.

Why use Doc Drift Detector on TypingMind?

Because you install it once and use it with any model. Doc Drift Detector is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Doc Drift Detector in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/borghei/Claude-Skills/tree/main/engineering/doc-drift-detector. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Doc Drift Detector?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Doc Drift Detector?

As many as you like. As long as a model supports skills, you can use Doc Drift Detector with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Doc Drift Detector AI skill free?

It is published on GitHub by borghei. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇