360 Secure SkillHub
360 安全技能中心

Markdown Linter

核心功能包括验证本地Markdown文件链接有效性、检查标题层级逻辑、确保代码块按需添加语言标识。适用于维护MEMORY.md、SKILL.md等文档时,排查断链、语法问题以保障文档完整性。可递归扫描指定目录,输出包含总文件数、断链详情、语法错误的JSON格式结果。

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

安装技能

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

执行命令安装此 skill: npx secure-skills-cli add markdown-linter
Metadata
name
markdown-linter
description
Validates Markdown files in the workspace for broken local links, missing file references, and basic syntax issues. Use to maintain documentation integrity and prevent broken references in MEMORY.md or SKILL.md files.

Markdown Linter

A lightweight tool to validate Markdown files in the workspace. It focuses on ensuring internal consistency, particularly broken file links and missing references.

Capabilities

  • Link Validation: Checks [link](path) references to ensure the target file exists locally.
  • Header Check: Verifies that headers follow a logical hierarchy (e.g., H1 -> H2).
  • Code Block Check: Ensures code blocks have language identifiers where appropriate.

Usage

const linter = require('./index');
const results = await linter.scan('.'); // Scans current directory recursively
console.log(JSON.stringify(results, null, 2));

Output Format

{
  "totalFiles": 15,
  "brokenLinks": [
    {
      "file": "docs/README.md",
      "line": 10,
      "link": "./missing-image.png",
      "error": "File not found"
    }
  ],
  "syntaxErrors": []
}