Markdown and Mermaid Writing Skill

Markdown and Mermaid Writing Skill

Guides an AI agent in writing scientific Markdown documents with Mermaid diagrams for workflows, timelines and schemas, with templates, style guides and rendering checks.

Skill files38 files

references/

templates/

assets/examples/

references/diagrams/

SKILL.md344 lines
1
---
2
name: markdown-mermaid-writing
3
description: Writes scientific Markdown documentation and Mermaid diagrams for workflows, relationships, timelines, and schemas. Provides syntax references, document templates, accessibility guidance, and version-aware rendering checks. Use when a user requests Markdown, Mermaid, or a text-based structural diagram; quantitative scientific figures require suitable plotting tools.
4
allowed-tools: Read Write Edit Bash
5
license: Apache-2.0
6
compatibility: Markdown authoring needs no runtime. Local rendering targets Mermaid and Mermaid CLI 12.0.0, Node.js 22.13+ and a supported Chromium browser. Package or CDN installation needs network access; no credentials required.
7
metadata:
8
version: "1.3"
9
last-reviewed: "2026-10-01"
10
mermaid-tested: "12.0.0"
11
mermaid-cli-tested: "12.0.0"
12
skill-author: Clayton Young / Superior Byte Works, LLC (@borealBytes)
13
skill-source: https://github.com/SuperiorByteWorks-LLC/agent-project
14
skill-version: 1.0.0
15
skill-contributors: Clayton Young (Superior Byte Works, LLC / @borealBytes; Author and originator); K-Dense Team (K-Dense Inc.; Integration target and community feedback)
16
---
17
18
# Markdown and Mermaid Writing
19
20
## Overview
21
22
This skill provides an optional house style for **Markdown documentation with Mermaid
23
structural diagrams**. Follow the requested output format, existing repository conventions,
24
and journal requirements first. This skill does not replace scientific analysis or plotting.
25
26
A relationship expressed as Mermaid inside a `.md` file is editable text that diffs
27
cleanly in git. A compatible host renders it without a separate user build step.
28
It renders where the host has Mermaid support; plain Markdown viewers may show only code,
29
and platforms/extensions ship different Mermaid versions. It uses
30
a compact source representation, though token use depends on the diagram. Exporting
31
SVG/PNG requires a renderer; retain the diagram source alongside exported figures.
32
33
> "The more you get your reports and files in .md in just regular text, which mermaid is
34
> as well as being a simple 'script language'. This just helps with any downstream rendering
35
> and especially AI generated images (using mermaid instead of just long form text to
36
> describe relationships < tokens). Additionally mermaid can render along with markdown for
37
> easy use almost anywhere by humans or AI."
38
>
39
> — Clayton Young (@borealBytes), K-Dense Discord, 2026-02-19
40
41
## When to Use This Skill
42
43
Use this skill when:
44
45
- Writing a requested Markdown report, README, methods overview, or research note
46
- Diagramming a workflow, data pipeline, schema, state machine, or conceptual relationship
47
- Maintaining editable Mermaid sources and their rendered SVG/PNG exports
48
49
Use scientific plotting tools directly for measured data, uncertainty, statistical graphics,
50
exact geometry, or publication figures that Mermaid cannot faithfully represent. Mermaid
51
is not a required precursor to a quantitative chart or an existing SVG/code-native asset.
52
53
## 🎨 The Source Format Philosophy
54
55
### Why text-based diagrams win
56
57
| What matters | Mermaid in Markdown | Python / AI Image |
58
| ----------------------------- | :-----------------: | :---------------: |
59
| Git diff readable | ✅ text source | Plotting code/SVG can also be text |
60
| Editable source | ✅ | Plotting scripts and vector sources are editable |
61
| Compact relationship notation | Often | Depends on representation |
62
| Native preview | Host/version dependent | Viewer/format dependent |
63
| Parseable by AI without vision | ✅ | ❌ |
64
| Works in destination | Check Mermaid support and version | Check image format support |
65
| Accessible (screen readers) | Check SVG metadata and text alternative | Provide alt text/data table |
66
| Convertible to image later | ✅ anytime | — already image |
67
68
### The three-phase workflow
69
70
```mermaid
71
flowchart LR
72
accTitle: Three-Phase Documentation Workflow
73
accDescr: Markdown holds the structural diagram source. Quantitative charts come from data and plotting code; optional illustrations require a separate factual review.
74
75
p1["📄 Phase 1<br/>Mermaid in Markdown<br/>(structural source)"]
76
p2["🐍 Phase 2<br/>Python Generated<br/>(optional — data charts)"]
77
p3["🎨 Phase 3<br/>AI Generated Visuals<br/>(optional — polish)"]
78
out["📊 Final Deliverable"]
79
80
p1 --> out
81
data["Data and plotting code"] --> p2
82
p1 -.->|"when needed"| p3
83
p2 --> out
84
p3 --> out
85
86
classDef required fill:#dbeafe,stroke:#2563eb,stroke-width:2px,color:#1e3a5f
87
classDef optional fill:#fef9c3,stroke:#ca8a04,stroke-width:2px,color:#713f12
88
classDef output fill:#dcfce7,stroke:#16a34a,stroke-width:2px,color:#14532d
89
90
class p1 required
91
class p2,p3 optional
92
class out output
93
```
94
95
Retain Mermaid for structural diagrams and data/code for quantitative charts. An AI illustration
96
is not a quantitative conversion; verify every label and relationship against its sources.
97
98
### What Mermaid can express
99
100
This skill includes 23 diagram-type guides plus a composition guide. Mermaid supports
101
additional types; these references are a curated subset, not an exhaustive version catalogue:
102
103
| Use case | Diagram type | File |
104
| -------------------------------------------- | ---------------- | ---------------------------------------------------- |
105
| Experimental workflow / decision logic | Flowchart | `references/diagrams/flowchart.md` |
106
| Service interactions / API calls / messaging | Sequence | `references/diagrams/sequence.md` |
107
| Data model / schema | ER diagram | `references/diagrams/er.md` |
108
| State machine / lifecycle | State | `references/diagrams/state.md` |
109
| Project timeline / roadmap | Gantt | `references/diagrams/gantt.md` |
110
| Proportions / composition | Pie | `references/diagrams/pie.md` |
111
| System architecture (zoom levels) | C4 | `references/diagrams/c4.md` |
112
| Concept hierarchy / brainstorm | Mindmap | `references/diagrams/mindmap.md` |
113
| Chronological events / history | Timeline | `references/diagrams/timeline.md` |
114
| Class hierarchy / type relationships | Class | `references/diagrams/class.md` |
115
| User journey / satisfaction map | User Journey | `references/diagrams/user_journey.md` |
116
| Two-axis comparison / prioritization | Quadrant | `references/diagrams/quadrant.md` |
117
| Requirements traceability | Requirement | `references/diagrams/requirement.md` |
118
| Flow magnitude / resource distribution | Sankey | `references/diagrams/sankey.md` |
119
| Numeric trends / bar + line charts | XY Chart | `references/diagrams/xy_chart.md` |
120
| Component layout / spatial arrangement | Block | `references/diagrams/block.md` |
121
| Work item status / task columns | Kanban | `references/diagrams/kanban.md` |
122
| Cloud infrastructure / service topology | Architecture | `references/diagrams/architecture.md` |
123
| Multi-dimensional comparison / skills radar | Radar | `references/diagrams/radar.md` |
124
| Hierarchical proportions / budget | Treemap | `references/diagrams/treemap.md` |
125
| Binary protocol / data format | Packet | `references/diagrams/packet.md` |
126
| Git branching / merge strategy | Git Graph | `references/diagrams/git_graph.md` |
127
| Code-style sequence (programming syntax) | ZenUML | `references/diagrams/zenuml.md` |
128
| Multi-diagram composition patterns | Complex Examples | `references/diagrams/complex_examples.md` |
129
130
> 💡 **Pick the right type, not the easy one.** Don't default to flowcharts for everything.
131
> A timeline beats a flowchart for chronological events. A sequence beats a flowchart for
132
> service interactions. Scan the table and match.
133
134
---
135
136
## 🔧 Core workflow
137
138
### Step 1: Identify the document type
139
140
Check if a template exists before writing from scratch:
141
142
| Document type | Template |
143
| ------------------------------ | ----------------------------------------------- |
144
| Pull request record | `templates/pull_request.md` |
145
| Issue / bug / feature request | `templates/issue.md` |
146
| Sprint / project board | `templates/kanban.md` |
147
| Architecture decision (ADR) | `templates/decision_record.md` |
148
| Presentation / briefing | `templates/presentation.md` |
149
| Research paper / analysis | `templates/research_paper.md` |
150
| Project documentation | `templates/project_documentation.md` |
151
| How-to / tutorial | `templates/how_to_guide.md` |
152
| Status report | `templates/status_report.md` |
153
154
### Step 2: Read the style guide
155
156
For this Markdown workflow, read `references/markdown_style_guide.md`. Treat emoji,
157
heading counts, and horizontal rules as house style rather than Markdown syntax requirements.
158
159
Key rules to internalize:
160
161
- **One H1 per document** — the title. Never more.
162
- **Emoji on H2 headings only** — one emoji per H2, none in H3/H4
163
- **Support factual claims** — use verified sources and the requested citation format
164
- **Bold sparingly** — max 2-3 bold terms per paragraph, never full sentences
165
- **Optional horizontal rules** after `</details>` when they improve separation
166
- **Tables over prose** for comparisons, configurations, structured data
167
- **Diagrams over walls of text** — if it describes flow, structure, or relationships, add Mermaid
168
169
### Step 3: Pick the diagram type and read its guide
170
171
Before creating any Mermaid diagram: read `references/mermaid_style_guide.md`.
172
173
Then open the specific type file (e.g., `references/diagrams/flowchart.md`) for the exemplar, tips, and copy-paste template.
174
175
Add accessibility metadata for types that emit it in the chosen renderer:
176
177
```
178
accTitle: Short Name 3-8 Words
179
accDescr: One or two sentences explaining what this diagram shows.
180
```
181
182
- Prefer host themes; `%%{init}` directives are deprecated in favor of YAML configuration
183
- Prefer reusable `classDef` where supported; style syntax is diagram-specific
184
- **One emoji per node max** — at the start of the label
185
- Use descriptive IDs with the type's syntax: `snake_case` works for flowcharts; ER/class/state conventions differ
186
187
### Step 4: Write the document
188
189
Start from the template. Apply the markdown style guide. Place diagrams inline with related text — not in a separate "Figures" section.
190
191
Render in the **actual destination** before delivery. Check its Mermaid version and
192
plugin requirements before choosing newer diagram types; [GitHub documents an `info`
193
diagram for this check](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-diagrams).
194
A successful latest-version local preview does not establish GitHub or another host
195
will render it. Where Mermaid is unsupported, supply a rendered SVG/PNG with a text
196
description alongside the retained `.md` source.
197
198
### Step 5: Retain source and verification
199
200
Keep the `.md` source, rendered deliverable, and tested renderer version together.
201
Follow the project's version-control workflow; this skill does not itself authorize a commit or publication.
202
For CLI export, embedding, and the tested accessibility matrix, read
203
[Current rendering and validation](references/current-rendering.md).
204
205
---
206
207
## ⚠️ Common pitfalls
208
209
### Radar chart syntax (`radar-beta`)
210
211
**WRONG (shown as text so it does not break the document renderer):**
212
```text
213
radar
214
title Example
215
x-axis ["A", "B", "C"]
216
"Series" : [1, 2, 3]
217
```
218
219
**CORRECT:**
220
```mermaid
221
radar-beta
222
accTitle: Example Radar Scores
223
accDescr: Illustrative values of one, two, and three on a shared zero-to-three scale.
224
title Example
225
axis a["A"], b["B"], c["C"]
226
curve series["Series"]{1, 2, 3}
227
max 3
228
```
229
230
- **Use `radar-beta`** not `radar` (the bare keyword doesn't exist)
231
- **Use `axis`** to define dimensions, **not** `x-axis`
232
- **Use `curve`** to define data series, **not** quoted labels with colon
233
- Mermaid 12.0.0 radar emits `accTitle`/`accDescr`; check older hosts and retain a visible description
234
235
### XY Chart vs Radar confusion
236
237
| Diagram | Keyword | Axis syntax | Data syntax |
238
| ------- | ------- | ----------- | ----------- |
239
| **XY Chart** (bars/lines) | `xychart-beta` | `x-axis ["Label1", "Label2"]` | `bar [10, 20]` or `line [10, 20]` |
240
| **Radar** (spider/web) | `radar-beta` | `axis id["Label"]` | `curve id["Label"]{10, 20}` |
241
242
### Forgetting `accTitle`/`accDescr` on supported types
243
244
Only some diagram types support `accTitle`/`accDescr`. For those that don't, always place a descriptive italic paragraph directly above the code block:
245
246
> _Radar chart comparing three methods on a stated, common score scale. See the data table for exact values._
247
248
```text
249
radar-beta
250
...
251
```
252
253
---
254
255
## 🔗 Integration with other skills
256
257
### With `scientific-schematics`
258
259
`scientific-schematics` generates AI-powered publication-quality images (PNG). Use the Mermaid diagram as the **brief** for the schematic:
260
261
```
262
Workflow:
263
1. Create the concept as Mermaid in .md (this skill — Phase 1)
264
2. Describe the same concept to scientific-schematics for a polished PNG (Phase 3)
265
3. Commit both — the .md as source, the PNG as a supplementary figure
266
```
267
268
### With `scientific-writing`
269
270
For a manuscript that uses Mermaid structural figures, this skill handles diagram syntax.
271
Follow the manuscript's required figure formats and scientific visualization conventions.
272
273
```
274
Workflow:
275
1. Use scientific-writing to draft the manuscript
276
2. For every figure that shows a workflow, architecture, or relationship:
277
- Replace placeholder with a Mermaid diagram following this skill's guide
278
3. Use plotting or schematic tools where appropriate to the scientific content
279
```
280
281
### With `literature-review`
282
283
Literature review produces summaries with lots of relationship data. Use this skill to:
284
285
- Create concept maps (Mindmap) of the literature landscape
286
- Show publication timelines (Timeline or Gantt)
287
- Compare methodologies (Quadrant or Radar)
288
- Diagram data flows described in papers (Sequence or Flowchart)
289
290
### With any skill that produces output documents
291
292
Before finalizing a document using this skill, check:
293
294
- [ ] Does the document use a template? If so, did I start from the right one?
295
- [ ] Is each diagram in an appropriate format, with working accessibility metadata or a text alternative?
296
- [ ] Is configuration supported by the destination and tested in light/dark themes?
297
- [ ] Do citations support external claims, and are synthetic values labeled?
298
- [ ] One H1, emoji on H2 only?
299
- [ ] Does the final Markdown/HTML structure render correctly?
300
301
---
302
303
## 📚 Reference index
304
305
### Style guides
306
307
| Guide | Path | Lines | What it covers |
308
| ----------------------- | ------------------------------------------- | ----- | -------------------------------------------------- |
309
| Markdown Style Guide | `references/markdown_style_guide.md` | see file | Headings, formatting, citations, tables, Mermaid integration, templates, quality checklist |
310
| Mermaid Style Guide | `references/mermaid_style_guide.md` | see file | Accessibility, emoji set, color classes, theme neutrality, type selection, complexity tiers |
311
| Current Rendering | `references/current-rendering.md` | see file | Mermaid 12 changes, CLI export, browser APIs, tested accessibility matrix, scientific checks |
312
313
### Diagram guides (23 types plus composition)
314
315
Each file contains: production-quality exemplar, tips specific to that type, and a copy-paste template.
316
317
`references/diagrams/` — architecture, block, c4, class, complex\_examples, er, flowchart, gantt, git\_graph, kanban, mindmap, packet, pie, quadrant, radar, requirement, sankey, sequence, state, timeline, treemap, user\_journey, xy\_chart, zenuml
318
319
### Document templates (9 types)
320
321
`templates/` — decision\_record, how\_to\_guide, issue, kanban, presentation, project\_documentation, pull\_request, research\_paper, status\_report
322
323
### Examples
324
325
`assets/examples/example-research-report.md` — a synthetic quality-control report with explicitly invented data, an auditable count table, a structural flowchart, a bar chart, and a chronology. It makes no experimental or software API claims.
326
327
---
328
329
## 📝 Attribution
330
331
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.
332
333
- **Source**: https://github.com/SuperiorByteWorks-LLC/agent-project
334
- **Author**: Clayton Young / Superior Byte Works, LLC (@borealBytes)
335
- **License**: Apache-2.0
336
337
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.
338
339
---
340
341
[^1]: GitHub Blog. (2022). "Include diagrams in your Markdown files with Mermaid." https://github.blog/2022-02-14-include-diagrams-markdown-files-mermaid/
342
343
[^2]: Mermaid. "Mermaid Diagramming and Charting Tool." https://mermaid.js.org/
344

© Clayton Young / Superior Byte Works, LLC (@borealBytes) · Apache 2.0 · source · posted by @OpenSourceBuffGuy on promptparty.com

@OpenSourceBuffGuy

I find openly licensed prompts and post them here.

0 followers · 6,373 prompts

More by @OpenSourceBuffGuy

See all
Website Clone Architect prompt image

Website Clone Architect

Reverse-engineers a website section by section, writes component specs, and hands them to parallel builder agents in git worktrees to rebuild it.

agent-skill, orchestrator, parallel-agents, multi-agent, plan-then-execute, web-development, frontend, codebase-analysis, scaffolding, css, html, nextjs, typescript, git, mcp, claude-code, for-developers, for-designers, long-form, advanced, technical-spec, task-decomposition, structured-output, design-systems, ui-ux, tool-use, checklist, report, vibe-coding

Italian Terrace Cafe Candid Portrait prompt image

Italian Terrace Cafe Candid Portrait

Generates a photorealistic candid shot of a woman in a white corset dress laughing at a sunny hotel terrace cafe, written as detailed JSON.

image-prompt, json-prompt, structured-output, photorealistic, portrait, woman, candid, fashion, cottagecore, natural-light, golden-hour, bokeh, summer, travel, cityscape, mountains, medium-shot, vibrant-colors, for-photographers, nano-banana, fashion-shoot, luxury

Night Street Photo With Leashed Cat prompt image

Night Street Photo With Leashed Cat

Generates a flash-lit night street photo of a blonde woman in a retro track jacket walking a hissing tabby cat on a leash.

image-prompt, json-prompt, nano-banana, structured-output, portrait, woman, animals, pet-portrait, night-scene, street-photography, candid, editorial, fashion, dramatic-lighting, photorealistic, vertical-format, medium-shot, graffiti, for-photographers, for-content-creators

1 view

Reviews

Loading reviews…

Discussion

Loading comments…