d2

Generate, validate, and render D2 diagrams from text or codebase analysis.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill enables the creation, validation, and rendering of complex diagrams directly from text-based descriptions, streamlining the visualization of system architecture, databases, and code structures.

Core Features & Use Cases

  • Diagram Generation: Create various diagram types (architecture, ER, sequence, class) from simple text definitions.
  • Code-to-Diagram: Analyze codebases to automatically generate comprehensive diagram suites.
  • Validation & Rendering: Ensure diagram syntax is correct and render them into SVG or PNG formats.
  • Use Case: You need to document a new microservice architecture. Describe the services, their connections, and data stores, and the Skill will generate a clear architecture diagram.

Quick Start

Use the d2 skill to generate an architecture diagram from the description provided.

Frequently Asked Questions about d2

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

FAQPage Schema
How do I generate architecture diagrams from text?

You can generate architecture diagrams by writing simple text definitions in the D2 language. This Skill parses your textual descriptions of services and data stores to automatically create and render visual diagrams for documentation.

Can I automatically create diagrams from my codebase?

Yes, this Skill can analyze your codebase to automatically generate comprehensive diagram suites. It translates code structures into visual representations, supporting ER, sequence, and class diagrams directly from your source files.

What diagram types are supported by the D2 language?

The D2 language supports generating architecture, ER, sequence, and class diagrams. You define these diagrams using textual descriptions, which are then validated and rendered into visual formats.

Does this Skill validate diagram syntax before rendering?

Yes, the Skill validates your D2 syntax to ensure it is correct before rendering. This prevents formatting errors and guarantees the final SVG or PNG output accurately reflects your textual definitions.

How do layout engines like dagre and elk optimize diagram visualization?

This Skill integrates with layout engines like dagre and elk to arrange diagram elements for optimal visualization. These engines automatically calculate node positioning and routing to produce clear, readable diagrams from your text.

What is the best way to document a microservice architecture as code?

The best way to document microservices as code is using the D2 language to describe services, connections, and data stores. This Skill generates clear architecture diagrams directly from those textual descriptions, streamlining visualization.