Architecture diagrams as code: render and edit trustdiagram blocks, checked against their model.
Architecture diagrams as code. Never trust a drawing. Always verify the model.
TrustDiagram turns a short YAML block into an architecture diagram, in Obsidian and in Confluence. The block is the single source of truth. Code checks every box and every arrow before anything is drawn, so no diagram shows what the model does not say.
Free to use, by Blooo. This plugin is closed source.
Rendered from examples/online-shop.trustdiagram.yaml: no position written by hand, everything placed and checked by code.
A drawing can say anything. Boxes get copied, arrows point to systems that were renamed long ago, and nobody can tell what is real. In a review, a diagram should be evidence, not a promise.
TrustDiagram applies Blooo's principle, never trust, always verify, to diagrams:
model holds the meaning (elements, relations, protocols, data). layout holds the positions. Moving a box with the mouse rewrites layout only, never the meaning.```trustdiagram
trustdiagram: 1
id: payments-containers
title: Payments — containers
kind: flow
model:
elements:
- { id: web, type: container, name: Web app, tech: React }
- { id: api, type: container, name: Payments API, tech: Go }
- { id: db, type: datastore, name: Ledger, tech: PostgreSQL }
relations:
- { id: r1, from: web, to: api, label: pays, protocol: HTTPS, mode: sync }
- { id: r2, from: api, to: db, protocol: SQL }
```
Without a layout, elements are placed automatically. Move them with the mouse and only layout is written back to the block.
| Fully placed by hand | Placed automatically, top to bottom |
|---|---|
ci-cd-pipeline |
photo-sharing |
| System context (C4 level 1) | Display rules |
|---|---|
library-context |
regles |

trustdiagram code blocks in notes, with a full-screen graphical editor and a zoomable viewer.{{key}} references in labels, "if… then…" rules (colours, stroke, icons), evaluated at every render.trustdiagram lint and the Obsidian commands compute the layout as drawn and report overflowing text, arrows crossing boxes and overlapping labels, each with a fix hint, so an agent can check and correct a diagram in a loop.trustdiagram validate in CI, trustdiagram lint for layout, trustdiagram render to SVG or PNG.trustdiagram blocks: saving from the editor, Insert a diagram, Pin the layout, and the two Recompute the layout commands (which rewrite layout only)._trustdiagram/ by default (set in the plugin settings): Export writes an SVG and a PNG per diagram, Export and Check the layout write a layout report per diagram, and every note command (including Recompute the layout) writes a status file for its last run. Nothing else is written outside the notes, and only when you run these commands.data.json.Report vulnerabilities privately: see SECURITY.md.
Proprietary, free to use: see LICENSE. Versions 0.8.0 and earlier were published under the Apache License 2.0. Third-party components keep their own licences: see NOTICE and third-party licenses.
Made by Blooo: cybersecurity governance and architecture for critical organisations. Never trust. Always verify.