mermaid-to-image — Claude Code skill: what it does, how to install
mermaid-to-image converts Mermaid diagrams in Markdown files to PNG via the mermaid.ink API and replaces code blocks with image references.
no license 4,000 installs updated 2026-08-28
npx skills add zc277584121/marketing-skills --skill mermaid-to-image -a claude-codeWhat mermaid-to-image does
The skill locates Mermaid code blocks in specified files, renders each to PNG through an external API, and substitutes the code with an image link. Inside is a Python script that encodes the diagram in base64, sends a request with a User-Agent header (the API returns 403 without it), and saves the result to a chosen directory. Image paths are formed relative to the file or absolute, depending on project structure.
Useful for publishing docs on platforms where Mermaid does not render natively: GitHub Pages with Jekyll, Dev.to, static sites. The skill suggests an image directory when the project has several candidates (images/, assets/, docs/figures/) and generates filenames based on diagram content. Standard Python library is sufficient.
What it helps with
- turn Mermaid blocks into PNG for publishing on a platform without diagram rendering
- replace diagram code in Markdown with links to ready images
- prepare documentation with diagrams for a static site
- save PNG versions of all schemas from a file or folder
Example prompts for the agent
- Convert Mermaid blocks in
docs/architecture.mdto images - Turn all diagrams from
docs/folder into PNG - Replace the second Mermaid schema in README with an image
How to install mermaid-to-image
1Skills CLI (Vercel)
npx skills add zc277584121/marketing-skills --skill mermaid-to-image -a claude-code2Manually: put the files in place
~/.claude/skills/mermaid-to-image/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/mermaid-to-image/
1Skills CLI (Vercel)
npx skills add zc277584121/marketing-skills --skill mermaid-to-image -a codex2Manually: put the files in place
.agents/skills/mermaid-to-image/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add zc277584121/marketing-skills --skill mermaid-to-image -a cursor2Manually: put the files in place
.cursor/skills/mermaid-to-image/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install zc277584121/marketing-skills skills/mermaid-to-image2Manually: put the files in place
.github/skills/mermaid-to-image/SKILL.md1Skills CLI (Vercel)
npx skills add zc277584121/marketing-skills --skill mermaid-to-image -a gemini-cli2Platform CLI
gemini skills install https://github.com/zc277584121/marketing-skills --path skills/mermaid-to-imageManually: put the files in place
.devin/skills/mermaid-to-image/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add zc277584121/marketing-skills --skill mermaid-to-image -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about mermaid-to-image
How to install mermaid-to-image in Claude Code?
Run npx skills add zc277584121/marketing-skills --skill mermaid-to-image -a claude-code, the file will appear in ~/.claude/skills/mermaid-to-image/SKILL.md.
What does mermaid-to-image do?
Finds Mermaid blocks in Markdown, renders each to PNG via mermaid.ink API, and replaces the code with a link to the saved image.
What is required for mermaid-to-image to work?
Standard Python library. The mermaid.ink API requires a User-Agent header, the script adds it automatically.