mermaid-d2

Render and validate Mermaid or d2 diagram sources into SVG or PNG files.

1|Updated Mar 18, 2024
One-click install
npx skills add https://github.com/erfianugrah/dotfiles --skill mermaid-d2
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mermaid-d2
Source: https://github.com/erfianugrah/dotfiles/tree/main/.pi/agent/skills/mermaid-d2
Command: npx skills add https://github.com/erfianugrah/dotfiles --skill mermaid-d2

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It prevents broken documentation visuals by validating Mermaid or d2 diagram syntax before you ship the rendered output.

Core Features & Use Cases

  • Render Mermaid or d2 diagrams on demand: create clear architecture, flow, sequence, ER, and state diagrams using the diagram source as the source of truth.
  • Syntax validation via tool rendering: detects silent parse errors early by rendering first to catch errors before saving final artifacts.
  • Export diagrams for docs and repos: produce rasterized SVG/PNG (or GitHub-renderable markdown workflows) so diagrams can live next to code and documentation.

Quick Start

Use the mermaid-d2 skill to render an architecture diagram from the diagram text I provide, and save it to docs/architecture.svg.

Frequently Asked Questions about mermaid-d2

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

FAQPage Schema
How do I validate Mermaid diagram syntax before exporting to SVG?

To validate Mermaid diagram syntax before exporting, you can render the diagram source locally to detect silent parse errors early. This rendering step ensures the syntax is correct before saving the final SVG or PNG artifacts for technical documentation.

What is the best way to generate d2 architecture diagrams for code repositories?

Generating d2 architecture diagrams for repositories involves rendering diagram text sources into visual formats like SVG or PNG. Using the source text as the single source of truth keeps system architecture visualizations consistent with the underlying codebase.

Can I render d2 sequence and ER diagrams locally for documentation?

Yes, you can render d2 sequence and ER diagrams locally for documentation. Local rendering via the render_diagram tool validates the syntax and produces deterministic output files, ensuring visuals are trustworthy before shipping.

Does Mermaid syntax validation catch errors before saving final diagram artifacts?

Yes, Mermaid syntax validation catches errors before saving final diagram artifacts. By rendering the diagram first to detect silent parse errors, it prevents broken documentation visuals from being exported to your docs or repos.

How to export validated flowcharts to GitHub-renderable markdown workflows?

To export validated flowcharts to GitHub-renderable markdown workflows, you render the diagram source to verify syntax, then generate the appropriate markdown or rasterized SVG/PNG output files. This ensures diagrams live consistently next to your code.