# Can Diagram Design Be Used for UML Diagrams? Yes—Here's How UML Class Diagrams Work

> Learn how Diagram Design supports UML Class diagrams with a dedicated reference file. Explore grammar, layout rules, and visual conventions to create your own UML diagrams easily.

- Repository: [Cathryn Lavery/diagram-design](https://github.com/cathrynlavery/diagram-design)
- Tags: how-to-guide
- Published: 2026-08-20

---

**Yes, Diagram Design supports UML Class diagrams natively through a dedicated reference file that defines grammar, layout rules, and visual conventions for this diagram type.**

Diagram Design, an open-source skill in the `cathrynlavery/diagram-design` repository, offers built-in UML diagram capabilities—but with a specific scope. This article explains exactly what UML functionality is available, how the system routes UML requests, and what limitations apply.

## What UML Diagram Types Diagram Design Supports

Diagram Design currently implements **only UML Class diagrams**. The visual notation shows a system's static structure: classes, their attributes, operations, and typed relationships.

The skill ships a dedicated reference file at [[`skills/diagram-design/references/type-uml-class.md`](https://github.com/cathrynlavery/diagram-design/blob/main/skills/diagram-design/references/type-uml-class.md)](https://github.com/cathrynlavery/diagram-design/blob/main/skills/diagram-design/references/type-uml-class.md) that serves as the definitive specification. Other UML forms—Sequence, State Machine, Component, Deployment, Activity—are **not implemented as UML types**. Instead, these requests route to corresponding non-UML diagram types (for example, Sequence diagrams redirect to [`type-sequence.md`](https://github.com/cathrynlavery/diagram-design/blob/main/type-sequence.md)).

### How UML Class requests are processed

When you ask for a UML diagram, Diagram Design executes this pipeline:

1. **Type selection** — The skill identifies Class-specific requirements and selects [`type-uml-class.md`](https://github.com/cathrynlavery/diagram-design/blob/main/type-uml-class.md)

2. **Layout application** — Each class renders as a rounded-corner box with up to three compartments: name, attributes, and operations. Typography and spacing follow precise rules defined in the reference

3. **Relationship rendering** — Inheritance, realization, composition, aggregation, association, and dependency all draw with correct arrowheads and line styles per the **Relationship Vocabulary** section

4. **Complexity enforcement** — Hard limits of **7 classes** and **8 relationships** keep outputs editorial-quality and readable

If your request lacks UML-specific elements (no operations, generic entities), the skill automatically falls back to **ER diagrams** via [`type-er.md`](https://github.com/cathrynlavery/diagram-design/blob/main/type-er.md).

## Architecture: How UML Support Fits Into Diagram Design

The UML implementation integrates cleanly with the skill's modular architecture:

- **Routing layer ([`SKILL.md`](https://github.com/cathrynlavery/diagram-design/blob/main/SKILL.md))** — Top-level routing resolves UML Class requests to [`type-uml-class.md`](https://github.com/cathrynlavery/diagram-design/blob/main/type-uml-class.md)

- **Lazy loading** — Only the needed reference file and its primitives load at runtime. The **What loads when** table in [`README.md`](https://github.com/cathrynlavery/diagram-design/blob/main/README.md) documents this behavior

- **Shared primitives** — UML diagrams reuse annotation callouts, sketchy filters, and icon sets from `skills/diagram-design/references/`

This design keeps the skill lightweight while maintaining professional UML output quality.

## Practical Examples: Generating UML Class Diagrams

Run these commands in any supported agent (Claude Code, Codex, Factory Droid, Pi):

### Basic natural language request

```text
Make me a UML class diagram of a User, Post, and Comment system.

```

### Mermaid import with full control

```text
/diagram-design:import-mermaid <<EOF
classDiagram
    class User {
        +id: UUID
        +name: string
        +email: string
        +login()
        +logout()
    }
    class Post {
        +id: UUID
        +title: string
        +content: string
        +publish()
    }
    class Comment {
        +id: UUID
        +text: string
        +author(): User
    }
    User <|-- Post
    User "1" <-- "0..*" Comment : writes
    Post "1" <-- "0..*" Comment : contains
EOF

```

### Format and sizing options

```text
/diagram-design:import-mermaid uml-class.mmd --size=slide-16x9 --detail=balanced --format=svg

```

The [`mermaid_extract.py`](https://github.com/cathrynlavery/diagram-design/blob/main/mermaid_extract.py) script parses `classDiagram` blocks into the skill's internal intermediate representation, which then renders according to [`type-uml-class.md`](https://github.com/cathrynlavery/diagram-design/blob/main/type-uml-class.md) specifications.

## Key Source Files for UML Support

Understanding these files helps you extend or debug UML functionality:

| File | Purpose |
|------|---------|
| [`SKILL.md`](https://github.com/cathrynlavery/diagram-design/blob/main/SKILL.md) | Core routing logic that maps user intent to diagram types |
| [`type-uml-class.md`](https://github.com/cathrynlavery/diagram-design/blob/main/type-uml-class.md) | Complete UML Class specification—layout, typography, relationships, budgets |
| [`type-er.md`](https://github.com/cathrynlavery/diagram-design/blob/main/type-er.md) | Fallback reference when UML-specific elements are absent |
| [`scripts/mermaid_extract.py`](https://github.com/cathrynlavery/diagram-design/blob/main/scripts/mermaid_extract.py) | Mermaid parser for `classDiagram` syntax |
| [`scripts/self_check.py`](https://github.com/cathrynlavery/diagram-design/blob/main/scripts/self_check.py) | Runtime validation of generated diagrams against skill contracts |
| [`assets/example-uml-class.html`](https://github.com/cathrynlavery/diagram-design/blob/main/assets/example-uml-class.html) | Live rendered examples in light, dark, and full variants |

## Limitations of UML in Diagram Design

Be aware of these constraints before planning your workflow:

- **Single diagram type** — Only UML Class diagrams are supported. Requesting other UML variants routes to non-UML alternatives with different visual conventions

- **Static semantics** — Diagrams are static by default. Optional motion features exist but do not alter UML semantics

- **Complexity ceilings** — The 7-class, 8-relationship budget may require decomposition for larger systems

## Summary

- Diagram Design **can generate UML diagrams**, but exclusively the **Class diagram** variant
- UML Class support lives in [`type-uml-class.md`](https://github.com/cathrynlavery/diagram-design/blob/main/type-uml-class.md) with comprehensive layout and relationship rules
- Requests route through [`SKILL.md`](https://github.com/cathrynlavery/diagram-design/blob/main/SKILL.md), lazy-load only needed components, and enforce complexity budgets for quality
- Other UML diagram types redirect to non-UML alternatives—check [`type-uml-class.md`](https://github.com/cathrynlavery/diagram-design/blob/main/type-uml-class.md)'s routing table for mappings
- Mermaid `classDiagram` syntax imports cleanly via [`mermaid_extract.py`](https://github.com/cathrynlavery/diagram-design/blob/main/mermaid_extract.py)

## Frequently Asked Questions

### Can Diagram Design create Sequence or State Machine diagrams?

No. These request types route to [`type-sequence.md`](https://github.com/cathrynlavery/diagram-design/blob/main/type-sequence.md) and other non-UML references. The UML implementation is intentionally scoped to Class diagrams only, as documented in the routing table within [`type-uml-class.md`](https://github.com/cathrynlavery/diagram-design/blob/main/type-uml-class.md).

### What happens if I request a UML diagram without operations or methods?

The skill falls back to an **ER diagram** ([`type-er.md`](https://github.com/cathrynlavery/diagram-design/blob/main/type-er.md)). Without class-specific features like operations, the system treats your request as entity-relationship modeling rather than object-oriented class modeling.

### How does Diagram Design validate UML diagram correctness?

The [`self_check.py`](https://github.com/cathrynlavery/diagram-design/blob/main/self_check.py) script runs runtime validation against skill contracts. This checks generated diagrams for compliance with layout rules, relationship vocabulary, and complexity budgets defined in the type reference files.

### Can I exceed the 7-class limit for large systems?

No—the complexity budget is enforced. For larger systems, decompose into multiple diagrams or use detailed ER diagrams instead. The budget exists to guarantee editorial-quality, readable outputs.