一键导入
d2
This 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.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
This 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.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
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 emacsclient.
This skill should be used when the user invokes "/highlight" to highlight relevant regions in one or more files in Emacs via emacsclient.
Use when the user asks about a specific place — restaurant, cafe, shop, business, landmark — or when context implies a location-based lookup ("where is X", "find Y", "X in Z", "X near A"). Calls the mappu CLI to search Apple Maps and returns local results with addresses, websites, preview images, and a map snapshot.
This skill should be used when the user invokes "/open" to open files from the latest interaction in Emacs buffers via emacsclient.
This skill should be used when the user invokes "/select" to open one or more files in Emacs and select a region relevant to the current discussion via emacsclient.
| name | d2 |
| description | This 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. |
| tools | Bash |
| disable-model-invocation | true |
Create a diagram from the most recent interaction context using D2. Generate a PNG image 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 200 if background mode is dark, or --theme 0 if light.
# Use --theme 200 for dark, --theme 0 for light
d2 --theme 200 --pad 40 /tmp/agent-diagram-XXXX.d2 /tmp/agent-diagram-XXXX.png
Use --theme 200 for dark or --theme 0 for light, based on the Emacs background mode. Apply the queried foreground color to style.font-color and style.stroke on nodes and edges.
direction: right
node1: Label {
style.font-color: "#eeffff"
style.fill: "#2d3748"
style.stroke: "#eeffff"
}
node2: Label {
style.font-color: "#eeffff"
style.fill: "#2d3748"
style.stroke: "#eeffff"
}
node1 -> node2: label {style.stroke: "#eeffff"; style.font-color: "#eeffff"}
(frame-parameter nil 'background-mode). Use --theme 200 for dark or --theme 0 for light. Always use --pad 40./tmp/agent-diagram-$(date +%s).png). Never use descriptive names.style.font-color and style.stroke for all nodes and edges so the diagram is readable on the user's Emacs background.) on its own line.