uml-modeling
UML diagram generation including class, sequence, activity, use case, and state diagrams
What this skill does
# UML Modeling Skill
## When to Use This Skill
Use this skill when:
- **Uml Modeling tasks** - Working on uml diagram generation including class, sequence, activity, use case, and state diagrams
- **Planning or design** - Need guidance on Uml Modeling approaches
- **Best practices** - Want to follow established patterns and standards
## Overview
Create UML diagrams using PlantUML and Mermaid notation for software design documentation.
## MANDATORY: Documentation-First Approach
Before creating UML diagrams:
1. **Invoke `docs-management` skill** for UML standards guidance
2. **Verify diagram syntax** using appropriate notation (PlantUML/Mermaid)
3. **Base all guidance on UML 2.5 specification**
## UML Diagram Types
### Structural Diagrams
| Diagram | Purpose | When to Use |
|---------|---------|-------------|
| Class | Show classes, attributes, methods, relationships | Domain modeling, design |
| Component | Show components and dependencies | Architecture documentation |
| Deployment | Show physical deployment | Infrastructure planning |
| Object | Show object instances | Specific scenarios |
| Package | Show namespaces/modules | Code organization |
### Behavioral Diagrams
| Diagram | Purpose | When to Use |
|---------|---------|-------------|
| Use Case | Show actor-system interactions | Requirements |
| Sequence | Show message flow over time | API design, protocols |
| Activity | Show workflows and processes | Business processes |
| State Machine | Show state transitions | Lifecycle modeling |
| Communication | Show object interactions | Design patterns |
## Class Diagram
### PlantUML Syntax
```plantuml
@startuml
skinparam classAttributeIconSize 0
abstract class Entity {
+Id: Guid
+CreatedAt: DateTimeOffset
+UpdatedAt: DateTimeOffset
}
class Order extends Entity {
-_lineItems: List<LineItem>
+CustomerId: Guid
+Status: OrderStatus
+Total: Money
--
+AddItem(product: Product, quantity: int): Result<LineItem>
+RemoveItem(lineItemId: Guid): Result
+Submit(): Result
+Cancel(): Result
}
class LineItem extends Entity {
+ProductId: Guid
+ProductName: string
+Quantity: int
+UnitPrice: Money
+LineTotal: Money
}
enum OrderStatus {
Draft
Submitted
Paid
Shipped
Delivered
Cancelled
}
class Money <<value object>> {
+Amount: decimal
+Currency: string
+{static} Zero: Money
+Add(other: Money): Money
+Multiply(factor: decimal): Money
}
Order "1" *-- "0..*" LineItem : contains
Order --> OrderStatus
Order --> Money
LineItem --> Money
@enduml
```
### Mermaid Class Diagram
```mermaid
classDiagram
class Entity {
<<abstract>>
+Guid Id
+DateTimeOffset CreatedAt
+DateTimeOffset UpdatedAt
}
class Order {
-List~LineItem~ _lineItems
+Guid CustomerId
+OrderStatus Status
+Money Total
+AddItem(Product, int) Result~LineItem~
+RemoveItem(Guid) Result
+Submit() Result
+Cancel() Result
}
class LineItem {
+Guid ProductId
+string ProductName
+int Quantity
+Money UnitPrice
+Money LineTotal
}
class OrderStatus {
<<enumeration>>
Draft
Submitted
Paid
Shipped
Delivered
Cancelled
}
Entity <|-- Order
Entity <|-- LineItem
Order "1" *-- "0..*" LineItem : contains
Order --> OrderStatus
```
### Relationship Types
```csharp
// UML Relationship Reference
public static class UMLRelationships
{
// Association: uses, knows about
// Customer --> Order (Customer uses Order)
// Aggregation: has-a (shared ownership)
// Team o-- Player (Team has Players, Players can exist independently)
// Composition: contains (exclusive ownership)
// Order *-- LineItem (Order contains LineItems, LineItems cannot exist without Order)
// Inheritance: is-a
// Dog --|> Animal (Dog extends Animal)
// Implementation: implements
// UserService ..|> IUserService (UserService implements IUserService)
// Dependency: depends on
// Controller ..> Service (Controller depends on Service)
}
```
## Sequence Diagram
### PlantUML Syntax
```plantuml
@startuml
title Order Submission Flow
actor Customer
participant "API Gateway" as API
participant "Order Service" as Orders
participant "Payment Service" as Payment
participant "Notification Service" as Notify
database "Order DB" as DB
queue "Message Bus" as Bus
Customer -> API: POST /orders/{id}/submit
activate API
API -> Orders: SubmitOrder(orderId)
activate Orders
Orders -> DB: GetOrder(orderId)
activate DB
DB --> Orders: Order
deactivate DB
alt Order is valid
Orders -> Payment: ProcessPayment(order)
activate Payment
Payment --> Orders: PaymentResult
deactivate Payment
alt Payment successful
Orders -> DB: UpdateStatus(Paid)
Orders -> Bus: Publish(OrderSubmitted)
Bus -> Notify: OrderSubmitted
activate Notify
Notify -> Notify: SendConfirmation()
deactivate Notify
Orders --> API: Success
API --> Customer: 200 OK
else Payment failed
Orders --> API: PaymentFailed
API --> Customer: 402 Payment Required
end
else Order invalid
Orders --> API: ValidationError
API --> Customer: 400 Bad Request
end
deactivate Orders
deactivate API
@enduml
```
### Mermaid Sequence Diagram
```mermaid
sequenceDiagram
participant C as Customer
participant A as API Gateway
participant O as Order Service
participant P as Payment Service
participant D as Database
C->>A: POST /orders/{id}/submit
activate A
A->>O: SubmitOrder(orderId)
activate O
O->>D: GetOrder(orderId)
D-->>O: Order
alt Order valid
O->>P: ProcessPayment(order)
P-->>O: PaymentResult
alt Payment successful
O->>D: UpdateStatus(Paid)
O-->>A: Success
A-->>C: 200 OK
else Payment failed
O-->>A: PaymentFailed
A-->>C: 402 Payment Required
end
else Order invalid
O-->>A: ValidationError
A-->>C: 400 Bad Request
end
deactivate O
deactivate A
```
## Activity Diagram
### PlantUML Syntax
```plantuml
@startuml
title Order Processing Workflow
start
:Customer submits order;
:Validate order;
if (Order valid?) then (yes)
:Calculate totals;
:Reserve inventory;
fork
:Process payment;
fork again
:Send confirmation email;
end fork
if (Payment successful?) then (yes)
:Confirm inventory;
:Create shipment;
:Update order status;
stop
else (no)
:Release inventory;
:Notify customer;
stop
endif
else (no)
:Return validation errors;
stop
endif
@enduml
```
## Use Case Diagram
### PlantUML Syntax
```plantuml
@startuml
left to right direction
actor Customer
actor "Warehouse Staff" as Warehouse
actor Admin
rectangle "E-Commerce System" {
usecase "Browse Products" as UC1
usecase "Add to Cart" as UC2
usecase "Checkout" as UC3
usecase "Track Order" as UC4
usecase "Process Refund" as UC5
usecase "Manage Inventory" as UC6
usecase "Fulfill Order" as UC7
usecase "Generate Reports" as UC8
Customer --> UC1
Customer --> UC2
Customer --> UC3
Customer --> UC4
Customer --> UC5
Warehouse --> UC6
Warehouse --> UC7
Admin --> UC6
Admin --> UC8
UC3 ..> UC2 : <<include>>
UC5 ..> UC4 : <<extend>>
}
@enduml
```
## State Machine Diagram
### PlantUML Syntax
```plantuml
@startuml
title Order State Machine
[*] --> Draft : Create
Draft --> Submitted : Submit
Draft --> Cancelled : Cancel
Submitted --> Paid : PaymentReceived
Submitted --> Cancelled : Cancel
Submitted --> Draft : RequiresChanges
Paid --> Shipped : Ship
Paid --> Refunded : Refund
Shipped --> Delivered : Deliver
Shipped --> Returned : Return
Delivered --> Completed : Finalize
Delivered --> Returned : Return
Returned --> Refunded : ProcessReturn
Completed -->Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.