360 Secure SkillHub
360 安全技能中心

Markdown Validator

核心功能:递归扫描Markdown文件,检查相对链接有效性,自动忽略外部URL与同文件锚点,输出含失效链接行号的JSON报告。典型场景:用于项目内部文档维护,保障内部链接一致。输入为目录或指定Markdown文件路径,通过命令行执行,输出含失效链接详情的JSON数组。

wanng-ide
wanng-ide
热度 78.44
最近更新 2026-05-11 17:25:49
分类:效率依赖:代码执行 / 读写文件应用场景:校对润色

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add markdown-validator
Metadata
name
markdown-validator
description
Validates Markdown files for broken local links.

Markdown Validator

Validates Markdown files for broken local links. Use this skill to check internal documentation consistency.

Usage

# Validate current directory
openclaw exec node skills/markdown-validator/index.js .

# Validate specific file
openclaw exec node skills/markdown-validator/index.js README.md

Features

  • Scans recursively
  • Checks relative links
  • Ignores external URLs (http/https)
  • Ignores anchors within the same file (#anchor)
  • Outputs JSON report of broken links with line numbers

Example Output

[
  {
    "file": "/path/to/README.md",
    "valid": false,
    "brokenLinks": [
      {
        "text": "Link Text",
        "url": "./broken-link.md",
        "line": 10
      }
    ]
  }
]