d2
This skill should be used when the user invokes "/d2" to create a diagram from the current context using D2 and output the…
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.
$ npx -y skills add xenodium/emacs-skills --skill mermaid --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/mermaidContext preview
The summary Claude sees to decide when to auto-load this skill.
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.
name: mermaid description: '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.' tools: Bash disable-model-invocation: true
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.
1. Extract or derive diagrammable data from the current context. 2. If the Emacs foreground color and background mode are not already known from a previous diagram in this session, query them:
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. 3. Write a Mermaid file to a temporary file. 4. 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. 5. Run `mmdc` with `-t dark` if background mode is `dark`, or `-t default` if `light`. 6. Output the result as a markdown image on its own line:

# 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 backClaude Code skills for Emacs integration. These skills enable tighter integration with agents running inside Emacs, for example agent-shell.
This skill should be used when the user invokes "/d2" to create a diagram from the current context using D2 and output the…
This skill should be used when the user invokes "/describe" to look up Emacs documentation via emacsclient.
This skill should be used when the user invokes "/dired" to open files from the latest interaction in an Emacs dired buffer via…
Always use emacsclient instead of emacs. This applies to all Emacs operations: user requests, byte compilation, check-parens,…
When referencing files, format them as markdown links with line numbers using GitHub-style #L syntax.
This skill should be used when the user invokes "/github-activity" to analyze a GitHub project''s recent activity (PRs and…