d2-render

Render .txt and .md D2 diagrams to SVG or PNG files and folders.

56|5|Updated Feb 27, 2026
One-click install
npx skills add https://github.com/diegomarino/claude-toolshed --skill d2-render
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: d2-render
Source: https://github.com/diegomarino/claude-toolshed/tree/main/plugins/d2/skills/d2-render
Command: npx skills add https://github.com/diegomarino/claude-toolshed --skill d2-render

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill automates the process of converting D2 diagram definitions into visual formats like SVG or PNG, eliminating manual rendering steps and ensuring consistency.

Core Features & Use Cases

  • Render .d2 files: Directly convert D2 source files into images.
  • Extract and Render from .md: Pull D2 code blocks from Markdown files and render them.
  • Directory Rendering: Process all .d2 files within a specified directory.
  • Configurable Output: Choose between SVG and PNG formats, and specify output directories.
  • Use Case: You have a complex architecture described in a .d2 file. Use this Skill to quickly generate an SVG image for your documentation or presentation.

Quick Start

Render the D2 diagram defined in the file 'diagrams/architecture.d2' to an SVG image in the default output directory.

Frequently Asked Questions about d2-render

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

FAQPage Schema
How do I render D2 diagrams into SVG or PNG images?

You can render D2 diagrams into SVG or PNG by processing .d2 files directly or extracting D2 code blocks from Markdown files. The Skill outputs images into a configurable directory.

Can I extract and render D2 diagrams from Markdown files?

Yes, you can render D2 diagrams from Markdown files. The Skill automatically pulls D2 code blocks from .md files and converts them into visual formats like SVG or PNG.

Do I need Playwright to export D2 diagrams to PNG?

Playwright is optionally required to export D2 diagrams to PNG. If you only need to render D2 diagrams into SVG format, Playwright is not necessary for the rendering process.

What is the best way to batch process multiple D2 files in a directory?

The best way to batch process multiple D2 files is using directory rendering. The Skill supports processing all .d2 files within a specified directory to generate visual outputs automatically.

Does D2 rendering support custom themes and layout configurations?

Yes, D2 rendering supports custom themes and layout configurations. The Skill integrates with D2's built-in configuration, allowing you to apply themes and layouts when generating SVG or PNG images.

Why are my D2 files not converting to PNG correctly?

D2 files may not convert to PNG correctly if Playwright is missing. Playwright is optionally required for PNG export, whereas SVG rendering does not depend on it.