Claude
Skills
Sign in
Back

diagram-types

Included with Lifetime
$97 forever

Comprehensive guide to all diagram types with selection criteria, notation rules, and draw.io implementation

General

What this skill does


# Diagram Types Reference

## Quick Selection Guide

| Need | Diagram Type | Complexity |
|------|-------------|------------|
| Show a process/workflow | Flowchart | Low |
| Model classes and relationships | UML Class | Medium |
| Show message flows over time | UML Sequence | Medium |
| Model object lifecycle | UML State | Medium |
| Show parallel/concurrent flows | UML Activity | Medium |
| Show system modules | UML Component | Medium |
| Show infrastructure layout | UML Deployment | Medium |
| Show user interactions | UML Use Case | Low |
| Describe architecture at scale | C4 Model | Low-High |
| Model business processes | BPMN 2.0 | High |
| Design database schema | ER Diagram | Medium |
| Map network topology | Network Diagram | Medium |
| Document cloud infrastructure | Cloud Architecture | Medium |
| Show Kubernetes resources | Kubernetes Diagram | Medium |
| Brainstorm ideas | Mindmap | Low |
| Show reporting structure | Org Chart | Low |
| Plan project timeline | Gantt Chart | Medium |
| Show cross-team processes | Swimlane | Medium |
| Analyze security threats | Threat Model | High |

---

## Flowcharts

### When to Use
Process documentation, decision logic, algorithms, onboarding guides, troubleshooting trees.

### Shapes and Notation

| Shape | Style | Meaning |
|-------|-------|---------|
| Rounded rectangle | `rounded=1;whiteSpace=wrap;html=1;` | Process / action step |
| Diamond | `rhombus;` | Decision (Yes/No branching) |
| Oval / stadium | `ellipse;` | Terminator (start/end) |
| Parallelogram | `shape=parallelogram;perimeter=parallelogramPerimeter;` | Input/Output |
| Rectangle | (default) | Generic step |
| Cylinder | `shape=cylinder3;` | Database / data store |
| Document | `shape=document;` | Document / report |
| Predefined process | `shape=process;` | Subroutine / predefined process |

### Swimlane Variant

Horizontal or vertical lanes partition a flowchart by role or department:

```xml
<mxCell id="lane1" value="Frontend" style="swimlane;startSize=30;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1">
  <mxGeometry x="0" y="0" width="300" height="400" as="geometry"/>
</mxCell>
<mxCell id="lane2" value="Backend" style="swimlane;startSize=30;fillColor=#d5e8d4;strokeColor=#82b366;" vertex="1" parent="1">
  <mxGeometry x="300" y="0" width="300" height="400" as="geometry"/>
</mxCell>
```

### Minimal XML Example

```xml
<mxGraphModel>
  <root>
    <mxCell id="0"/>
    <mxCell id="1" parent="0"/>
    <mxCell id="start" value="Start" style="ellipse;fillColor=#d5e8d4;strokeColor=#82b366;" vertex="1" parent="1">
      <mxGeometry x="160" y="20" width="80" height="40" as="geometry"/>
    </mxCell>
    <mxCell id="step1" value="Process Request" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
      <mxGeometry x="130" y="100" width="140" height="60" as="geometry"/>
    </mxCell>
    <mxCell id="dec1" value="Approved?" style="rhombus;whiteSpace=wrap;html=1;" vertex="1" parent="1">
      <mxGeometry x="150" y="200" width="100" height="80" as="geometry"/>
    </mxCell>
    <mxCell id="end" value="End" style="ellipse;fillColor=#f8cecc;strokeColor=#b85450;" vertex="1" parent="1">
      <mxGeometry x="160" y="330" width="80" height="40" as="geometry"/>
    </mxCell>
    <mxCell id="e1" style="edgeStyle=orthogonalEdgeStyle;" edge="1" source="start" target="step1" parent="1">
      <mxGeometry relative="1" as="geometry"/>
    </mxCell>
    <mxCell id="e2" style="edgeStyle=orthogonalEdgeStyle;" edge="1" source="step1" target="dec1" parent="1">
      <mxGeometry relative="1" as="geometry"/>
    </mxCell>
    <mxCell id="e3" value="Yes" style="edgeStyle=orthogonalEdgeStyle;" edge="1" source="dec1" target="end" parent="1">
      <mxGeometry relative="1" as="geometry"/>
    </mxCell>
  </root>
</mxGraphModel>
```

---

## UML Class Diagrams

### When to Use
Object-oriented design, domain modeling, API contracts, data model documentation.

### Notation

| Element | Representation |
|---------|---------------|
| Class | Rectangle with 3 compartments: name, attributes, methods |
| Abstract class | Name in italics |
| Interface | `<<interface>>` stereotype |
| Visibility | `+` public, `-` private, `#` protected, `~` package |
| Static member | Underlined |

### Relationship Types

| Relationship | Arrow Style | draw.io Style |
|-------------|-------------|---------------|
| Inheritance (extends) | Solid line, hollow triangle | `endArrow=block;endFill=0;` |
| Interface (implements) | Dashed line, hollow triangle | `endArrow=block;endFill=0;dashed=1;` |
| Association | Solid line, open arrow | `endArrow=open;endFill=0;` |
| Directed association | Solid line, filled arrow | `endArrow=open;endFill=1;` |
| Aggregation | Solid line, hollow diamond at parent | `startArrow=diamond;startFill=0;endArrow=none;` |
| Composition | Solid line, filled diamond at parent | `startArrow=diamond;startFill=1;endArrow=none;` |
| Dependency | Dashed line, open arrow | `dashed=1;endArrow=open;endFill=0;` |

### Multiplicity Labels

Place as edge labels: `0..1`, `1`, `0..*`, `1..*`, `*`

### draw.io Class Shape

```xml
<mxCell id="cls1" value="&lt;p style='margin:0;padding:4px;font-weight:bold;border-bottom:1px solid #666;'&gt;User&lt;/p&gt;&lt;p style='margin:0;padding:4px;text-align:left;border-bottom:1px solid #ccc;'&gt;- id: Long&lt;br/&gt;- name: String&lt;br/&gt;- email: String&lt;/p&gt;&lt;p style='margin:0;padding:4px;text-align:left;'&gt;+ getName(): String&lt;br/&gt;+ setEmail(e: String)&lt;/p&gt;"
  style="verticalAlign=top;align=center;overflow=fill;html=1;whiteSpace=wrap;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1">
  <mxGeometry x="100" y="100" width="200" height="150" as="geometry"/>
</mxCell>
```

---

## UML Sequence Diagrams

### When to Use
API call flows, authentication sequences, microservice communication, protocol documentation.

### Notation

| Element | Style |
|---------|-------|
| Lifeline | `shape=umlLifeline;perimeter=lifelinePerimeter;container=1;collapsible=0;recursiveResize=0;size=40;` |
| Activation box | Narrow filled rectangle on lifeline |
| Sync message | Solid line, filled arrowhead: `endArrow=block;endFill=1;` |
| Async message | Solid line, open arrowhead: `endArrow=async;endFill=0;` or `endArrow=open;endFill=0;` |
| Return message | Dashed line, open arrowhead: `dashed=1;endArrow=open;endFill=0;` |
| Self-call | Loop back to same lifeline |
| Create message | Dashed line to new lifeline: `dashed=1;endArrow=open;endFill=1;` |
| Destroy | X marker: `shape=umlDestroy;` |

### Combined Fragments

| Fragment | Meaning | Style |
|----------|---------|-------|
| `alt` | Alternative (if/else) | `shape=umlFrame;` with label `alt` |
| `opt` | Optional (if without else) | `shape=umlFrame;` with label `opt` |
| `loop` | Loop/iteration | `shape=umlFrame;` with label `loop` |
| `par` | Parallel execution | `shape=umlFrame;` with label `par` |
| `break` | Break from enclosing fragment | `shape=umlFrame;` with label `break` |
| `critical` | Critical region | `shape=umlFrame;` with label `critical` |

### Minimal Example

```xml
<mxGraphModel>
  <root>
    <mxCell id="0"/>
    <mxCell id="1" parent="0"/>
    <mxCell id="client" value=":Client" style="shape=umlLifeline;perimeter=lifelinePerimeter;whiteSpace=wrap;container=1;collapsible=0;recursiveResize=0;outlineConnect=0;size=40;" vertex="1" parent="1">
      <mxGeometry x="80" y="20" width="100" height="300" as="geometry"/>
    </mxCell>
    <mxCell id="server" value=":Server" style="shape=umlLifeline;perimeter=lifelinePerimeter;whiteSpace=wrap;container=1;collapsible=0;recursiveResize=0;outlineConnect=0;size=40;" vertex="1" parent="1">
      <mxGeometry x="280" y="20" width="100" height="300" as="geometry"/>
    </mxCell>
    <mxCell id="msg1" value="request()" style="endArrow=block;endFill=1;" edge="1" parent="1">
      <mxGeometry relative="1" as="geometry">
        <mxPoint x="130" y="90" as="sourcePoint"/>
        <mxPoint x="325" y="90" as="targetPoint"/

Related in General