| name | obsidian-mermaid |
| description | Create Obsidian-compatible Mermaid diagrams. Prefer square layouts (TB + subgraph LR), avoid markdown in labels. Use when creating flowcharts, sequence diagrams, or any Mermaid diagrams in markdown files. |
| allowed-tools | ["Read","Edit"] |
| license | MIT |
Obsidian Mermaid Diagrams
Create Mermaid diagrams that render correctly in Obsidian and publish without issues.
CMDS users: This vault has additional Obsidian-specific Mermaid rules at .claude/rules/mermaid-rules.md (Korean label quoting, trapezoid [/...] parser pitfalls, edge-label quoting). Read both โ they are complementary, not duplicative.
When to Use This Skill
Activate when you need to:
- Create flowcharts, sequence diagrams, ER diagrams
- Convert ASCII art to Mermaid
- Fix Mermaid rendering errors in Obsidian
Core Principle: Simplicity First
๋ค์ด์ด๊ทธ๋จ์ ํ๋์ ๋ค์ด์์ผ ํ๋ค
๋ณต์กํ ๋ค์ด์ด๊ทธ๋จ์ ์ฝ๊ธฐ ์ด๋ ต๋ค. ํญ์ ์ต์ํ์ ๋
ธ๋์ ์ฐ๊ฒฐ๋ก ํต์ฌ๋ง ํํํ๋ผ.
Node Minimization
Before (9๊ฐ ๋
ธ๋):
flowchart LR
A[์์ง] --> B[์ ๋ฆฌ] --> C[๋ณด๊ด]
D[๋ชฉํ] --> E[ํ์ต] --> F[์คํ] --> G[์ธก์ ] --> H[๋ฌ์ฑ]
After (2๊ฐ ๋
ธ๋ - ์์ฐจ ํ๋ฆ์ ๋
ธ๋ ๋ด ํ
์คํธ๋ก):
flowchart LR
A[์์ง โ ์ ๋ฆฌ โ ๋ณด๊ด]
B[๋ชฉํ โ ํ์ต โ ์คํ โ ๋ฌ์ฑ]
Connection Minimization
- ํต์ฌ ํ๋ฆ๋ง ํํ, ์ธ๋ถ์ฌํญ์ ๋ณธ๋ฌธ์์ ์ค๋ช
- ๋
ธ๋ 5๊ฐ ์ดํ, ์ฐ๊ฒฐ์ ๊ต์ฐจ ๊ธ์ง
- ๋ณต์กํ ๊ด๊ณ๋ ์ฌ๋ฌ ๊ฐ์ ๋จ์ํ ๋ค์ด์ด๊ทธ๋จ์ผ๋ก ๋ถ๋ฆฌ
Table vs Mermaid ์ ํ
| ํ์ | ์ฉ๋ | ์์ |
|---|
| ํ
์ด๋ธ | ์์ฑ-๊ฐ ๋งคํ, ๋น๊ต, ์ต์
| ์๋์ง ๋ ๋ฒจ๋ณ ์์
|
| Mermaid | ํ๋ฆ, ํ๋ก์ธ์ค, ํผ๋๋ฐฑ ๋ฃจํ | ์
๋ ฅโ์ฒ๋ฆฌโ์ถ๋ ฅ |
| ์ธ๋ผ์ธ | ๋จ์ ์์ฐจ ํ๋ฆ | A โ B โ C |
์์น: ๊ฐ์ ์ ๋ณด๋ฅผ ๋ ์ปดํฉํธํ๊ฒ ํํํ๋ ํ์ ์ ํ
Critical Rules
1. NO Markdown in Labels
Common Errors:
Node["1. First"] โ "Unsupported markdown: list"
Node["Text<br/>More"] โ "Unsupported markdown: heading"
Node["## Header"] โ "Unsupported markdown: heading"
Correct:
Node[First]
Node[Text]
Rule: Keep labels plain text. Move complex descriptions outside the diagram.
2. Prefer Square Layout (์ ์ฌ๊ฐํ ๋ ์ด์์)
Problem: flowchart LR์ ๋๋ฌด ๋๊ณ , flowchart TB๋ ๋๋ฌด ๊ธธ์ด์ง๋ค.
Solution: TB + ๋ด๋ถ LR ์กฐํฉ์ผ๋ก ์ ์ฌ๊ฐํ์ ๊ฐ๊น์ด ๋ ์ด์์ ๋ง๋ค๊ธฐ
flowchart TB
subgraph Layer1["๋ ์ด์ด 1"]
direction LR
A[ํญ๋ชฉA] ~~~ B[ํญ๋ชฉB] ~~~ C[ํญ๋ชฉC]
end
subgraph Layer2["๋ ์ด์ด 2"]
direction LR
D[ํญ๋ชฉD] ~~~ E[ํญ๋ชฉE]
end
Layer1 --> Layer2
ํจํด:
flowchart TB: ์ ์ฒด ํ๋ฆ์ ์โ์๋
direction LR: ๊ฐ subgraph ๋ด๋ถ๋ ๊ฐ๋ก ๋ฐฐ์น
~~~: ๋ณด์ด์ง ์๋ ์ฐ๊ฒฐ (ํ์ดํ ์์ด ์ ๋ ฌ์ฉ)
Rule: ์ธ๋ก๋ก ๋๋ฌด ๊ธธ์ด์ง๋ฉด subgraph + direction LR ์ฌ์ฉ.
3. Keep Labels Short
โ Too long:
Node["This is a very long description that will break layout"]
โ
Short and clear:
Node[Short Label]
Rule: Labels should be under 15 characters. Add details in text below the diagram.
4. Avoid Special Characters in Subgraph Names
โ May cause issues:
subgraph "1. Phase One"
subgraph "Phase: Setup"
โ
Safe:
subgraph Phase_One["Phase One"]
subgraph Setup["Setup Phase"]
Good Examples
Simple Flowchart
flowchart TB
A[Start] --> B{Decision}
B -->|Yes| C[Action]
B -->|No| D[End]
Process Flow with Details Outside
flowchart TB
Input[Input] --> Process[Process]
Process --> Output[Output]
Process Details:
- Input: User data from form
- Process: Validation and transformation
- Output: Saved to database
Subgraph Example
flowchart TB
subgraph Frontend["Frontend"]
UI[UI] --> API[API Call]
end
subgraph Backend["Backend"]
Server[Server] --> DB[Database]
end
API --> Server
Bad Examples (Don't Do This)
Markdown in Labels
flowchart LR
A["1. Start<br/>with details"] --> B{"2. Decision"}
This will show "Unsupported markdown" errors.
Too Wide
flowchart LR
A[Very Long Process Name Here] --> B[Another Long Name] --> C[Yet Another] --> D[And More]
This gets cut off on mobile and narrow screens.
Converting ASCII to Mermaid
ASCII Art:
โโโโโโโโโ โโโโโโโโโ
โ Start โโโโโโโ End โ
โโโโโโโโโ โโโโโโโโโ
Mermaid:
flowchart TB
Start[Start] --> End[End]
Quality Checklist
Before completing diagram creation: