Pre-push quality check for markdown documentation. Catches formatting issues that would render incorrectly on GitHub — broken numbered lists, heading hierarchy problems, inconsistent spacing, malformed tables — and fixes what it can automatically.
Never changes your words. Only formatting.
Invoke via slash command:
/md-linter
Or just ask naturally:
- "Check my documents before I push"
- "I just wrote a new policy, check it"
- "My numbered list is rendering wrong"
- "Fix all markdown errors"
- "Set up linting for this repo"
/md-linter:mdlinter [mode] [scope]
- mode:
check(default, report only) orfix(apply changes) - scope: specific files, a folder, or omit for changed-files-only
Examples:
/md-linter:mdlinter # check changed files
/md-linter:mdlinter fix # fix changed files
/md-linter:mdlinter policies/access-control.md # check one document
/md-linter:mdlinter fix docs/ # fix everything in docs/
| Issue | Why it matters |
|---|---|
| Numbered lists breaking apart | Steps with sub-content (paragraphs, diagrams, code) between them render as separate lists restarting at 1 |
| Heading hierarchy jumps | Jumping from h2 to h4 confuses document structure |
| Spacing inconsistencies | Extra blank lines, missing blank lines before lists |
| Malformed tables | Missing pipes, inconsistent column counts |
| Bold text as headings | **Section** should be ## Section |
| Mermaid diagram fencing | Malformed fences render as raw text instead of diagrams |
| GitHub callout typos | [!WARINING] renders as plain text instead of a styled box |
Write → Lint → Push → Read
- You write your documents in markdown
- You run
/md-linter— it scans only the files you changed - It auto-fixes what it can (spacing, blank lines, trailing whitespace)
- It walks you through anything that needs your attention
- You push clean, well-formatted documents to GitHub
The skill runs a 6-phase workflow:
- Setup — verifies
markdownlint-cli2is available (vianpx) - Scan — lints the scoped files, produces an error inventory
- Analyze — categorizes errors, flags what needs manual attention
- Auto-fix — runs
--fixfor everything markdownlint can handle - Manual fixes — guides you through remaining issues with reference docs
- Verify — re-runs the linter to confirm everything is clean
On agents that support subagents (Claude Code, Codex, etc.), phases 1-3 run in a background subagent to keep your conversation clean. On agents without subagent support, all phases run inline — same workflow, just more visible output. Phases 4-6 are always interactive — you approve changes and make decisions.
The skill includes two reference guides, loaded only when needed:
references/MD029-Fix-Guide.md— Ordered list issues. The most common problem in procedural documents: content between numbered steps breaks list continuity. Root cause is always indentation.references/MD036-Guide.md— Bold-text-as-heading issues. Common when writing documents by hand.
Creates .markdownlint-cli2.jsonc if none exists:
{
"config": {
"MD013": false
},
"ignores": []
}MD013 (line length) is disabled by default — long lines in documentation are normal and shouldn't be flagged.
The linter fixes formatting. It does not touch the words you wrote. If a lint rule can only be satisfied by changing what your text says, the skill reports it to you and lets you decide — it will never silently rewrite your content.
This skill follows the Agent Skills open standard and works with any compatible agent — Claude Code, Codex, Cursor, Goose, Gemini CLI, and others.
MIT — see LICENSE.
Forked from s2005/markdown-linter-fixer-skill. Built on markdownlint-cli2 by David Anson.