Markdown Expert
Follow these rules when writing or editing any markdown file.
Formatting Rules
Comply with CommonMark specification and GitHub Flavored Markdown (GFM) extensions. These are universal standards — do not apply project-specific overrides.
Headings
- One H1 (
#) per document — the document title
- Never skip heading levels (H2 → H4 is wrong, use H2 → H3)
- Blank line before and after every heading
- Use ATX-style headings (
#), never Setext (underlines)
Code Blocks
- Always specify a language identifier on fenced code blocks
- Common identifiers:
python, bash, json, yaml, sql, text, markdown, javascript, typescript, go, rust, html, css, toml, xml, diff
- Use
text for plain output that has no specific language
- Use
bash for shell commands, not sh or shell
Tables
- Always space-align columns for readability
- Use pipe tables (GFM standard)
- Align separator row dashes to match column width
- Right-align numeric columns with
: in separator
- Run
${CLAUDE_PLUGIN_ROOT}/skills/md-expert/scripts/format-tables.py to auto-fix table alignment
- For reference on table formatting patterns, read
${CLAUDE_PLUGIN_ROOT}/skills/md-expert/references/table-formatting.md
Spacing
- Blank line before and after: headings, lists, code blocks, tables, blockquotes
- No trailing whitespace on any line
- Single blank line between sections (never double)
- Files end with a single newline
Links
- Prefer reference-style links when the same URL appears more than once
- Use relative paths for internal links within the same repository
- Use descriptive link text — never "click here" or bare URLs in prose
Lists
- Use
- for unordered lists (consistent, not mixed * and -)
- Use
1. for all ordered list items (auto-numbering)
- Indent nested lists by 4 spaces
Tools
Use these tools to validate and fix markdown quality:
| Tool |
Command |
Purpose |
| markdownlint-cli2 |
markdownlint-cli2 "**/*.md" |
Structure linting |
| vale |
vale file.md |
Prose quality |
| mdformat |
mdformat file.md |
Auto-formatting |
| doctoc |
doctoc file.md |
TOC generation |
| lychee |
lychee file.md |
Link validation |
Run tools in this order: mdformat first to auto-fix formatting, then markdownlint-cli2 for structural issues, then vale for prose quality. Use lychee last since it hits the network.
Document Structure
Follow standard section ordering. For detailed guidance, read ${CLAUDE_PLUGIN_ROOT}/skills/md-expert/references/document-structure.md.
- Title (H1)
- Brief description / overview
- Table of contents (for documents with 4+ sections)
- Main content sections (H2)
- Examples / usage
- Reference / appendix
Linting
For the complete set of universal markdownlint rules and vale style configuration, read ${CLAUDE_PLUGIN_ROOT}/skills/md-expert/references/linting-rules.md.
Key rules enforced:
- MD001: Heading levels increment by one
- MD003: ATX-style headings
- MD009: No trailing spaces
- MD012: No multiple consecutive blank lines
- MD022: Headings surrounded by blank lines
- MD031: Fenced code blocks surrounded by blank lines
- MD040: Fenced code blocks have a language identifier
- MD047: Files end with a single newline
1---2name: md-expert3description: This skill should be used when the user is writing, editing, or reviewing markdown files. It ensures high-quality markdown authoring following universal CommonMark and GitHub Flavored Markdown standards. Triggers on: creating .md files, writing READMEs, formatting tables, fixing markdown lint errors, structuring documents, generating TOCs, checking links, or fixing markdownlint warnings. Also available as /sawkit:md-expert.4---56# Markdown Expert78Follow these rules when writing or editing any markdown file.910## Formatting Rules1112Comply with CommonMark specification and GitHub Flavored Markdown (GFM) extensions. These are universal standards — do not apply project-specific overrides.1314### Headings1516- One H1 (`#`) per document — the document title17- Never skip heading levels (H2 → H4 is wrong, use H2 → H3)18- Blank line before and after every heading19- Use ATX-style headings (`#`), never Setext (underlines)2021### Code Blocks2223- Always specify a language identifier on fenced code blocks24- Common identifiers: `python`, `bash`, `json`, `yaml`, `sql`, `text`, `markdown`, `javascript`, `typescript`, `go`, `rust`, `html`, `css`, `toml`, `xml`, `diff`25- Use `text` for plain output that has no specific language26- Use `bash` for shell commands, not `sh` or `shell`2728### Tables2930- Always space-align columns for readability31- Use pipe tables (GFM standard)32- Align separator row dashes to match column width33- Right-align numeric columns with `:` in separator34- Run `${CLAUDE_PLUGIN_ROOT}/skills/md-expert/scripts/format-tables.py` to auto-fix table alignment35- For reference on table formatting patterns, read `${CLAUDE_PLUGIN_ROOT}/skills/md-expert/references/table-formatting.md`3637### Spacing3839- Blank line before and after: headings, lists, code blocks, tables, blockquotes40- No trailing whitespace on any line41- Single blank line between sections (never double)42- Files end with a single newline4344### Links4546- Prefer reference-style links when the same URL appears more than once47- Use relative paths for internal links within the same repository48- Use descriptive link text — never "click here" or bare URLs in prose4950### Lists5152- Use `-` for unordered lists (consistent, not mixed `*` and `-`)53- Use `1.` for all ordered list items (auto-numbering)54- Indent nested lists by 4 spaces5556## Tools5758Use these tools to validate and fix markdown quality:5960| Tool | Command | Purpose |61|-----------------------|-----------------------------------|-------------------|62| **markdownlint-cli2** | `markdownlint-cli2 "**/*.md"` | Structure linting |63| **vale** | `vale file.md` | Prose quality |64| **mdformat** | `mdformat file.md` | Auto-formatting |65| **doctoc** | `doctoc file.md` | TOC generation |66| **lychee** | `lychee file.md` | Link validation |6768Run tools in this order: `mdformat` first to auto-fix formatting, then `markdownlint-cli2` for structural issues, then `vale` for prose quality. Use `lychee` last since it hits the network.6970## Document Structure7172Follow standard section ordering. For detailed guidance, read `${CLAUDE_PLUGIN_ROOT}/skills/md-expert/references/document-structure.md`.73741. Title (H1)752. Brief description / overview763. Table of contents (for documents with 4+ sections)774. Main content sections (H2)785. Examples / usage796. Reference / appendix8081## Linting8283For the complete set of universal markdownlint rules and vale style configuration, read `${CLAUDE_PLUGIN_ROOT}/skills/md-expert/references/linting-rules.md`.8485Key rules enforced:8687- MD001: Heading levels increment by one88- MD003: ATX-style headings89- MD009: No trailing spaces90- MD012: No multiple consecutive blank lines91- MD022: Headings surrounded by blank lines92- MD031: Fenced code blocks surrounded by blank lines93- MD040: Fenced code blocks have a language identifier94- MD047: Files end with a single newline