Comprehensive markdown and Mermaid diagram writing skill. Use when creating any scientific document, report, analysis, or visualization. Establishes text-based diagrams as the default documentation standard with full style guides (markdown + mermaid), 24 diagram type references,
Installs just this skill. Get the whole plugin for auto-invocation.
โก How it fires
How this skill gets triggered: by you, by Claude, or both.
Fires itselfClaude auto-loads it when your prompt matches the work.
You can call itInvoke it directly when you want it.
Slash command/markdown-mermaid-writing
๐๏ธ Context preview
The summary Claude sees to decide when to auto-load this skill.
Comprehensive markdown and Mermaid diagram writing skill. Use when creating any scientific document, report, analysis, or visualization. Establishes text-based diagrams as the default documentation standard with full style guides (markdown + mermaid), 24 diagram type references,
๐ Stats
Stars31,545
Forks3,146
LanguagePython
LicenseMIT
๐ฆ Ships with scientific-agent-skills
</> SKILL.md
markdown-mermaid-writing.SKILL.md
---name: markdown-mermaid-writing
description: Comprehensive markdown and Mermaid diagram writing skill. Use when creating any scientific document, report, analysis, or visualization. Establishes text-based diagrams as the default documentation standard with full style guides (markdown + mermaid), 24 diagram type references, and 9 document templates.
allowed-tools: Read Write Edit Bash
license: Apache-2.0
metadata: {"version": "1.1", "skill-author": "Clayton Young / Superior Byte Works, LLC (@borealBytes)", "skill-source": "https://github.com/SuperiorByteWorks-LLC/agent-project", "skill-version": "1.0.0", "skill-contributors": "Clayton Young (Superior Byte Works, LLC / @borealBytes; Author and originator); K-Dense Team (K-Dense Inc.; Integration target and community feedback)"}
---# Markdown and Mermaid Writing
## Overview
This skill teaches you โ and enforces a standard for โ creating scientific documentation
using **markdown with embedded Mermaid diagrams as the default and canonical format**.
The core bet: a relationship expressed as a Mermaid diagram inside a `.md` file is more
valuable than any image. It is text, so it diffs cleanly in git. It requires no build step.
It renders natively on GitHub, GitLab, Notion, VS Code, and any markdown viewer. It uses
fewer tokens than a prose description of the same relationship. And it can always be
converted to a polished image later โ but the text version remains the source of truth.
| Renders without a build step | โ | โ needs hosting |
| Parseable by AI without vision | โ | โ |
| Works in GitHub / GitLab / Notion | โ | โ ๏ธ if hosted |
| Accessible (screen readers) | โ accTitle/accDescr | โ ๏ธ needs alt text |
| Convertible to image later | โ anytime | โ already image |
### The three-phase workflow
```mermaid
flowchart LR
accTitle: Three-Phase Documentation Workflow
accDescr: Phase 1 Mermaid in markdown is always required and is the source of truth. Phases 2 and 3 are optional downstream conversions for polished output.
p1["๐ Phase 1<br/>Mermaid in Markdown<br/>(ALWAYS โ source of truth)"]
p2["๐ Phase 2<br/>Python Generated<br/>(optional โ data charts)"]
Before writing any `.md` file: read `references/markdown_style_guide.md`.
Key rules to internalize:
- **One H1 per document** โ the title. Never more.
- **Emoji on H2 headings only** โ one emoji per H2, none in H3/H4
- **Cite everything** โ every external claim gets a footnote `[^N]` with full URL
- **Bold sparingly** โ max 2-3 bold terms per paragraph, never full sentences
- **Horizontal rule after every `</details>`** โ mandatory
- **Tables over prose** for comparisons, configurations, structured data
- **Diagrams over walls of text** โ if it describes flow, structure, or relationships, add Mermaid
### Step 3: Pick the diagram type and read its guide
Before creating any Mermaid diagram: read `references/mermaid_style_guide.md`.
Then open the specific type file (e.g., `references/diagrams/flowchart.md`) for the exemplar, tips, and copy-paste template.
Mandatory rules for every diagram:
```
accTitle: Short Name 3-8 Words
accDescr: One or two sentences explaining what this diagram shows.
```
- **No `%%{init}` directives** โ breaks GitHub dark mode
- **No inline `style`** โ use `classDef` only
- **One emoji per node max** โ at the start of the label
- **`snake_case` node IDs** โ match the label
### Step 4: Write the document
Start from the template. Apply the markdown style guide. Place diagrams inline with related text โ not in a separate "Figures" section.
### Step 5: Commit as text
The `.md` file with embedded Mermaid is what gets committed. If you also generated a PNG or AI image, those are supplementary โ the markdown is the source.
---
## โ ๏ธ Common pitfalls
### Radar chart syntax (`radar-beta`)
**WRONG:**
```mermaid
radar
title Example
x-axis ["A", "B", "C"]
"Series" : [1, 2, 3]
```
**CORRECT:**
```mermaid
radar-beta
title Example
axis a["A"], b["B"], c["C"]
curve series["Series"]{1, 2, 3}
max 3
```
- **Use `radar-beta`** not `radar` (the bare keyword doesn't exist)
- **Use `axis`** to define dimensions, **not** `x-axis`
- **Use `curve`** to define data series, **not** quoted labels with colon
- **No `accTitle`/`accDescr`** โ radar-beta doesn't support accessibility annotations; always add a descriptive italic paragraph above the diagram
### Forgetting `accTitle`/`accDescr` on supported types
Only some diagram types support `accTitle`/`accDescr`. For those that don't, always place a descriptive italic paragraph directly above the code block:
> _Radar chart comparing three methods across five performance dimensions. Note: Radar charts do not support accTitle/accDescr._
```mermaid
radar-beta
...
```
---
## ๐ Integration with other skills
### With `scientific-schematics`
`scientific-schematics` generates AI-powered publication-quality images (PNG). Use the Mermaid diagram as the **brief** for the schematic:
```
Workflow:
1. Create the concept as Mermaid in .md (this skill โ Phase 1)
2. Describe the same concept to scientific-schematics for a polished PNG (Phase 3)
3. Commit both โ the .md as source, the PNG as a supplementary figure
```
### With `scientific-writing`
When `scientific-writing` produces a manuscript, all diagrams and structural figures should use this skill's standards. The writing skill handles prose and citations; this skill handles visual structure.
```
Workflow:
1. Use scientific-writing to draft the manuscript
2. For every figure that shows a workflow, architecture, or relationship:
- Replace placeholder with a Mermaid diagram following this skill's guide
3. Use scientific-schematics only for figures that truly need photorealistic/complex rendering
```
### With `literature-review`
Literature review produces summaries with lots of relationship data. Use this skill to:
- Create concept maps (Mindmap) of the literature landscape
- Show publication timelines (Timeline or Gantt)
- Compare methodologies (Quadrant or Radar)
- Diagram data flows described in papers (Sequence or Flowchart)
### With any skill that produces output documents
Before finalizing any document from any skill, apply this skill's checklist:
- [ ] Does the document use a template? If so, did I start from the right one?
- [ ] Are all diagrams in Mermaid with `accTitle` + `accDescr`?
- [ ] No `%%{init}`, no inline `style`, only `classDef`?
`assets/examples/example-research-report.md` โ a complete scientific research report demonstrating proper heading hierarchy, multiple diagram types (flowchart, sequence, gantt), tables, footnote citations, collapsible sections, and all style guide rules applied.
---
## ๐ Attribution
All style guides, diagram type guides, and document templates in this skill are ported from the `SuperiorByteWorks-LLC/agent-project` repository under the Apache-2.0 License.
- **Author**: Clayton Young / Superior Byte Works, LLC (@borealBytes)
- **License**: Apache-2.0
This skill (as part of scientific-agent-skills) is distributed under the MIT License. The included Apache-2.0 content is compatible for downstream use with attribution retained, as preserved in the file headers throughout this skill.
---
[^1]: GitHub Blog. (2022). "Include diagrams in your Markdown files with Mermaid." https://github.blog/2022-02-14-include-diagrams-markdown-files-mermaid/
[^2]: Mermaid. "Mermaid Diagramming and Charting Tool." https://mermaid.js.org/