Token导航 LogoToken导航

Agent Skill · 研究检索

doc-drift-detector(文档漂移检测器)

用于辅助文档、README、Markdown、说明文和内容稿件的整理与改写。它适合让 Agent 提炼结构、补齐章节、统一术语、检查链接或把零散材料整理成可读文档。使用时应保留项目已有事实、命令和路径,不要把未确认的信息写成确定结论;涉及对外文案时,还需要控制语气,避免过度营销或夸大能力。

doc-drift-detector 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证信息还不明确,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 42,057。

总安装 1,112周安装 45GitHub Stars 103下载 349核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:doc-drift-detector(文档漂移检测器)
来源仓库:https://github.com/borghei/claude-skills
仓库路径:skills/doc-drift-detector
安装命令:
npx skills add https://github.com/borghei/claude-skills --skill doc-drift-detector
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/borghei/claude-skills --skill doc-drift-detector

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

用于检测代码与文档之间的内容漂移和不一致问题。适合监控API变更、函数签名更新及链接失效等文档老化现象。通过AST解析和git历史比对,提供0-100分的文档新鲜度评分。仅使用Python标准库,适合集成到CI/CD流程中进行定期文档健康检查。

doc-drift-detector 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/doc-drift-detector

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/borghei/claude-skills --skill doc-drift-detect…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

doc-drift-detector 怎么安装?

在终端执行 npx skills add https://github.com/borghei/claude-skills --skill doc-drift-detector。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

doc-drift-detector 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

doc-drift-detector 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

doc-drift-detector 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

doc-drift-detector 用的人多吗?

公开数据是累计安装 1,112 次,近一周安装 45 次,下载 349 次,GitHub 103 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

doc-drift-detector 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
doc-drift-detector

文档漂移检测器 · 本页

1,112103需要联网未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

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.


Quick Start

# 1. Run full drift analysis on a repository
python scripts/drift_analyzer.py /path/to/repo

# 2. Score documentation freshness
python scripts/doc_staleness_scorer.py /path/to/repo

# 3. Validate API docs against Python source
python scripts/api_doc_validator.py /path/to/repo/src /path/to/repo/docs/api.md

# 4. Check all markdown links
python scripts/link_checker.py /path/to/repo

# JSON output for any tool
python scripts/drift_analyzer.py /path/to/repo --json

# Set failure threshold for CI
python scripts/doc_staleness_scorer.py /path/to/repo --threshold 60

All tools support --help for full usage details.


Core Workflows

Workflow 1: Full Drift Analysis

Scan all documentation against code changes since each doc was last updated. This is the primary entry point for understanding the overall drift state of a repository.

# Basic analysis
python scripts/drift_analyzer.py /path/to/repo

# Analyze with custom doc patterns
python scripts/drift_analyzer.py /path/to/repo --doc-patterns "*.md,*.rst,*.txt"

# JSON output for tooling
python scripts/drift_analyzer.py /path/to/repo --json

# Only show high-severity drift
python scripts/drift_analyzer.py /path/to/repo --min-severity high

# Analyze specific directory
python scripts/drift_analyzer.py /path/to/repo --scope src/

What it does:

  1. Discovers all documentation files in the repo
  2. For each doc, identifies the code directories it describes (via path proximity and content references)
  3. Compares the doc's last-modified date against the git history of its associated code
  4. Identifies specific changes (renamed files, moved directories, changed function signatures)
  5. Classifies each drift instance by category and severity
  6. Generates an actionable report with specific file:line references

Output example:

Documentation Drift Report
==========================
Repository: /path/to/repo
Scan date:  2026-03-18
Docs found: 12
Drifted:    5

HIGH SEVERITY:
  docs/api.md (last updated: 2026-01-15)
    - 23 code files changed since doc update
    - 4 functions renamed in src/handlers/
    - 2 new modules undocumented
    Category: Factual + Structural
    Recommendation: Manual update required

MEDIUM SEVERITY:
  README.md (last updated: 2026-02-28)
    - Installation section references removed dependency
    - Version string outdated (says 1.8.0, current 2.0.0)
    Category: Factual + Temporal
    Recommendation: Auto-fixable (version), Manual (installation)

Workflow 2: API Documentation Validation

Check that API documentation accurately reflects the actual function signatures, class definitions, and module structure in your Python source code.

# Validate API docs against source
python scripts/api_doc_validator.py /path/to/src /path/to/docs/api.md

# Scan entire docs directory
python scripts/api_doc_validator.py /path/to/src /path/to/docs/ --recursive

# JSON output
python scripts/api_doc_validator.py /path/to/src /path/to/docs/api.md --json

# Include private methods in validation
python scripts/api_doc_validator.py /path/to/src /path/to/docs/ --include-private

What it detects:

  • Functions/classes present in code but missing from docs
  • Functions/classes documented but no longer in code (removed or renamed)
  • Parameter mismatches (missing params, wrong types, wrong defaults)
  • Deprecated items still documented as current
  • Return type mismatches
  • Module-level docstring drift

How it works:

The tool uses Python's ast module to parse source files and extract function signatures, class definitions, decorators, and docstrings. It then parses the markdown documentation looking for function/class references, parameter lists, and code blocks. Mismatches are reported with exact locations in both source and documentation.

Workflow 3: README Health Check

Validate README sections against the actual project state. This combines drift analysis, link checking, and completeness scoring into a single README-focused report.

# Check README health
python scripts/doc_staleness_scorer.py /path/to/repo --readme-focus

# Check with custom sections
python scripts/doc_staleness_scorer.py /path/to/repo --required-sections "Installation,Usage,API,Contributing,License"

Validates:

  • Required sections are present (Installation, Usage, API Reference, Contributing, License)
  • Version strings match package version (package.json, setup.py, pyproject.toml)
  • File references in README actually exist
  • Badge URLs are well-formed
  • Code examples reference existing files/functions
  • Table of contents matches actual headings

Workflow 4: Link Integrity Audit

Check every link in every markdown file -- local file references, anchors, cross-document links, and optionally external URLs.

# Check all markdown links
python scripts/link_checker.py /path/to/repo

# Include external URL checks (slower, makes HTTP requests)
python scripts/link_checker.py /path/to/repo --check-external

# Check specific file
python scripts/link_checker.py /path/to/repo/README.md

# JSON output
python scripts/link_checker.py /path/to/repo --json

# Only show broken links
python scripts/link_checker.py /path/to/repo --broken-only

What it checks:

  • Local file references ([link](path/to/file.md)) -- does the file exist?
  • Anchor references ([link](#section-name)) -- does the heading exist?
  • Cross-document anchors ([link](other.md#section)) -- does the file and heading exist?
  • Relative path correctness (catches ../ errors)
  • Case sensitivity issues (common on Linux but silent on macOS)
  • Image references -- do referenced images exist?
  • Duplicate anchors that would cause ambiguous links

Workflow 5: Continuous Doc Monitoring

Integrate documentation drift detection into your CI/CD pipeline for ongoing monitoring.

GitHub Actions example:

name: Documentation Drift Check
on:
  pull_request:
    branches: [main, dev]
  push:
    branches: [main]

jobs:
  doc-drift:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0  # Full history for git log analysis

      - uses: actions/setup-python@v5
        with:
          python-version: '3.11'

      - name: Run drift analysis
        run: python engineering/doc-drift-detector/scripts/drift_analyzer.py . --json > drift-report.json

      - name: Check staleness score
        run: python engineering/doc-drift-detector/scripts/doc_staleness_scorer.py . --threshold 50

      - name: Validate API docs
        run: python engineering/doc-drift-detector/scripts/api_doc_validator.py src/ docs/api.md

      - name: Check links
        run: python engineering/doc-drift-detector/scripts/link_checker.py .

      - name: Upload drift report
        if: always()
        uses: actions/upload-artifact@v4
        with:
          name: drift-report
          path: drift-report.json

Pre-commit hook:

#!/bin/bash
# .git/hooks/pre-commit
# Fail commit if docs are severely stale
python engineering/doc-drift-detector/scripts/doc_staleness_scorer.py . --threshold 30 --quiet
if [ $? -ne 0 ]; then
    echo "Documentation is critically stale. Update docs before committing."
    exit 1
fi

Tools

ToolPurposeLinesKey Feature
drift_analyzer.pyFull drift analysis between code and docs~550Git history comparison with code-to-doc mapping
doc_staleness_scorer.pyScore documentation freshness 0-100~450Weighted multi-dimensional scoring
api_doc_validator.pyValidate API docs against Python source~400AST-based signature extraction and comparison
link_checker.pyAudit all markdown links and anchors~400Local file, anchor, and cross-document validation

All tools:

  • Python 3.8+ standard library only
  • Support --json for machine-readable output
  • Support --help for usage details
  • Use non-zero exit codes on failure (CI/CD compatible)
  • Work on any OS (Windows, macOS, Linux)

Staleness Scoring

Documentation freshness is scored on a 0-100 scale where 100 = perfectly current. The score is a weighted combination of five dimensions:

DimensionWeightWhat It Measures
Last Updated20%How recently the doc file was modified relative to its associated code
Code-Doc Alignment30%Whether documented items (functions, classes, files) still exist and match
Link Health15%Percentage of links that resolve correctly
Completeness20%Whether expected sections are present and non-empty
Accuracy15%Whether version strings, file paths, and other verifiable facts are correct

Score interpretation:

ScoreLabelAction
90-100ExcellentNo action needed
70-89GoodMinor updates recommended
50-69StaleUpdates needed before next release
30-49CriticalImmediate attention required
0-29AbandonedFull rewrite likely needed

Customization:

# Override default weights
python scripts/doc_staleness_scorer.py /path/to/repo \
  --weight-updated 0.25 \
  --weight-alignment 0.25 \
  --weight-links 0.15 \
  --weight-completeness 0.20 \
  --weight-accuracy 0.15

# Set staleness thresholds
python scripts/doc_staleness_scorer.py /path/to/repo --threshold 60

Drift Categories

Every detected drift instance is classified into one or more categories:

Structural Drift

Missing or misorganized sections. A README lacks an Installation section. An API doc is missing an entire module. A CHANGELOG has no entries for the latest version.

Detection: Compare actual document headings against expected headings for that document type.

Factual Drift

Incorrect information. A function signature in the docs has the wrong parameters. An installation command references a removed package. A configuration example uses deprecated options.

Detection: Cross-reference documented facts against code analysis (AST parsing, file existence, git tags).

Referential Drift

Broken references. A link points to a file that was moved. An anchor references a heading that was renamed. An image path is wrong.

Detection: Link checker validates every reference against the filesystem and document structure.

Temporal Drift

Outdated time-sensitive content. Version strings are old. "Last updated" dates are stale. "Coming soon" items that shipped months ago. Roadmap items past their target date.

Detection: Extract version strings and dates, compare against git tags, package manifests, and current date.

Semantic Drift

Technically accurate but misleading. A description says "simple REST API" when the project now has GraphQL, gRPC, and WebSocket endpoints. The architecture overview omits a major new subsystem.

Detection: Compare document topic coverage against code directory structure and file counts. Flag when code complexity has grown significantly but documentation scope has not.


Auto-Fix vs Manual-Fix Classification

Not all drift can be fixed programmatically. The tools classify each issue:

Auto-Fixable (safe to automate)

  • Version string updates -- replace old version with current from package manifest
  • Date updates -- update "last modified" timestamps
  • Broken local links -- suggest correct path when file was moved (git log tracks renames)
  • Missing table of contents entries -- generate from actual headings
  • Removed file references -- flag for deletion or suggest replacement

Manual-Fix Required (needs human judgment)

  • Architectural description changes -- requires understanding intent
  • API usage examples -- new examples need domain context
  • Migration guides -- require understanding of breaking changes
  • Getting started rewrites -- narrative flow needs human touch
  • Security documentation updates -- compliance implications require review

Semi-Automated (template + human review)

  • New function documentation -- generate skeleton from AST, human fills description
  • Changelog entries -- generate from git commits, human edits for clarity
  • README section additions -- provide template, human adds content

The drift report marks each issue with [AUTO], [MANUAL], or [SEMI] tags.


Integration Points

With CI/CD Pipelines

All tools return non-zero exit codes when issues are found:

  • Exit 0: No issues (or all within threshold)
  • Exit 1: Issues found exceeding threshold
  • Exit 2: Tool error (invalid arguments, missing files)

With Code Review

Add drift analysis to PR checks. When a PR modifies code in src/, automatically check whether docs in docs/ need updates. The drift analyzer can scope its analysis to only changed directories.

With Documentation Generators

Pair with tools like Sphinx, MkDocs, or mdBook. Run API validation after doc generation to ensure the generated docs match source. Run link checker on the built output.

With Release Processes

Add staleness scoring to release checklists. Block releases if documentation score falls below threshold. Generate drift reports as release artifacts.

With Other Skills

  • code-reviewer -- include doc drift in PR review reports
  • senior-devops -- integrate into deployment pipelines
  • senior-qa -- documentation quality as part of QA checklist

Reference Guides

GuideDescription
Documentation StandardsREADME structure, API docs, changelogs, ADRs, docs-as-code
Drift Prevention GuideCoupling strategies, CI gates, review checklists, prevention patterns

Assets

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

Anti-Patterns

  • Ignoring drift until release -- run drift analysis in CI on every PR, not as a release-day scramble
  • Treating all drift as equal -- factual drift (wrong function signatures) is critical; temporal drift (stale dates) is cosmetic; prioritize by category
  • Manual-only doc updates -- use [AUTO] fixes for version strings and broken links; reserve human effort for semantic and architectural drift
  • Shallow clone in CI -- fetch-depth: 1 breaks git history comparison; always use fetch-depth: 0 for drift analysis
  • Skipping link checks on internal docs -- cross-document anchor references break silently on refactors; run link_checker.py on every markdown change

Troubleshooting

ProblemCauseSolution
drift_analyzer.py reports zero docs foundRepository has non-standard doc extensions or docs are in ignored directories (e.g., node_modules, dist)Use --doc-patterns "*.md,*.rst,*.txt" to explicitly specify extensions
Staleness scores are unexpectedly lowDocs reference files that were reorganized or moved to new directoriesRun link_checker.py first to identify broken references, fix them, then re-score
API validator finds no source signaturesSource path points to a non-Python directory or all functions are _-prefixed privateVerify source_path contains .py files; add --include-private if the API surface uses private names
Link checker flags valid anchors as brokenHeading text contains special characters, inline code, or emoji that alter the slugCompare the expected slug (lowercase, special chars stripped, spaces to hyphens) against the actual heading text
Git history comparison shows no changesShallow clone lacks full commit history (common in CI)Clone with fetch-depth: 0 or pass --scope to narrow the analysis window
External URL checks hang or time outTarget servers are slow or block automated HEAD requestsOmit --check-external for local-only validation, or run external checks in a separate non-blocking job
Drift report marks everything as [MANUAL]Most detected drift is semantic or architectural, not auto-fixableThis is expected for large refactors; focus on [AUTO] and [SEMI] items first, then triage [MANUAL] items by severity

Success Criteria

  • Zero stale docs older than 90 days -- every documentation file has been updated within the last 90 days relative to its associated code changes
  • Aggregate staleness score above 80/100 -- the repository-wide freshness score stays in the "Good" or "Excellent" range
  • Link integrity above 99% -- fewer than 1% of internal links (file references, anchors, cross-document links) are broken
  • API doc coverage above 95% -- at least 95% of public functions and classes have corresponding entries in API documentation
  • Zero high-severity drift issues in CI -- pull requests with high or critical drift are blocked before merge
  • Version string accuracy at 100% -- every version reference in documentation matches the current release tag or package manifest
  • Drift report turnaround under 60 seconds -- full drift analysis completes in under one minute for repositories with up to 500 documentation files

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

Tool Reference

drift_analyzer.py

Purpose: Scan a git repository for documentation that has fallen out of sync with code. Maps documentation files to their associated code directories, compares git modification dates, detects renamed files, version string drift, broken references, and structural gaps. Classifies every issue by category, severity, and fix type.

Usage:

python scripts/drift_analyzer.py <repo_path> [options]

Parameters:

FlagTypeDefaultDescription
repo_pathpositional*(required)*Path to the git repository to analyze
--jsonflagoffOutput the full drift report as JSON
--min-severitychoicelowMinimum severity to include in report. Choices: critical, high, medium, low, info
--scopestring"" (all)Limit code analysis to a subdirectory (e.g., src/)
--doc-patternsstring*.md,*.rst,*.txt,*.adocComma-separated file patterns for documentation discovery

Example:

python scripts/drift_analyzer.py /path/to/repo --min-severity medium --scope src/ --json

Output Formats:

  • Human-readable (default): Grouped by severity with [AUTO]/[SEMI]/[MANUAL] fix-type tags, category labels, and a fix-type summary
  • JSON (--json): Structured object with repository, scan_date, summary (counts by severity, category, fix type), and issues array

Exit Codes: 0 = no high/critical issues, 1 = high or critical issues found, 2 = tool error (invalid path, not a git repo)


doc_staleness_scorer.py

Purpose: Score documentation freshness on a weighted 0-100 scale across five dimensions: last updated, code-doc alignment, link health, completeness, and accuracy. Supports CI/CD threshold gates and README-focused analysis.

Usage:

python scripts/doc_staleness_scorer.py <repo_path> [options]

Parameters:

FlagTypeDefaultDescription
repo_pathpositional*(required)*Path to the git repository to score
--jsonflagoffOutput the full scoring report as JSON
--thresholdfloat*(none)*Fail with exit code 1 if aggregate score falls below this value
--readme-focusflagoffOnly score README files (filenames starting with readme)
--required-sectionsstringInstallation,Usage,API,Contributing,LicenseComma-separated section names for completeness scoring
--quietflagoffOnly print the aggregate score number (no report)
--weight-updatedfloat0.20Weight for the "last updated" dimension
--weight-alignmentfloat0.30Weight for the "code-doc alignment" dimension
--weight-linksfloat0.15Weight for the "link health" dimension
--weight-completenessfloat0.20Weight for the "completeness" dimension
--weight-accuracyfloat0.15Weight for the "accuracy" dimension

Example:

python scripts/doc_staleness_scorer.py /path/to/repo --threshold 60 --readme-focus --quiet

Output Formats:

  • Human-readable (default): Aggregate score with label, per-file score table sorted worst-first, and dimension breakdown with ASCII bars for the bottom 5 files
  • JSON (--json): Structured object with aggregate_score, aggregate_label, total_documents, and documents array (each with total_score, label, and per-dimension scores/details)
  • Quiet (--quiet): Single line with the aggregate score (e.g., 72.3)

Exit Codes: 0 = score above threshold (or no threshold set), 1 = score below threshold, 2 = tool error


api_doc_validator.py

Purpose: Extract function and class signatures from Python source files using the ast module and compare them against API documentation in markdown files. Detects undocumented items, phantom documentation for removed code, parameter mismatches, and deprecated items.

Usage:

python scripts/api_doc_validator.py <source_path> <doc_path> [options]

Parameters:

FlagTypeDefaultDescription
source_pathpositional*(required)*Path to a Python source file or directory
doc_pathpositional*(required)*Path to API documentation file (.md) or directory
--jsonflagoffOutput the validation report as JSON
--recursiveflagoffRecursively scan the doc directory for markdown files
--include-privateflagoffInclude _-prefixed private functions and classes in validation

Example:

python scripts/api_doc_validator.py /path/to/src /path/to/docs/ --recursive --include-private --json

Output Formats:

  • Human-readable (default): Summary counts (source signatures, documented items, issues), then issues grouped by severity with type tags, source/doc file locations, and a summary-by-type table
  • JSON (--json): Structured object with summary (counts by type and severity) and issues array (each with type, severity, name, file/line references, and description)

Exit Codes: 0 = no high-severity issues, 1 = high-severity issues found (e.g., documented items missing from source), 2 = tool error


link_checker.py

Purpose: Scan markdown files for every link type (local files, anchors, cross-document anchors, images, HTML links, reference-style links) and validate them against the filesystem and document headings. Optionally validates external URLs via HTTP HEAD requests. Also detects duplicate heading anchors.

Usage:

python scripts/link_checker.py <path> [options]

Parameters:

FlagTypeDefaultDescription
pathpositional*(required)*File or directory to check (single .md file or directory for recursive scan)
--jsonflagoffOutput the link check report as JSON
--broken-onlyflagoffOnly show broken links in the report (omit valid links from output)
--check-externalflagoffAlso validate external URLs via HTTP HEAD requests (slower, makes network requests)

Example:

python scripts/link_checker.py /path/to/repo --broken-only --json

Output Formats:

  • Human-readable (default): Summary counts (total, valid, broken, skipped, duplicate anchors), broken links grouped by source file with line numbers and error messages, duplicate anchor list, and link-type breakdown table
  • JSON (--json): Structured object with summary (counts), broken_links array (each with source file, line, text, target, type, error), duplicate_anchors map, and optionally all_links (when --broken-only is not set)

Exit Codes: 0 = no broken links and no duplicate anchors, 1 = broken links or duplicate anchors found, 2 = tool error


Last Updated: 2026-03-18 Version: 2.0.0 Tools: 4 Python CLI tools, 0 external dependencies Compatibility: Python 3.8+, any OS, any git repository

平台分布

Codex

36.32%
按下载量换算127

Claude

30.87%
按下载量换算108

Cursor

18.51%
按下载量换算65

Gemini CLI

8.35%
按下载量换算29

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills