mermaid-diagram
하는 일
이 스킬은 순서도, 시퀀스 다이어그램, 클래스 다이어그램 등의 Mermaid 다이어그램 코드를 쓰고 검사합니다. 글로 된 설명에서 깔끔한 다이어그램이 필요한 사람을 위한 스킬입니다.
사용하는 경우
- ✓설명에서 순서도, 시퀀스 다이어그램, 클래스 다이어그램이 필요할 때.
- ✓문서화를 위해 figures 폴더에 Mermaid 파일을 저장하고 싶을 때.
- ✓수학 표기가 있는 다이어그램이 올바르게 렌더링되어야 할 때.
스킬 링크
https://github.com/wanshuiyin/Auto-claude-code-research-in-sleep/blob/main/skills/skills-codex/mermaid-diagram/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“제 API 호출의 Mermaid 시퀀스 다이어그램을 만들어 figures 폴더에 저장하고, 문법을 확인해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 다이어그램 종류를 고르고, 코드를 쓰고, .mmd와 .md 파일을 figures 폴더에 저장합니다. 문법을 확인하고, 필요하면 몇 라운드에 걸쳐 배치를 다듬습니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Mermaid Diagram Generator
Generate high-quality Mermaid diagram code based on user requirements, with file output and verification.
Constants
- OUTPUT_DIR =
figures/— Output directory for generated files - MAX_ITERATIONS = 3 — Maximum refinement rounds for syntax or layout issues
Workflow: MUST EXECUTE ALL STEPS
Step 0: Pre-flight Check
Create output directory
mkdir -p figures
Step 1: Understand Requirements & Select Diagram Type
Parse the input: $ARGUMENTS
- Analyze the request and choose the most suitable diagram type
- Read the corresponding Mermaid syntax reference below
- If the diagram involves mathematical notation, apply the math syntax rules from the Math Formulas in Diagrams section
- Identify all components, connections, and data flow
- Plan the diagram structure before writing code
Step 2: Read Documentation
Select the appropriate diagram type. Use built-in Mermaid knowledge first; if external documentation is needed and your environment provides it, fetch the up-to-date syntax reference.
Configuration & Themes
Choose theme, colors, and layout before writing code. For academic diagrams, prefer clean white backgrounds, restrained colors, and readable labels over decorative styling.
| Type | Use Cases |
|---|---|
| Flowchart | Processes, decisions, steps |
| Sequence Diagram | Interactions, messaging, API calls |
| Class Diagram | Class structure, inheritance, associations |
| State Diagram | State machines, state transitions |
| ER Diagram | Database design, entity relationships |
| Gantt Chart | Project planning, timelines |
| Pie Chart | Proportions, distributions |
| Mindmap | Hierarchical structures, knowledge graphs |
| Timeline | Historical events, milestones |
| Git Graph | Branches, merges, versions |
| Quadrant Chart | Four-quadrant analysis |
| Requirement Diagram | Requirements traceability |
| C4 Diagram | System architecture |
| Sankey Diagram | Flow, conversions |
| XY Chart | Line charts, bar charts |
| Block Diagram | System components, modules |
| Packet Diagram | Network protocols, data structures |
| Kanban | Task management, workflows |
| Architecture Diagram | System architecture |
| Radar Chart | Multi-dimensional comparison |
| Treemap | Hierarchical data visualization |
| User Journey | User experience flows |
| ZenUML | Sequence diagrams (code style) |
Step 3: Generate Mermaid Code & Save Files
Generate the Mermaid code and save two files:
File 1: figures/<diagram-name>.mmd — Raw Mermaid source
The .mmd file contains only raw Mermaid code, no markdown fences.
File 2: figures/<diagram-name>.md — Markdown with embedded Mermaid
The .md file wraps the same Mermaid code in a mermaid code block for preview rendering, plus a short title and description.
Diagram Title
Use a concise title in the .md wrapper that matches the generated diagram name.
Naming convention: use a descriptive kebab-case name derived from the request, such as auth-flow, system-architecture, or database-er.
Step 4: Verify Mermaid Syntax (MANDATORY)
Codex MUST verify the generated Mermaid code by running the Mermaid CLI (mmdc).
Check if mermaid-cli is available
if command -v mmdc >/dev/null 2>&1; then
mmdc -i figures/<diagram-name>.mmd -o figures/<diagram-name>.png -b transparent \
&& echo "Syntax valid — PNG rendered to figures/<diagram-name>.png"
else
npx -y @mermaid-js/mermaid-cli@latest -i figures/<diagram-name>.mmd -o figures/<diagram-name>.png -b transparent \
&& echo "Syntax valid — PNG rendered to figures/<diagram-name>.png"
fi
If verification fails:
- Read the error carefully
- Fix the syntax issue in both
.mmdand.md - Re-run verification
- Repeat up to
MAX_ITERATIONS
Step 5: Codex STRICT Visual Review & Scoring (MANDATORY)
After successful rendering, Codex MUST read the generated PNG and perform a strict review:
## Codex's STRICT Review of <diagram-name>
### What I See
[Describe the rendered diagram in detail]
### Files Generated
- `figures/<diagram-name>.mmd`
- `figures/<diagram-name>.md`
- `figures/<diagram-name>.png`
### ═══════════════════════════════════════════════════════════════
### STRICT VERIFICATION CHECKLIST (ALL must pass for score ≥ 9)
### ═══════════════════════════════════════════════════════════════
#### A. File Correctness
- [ ] `.mmd` contains valid Mermaid syntax
- [ ] `.
자주 묻는 질문
다이어그램 종류는 몇 개인가요?
순서도, 시퀀스, 클래스, ER, 간트 차트를 포함해 많은 종류를 다룹니다.
파일은 어디에 저장되나요?
기본적으로 프로젝트의 figures 폴더에 저장됩니다.
인터넷이 필요한가요?
먼저 내장된 Mermaid 지식을 쓰고, 환경이 제공할 때만 외부 문서를 가져옵니다.
상세 정보
작성자의 원본 설명
Generate Mermaid diagrams from user requirements. Save .mmd and .md files to figures/ with syntax verification. Supports flowcharts, sequence diagrams, class diagrams, ER diagrams, Gantt charts, and many more diagram types.
인기도
- GitHub 스타
- 18k
- 순위
- #10605
- 라이선스
- MIT
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
ablation-planner
18k에이전트가 논문의 제거 실험(ablation)을 계획하도록 돕습니다. 주요 결과가 좋아 보이면 심사위원이 요청할 가능성이 높은 실험을 고릅니다.
alphaxiv
18k에이전트가 arXiv 링크나 ID로 AlphaXiv 요약을 써서 논문 한 편을 빠르게 읽도록 합니다. 요약이 없으면 원문이나 LaTeX를 씁니다.
analyze-results
18k에이전트가 머신러닝 실험 결과를 분석하고, 실행 결과를 기준선과 비교하며, 숫자를 명확한 발견과 다음 단계로 정리하도록 돕습니다.
arxiv
18k에이전트가 arXiv에서 학술 논문을 검색하고, 세부 정보를 읽고, 연구 주제에 맞는 PDF를 내 라이브러리에 저장하도록 돕습니다.