d2

Generates D2 diagrams from conversational context as inline markdown images.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/benonions/dotfiles --skill d2-benonions
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: d2
Source: https://github.com/benonions/dotfiles/tree/main/codex/.codex/skills/community/emacs-skills/d2
Command: npx skills add https://github.com/benonions/dotfiles --skill d2-benonions

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps users visualize information by creating diagrams from the current context using the D2 diagramming language.

Core Features & Use Cases

  • Diagram Generation: Creates diagrams from context using D2.
  • Inline Rendering: Outputs the diagram as a markdown image for easy viewing.
  • Customizable Themes: Adapts diagram appearance based on Emacs theme settings (dark/light mode, foreground color).
  • Use Case: You're discussing a system architecture with an AI, and you want a visual representation. You can invoke this skill to generate a D2 diagram that's immediately displayed in your chat.

Quick Start

Use the d2 skill to create a diagram from the current context.

Frequently Asked Questions about d2

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate diagrams from conversational context automatically?

Creating diagrams from context involves using the D2 language to process contextual data and output a visual diagram directly as an inline markdown image.

Can I render D2 diagrams as inline markdown images in my chat?

Yes, this approach renders D2 diagrams as inline markdown images, allowing you to view the generated visual representations directly within your conversational interface.

Does D2 diagram generation support theming for Emacs dark and light modes?

D2 diagram generation supports dynamic theming by adapting the diagram appearance based on Emacs foreground and background modes to ensure visual consistency.

What is the best way to visualize system architecture during an AI discussion?

Visualizing system architecture during an AI discussion is best handled by generating a D2 diagram from the current conversational context, which is then immediately displayed as an inline image.

Do I need to manually extract data to create D2 diagrams from context?

No, you do not need to manually extract data; the process handles contextual data extraction automatically to perform visualization tasks and generate the required diagrams.