360 Secure SkillHub
360 安全技能中心

md-lint

提供 Markdown 格式约定:列出 prettier 会重写的写法(列表符号、强调、空行、表格填充等)和 markdownlint 可自动修复的规则,并指出标题风格、单 H1、图片替代文本、链接目标、代码块语言等需手工修改的问题,帮助一次写出合规文档。

jimweller
热度 0.00
最近更新 2026-10-19 03:43:35
分类:效率依赖:纯提示词应用场景:校对润色 / 模板 / 工作流

安装技能

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

执行命令安装此 skill: npx secure-skills-cli add jimweller/clanker-skills/md-lint
Metadata
name
md-lint
description
What the markdown formatter rewrites and which lint rules it cannot fix. Use before writing markdown intended for a human reader, so the file comes out conforming instead of being reformatted afterward.

STARTER_CHARACTER = 🔏

Markdown Formatter Contract

A PostToolUse hook runs markdownlint-cli2 --fix and then prettier --write on every markdown file written or edited, excluding .llmtmp/, .llmdocs/, SKILL.md, and plan files. Writing to this contract avoids a rewrite, and a rewrite invalidates the in-context copy of the file.

What prettier rewrites

Input Output
* item, + item - item
1) ordered marker 1.
*emphasis* _emphasis_
__strong__ **strong**
*** thematic break ---
Two or more blank lines One blank line
Runs of spaces inside a line Single space
Unpadded table cells Cells padded to column width
No trailing newline Trailing newline added

Prose is not rewrapped. Long lines stay as written.

What markdownlint fixes

Missing space after #, missing blank lines around headings and fenced blocks, trailing whitespace, and bare URLs.

Four rules are off: MD013 (line length), MD024 (duplicate headings), MD029 (ordered list prefix), MD033 (inline HTML).

What neither can fix

These reach the model as hook feedback and need a manual edit:

  • MD003, heading style. Setext headings underlined with === or --- are errors. Use ATX (#, ##).
  • MD025, one H1 per document.
  • MD045, images need alt text.
  • MD042, links need a destination.
  • MD040, fenced code blocks need a language.

Writing conforming markdown

Start with a single # Title. Use ATX headings, - bullets, _emphasis_, **strong**, one blank line between blocks, a language on every fence, alt text on every image, and a trailing newline.