jocyscom/focuslogger/mermaid-rasterize

Claude Code and agent skill by jocyscom/focuslogger

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Rasterize specific mermaid blocks inside a markdown file into PNG images. Use when mermaid diagrams don't render in the target viewer (GitHub, Notion, PDF, etc.). Triggers on: rasterize diagrams, mermaid isn't rendering, convert mermaid to images, replace mermaid blocks with images.

Install

npx vskill@latest install jocyscom/focuslogger/mermaid-rasterize

SKILL.md

Mermaid Rasterize

Converts user-selected mermaid blocks into a PNG + .mmd source file, then rewrites only those blocks in the markdown with image references.

0. Resolve inputs from context — avoid redundant reads

Before reading any file, check what is already available in the conversation:

What to resolveCheck firstFallback
Mermaid block contentAlready in conversation? Use it directlyRead the markdown file
Which blocks to convertUser specified them? ProceedList found blocks and ask
Markdown file pathMentioned in conversation? Use itAsk the user
Output/asset folderMentioned in conversation? Use itRun detection (Step 2)

Only perform file reads for information that is genuinely missing. Never re-read content already visible in context.

1. Install mmdc

bash
which mmdc || npm install -g @mermaid-js/mermaid-cli

On sandbox errors (Linux/CI), create once and reuse:

bash
echo '{"args":["--no-sandbox","--disable-setuid-sandbox"]}' > /tmp/puppeteer.json

Append --puppeteerConfigFile /tmp/puppeteer.json to every mmdc call.

2. Detect asset folder (only if not already known)

bash
ls $(dirname <file>) && ls $(dirname <file>)/..

Pick the first match:

  1. assets/ exists → use it
  2. images/ or img/ or static/ exists → use it
  3. Other images already alongside the .md → use same folder
  4. Nothing found → ask the user before continuing

3. Name each diagram

  • contextname: markdown filename without extension, slugified (e.g. sistema-auth)
  • diagramname: infer from diagram type or first node label; fallback to diagram-1, diagram-2

Output files per block:

<asset-folder>/diagram-{contextname}-{diagramname}.mmd ← source
<asset-folder>/image-{contextname}-{diagramname}.png ← rendered

4. Extract, save, and convert

For each confirmed block:

bash
cat > <asset-folder>/diagram-{contextname}-{diagramname}.mmd << 'EOF'
<mermaid content>
EOF
mmdc \
-i <asset-folder>/diagram-{contextname}-{diagramname}.mmd \
-o <asset-folder>/image-{contextname}-{diagramname}.png \
--scale 2 --backgroundColor white

5. Rewrite the markdown

Replace only the converted blocks with a relative image reference. Leave all other blocks untouched.

markdown
![{diagramname}]({asset-folder}/image-{contextname}-{diagramname}.png)

Save updated .md and generated files to /mnt/user-data/outputs/ mirroring the folder structure.

6. Present outputs

Call present_files with the updated .md first, then each .png. Tell the user which diagrams were converted and which were skipped.


Troubleshooting

ProblemFix
Sandbox crashAdd --puppeteerConfigFile /tmp/puppeteer.json
mmdc not foundexport PATH="$PATH:$(npm root -g)/.bin"
Blank PNGValidate syntax at https://mermaid.live
Broken image linksVerify relative path from .md to asset folder

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/jocyscom/focuslogger/mermaid-rasterize/badge)](https://verified-skill.com/skills/jocyscom/focuslogger/mermaid-rasterize)

Something wrong with this skill or its page? Tell us.