Use whenever creating, substantially rewriting, or upgrading ANY Markdown (.md) file — READMEs, docs, plans, architecture notes, reports, summaries, runbooks, comparisons — including when the user as…
Plain walls of text are a failure mode. Every markdown document you produce must communicate visually first, textually second: show the structure in a diagram or table, then explain in prose.
Target renderer is GitHub-flavored markdown (GitHub, VS Code, GitLab, Obsidian all render it). Mermaid and alerts render natively on GitHub — use them freely.
| If the content contains… | Render it as… |
|---|---|
| Steps, workflow, pipeline, decision logic | flowchart |
| Two+ components exchanging messages (API calls, auth flows) | sequenceDiagram |
| System / service architecture | flowchart with subgraph blocks |
| Lifecycle, statuses, transitions | stateDiagram-v2 |
| Schedule, phases, milestones, deadlines | gantt |
| Chronological events, history, roadmap | timeline |
| Database schema, entities and relations | erDiagram |
| Proportions, percentage breakdown | pie |
| Class / type hierarchies | classDiagram |
| Git branching strategy | gitGraph |
| Hierarchical concepts, brainstorm | mindmap |
| Options compared against criteria | Table with ✅ / ⚠️ / ❌ cells |
| Key numbers / metrics | Compact table or bold inline stats, never buried in prose |
| Warnings, tips, prerequisites, gotchas | GitHub alerts (> [!WARNING] etc.) |
| Long logs, raw output, optional deep-dives | <details><summary> collapsible |
| Task/progress status | ✅ 🔄 ⏳ ❌ markers or █████░░░░░ 50% bars |
| Document longer than ~4 sections | Table of contents with anchor links |
These prevent the most common render failures — full details in the cheatsheet:
( ) [ ] { } # ; : or other punctuation in double quotes: A["Deploy (prod)"].end as a node ID in flowcharts — it terminates subgraphs. Use End or finish.<br/> for line breaks inside labels, not \n.flowchart over the legacy graph keyword.%%{init}%% theme overrides unless asked — GitHub's default themes handle light/dark mode automatically.When asked to upgrade/beautify/redesign an existing markdown file (e.g. /markdown-design path/to/file.md), redesign its layout without changing its meaning:
<details>; scattered status words → status markers; missing summary line or TOC → add them.Hard rules for retrofits:
<a id="old-anchor"></a>.Visual ≠ decorated. Do not force diagrams onto content with no structure (changelogs, short answers, license files, code-heavy snippets). A 5-line note stays a 5-line note. Emoji are for status semantics (✅ ❌ ⚠️), not sprinkles — never more than one per line, none in headings unless the doc already uses them.