AgentSkillsCN

doc-lint

对单个文档文件进行快速的 lint 检查。相比全面验证,它仅检查前言与基本格式,速度更快。适用于写作过程中,以便及早发现并解决问题。

SKILL.md
--- frontmatter
name: doc-lint
description: Quick lint check for a single documentation file. Faster than full validation - checks frontmatter and basic formatting only. Use during writing to catch issues early.
argument-hint: <file-path>
allowed-tools: Read

Quick Documentation Lint

Perform a fast lint check on a single documentation file.

Instructions

  1. Read the specified file using the Read tool

  2. Check frontmatter (first priority):

code
Required fields:
- title: string (non-empty)
- category: string (non-empty)
- tags: array (at least one tag)
- order: integer (>= 0)
  1. Check markdown basics:

    • Exactly one H1 header
    • H1 appears before any other content (after frontmatter)
    • No skipped header levels
    • Code blocks have language tags
  2. Check line length:

    • Flag lines > 100 characters
    • Ignore: URLs, code blocks, tables
  3. Check naming:

    • Filename should be kebab-case
    • No uppercase letters
    • No underscores

Output Format

Use a compact, scannable format:

code
## Lint: docs/guides/my-doc.md

[PASS] Frontmatter valid
[PASS] Single H1 header
[FAIL] Line 23: exceeds 100 chars (142)
[FAIL] Line 45: code block missing language
[WARN] Line 67: H4 after H2 (skipped H3)

Result: 2 errors, 1 warning

Or for passing files:

code
## Lint: docs/guides/my-doc.md

All checks passed!

Checks Performed

CheckSeverityDescription
Frontmatter existsERRORMust have YAML frontmatter
Required fieldsERRORtitle, category, tags, order
Single H1ERRORExactly one # header
Header hierarchyWARNNo skipped levels
Code languageERRORAll ``` blocks need language
Line lengthWARNLines > 100 chars
Filename formatWARNMust be kebab-case

Example Usage

code
/doc-lint docs/guides/getting-started.md
/doc-lint example/api/authentication.md