d2-validate

Validate D2 diagram syntax in .d2 files and Markdown code blocks.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill ensures that your D2 diagram code is syntactically correct, preventing rendering errors and maintaining the integrity of your visual documentation.

Core Features & Use Cases

  • Syntax Validation: Checks .d2 files and D2 code blocks within .md files for correct D2 syntax.
  • Automated File Discovery: Can process individual files, multiple files within a directory, or extract D2 code from Markdown.
  • Use Case: After writing a complex D2 diagram for your system architecture, use this Skill to quickly verify its syntax before committing or rendering it.

Quick Start

Validate the D2 syntax in the file named 'architecture.d2'.

Frequently Asked Questions about d2-validate

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

FAQPage Schema
How do I validate D2 diagram syntax in my files?

To validate D2 diagram syntax, you can check individual `.d2` files or extract D2 code blocks from `.md` files. This ensures code integrity and adherence to D2 language specifications before rendering.

Can I check D2 code blocks embedded inside Markdown files?

Yes, you can validate D2 code blocks embedded inside Markdown files. The tool extracts D2 code from `.md` files and checks it for correct syntax to prevent rendering errors.

What is the best way to recursively validate multiple D2 diagrams in a directory?

The best way to validate multiple diagrams is recursive searching within directories. This approach processes multiple `.d2` files automatically to ensure code integrity across your project.

Why should I check my D2 syntax before rendering visual documentation?

Checking D2 syntax before rendering prevents rendering errors and maintains the integrity of your visual documentation. It verifies that complex system architecture diagrams are syntactically correct.