d2
/d2
Create, validate, render, or revise D2 diagrams using d2-mcp. Use for architecture, flow, dependency, sequence, and data diagrams when D2 source or a PNG, SVG, or ASCII artifact is wanted.
Assessment and security
- Files in this package
- 1
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 21.10.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
What it does and when to use it
Create, validate, render, or revise D2 diagrams using d2-mcp. Use for architecture, flow, dependency, sequence, and data diagrams when D2 source or a PNG, SVG, or ASCII artifact is wanted.
Original author description
Create, validate, render, or revise D2 diagrams using d2-mcp. Use for architecture, flow, dependency, sequence, and data diagrams when D2 source or a PNG, SVG, or ASCII artifact is wanted.
How it works
- Inputs, files, and state
- Useful starting prompts
SKILL.md preview
--- name: d2 description: Create, validate, render, or revise D2 diagrams using d2-mcp. Use for architecture, flow, dependency, sequence, and data diagrams when D2 source or a PNG, SVG, or ASCII artifact is wanted. --- # D2 diagrams Use the connected d2-mcp tools. If they are unavailable, explain that the MCP connection must be installed; do not claim a diagram was rendered. Discover `compile-d2`, `render-d2`, and `fetch_d2_cheat_sheet`; clients may add a prefix or normalize hyphens to underscores. Inspect the advertised tool schemas before selecting options. This workflow targets the refreshed server; older releases may lack layout choices, structured diagnostics, or native PNG. If a requested feature is unavailable, explain the version limitation and use only options the connected server advertises. 1. Identify the audience, relationships, and requested artifact. Infer reasonable layout choices from the task; ask only for missing facts that change the diagram. 2. Read `fetch_d2_cheat_sheet` when syntax or supported features are uncertain. Write the complete D2 source. Keep labels short, group related nodes, and make arrow direction meaningful. Start with `dagre`; try `elk` for dense hierarchies or `tala` when its layout improves readability. 3. Call `compile-d2` with `code` and the intended layout/options. Read `isError` and `structuredContent.error`, including one-based diagnostic locations. Fix the source and validate again. Do not retry unchanged invalid input or silently remove requested content. 4. Call `render-d2` with the same complete source/options. Prefer PNG for viewing, SVG for a scalable downloadable artifact, and ASCII for text-only output. Inspect the returned artifact when the client permits; report rendering success separately from visual inspection. 5. Return the artifact and complete source, or save source to a user-requested local file when your client has file tools. Explain material assumptions and any limitation that prevented the requested result. For revisions, resubmit the full source and options. ## Inputs, files, and state - `code` works with local or remote servers and agents without files. `file_path` means a relative `.d2` file on the **server**, within its configured input root; it does not upload a client file. Use exactly one input. Resolve imports into self-contained source for a remote server unless its operator has configured the required files. - Each HTTP request is independent. Preserve the source and rendering options in the conversation or user-controlled files. The default server has no document store. Use `document_id` and `revision` only if a configured server advertises a document backend; handles work only within that backend and its authorization namespace. - PNG is MCP image content, SVG is an embedded resource containing XML, and ASCII is text. A `urn:sha256:...` identifies returned content; it is not a download URL. A returned `file:` path is server-local. Do not invent a hosted artifact link. - Use `output_name` only when the user wants a server-local artifact and the server has an output root. Overwrite needs both server opt-in and explicit request intent. Saving returned bytes with client file tools does not require server output configuration. - Assets require server opt-in. Never fetch arbitrary network images or bypass configured file roots. If an asset is unavailable, describe the limitation and offer a text/native-shape alternative without silently changing the requested diagram. - Multi-board source needs an explicit `board_path` when selecting a nested board; inspect the tool schema for its path representation. One render returns one artifact, not a board collection. ## Useful starting prompts - “Diagram browser → API → database, with a queue and worker for background jobs. Label synchronous and asynchronous connections, validate it, and return PNG plus complete D2 source.” - “Revise this complete D2 source to add a cache. Preserve existing relationships, validate it, and return SVG plus the updated source.” - “Validate this D2 source. Explain located errors and show the smallest correction; do not render or write files.” Do not deploy a server, change client permissions, enable asset/file access, or provision storage merely to complete a diagram.
Versions
| Repository | Score | Licence |
|---|---|---|
| This page · h0rv/d2-mcp | 90 | MIT |
| antoinebou12/uml-mcp | 100 | MIT |
| david-crespo/dotfiles | 100 | MIT |
Database snapshot: 13.11.2026 · package version 28c4e668bd44 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 1 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 95mermaid
Render Mermaid diagrams as SVG or ASCII art using beautiful-mermaid. Use when users need to create flowcharts, sequence diagrams, state diagrams, class diagrams, or ER diagrams. Supports both graphical SVG output and terminal-friendly ASCII/Unicode output. - 95mermaid
Render Mermaid diagrams as SVG or ASCII art using beautiful-mermaid. Use when users need to create flowcharts, sequence diagrams, state diagrams, class diagrams, or ER diagrams. Supports both graphical SVG output and terminal-friendly ASCII/Unicode output. - 100mermaid-studio
Expert Mermaid diagram creation, validation, and rendering with dual-engine output (SVG/PNG/ASCII). Supports all 20+ diagram types including C4 architecture, AWS architecture-beta with service icons, flowcharts, sequence, ERD, state, class, mindmap, timeline, git graph, sankey,… - 87generating-mermaid-diagrams
Use when asked to create diagrams, flowcharts, architecture visuals, or render Mermaid syntax to PNG/SVG files using the local mmdc CLI tool. Not for inline Mermaid in markdown. - 100render
Use when the user says '/render', 'render this', 'render diagrams', 'generate SVG', 'mdview render', or wants to render markdown files with ASCII art diagrams to HTML via mdview. This skill generates DiagramSpec JSON for ASCII art blocks, embeds specs as HTML comments in the… - 100beautiful-mermaid
Render Mermaid diagrams as ASCII/Unicode art for terminal display or as SVG files. Use when visualizing flowcharts, state machines, sequence diagrams, class diagrams, or ER diagrams. Supports 17 themes (including vellum, tokyo-night, catppuccin, nord, dracula, github) plus…