본문으로 건너뛰기
Skillpedia
이미지 및 아이콘18k · #10605

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가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/wanshuiyin/Auto-claude-code-research-in-sleep/blob/main/skills/skills-codex/mermaid-diagram/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

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

  1. Analyze the request and choose the most suitable diagram type
  2. Read the corresponding Mermaid syntax reference below
  3. If the diagram involves mathematical notation, apply the math syntax rules from the Math Formulas in Diagrams section
  4. Identify all components, connections, and data flow
  5. 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:

  1. Read the error carefully
  2. Fix the syntax issue in both .mmd and .md
  3. Re-run verification
  4. 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.

repo: wanshuiyin/Auto-claude-code-research-in-sleep

인기도

GitHub 스타
18k
순위
#10605
라이선스
MIT
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬