Creates diagrams from conversation context using Mermaid and outputs PNG images inline. Invoked via /mermaid command.
Ships in emacs-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
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.
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."theme" to "dark" or "default" based on the background mode.mmdc with -t dark if background mode is dark, or -t default if light.
# Use -t dark for dark, -t default for light
PUPPETEER_EXECUTABLE_PATH=/opt/homebrew/bin/chromium mmdc \
-i /tmp/agent-diagram-XXXX.mmd \
-o /tmp/agent-diagram-XXXX.png \
-t dark -b transparent --scale 2 \
--configFile /tmp/agent-diagram-XXXX-config.json
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.
{
"theme": "dark",
"themeVariables": {
"primaryTextColor": "#eeffff",
"secondaryTextColor": "#eeffff",
"tertiaryTextColor": "#eeffff",
"primaryBorderColor": "#eeffff",
"lineColor": "#eeffff",
"textColor": "#eeffff",
"actorTextColor": "#eeffff",
"actorBorder": "#eeffff",
"signalColor": "#eeffff",
"signalTextColor": "#eeffff",
"labelTextColor": "#eeffff",
"loopTextColor": "#eeffff",
"noteTextColor": "#eeffff",
"noteBorderColor": "#eeffff",
"sectionTextColor": "#eeffff",
"titleColor": "#eeffff"
}
}
sequenceDiagram
participant a as Alice
participant b as Bob
a->>b: Hello
b-->>a: Hi back
(frame-parameter nil 'background-mode). Use -t dark for dark or -t default for light. Always use -b transparent --scale 2.PUPPETEER_EXECUTABLE_PATH=/opt/homebrew/bin/chromium when invoking mmdc.themeVariables set to the queried foreground color and pass it via --configFile./tmp/agent-diagram-$(date +%s).png). Never use descriptive names.) on its own line.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
20 skills in this plugin
/d2This skill should be used when the user invokes "/d2" to create a diagram from the current context using D2 and output the resulting image path./describeThis skill should be used when the user invokes "/describe" to look up Emacs documentation via emacsclient./diredThis skill should be used when the user invokes "/dired" to open files from the latest interaction in an Emacs dired buffer via emacsclient./emacsclientAlways use emacsclient instead of emacs. This applies to all Emacs operations: user requests, byte compilation, check-parens, running ERT tests, and any other elisp evaluation. Exception: a project's own test/build entry points (make test, eask, eldev, CI scripts) may run even though they spawn emacs --batch internally./emacs-skills:mermaidfrom emacs-skills
npx claudepluginhub xenodium/emacs-skills --plugin emacs-skillsOther plugins' skills for the same job