RFC: c4-beta - a modern, Structurizr-inspired C4 diagram type #7844
Replies: 5 comments 1 reply
-
|
Update: the prototype in #7843 now implements the complete proposal - all five diagram kinds work end to end (context, container, component, dynamic with numbered steps, deployment with nested nodes), plus the Remaining from the proposal (in preparation as separate follow-ups): auto-generated legend (on by default, |
Beta Was this translation helpful? Give feedback.
-
|
Do you need the |
Beta Was this translation helpful? Give feedback.
-
|
Thanks @simonbrowndotje, that is really helpful coming from you, and you are right. It also matches the direction c4-beta already leans: styling is tag-based ( (For backward compatibility the legacy If you have any other thoughts on the syntax we would genuinely welcome them - thanks again for taking the time to look. |
Beta Was this translation helpful? Give feedback.
-
|
And while we have your attention, a few design questions we would genuinely value your view on for c4-beta (no pressure):
Thanks again - your input genuinely shapes this. |
Beta Was this translation helpful? Give feedback.
-
|
Thank you, this is incredibly useful (and congratulations on the book!). Acting on all three:
Thanks again - this has materially improved the design. |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Motivation
The current C4 diagram is experimental, uses a hand-rolled row-based layout (no real layout algorithm), and its C4-PlantUML macro syntax (
Person(alias, "label", ...)) is verbose and error-prone. Issues #7492, #7358, #4906 and discussion #4522 document the pain. In parallel to the unified-renderer migration for the existing syntax (#7673, first slice #7842), we propose a new diagram type with a clean, mermaid-idiomatic syntax modeled on the Structurizr DSL.This design has been reviewed by Simon Brown (@simonbrowndotje), the creator of the C4 model and Structurizr, in the comments below. The syntax now reflects his guidance.
Proposed syntax
Deployment diagrams add
deploymentNode(nestable, with instance counts),infrastructureNode(DNS, load balancers, firewalls), and inline container declarations:Design principles
softwareSystemwith a{}body renders as a boundary; a leaf renders as a box. The same element naturally appears at the right zoom level per diagram.c4-beta+ kind (context|container|component|dynamic|deployment). The kind drives validation and the legend caption, not the grammar.person,softwareSystem,container,component,deploymentNode,infrastructureNode, plusgroupfor boundaries. No shortsystem/nodealiases -nodeis overloaded andsoftwareSystemstays unambiguous if hardware systems ever appear. Elements render their proper C4 type (e.g. <>).-->/<--;<-->exists as a discouraged shorthand for two relationships. Inter-container relationships carry a technology/protocol.:::tag+style <tag> key:value, ....externalis not a keyword - it is a conventional:::externaltag that ships an overridable default grey style (Simon removedexternalfrom Structurizr because it requires a point of reference; tags avoid that).Design decisions confirmed with Simon Brown
externalkeyword; use a conventional:::externaltag with an overridable default style (the tags-and-tagging route from Structurizr).softwareSystem/deploymentNodekeywords (avoid the overloadednode; stay unambiguous vs hardware systems).infrastructureNode+ deployment-node instance counts are essential to reproduce the canonical Live deployment example - now implemented.Status
Working prototype: draft PR #7843 - langium grammar, db with
getData() -> LayoutData, unified renderer, all five C4 kinds (context, container, component, dynamic, deployment), tag-based styling, the C4 person shape, infrastructureNode + instance counts, and the reproduced Live deployment example. Tracker: #7849.The legacy C4 syntax remains untouched and fully supported; c4-beta is purely additive (like architecture-beta).
Full disclosure: this proposal and prototype were prepared with assistance from Claude Code; all changes were reviewed and tested by a human.
Beta Was this translation helpful? Give feedback.
All reactions