d2-convert

Convert Mermaid diagrams into D2 format with SVG rendering.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill bridges the gap between Mermaid's diagramming capabilities and D2's powerful visualization engine, allowing you to leverage existing Mermaid diagrams within the D2 ecosystem.

Core Features & Use Cases

  • Mermaid to D2 Conversion: Automatically translates various Mermaid diagram types (flowchart, sequence, ER, class) into D2 format.
  • Dependency Management: Ensures necessary tools for conversion are installed.
  • Configuration Options: Supports customization of themes, layouts, and rendering.
  • Use Case: You have a sequence diagram created in Mermaid and want to render it with a specific D2 theme. This Skill handles the conversion and rendering process seamlessly.

Quick Start

Convert the provided Mermaid code block into a D2 diagram.

Frequently Asked Questions about d2-convert

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

FAQPage Schema
How do I convert Mermaid diagrams to D2 format?

You can convert Mermaid diagrams to D2 format by providing raw code blocks or file paths. The tool detects diagram types, applies translation rules, and optionally renders the output to SVG.

What Mermaid diagram types can be translated into D2?

Mermaid flowchart, sequence, ER, and class diagram types can be translated into D2. The conversion process detects the specific diagram type and applies the appropriate translation rules.

Does converting Mermaid to D2 require installing additional dependencies?

Converting Mermaid to D2 requires necessary tools to be installed. The process checks dependencies, resolves plugin paths, and reports errors if required components are missing.

Can I render Mermaid sequence diagrams using custom D2 themes?

Yes, you can render Mermaid sequence diagrams with custom D2 themes. The conversion supports configuration options for themes and layouts, handling the translation and rendering process seamlessly.

How do I handle errors when translating Mermaid code blocks to D2?

When translating Mermaid code blocks to D2, the tool provides robust error checking and reporting. It validates input from file paths or raw code and alerts you to dependency or configuration issues.

What is the best way to migrate existing flowcharts from Mermaid to D2?

The best way to migrate Mermaid flowcharts to D2 is using an automated conversion tool. It reads your existing configurations, resolves necessary paths, and translates the structure directly into D2 format.