Skip to main content
skill CX Codex

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

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add zc277584121/marketing-skills --skill mermaid-to-image -a claude-code
Open on GitHub

What 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.md to 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-code

2Manually: put the files in place

~/.claude/skills/mermaid-to-image/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/mermaid-to-image/

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.

Similar skills

All skills for Writing and docs →

From the same set13

The whole set →
remove-ai-style remove-ai-style rewrites English or Chinese prose to drop formulaic phrasing, stray dashes and exclamation marks. Useful before you publish an article or a doc. CX Codex +1 4,200installs browser-screenshot browser-screenshot captures one block of a page — a post, a tweet, a chart, a section of an article — instead of a full-page dump. Useful when you need a clean illustration. CX Codex +1 4,100installs image-generation The image-generation skill creates illustrations, diagrams, and other visuals for articles and docs. It chooses between Codex, OpenAI API, and Gemini paths. CX Codex +1 4,000installs chrome-automation chrome-automation controls an active Chrome window via the agent-browser CLI. Useful for extracting web data, filling forms, and replaying DevTools recordings while keeping active login sessions intact. CX Codex +1 4,000installs content-rewrite content-rewrite turns one article or announcement into versions for LinkedIn, X, Reddit, an English blog and WeChat. Useful when the same material has to go out in several places. CX Codex +1 4,000installs mermaid-to-gif mermaid-to-gif turns Mermaid diagrams from .mmd and .md files into animated GIFs with four animation styles. CX Codex +1 3,900installs jupyter-notebook-writing jupyter-notebook-writing — a skill for editing Jupyter notebooks in Markdown instead of JSON. Runs on Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, and OpenCode; edit .md files first, then convert to .ipynb using jupyter-switch. CX Codex +1 3,900installs video-to-gif video-to-gif turns one video into several GIFs at different settings and drops them in a folder, so you pick the one that looks right. CX Codex +1 3,900installs

Project sponsors

Companies that keep this analytics open