AgentStack
SKILL verified MIT Self-run

Mermaid To Png

skill-haiyuan-ai-agent-skills-mermaid-to-png · by haiyuan-ai

Convert Mermaid code blocks in Markdown to styled PNG or SVG images. Use for Mermaid export, image replacement, or visual polish. Supports `dark-tech`, `fresh-business`, `hand-drawn`, and `gradient-modern`.

No reviews yet
0 installs
3 views
0.0% view→install

Install

$ agentstack add skill-haiyuan-ai-agent-skills-mermaid-to-png

✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

Are you the author of Mermaid To Png? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

mermaid-to-png

Convert Mermaid code blocks in Markdown files to styled PNG/SVG images with built-in themes.

Use This Skill When

  • The input is a Markdown file containing ``mermaid`` code blocks
  • The user wants PNG/SVG exports, visual polish, or image replacement in the Markdown
  • The target is an article, slide deck, blog post, or WeChat Official Account post
  • The user says "make this Mermaid diagram look better" without naming a file format

Workflow

  1. Inspect the Markdown file and confirm it contains Mermaid code blocks.
  2. Run the bundled converter:
python3 mermaid-to-png/scripts/convert.py  --style fresh-business --width 900 --replace
  1. Pick a style based on context:
  • fresh-business: reports, docs, business/process diagrams
  • dark-tech: architecture, engineering, API/system diagrams
  • hand-drawn: ideation, teaching, workshop notes
  • gradient-modern: product, marketing, keynote-style visuals
  1. Use --width 900 for WeChat unless the user requests something else.
  2. Add --replace when the user wants a Markdown file with image references.

Key Options

  • --style : apply one built-in theme
  • --format png|svg: choose raster or vector output
  • --width : image width, default 1200
  • --replace: emit _converted.md with Mermaid blocks replaced by image links
  • --output-dir : store generated assets in a specific directory
  • --chart-type auto|flowchart|sequence|gantt|class|state: override type detection only if auto-detection is wrong
  • --allow-npx: allow a dynamic npx fallback only when local mmdc is unavailable
  • --disable-browser-sandbox: disable Chromium sandbox only in trusted restricted environments

Notes

  • The converter auto-detects common Mermaid chart types.
  • When --replace is used, the converted Markdown references image filenames in the same output directory.
  • Prefer a locally installed mmdc.
  • npx fallback is disabled by default and must be explicitly enabled with --allow-npx.
  • Browser sandbox disabling is also opt-in via --disable-browser-sandbox.

Prerequisites

npm install -g @mermaid-js/mermaid-cli

If rendering fails, check Mermaid syntax first, then verify mmdc/Puppeteer can run in the local environment.

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet — be the first.

Versions

  • v0.1.0 Imported from the upstream source.