lint-clean-markdown
Skill0 starsChanged 4 months agoMITView on GitHub
Write markdown that passes markdownlint on first attempt — encode the most common rules as muscle memory
1 other project uses a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- fabioc-aloha/alex-cognitive-architectureedited, first seen Apr 26, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 1
- fabioc-aloha/alex-cognitive-architecture★ 076% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository38 other files it gives its agents.
- .github/copilot-instructions.mdCopilot instructions
- agent-creatorSkill
- agent-reviewSkill
- ai-memory-setupSkill
- alex-banner-generationSkill
- anti-hallucinationSkill
- brain-auditSkill
- browser-toolsSkill
- code-reviewSkill
- creative-writingSkill
- critical-thinkingSkill
- deep-reviewSkill
- doc-hygieneSkill
- docx-to-mdSkill
- git-workflowSkill
- greeting-checkinSkill
- html-to-mdSkill
- humanizerSkill
- instruction-creatorSkill
- instruction-reviewSkill
- markdown-mermaidSkill
- markdown-sanitization-chainSkill
- md-to-emlSkill
- md-to-htmlSkill
- md-to-txtSkill
- md-to-wordSkill
- meditationSkill
- planSkill
- problem-framing-auditSkill
- prompt-creatorSkill
- prompt-reviewSkill
- security-and-hardeningSkill
- skill-creatorSkill
- skill-reviewSkill
- spikeSkill
- status-reportingSkill
- systematic-debuggingSkill
- test-driven-developmentSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 4 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 100
Document metadata blocks (Date / Author / Status / Audience / Trigger) at the top of decision docs, ADRs, READMEs
- Very specific: line 127
When showing a template/pattern (not a renderable diagram), use
text instead ofmermaid . - Very specific: line 131
Every `mermaid block must declare its diagram type on the first line (flowchart TB, sequenceDiagram, etc.) — otherwise it renders blank.
- Very specific: line 137
Use inline code for short examples:
js - Distinctive: line 138
Use descriptions instead of showing wrong examples literally
- Distinctive: line 139
Use single examples showing only the correct form
- Distinctive: line 145
Before writing markdown, plan for:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Lint-Clean Markdown
Eliminate the edit-lint-fix cycle by writing markdown correctly the first time.
When to Use
- Authoring any markdown file in this brain or in heir documentation
- Reviewing a PR that touches
.mdfiles - The file just hit MD031, MD032, MD022, or MD060 errors
The Golden Rule
When in doubt: add a blank line.
Roughly 90% of markdown lint errors are missing blank lines. Lists, code blocks, and headings all need breathing room.
Core Rules Quick Reference
| Rule | Code | Pattern | Mnemonic |
| Blank lines around lists | MD032 | \n- item\n- item\n | "Lists breathe" |
| Blank lines around fences | MD031 | \n\``code```\n` | "Code breathes" |
| Blank line before headings | MD022 | text\n\n## Head | "Headers breathe" |
| Use dash for lists | MD004 | - not * or + | "Dash dash dash" |
| No trailing whitespace | MD009 | No spaces at line end | "Clean endings" |
| Hard line break in prose | (no MD code) | End line with \ then newline | "Backslash breaks" |
| Single final newline | MD047 | One \n at EOF | "One newline" |
| Language on fences | MD040 | ```js not ``` | "Name your code" |
| Consistent fence style | MD046 | Use ``` not indent | "Fences only" |
| No bold as heading | MD036 | Use ## not **text** | "Headers are headers" |
| Table separator spacing | MD060 | Space around pipes | "Tables breathe too" |
Rule Details
MD032: Blank Lines Around Lists
❌ Wrong: text immediately before/after list
✅ Correct: blank line before first - AND after last -
**Why**:
- Reason one
- Reason two
**Result**: SomethingMD031: Blank Lines Around Code Blocks
❌ Wrong: text touching the fence markers
✅ Correct: blank line before opening ``` AND after closing ```
MD022: Blank Lines Before Headings
❌ Wrong: Some text.\n## Heading
✅ Correct: Some text.\n\n## Heading
Hard Line Breaks in Prose (the metadata-block trap)
The problem: Markdown collapses consecutive lines into one wrapped paragraph. A block of metadata like **Date**:, **Author**:, **Status**: on consecutive lines renders as one run-on sentence unless you force breaks.
The wrong fixes:
- Two trailing spaces (
text) — works in most renderers, but lints as MD009 (no trailing whitespace) and is invisible in source review. - Empty lines between every item — turns the metadata block into a wall of paragraphs with massive vertical spacing.
<br/>tag — works but mixes HTML into prose markdown; flagged as MD033 in many configs.
The right fix: end each line with a backslash (\) followed by a newline. This is the CommonMark hard-line-break form. Renders identically to two spaces, but is visible in source review and lints clean.
❌ Wrong (renders as one wrapped paragraph):
**Date**: 2026-05-01
**Author**: Supervisor
**Status**: Analysis✅ Correct (renders as three lines):
**Date**: 2026-05-01 \
**Author**: Supervisor \
**Status**: AnalysisNote the spacing: one space before the backslash, then the newline. The last line in the block does not need the backslash (no break needed after the final line).
When this rule fires:
- Document metadata blocks (Date / Author / Status / Audience / Trigger) at the top of decision docs, ADRs, READMEs
- Address blocks, contact-info blocks
- Any list of consecutive
**Label**: valuelines that should visually be separate but should not have full paragraph spacing between them - Poetry, lyrics, or any prose where line breaks are semantic
Not applicable in these cases:
- Inside a real Markdown list (use
-or1.instead) - Inside a table (use
<br/>for in-cell line breaks) - Inside a code fence (literal newlines work; no special handling needed)
MD004: Use Dash for Unordered Lists
❌ Wrong: * item or + item
✅ Correct: - item
MD040: Specify Language on Fenced Code
❌ Wrong: ``` (no language)
✅ Correct: ```javascript or ```text or ```markdown
Mermaid-Specific Rules
Template Blocks Use text
When showing a template/pattern (not a renderable diagram), use ```text instead of ```mermaid. The Mermaid parser will fail on placeholder text like [DIAGRAM_TYPE].
Diagram Type Required
Every ```mermaid block must declare its diagram type on the first line (flowchart TB, sequenceDiagram, etc.) — otherwise it renders blank.
Nested Code Block Problem
You cannot nest fenced code blocks in markdown. When documenting code-block rules:
- Use inline code for short examples:
`js` - Use descriptions instead of showing wrong examples literally
- Use single examples showing only the correct form
This skill itself demonstrates the solution.
Pre-Write Mental Checklist
Before writing markdown, plan for:
- ☐ Will I have lists? → blank lines around them
- ☐ Will I have code blocks? → blank lines around them
- ☐ Will I show "wrong" examples? → can't nest fences, describe instead
- ☐ Will I have tables? → need
| ---- |separator row - ☐ Will I have mermaid? → diagram type after init
Related
- markdown-mermaid — full markdown + Mermaid style guide
- markdown-mermaid § Mode Fragility — silent render failures
Falsifiability
- This skill has failed if markdown produced after activation still fails markdownlint with the same violation classes the skill explicitly addresses
- The rule set is stale if markdownlint releases new defaults this skill contradicts
- Wrong if the formatting constraints reduce readability rather than improve it (user consistently overrides the prescribed style)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

