GitHubGitHub Stars
← All posts

Why I'm building yet another UML tool in 2026

Twenty years in automotive R&D, a weekend mapping the UML tool landscape, and one structural gap nobody talks about.

  • kUML
  • architecture
  • kotlin
  • uml
  • modeling

Let me get the obvious objection out of the way.

PlantUML exists. Mermaid renders natively on GitHub. draw.io is free and works. Enterprise Architect, MagicDraw, Rhapsody and Papyrus cover the heavy end. By any reasonable count, the world has somewhere north of forty UML tools, and most teams complain about exactly one of them: the one they have to use.

So why build another?

The honest answer has three parts. I’ll walk through each — including the parts where my reasoning is shaky, and the one structural gap I think the whole category has been ignoring for a decade.


What’s actually broken

I’ve spent twenty years writing UML and SysML in automotive R&D — Car2x, autonomous driving, safety-critical embedded systems at Keysight. The diagrams aren’t decoration. They drive code generation, ISO 26262 evidence, and reviews with hardware engineers who don’t read Kotlin.

Here is the workflow that every automotive team I know actually runs, regardless of which tool sits in the middle:

  1. Draw the diagram in EA, MagicDraw, or Papyrus.
  2. Export PNG.
  3. Paste into Confluence or a Word deliverable.
  4. Change the class in the code six weeks later.
  5. Forget the diagram exists.
  6. Eight months on, the safety auditor asks which version is binding. Nobody knows.

This is not a tooling failure of any one product. It’s a property of treating the model and the code as two separate artifacts that happen to describe the same thing. The gap between them grows by default, every sprint, forever. No amount of “discipline” closes it — I’ve watched senior people try.

PlantUML and Mermaid tried to fix this by making the diagram text. That was the right move and the wrong implementation. Both are bespoke text formats, parsed by bespoke engines, with no connection whatsoever to the code they’re supposed to describe. You can write User <|-- Admin in PlantUML on Monday and rename Admin to Administrator in Kotlin on Tuesday, and nothing — not the IDE, not the compiler, not CI — will tell you the diagram is now lying.

The enterprise tools (EA, MagicDraw, Rhapsody) do understand types and constraints. They’re genuine modelling tools. They also cost five figures per seat, need administrators, and ship a UI that was state of the art around the time Windows XP launched.

Every one of these tools treats UML as a separate artifact from the code. That is the structural flaw. Everything else is decoration.


Two empty quadrants

I spent a weekend mapping the modelling-tool landscape — text DSLs, classic CASE tools, executable-UML attempts, code-as-diagram libraries. The detailed breakdown lives on kuml.dev/why for anyone who wants the full matrix.

Two findings refused to leave me alone.

Nobody has built a modelling tool on a typed host language. Plenty of Python libraries draw diagrams. Plenty of Java APIs sit on top of EMF. There are dozens of custom text grammars. There is no serious modelling tool that treats the model as ordinary code in a modern, statically-typed language, with first-class IDE refactoring across model and code. That’s a structural gap, not a language-preference argument — it happens that Kotlin’s type-safe builders are the cleanest fit available today, but the point would stand for any equivalent host.

Nobody designs for the LLM era. PlantUML and Mermaid are LLM-friendly by accident — they have enormous training footprints. “Common in training data” is a fragile moat that erodes the day a typed, verifiable alternative appears. None of the major tools have asked the obvious question: what does a modelling language look like if you assume an LLM writes half the diagrams? Named parameters everywhere. Compile-checkable output. An MCP server so the agent can introspect the model. A benchmark that measures how often the generated model actually type-checks.

These aren’t wishlist features. They’re empty quadrants on the market map. Building kUML is partly a bet that those quadrants are empty because they’re hard, not because nobody wants them.


The idea I couldn’t shake

What if the UML diagram and the code were written in the same language?

Not “next to” the code. Not “generated from” the code. The same artifact. Same compiler. Same IDE. Same refactoring engine. Same review tooling.

Kotlin has a feature called type-safe builders — DSLs implemented as ordinary function calls. If you’ve used Gradle’s Kotlin DSL, you’ve already seen it: dependencies { implementation("…") } looks like configuration but is in fact a Kotlin function call that the IDE understands, the refactorer can rename, and the compiler can check.

A class diagram in kUML looks like this:

@file:Suppress("unused")

import dev.kuml.core.dsl.classDiagram
import dev.kuml.uml.dsl.association
import dev.kuml.uml.dsl.attribute
import dev.kuml.uml.dsl.classOf
import dev.kuml.uml.dsl.operation
import dev.kuml.uml.dsl.returns

classDiagram("E-Commerce Domain") {

    val order = classOf("Order") {
        attribute(name = "id",        type = "UUID")
        attribute(name = "createdAt", type = "Instant")
        attribute(name = "status",    type = "OrderStatus")
        operation(name = "confirm")   { returns("Boolean") }
    }

    val orderItem = classOf("OrderItem") {
        attribute(name = "quantity",  type = "Int")
        attribute(name = "unitPrice", type = "BigDecimal")
    }

    association(source = order, target = orderItem) {
        name = "items"
        target { multiplicity("1..*") }
    }
}

This is a .kuml.kts file — a Kotlin script — sitting inside your Gradle project. The JetBrains plugin’s rename action propagates across all classOf references in the diagram. Elements show up in IntelliJ’s Find Usages. The diagram lives in source control, in code review, in the same diff as the classes it describes.

The multiplicity("1..*") on the orderItem end is not a label — it’s part of the model. The M2M transformers read it: kuml transform --transformer uml-to-jpa uses it to decide whether the JPA relationship becomes @OneToMany or @ManyToOne.

What’s still coming: OCL constraint evaluation. The goal is that self.items->size() >= 1 embedded in the model fails your CI build the moment the constraint is violated. The structural checks already reach CI (kuml validate catches duplicate IDs, circular inheritance, dangling references); the OCL evaluation layer is next.


What kUML is today

Let me be specific about what exists, because the “class diagrams only” framing I used in early talks is no longer accurate.

Diagram types — all shipped: all 14 UML 2 types (class, sequence, activity, state machine, component, deployment, use case, and more), all 8 SysML 2 types (BDD, IBD, UC, REQ, STM, ACT, SEQ, PAR), and C4 architecture diagrams.

IDE integration: the JetBrains plugin gives you a live SVG preview pane (300 ms debounce), 38 DSL autocomplete items, rename refactoring across model and code, code folding with named placeholders, and inline error squiggles — all in .kuml.kts files that IntelliJ already understands as Kotlin.

Interfaces: kuml serve launches a browser-based editor with live preview and SVG/PNG/LaTeX download. kuml-desktop is a standalone Compose desktop app — edit and preview with no server, no browser required. The CLI covers render, validate, simulate, reverse, run, and transform.

Reverse engineering: kuml reverse <source-dir> reads existing Java (JavaParser) or Kotlin (PSI K2) code and emits a clean .kuml.kts model. Smoke test: parsing 10 production Kotlin files in ~550 ms to a 267-line model.

Code generation — five M2M transformers: Kotlin JPA @Entity classes, OpenAPI 3.0 YAML, Kubernetes Deployment + Service manifests, Dockerfiles, C4→UML converter. The transformer registry uses ServiceLoader — custom transformers plug in without forking the CLI.

Runtime: kuml run drives state machines interactively (REPL), via REST (MCP adapter), or from a batch events file. kuml simulate produces deterministic JSON traces with OpenTelemetry OTLP export for Jaeger or Grafana Tempo.

Distribution: sdk install kuml via SDKMAN! on five platforms. Native installers: .deb, .rpm, .dmg, .msi. Docker: ghcr.io/kuml-dev/kuml-cli. JVM library on Maven Central. Homebrew tap.

What’s still in progress: full OCL constraint evaluation inside CI pipelines (structural validation via kuml validate exists; running self.items->size() >= 1 against a live model in your Gradle build is the next milestone), and XMI import/export for full round-trip interoperability with EA and Papyrus.

We’re at v0.10.0. The core idea — UML as Kotlin code, validated by your compiler — works. If you’ve ever had a code review where someone pointed out that the sequence diagram no longer matches reality: there is a working tool for you today.


Why not just extend PlantUML?

I considered it. PlantUML is Java, open source, actively maintained — extending it would have been the path of least resistance.

The problem is that the gap I care about can’t be patched. PlantUML’s parser is a bespoke text format. There is no Kotlin type system to lean on. There is no typed metamodel. Adding genuine type-safety to PlantUML isn’t a feature; it’s a rewrite. And a rewrite constrained by fifteen years of backwards-compatible .puml files inherits every design choice that produced the original problem.

kUML’s single design constraint is the diagram is Kotlin code. Everything else falls out for free. IDE support is already there because it’s a .kt file. Refactoring works because IntelliJ doesn’t know it’s a “diagram”. Type-checking works because it’s the same compiler that checks the rest of your codebase. Build integration is just Gradle. There is no new language server to write, no new parser to maintain, no new plugin ecosystem to bootstrap.

That only works if you start over.


The MDA angle

There’s a deeper bet here that I’ll write about in future posts.

kUML is built around Model Driven Architecture — the OMG standard that defines a workflow from Platform-Independent Models through Platform-Specific Models to deployment artifacts. The idea is that you write the domain model once and transform it, automatically, into JPA entities, REST contracts, Kubernetes manifests, Docker Compose files.

MDA isn’t a new idea. It was proposed in the early 2000s and mostly failed in practice, because the tooling was too heavy, too expensive, and too far from how developers actually work.

kUML’s bet is that a Kotlin-native MDA toolchain — one that lives inside Gradle, renders inside your IDE, validates inside CI — is the version that actually works. Lightweight enough to adopt incrementally. Native enough not to fight the rest of your stack.

The early evidence says yes. Five M2M transformers already generate JPA entities, OpenAPI contracts, Kubernetes manifests, and Dockerfiles from a kUML model — code that downstream tooling accepts directly. The transformer registry is pluggable via ServiceLoader.

What’s still ahead: a full PIM → PSM → deployment pipeline with automatic dependency resolution, OCL-validated model consistency before transformation, and XMI round-trip with EA and Papyrus. The bet isn’t settled — but it’s no longer just a hypothesis.


What this blog will be

This is where I’ll write about the work of building kUML. Not changelogs — those are on What’s New. The actual decisions:

  • Why a hand-written Kotlin metamodel — sealed interface plus data class plus kotlinx.serialization — beats EMF/Ecore for this problem.
  • How OCL constraint validation slots into a Gradle build.
  • What the JetBrains plugin platform requires for a custom DSL.
  • Where the rendering model breaks first under complex sequence diagrams.
  • What the LLM benchmark actually measures, and what I had to throw away on the third attempt.

Sometimes I’ll be wrong, and I’ll say so on the same page where I said the original thing.

If you work with UML, SysML, or domain modelling — particularly if you’ve felt the gap between your models and your code — I think you’ll find this useful.


Irakli Betchvaia — Senior Software Architect at Keysight Technologies, building kUML. GitHub: kuml-dev/kUML. Questions and criticism welcome at irakli@kuml.dev.

Irakli Betchvaia

Senior Software Architect at Keysight Technologies (Car2x, autonomous driving), co-founder of Pepela Innovation. Building kUML in the evenings and weekends. Questions welcome at irakli@kuml.dev.