xenodium/emacs-skills/mermaid
Claude Code and agent skill by xenodium/emacs-skills
- community
Checking that the SKILL.md file is still in the repository.
This skill should be used when the user invokes "/mermaid" to create a diagram from the current context using Mermaid and output the resulting image path.
Install
npx vskill@latest install xenodium/emacs-skills/mermaidSKILL.md
Create diagrams with Mermaid
Create a diagram from the most recent interaction context using Mermaid. Generate a PNG image with a transparent background and output it as a markdown image so it renders inline.
How to create a diagram
- Extract or derive diagrammable data from the current context.
- If the Emacs foreground color and background mode are not already known from a previous diagram in this session, query them:
``sh emacsclient --eval '(face-foreground (quote default))' emacsclient --eval '(frame-parameter nil (quote background-mode))' ` The first returns a hex color like "#eeffff". The second returns dark or light`. Reuse both for all subsequent diagrams.
- Write a Mermaid file to a temporary file.
- Write a JSON config file that overrides theme variables with the queried foreground color. Set
"theme"to"dark"or"default"based on the background mode. - Run
mmdcwith-t darkif background mode isdark, or-t defaultiflight. - Output the result as a markdown image on its own line:
``  ``
Mermaid config template
Write this JSON config file to apply the Emacs foreground color. Replace #eeffff with the queried color. Set "theme" to "dark" or "default" based on the Emacs background mode.
Mermaid diagram template
Rules
- Query the Emacs foreground color once per session and reuse it for all subsequent diagrams. Only query again if the color is not already known.
- Query the Emacs background mode once per session via
(frame-parameter nil 'background-mode). Use-t darkfordarkor-t defaultforlight. Always use-b transparent --scale 2. - Always use
PUPPETEER_EXECUTABLE_PATH=/opt/homebrew/bin/chromiumwhen invokingmmdc. - Always write a JSON config file with
themeVariablesset to the queried foreground color and pass it via--configFile. - Always use a timestamp in the filename (e.g.,
/tmp/agent-diagram-$(date +%s).png). Never use descriptive names. - After mmdc runs successfully, output a markdown image (
) on its own line. - Choose an appropriate diagram type for the data (sequence, flowchart, class, state, er, gantt, etc.).
- Include a title when it adds clarity.
- If no diagrammable data exists in the recent context, inform the user.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/mermaid/SKILL.md
Popularity
- Repository stars
- 65
- Repository forks
- 8
- 7-day trend score
- 21
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 18 Mar 2026, 7 months ago.
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
[](https://verified-skill.com/skills/xenodium/emacs-skills/mermaid)