D2 diagrams
Portable equal-primary Claude and Codex agent harness for a governed agentic SDLC
npx -y skills add mblauberg/provenant --skill d2-diagramsAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- 27 days oldThe repository was created 27 days ago. New is not bad, but a brand new repository carrying a familiar-sounding name is the shape a typosquat arrives in, and there has been no time for anyone else to find a problem with it.
- 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Use for creating, validating, rendering, or exporting D2 source, including fixed-layout and vector-PDF publication figures. Not for Mermaid, Graphviz, or PlantUML requirements diagrams; use engineering-docs or uml-diagrams.
SKILL.md
3.3 KB, as published. Nobody here has run it
D2 diagrams
Use D2 when fixed layout, repeatable exports or publication quality justify maintaining source plus a rendered asset. The project's diagram conventions, source/render owners and terminology are authoritative. Where the project is silent, prefer native Mermaid for GitHub READMEs and living operational docs. Simplify or split an overloaded Mermaid graph before converting it; a tool change cannot fix mixed conceptual levels. A review or validation request is read-only unless edits or exports are explicitly authorised.
Publication figures (anything in a written document)
For a paper, thesis, report or manuscript:
- Match labels to the intended reader. Use implementation names only when exact reproducibility is the figure's purpose.
- Match the target venue's output requirements. D2's native PDF path is PNG-derived; when vector shapes/text are required, render SVG and use a project-approved converter, then inspect the PDF.
Read publication-figures.md before editing a publication figure.
Where To Put Things
- Use the project's diagram directory and naming convention when writes are authorised; otherwise use an assigned run-owned temporary path.
- Export only when requested or required by the authorised workflow.
- Never overwrite unrelated Mermaid or Structurizr artefacts.
Default Workflow
- Choose the reader question and diagram type.
- Draft concise labels and stable identifiers.
- For authorised edits, run
d2 fmt; for read-only review, used2 --check. - Run
d2 validatewhen the installed CLI supports it. If D2 or a required converter is unavailable, report the skipped check rather than installing it. - Render SVG by default to an authorised path; use PNG only when raster is required.
- Open the render and inspect labels, edges, grouping, whitespace and page fit.
Defaults
- Prefer
dagrefor directed flows; tryelkfor dense architecture. - Group related systems; distinguish roles only when it aids the argument.
- Keep detail in prose, follow the project's language convention (otherwise Australian English), and exclude real PII.
Syntax And CLI References
- For core D2 syntax, read references/syntax.md.
- For local CLI usage, read references/cli.md.
- For diagram-shaping and naming guidance, read references/diagram-patterns.md.
Guardrails
- Prefer plain nodes and edges; avoid themes, icons and flourishes by default.
- Do not commit batches of exports without authority.
- Split crowded diagrams instead of forcing one canvas.
d2 playuses a hosted viewer. Do not invoke it for private or undisclosed source without explicit external-disclosure authority.- Close run-owned watch processes and remove only assigned temporary outputs.
- For high-stakes review, load
orchestrate; let runtime routing choose review families and adjudicate findings against render/build evidence.
Official Sources
- D2 repository: https://github.com/terrastruct/d2
- D2 tour/docs: https://d2lang.com/tour/