<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Berny0x</title>
    <description>The latest articles on DEV Community by Berny0x (@berny0x).</description>
    <link>https://dev.to/berny0x</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3663207%2F4aa486c0-3708-4503-906e-63a1a8d9b733.png</url>
      <title>DEV Community: Berny0x</title>
      <link>https://dev.to/berny0x</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/berny0x"/>
    <language>en</language>
    <item>
      <title>ArchiMate® diagrams as code with Mermaid</title>
      <dc:creator>Berny0x</dc:creator>
      <pubDate>Sat, 14 Nov 2026 11:22:45 +0000</pubDate>
      <link>https://dev.to/berny0x/archimater-diagrams-as-code-with-mermaid-1ni4</link>
      <guid>https://dev.to/berny0x/archimater-diagrams-as-code-with-mermaid-1ni4</guid>
      <description>&lt;p&gt;Developers already have text formats for nearly every diagram: flowcharts, sequence diagrams, ER diagrams, C4. They write them in Markdown, review them in pull requests, and the docs site renders them.&lt;/p&gt;

&lt;p&gt;Enterprise architects mostly don't have that. ArchiMate®, the standard modelling language for enterprise architecture, lives in desktop tools. The diagrams leave those tools as PNG screenshots, which drift out of date the day after they're pasted into a wiki.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://archimaid.org" rel="noopener noreferrer"&gt;Archimaid&lt;/a&gt;&lt;/strong&gt; brings ArchiMate 3.2 to Mermaid. You write a diagram as text, a Mermaid plugin draws it in standard ArchiMate notation, and a CLI checks it in CI.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ftje91nlyltcgnptuw9bo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ftje91nlyltcgnptuw9bo.png" alt=" " width="800" height="434"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This post covers:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A 60-second ArchiMate primer&lt;/li&gt;
&lt;li&gt;Your first diagram&lt;/li&gt;
&lt;li&gt;Relationships and the connector shorthand&lt;/li&gt;
&lt;li&gt;Layouts, nesting, notes and links&lt;/li&gt;
&lt;li&gt;Integrating it into a site, a docs pipeline and CI&lt;/li&gt;
&lt;li&gt;Letting an AI assistant write the diagrams&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Try every snippet as you read:&lt;/strong&gt; &lt;a href="https://try.archimaid.org" rel="noopener noreferrer"&gt;try.archimaid.org&lt;/a&gt; is a browser playground with live rendering and inline errors. You don't need to install anything.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  ArchiMate in 60 seconds
&lt;/h2&gt;

&lt;p&gt;ArchiMate describes an organisation in &lt;strong&gt;layers&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Strategy:&lt;/strong&gt; capabilities, value streams, resources&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Business:&lt;/strong&gt; actors, roles, processes, services, business objects&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Application:&lt;/strong&gt; components, services, data objects&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Technology:&lt;/strong&gt; nodes, devices, system software, networks&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Physical:&lt;/strong&gt; equipment, facilities, materials&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Implementation &amp;amp; Migration:&lt;/strong&gt; work packages, plateaus, gaps&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Motivation&lt;/strong&gt; sits alongside all of these: stakeholders, goals, requirements, principles&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Every element has an exact type, and every type has a standard symbol. A business process is a rounded yellow box with an arrow icon. An application component is a blue box with the component icon. Typed &lt;strong&gt;relationships&lt;/strong&gt; connect the elements: serving, realization, assignment, access, triggering, flow and a few more. Each has its own line style.&lt;/p&gt;

&lt;p&gt;That precision is what makes ArchiMate useful. "The order service &lt;em&gt;serves&lt;/em&gt; the fulfilment process" means something different from "the order service &lt;em&gt;realizes&lt;/em&gt; it". It's also why a generic box-and-arrow tool falls short.&lt;/p&gt;

&lt;h2&gt;
  
  
  Your first diagram
&lt;/h2&gt;

&lt;p&gt;Install the package:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm install archimaid mermaid
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A diagram starts with the &lt;code&gt;archimate-beta&lt;/code&gt; header. Each line declares one element or relationship:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;archimate-beta
  direction LR
  accTitle: Order fulfilment responsibilities

  element businessRole clerk "Fulfilment clerk"
  element businessProcess fulfil "Fulfil order"
  relationship assignment clerk_to_fulfil clerk -&amp;gt; fulfil
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The parts of an element declaration are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;element&lt;/code&gt; is the keyword&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;businessRole&lt;/code&gt; is the ArchiMate type (all 60 types use camelCase keys)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;clerk&lt;/code&gt; is a stable ID that you reference later&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;"Fulfilment clerk"&lt;/code&gt; is the label shown in the diagram&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The relationship line reads as &lt;em&gt;the clerk is assigned to the fulfil process&lt;/em&gt;. &lt;code&gt;accTitle&lt;/code&gt; gives the SVG an accessible name. Use it.&lt;/p&gt;

&lt;p&gt;Misspell a type and the validator suggests the closest match:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx archimaid validate diagram.mmd
&lt;span class="c"&gt;# diagram.mmd:5:11: Unknown element type "businesProcess". Did you mean "businessProcess"?&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Relationships: long form and shorthand
&lt;/h2&gt;

&lt;p&gt;The long form, &lt;code&gt;relationship &amp;lt;type&amp;gt; &amp;lt;id&amp;gt; &amp;lt;source&amp;gt; -&amp;gt; &amp;lt;target&amp;gt;&lt;/code&gt;, is explicit and gives the relationship an ID you can reference. Most of the time you'll want the &lt;strong&gt;shorthand&lt;/strong&gt; instead. It's modelled on Mermaid's own connectors:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;archimate-beta
  direction LR
  element businessProcess fulfil "Fulfil order"
  element applicationComponent oms "Order management system"
  element applicationFunction manage "Manage orders"
  element applicationService orders "Order management"
  element dataObject order "Order record"

  oms @==&amp;gt; manage
  manage ..|&amp;gt; orders
  orders --&amp;gt; fulfil
  manage &amp;lt;.. order
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Read it left to right. The left endpoint is always the source in the model:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Relationship&lt;/th&gt;
&lt;th&gt;Shorthand&lt;/th&gt;
&lt;th&gt;Reads as&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Composition&lt;/td&gt;
&lt;td&gt;&lt;code&gt;a *-- b&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a is composed of b&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Aggregation&lt;/td&gt;
&lt;td&gt;&lt;code&gt;a o-- b&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a aggregates b&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Assignment&lt;/td&gt;
&lt;td&gt;&lt;code&gt;a @==&amp;gt; b&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a is assigned to b&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Realization&lt;/td&gt;
&lt;td&gt;`a ..\&lt;/td&gt;
&lt;td&gt;&amp;gt; b`&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Serving&lt;/td&gt;
&lt;td&gt;&lt;code&gt;a --&amp;gt; b&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a serves b&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Access (read / write / both)&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;a &amp;lt;.. b&lt;/code&gt; / &lt;code&gt;a ..&amp;gt; b&lt;/code&gt; / &lt;code&gt;a &amp;lt;..&amp;gt; b&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;a reads / writes / reads and writes b&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Influence&lt;/td&gt;
&lt;td&gt;&lt;code&gt;a -.-&amp;gt; b&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a influences b&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Association&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;a --- b&lt;/code&gt; (or &lt;code&gt;a --/ b&lt;/code&gt; when directed)&lt;/td&gt;
&lt;td&gt;a is associated with b&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Triggering&lt;/td&gt;
&lt;td&gt;&lt;code&gt;a ==&amp;gt; b&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a triggers b&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Flow&lt;/td&gt;
&lt;td&gt;&lt;code&gt;a -.=&amp;gt; b&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a flows to b&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Specialization&lt;/td&gt;
&lt;td&gt;`a --\&lt;/td&gt;
&lt;td&gt;&amp;gt; b`&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The glyphs mirror what gets drawn. &lt;code&gt;..&lt;/code&gt; is dotted, &lt;code&gt;-.&lt;/code&gt; is dashed, &lt;code&gt;|&amp;gt;&lt;/code&gt; is a hollow triangle and &lt;code&gt;=&amp;gt;&lt;/code&gt; is a filled arrowhead. Add a visible label with &lt;code&gt;: "Text"&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;archimate-beta
  element applicationComponent shop "Web shop"
  element applicationComponent oms "Order management"
  shop -.=&amp;gt; oms : "Placed orders"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;manage &amp;lt;.. order&lt;/code&gt; needs a second look. The arrow points at &lt;code&gt;manage&lt;/code&gt;, because that's how ArchiMate draws a read access, but the model still says &lt;em&gt;manage reads order&lt;/em&gt;. The shorthand follows the picture and the model stays correct.&lt;/p&gt;

&lt;h2&gt;
  
  
  Layouts
&lt;/h2&gt;

&lt;p&gt;Archimaid has three layouts.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;layout architecture&lt;/code&gt;&lt;/strong&gt; is the default. It stacks the occupied layers top to bottom (Strategy, Business, Application, Technology, Implementation &amp;amp; Migration), with Motivation at the top. Relationships pull connected elements towards each other. This is the layered view that architects expect.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;layout framework&lt;/code&gt;&lt;/strong&gt; puts the same layers in fixed columns: passive structure, behaviour and active structure from left to right, with Motivation on the right. It's useful for teaching and for full-framework overviews.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;layout graph&lt;/code&gt;&lt;/strong&gt; drops the layers and places elements purely by their relationships, using ELK. Writing &lt;code&gt;direction TB&lt;/code&gt;, &lt;code&gt;BT&lt;/code&gt;, &lt;code&gt;LR&lt;/code&gt; or &lt;code&gt;RL&lt;/code&gt; on its own selects it. The examples above use &lt;code&gt;direction LR&lt;/code&gt;, so they're graph layouts.&lt;/p&gt;

&lt;p&gt;In architecture and framework layout, relationships of the same type that leave the same element share one anchor and run as one trunk before branching. That keeps busy diagrams readable without manual routing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Nesting, notes and links
&lt;/h2&gt;

&lt;p&gt;Nest elements by declaring them inside a block:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;archimate-beta
  accTitle: Order management components

  element applicationComponent storefront "Storefront"
  element applicationComponent suite "Order management suite" {
    element applicationComponent orders "Order processing"
    element applicationComponent billing "Billing"
  }

  suite *-- orders
  suite *-- billing
  storefront -.=&amp;gt; orders
  orders -.=&amp;gt; billing

  note review "Confirm retry behaviour\nwith the billing team" on suite
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;ArchiMate lets nesting stand in for a relationship. Because &lt;code&gt;suite *-- orders&lt;/code&gt; is a composition from parent to child, the enclosure represents it and no line is drawn. Without such a relationship, nesting is purely visual grouping. Both are valid, and Archimaid handles both.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;note ... on suite&lt;/code&gt; attaches a note to the top edge of the element. Leave out &lt;code&gt;on&lt;/code&gt; for a standalone note, which can then be connected like an element.&lt;/p&gt;

&lt;p&gt;Elements can also link to a runbook, an ADR or a wiki page:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;archimate-beta
  element applicationComponent billing "Billing"
  description billing "Handles invoicing."
  click billing href "https://wiki.example.com/billing" "Open the billing runbook"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Hovering shows the type, the name and the description, or the tooltip if you set one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Putting it all together
&lt;/h2&gt;

&lt;p&gt;Here's a cross-layer view of an online shop:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;archimate-beta
  accTitle: Online order fulfilment
  accDescr: A fulfilment clerk runs the fulfil order process, supported by the order management system on the shop platform.

  element businessActor customer "Customer"
  element businessRole clerk "Fulfilment clerk"
  element businessProcess fulfil "Fulfil order"
  element businessService delivery "Order delivery"

  element applicationComponent oms "Order management system" {
    element applicationComponent billing "Billing"
  }
  element applicationFunction manage "Manage orders"
  element applicationService orders "Order management"
  element dataObject order "Order record"

  element node platform "Shop platform"
  element technologyService hosting "Container hosting"

  clerk @==&amp;gt; fulfil
  fulfil ..|&amp;gt; delivery
  delivery --&amp;gt; customer

  oms *-- billing
  oms @==&amp;gt; manage
  manage ..|&amp;gt; orders
  orders --&amp;gt; fulfil
  manage ..&amp;gt; order

  platform ..|&amp;gt; hosting
  hosting --&amp;gt; oms
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Without &lt;code&gt;layout&lt;/code&gt; or &lt;code&gt;direction&lt;/code&gt;, this uses architecture layout. Business is on top, application in the middle and technology at the bottom. Paste it into &lt;a href="https://try.archimaid.org" rel="noopener noreferrer"&gt;the playground&lt;/a&gt; to see it, then try &lt;code&gt;layout framework&lt;/code&gt; and &lt;code&gt;layout graph&lt;/code&gt; on the same source.&lt;/p&gt;

&lt;h2&gt;
  
  
  Integrating it
&lt;/h2&gt;

&lt;h3&gt;
  
  
  In a web page with a bundler
&lt;/h3&gt;

&lt;p&gt;Archimaid uses Mermaid's public &lt;code&gt;registerExternalDiagrams&lt;/code&gt; API, so registration is two lines:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;mermaid&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s1"&gt;'mermaid'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;archimate&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s1"&gt;'archimaid'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="n"&gt;mermaid&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;initialize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;startOnLoad&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;securityLevel&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'strict'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;mermaid&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;registerExternalDiagrams&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;archimate&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;svg&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;mermaid&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;render&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'fulfilment'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;source&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'#diagram'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;innerHTML&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;svg&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Without a bundler
&lt;/h3&gt;

&lt;p&gt;Load both prebuilt ES modules from a CDN, and every &lt;code&gt;&amp;lt;pre class="mermaid"&amp;gt;&lt;/code&gt; on the page renders:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;pre&lt;/span&gt; &lt;span class="na"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"mermaid"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
archimate-beta
  element businessRole clerk "Fulfilment clerk"
  element businessProcess fulfil "Fulfil order"
  clerk @==&amp;gt; fulfil
&lt;span class="nt"&gt;&amp;lt;/pre&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;script&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"module"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;mermaid&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s1"&gt;'https://cdn.jsdelivr.net/npm/mermaid@12/dist/mermaid.esm.min.mjs'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;archimate&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s1"&gt;'https://cdn.jsdelivr.net/npm/archimaid@0/dist/bundle/archimaid.esm.min.mjs'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="n"&gt;mermaid&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;initialize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;startOnLoad&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;securityLevel&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'strict'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;mermaid&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;registerExternalDiagrams&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;archimate&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;mermaid&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The same approach works in any docs site where you control Mermaid's initialisation, such as a custom VitePress or Docusaurus theme, or a plain static site.&lt;/p&gt;

&lt;h3&gt;
  
  
  Theming
&lt;/h3&gt;

&lt;p&gt;Mermaid's &lt;code&gt;dark&lt;/code&gt; theme is supported. With &lt;code&gt;theme: 'base'&lt;/code&gt;, the diagram takes its background, line colour, text colour and font from &lt;code&gt;themeVariables&lt;/code&gt;, so it blends in with the rest of your site. For padding, palette and row-wrapping options, register an instance from &lt;code&gt;createArchiMatePlugin&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;createArchiMatePlugin&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s1"&gt;'archimaid'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;mermaid&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;registerExternalDiagrams&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;
  &lt;span class="nf"&gt;createArchiMatePlugin&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;diagramPadding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;32&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'transparent'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  On GitHub
&lt;/h3&gt;

&lt;p&gt;GitHub ships a fixed Mermaid build and can't load external diagrams, so an &lt;code&gt;archimate-beta&lt;/code&gt; block won't render there. The workaround: commit the &lt;code&gt;.mmd&lt;/code&gt; source next to an exported SVG and embed the SVG.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm install --save-dev playwright
npx playwright install chromium
npx archimaid render fulfilment.mmd fulfilment.svg
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;![Online order fulfilment](fulfilment.svg)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Reviewers see the readable text diff, and readers see the picture.&lt;/p&gt;

&lt;h3&gt;
  
  
  In CI
&lt;/h3&gt;

&lt;p&gt;The validator needs no browser. It reads &lt;code&gt;.mmd&lt;/code&gt; files and the &lt;code&gt;archimate-beta&lt;/code&gt; blocks inside Markdown, and reports Markdown line numbers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="c1"&gt;# .github/workflows/diagrams.yml
&lt;/span&gt;&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Diagrams&lt;/span&gt;
&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;push&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;pull_request&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;validate&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v4&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/setup-node@v4&lt;/span&gt;
        &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;node-version&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;22&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;npx --yes archimaid validate --format github docs/&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;--format github&lt;/code&gt; turns each problem into an inline annotation on the pull request. &lt;code&gt;--format json&lt;/code&gt; is there for other tooling.&lt;/p&gt;

&lt;h3&gt;
  
  
  In your own tooling
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;archimaid/language&lt;/code&gt; runs anywhere Node runs, with no DOM needed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;validateArchiMate&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s1"&gt;'archimaid/language'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;diagnostics&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;validateArchiMate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;source&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="n"&gt;diagnostics&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sb"&gt;`${d.line}:${d.column} ${d.severity} ${d.code}: ${d.message}`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every diagnostic has a code, a severity and a start and end range, so an editor can underline the exact token. The browser playground uses this to show inline errors.&lt;/p&gt;

&lt;h2&gt;
  
  
  Letting an AI write it
&lt;/h2&gt;

&lt;p&gt;A plain-text format with a strict validator suits language models well. They write a draft, the validator points at the line that's wrong, and they fix it.&lt;/p&gt;

&lt;p&gt;The package includes a skill file (&lt;code&gt;skills/archimaid/SKILL.md&lt;/code&gt;) that teaches an assistant the syntax, the 60 type keys, the connectors and the layout rules. Point Claude Code, Codex, Cursor or another skill-aware agent at it, and ask for &lt;em&gt;"an ArchiMate view of how our checkout service supports the order process"&lt;/em&gt;. You get a diagram you can validate, review and commit.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it doesn't do (yet)
&lt;/h2&gt;

&lt;p&gt;Archimaid is for &lt;strong&gt;authoring diagrams, not managing models&lt;/strong&gt;. It isn't trying to replace Archi or a commercial repository. Currently out of scope:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Checking relationships against ArchiMate's Appendix B.&lt;/strong&gt; The validator checks syntax, types, endpoints and nesting. It doesn't yet check that, say, a data object may serve a business role. This is under development and depends on permission from The Open Group to distribute the relationship table.&lt;/li&gt;
&lt;li&gt;Junctions, relationships on relationships, alternative figures, viewpoints and model exchange.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The syntax is called &lt;code&gt;archimate-beta&lt;/code&gt; for a reason, and feedback will shape it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Playground:&lt;/strong&gt; &lt;a href="https://try.archimaid.org" rel="noopener noreferrer"&gt;try.archimaid.org&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Docs:&lt;/strong&gt; &lt;a href="https://archimaid.org" rel="noopener noreferrer"&gt;archimaid.org&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Source:&lt;/strong&gt; &lt;a href="https://github.com/Archimaid/archimaid" rel="noopener noreferrer"&gt;github.com/Archimaid/archimaid&lt;/a&gt; (MIT)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;npm:&lt;/strong&gt; &lt;a href="https://www.npmjs.com/package/archimaid" rel="noopener noreferrer"&gt;archimaid&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you work with ArchiMate, I'd especially like to hear where the syntax feels wrong. Open an issue or leave a comment below.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;ArchiMate® is a registered trademark of The Open Group. Archimaid is an independent project, not affiliated with or endorsed by The Open Group.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>mermaid</category>
      <category>architecture</category>
      <category>documentation</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
