본문으로 건너뛰기
Skillpedia
문서화75k · #2642

beautiful-mermaid

하는 일

이 스킬은 Mermaid 다이어그램 코드를 이미지 파일로 렌더링합니다. 순서도, 시퀀스 다이어그램, 데이터베이스 다이어그램을 이미지로 만들고 싶은 작가와 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓순서도, 시퀀스, 상태, 데이터베이스 다이어그램을 이미지로 렌더링하고 싶을 때.
  • ✓텍스트 설명이 있고 Mermaid 코드와 그 이미지를 얻고 싶을 때.
  • ✓다크 테마처럼 특정 색 테마의 다이어그램이 필요할 때.

스킬 링크

https://github.com/calesthio/OpenMontage/blob/main/.agents/skills/beautiful-mermaid/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

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

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

AI에게 요청하는 예시

“이 공정 설명을 다크 테마의 순서도 이미지로 바꿔 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 Mermaid 코드를 쓰거나 확인하고, 색 테마를 적용한 뒤 다이어그램을 SVG와 PNG 파일로 렌더링합니다. PNG 단계는 브라우저 도구를 사용합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Beautiful Mermaid Diagram Rendering

Render Mermaid diagrams as SVG and PNG images using the Beautiful Mermaid library.

Dependencies

This skill requires the agent-browser skill for PNG rendering. Load it before proceeding with PNG capture.

Supported Diagram Types

  • Flowchart - Process flows, decision trees, CI/CD pipelines
  • Sequence - API calls, OAuth flows, database transactions
  • State - State machines, connection lifecycles
  • Class - UML class diagrams, design patterns
  • Entity-Relationship - Database schemas, data models

Available Themes

Default, Dracula, Solarized, Zinc Dark, Tokyo Night, Tokyo Night Storm, Tokyo Night Light, Catppuccin Latte, Nord, Nord Light, GitHub Dark, GitHub Light, One Dark.

If no theme is specified, use default.

Common Syntax Patterns

Flowchart Edge Labels

Use pipe syntax for edge labels:

A -->|label| B
A ---|label| B

Avoid space-dash syntax which can cause incomplete renders:

A -- label --> B   # May cause issues

Node Labels with Special Characters

Wrap labels containing special characters in quotes:

A["Label with (parens)"]
B["Label with / slash"]

Workflow

Step 1: Generate or Validate Mermaid Code

If the user provides a description rather than code, generate valid Mermaid syntax. Consult references/mermaid-syntax.md for full syntax details.

Step 2: Render SVG

Run the rendering script to produce an SVG file:

bun run scripts/render.ts --code "graph TD; A-->B" --output diagram --theme default

Or from a file:

bun run scripts/render.ts --input diagram.mmd --output diagram --theme tokyo-night

Alternative runtimes:

npx tsx scripts/render.ts --code "..." --output diagram
deno run --allow-read --allow-write --allow-net scripts/render.ts --code "..." --output diagram

This produces <output>.svg in the current working directory.

Step 3: Create HTML Wrapper

Run the HTML wrapper script to prepare for screenshot:

bun run scripts/create-html.ts --svg diagram.svg --output diagram.html

This creates a minimal HTML file that displays the SVG with proper padding and background.

Step 4: Capture High-Resolution PNG with agent-browser

Use the agent-browser CLI to capture a high-quality screenshot. Refer to the agent-browser skill for full CLI documentation.

# Set 4K viewport for high-resolution capture
agent-browser set viewport 3840 2160

# Open the HTML wrapper
agent-browser open "file://$(pwd)/diagram.html"

# Wait for render to complete
agent-browser wait 1000

# Capture full-page screenshot
agent-browser screenshot --full diagram.png

# Close browser
agent-browser close

For even higher resolution on complex diagrams, increase the viewport further or use the --padding option when creating the HTML wrapper to give the diagram more space.

Step 5: Clean Up Intermediary Files

After rendering, remove all intermediary files. Only the final .svg and .png should remain.

Files to clean up:

  • The HTML wrapper file (e.g., diagram.html)
  • Any temporary .mmd files created to hold diagram code
  • Any other files created during the rendering process
rm diagram.html

If a temporary .mmd file was created, remove it as well.

Output

Both outputs are always produced:

  • SVG: Vector format, infinitely scalable, small file size
  • PNG: High-resolution raster, captured at 4K (3840×2160) viewport with minimum 1200px diagram width

Files are saved to the current working directory unless the user explicitly specifies a different path.

Theme Selection Guide

Theme Background Best For
default Light grey General use
dracula Dark purple Dark mode preference
tokyo-night Dark blue Modern dark aesthetic
tokyo-night-storm Darker blue Higher contrast
nord Dark arctic Muted, calm visuals
nord-light Light arctic Light mode with soft tones
github-dark GitHub dark Matches GitHub UI
github-light GitHub light Matches GitHub UI
catppuccin-latte Warm light Soft pastel aesthetic
solarized Tan/cream Solarized colour scheme
one-dark Atom dark Atom editor aesthetic
zinc-dark Neutral dark Minimal, no colour bias

Troubleshooting

Theme not applied

Check the render script output for the bg and fg values, or inspect the SVG's opening tag for --bg and `--

자주 묻는 질문

어떤 이미지 형식을 만드나요?

SVG와 PNG 파일을 모두 만듭니다.

어떤 다이어그램 유형을 지원하나요?

순서도, 시퀀스 다이어그램, 상태 다이어그램, 클래스 다이어그램, 개체 관계 다이어그램을 지원합니다.

테마를 고르지 않으면 어떻게 되나요?

기본 테마가 사용됩니다.

상세 정보

작성자의 원본 설명

Render Mermaid diagrams as SVG and PNG using the Beautiful Mermaid library. Use when the user asks to render a Mermaid diagram.

repo: calesthio/OpenMontage

인기도

GitHub 스타
75k
순위
#2642
라이선스
AGPL-3.0
업데이트
2026. 10. 28.

이 스킬이 유용한가요?

0

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

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬