统一建模语言
- 作者仓库星标 2,891
- 作者仓库 skills
- 领域
- 运维部署
- 作者声明的智能体
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 88 / 100 · 启发式扫描,不代表运行安全
- 运行环境证据
- 未执行;当前没有隔离运行测试证据
- 作者 / 版本 / 许可证
- @markdown-viewer · 未声明许可证
- 上下文用量评级
- 低消耗
- 接入复杂程度
- 即装即用
- 是否需要外部接口密钥
- 不需要
- 兼容的系统
- macOS · Linux · Windows
- 运行环境要求
- Node.js
- 检测到的文件与系统行为
-
- 只读
- 允许写入 / 修改
- 网络行为
- 仅限本地
- 安装命令数
- 无(仅作为资料)
需要注意: 未声明工具权限范围;实际权限由运行环境决定。
@startuml
' Simple icon declaration
mxgraph.aws4.lambda "Lambda\nFunction" as fn
mxgraph.aws4.api_gateway "API GW" as gw
mxgraph.aws4.dynamodb "DynamoDB" as db
gw --> fn
fn --> db
@enduml
# UML Diagram Generator
**Quick Start:** Choose diagram type → Write PlantUML text → Define elements and relationships → Wrap in ` ```plantuml ` fence.
> ⚠️ **IMPORTANT:** Always use ` ```plantuml ` or ` ```puml ` code fence. NEVER use ` ```text ` — it will NOT render as a diagram.
## Critical Rules
- Every diagram starts with `@startuml` and ends with `@enduml`
- Use standard PlantUML keywords: `class`, `interface`, `abstract`, `enum`, `actor`, `participant`, `component`, `node`, `database`, `package`
- Relationships use arrow syntax: `-->`, `<|--`, `*--`, `o--`, `..>`, `..|>`
- Use `skinparam` for global styling and colors
- Use `#color` on individual elements for specific colors
- Notes use `note left of`, `note right of`, `note over`, or standalone `note "text" as N`
## UML Diagram Types
| Type | Purpose | Key Syntax | Example |
|------|---------|------------|---------|
| Class | Class structure and relationships | `class`, `interface`, `<\|--` | [class-diagram.md](examples/class-diagram.md) |
| Sequence | Message interactions over time | `participant`, `->`, `-->` | [sequence-diagram.md](examples/sequence-diagram.md) |
| Activity | Workflow and process flow | `start`, `:action;`, `if/else` | [activity-diagram.md](examples/activity-diagram.md) |
| Swimlane Activity | Multi-role activity with swimlanes | `\|Lane\|`, `:action;` | [swimlane-activity-diagram.md](examples/swimlane-activity-diagram.md) |
| State Machine | Object lifecycle states | `state`, `[*] -->` | [state-machine-diagram.md](examples/state-machine-diagram.md) |
| Component | System component organization | `component`, `[name]`, `interface` | [component-diagram.md](examples/component-diagram.md) |
| Use Case | User-system interactions | `actor`, `usecase`, `(name)` | [use-case-diagram.md](examples/use-case-diagram.md) |
| Deployment | Physical deployment architecture | `node`, `artifact`, `database` | [deployment-diagram.md](examples/deployment-diagram.md) |
| Object | Runtime object snapshot | `object "name" as id` | [object-diagram.md](examples/object-diagram.md) |
| Package | Module organization | `package "name"` | [package-diagram.md](examples/package-diagram.md) |
| Communication | Object collaboration | Numbered messages with sequence syntax | [communication-diagram.md](examples/communication-diagram.md) |
| Composite Structure | Internal class structure | `component` with nested `port` | [composite-structure-diagram.md](examples/composite-structure-diagram.md) |
| Interaction Overview | Activity + sequence combination | `group`, `ref over` | [interaction-overview-diagram.md](examples/interaction-overview-diagram.md) |
| Profile | UML extension mechanisms | `<<stereotype>>` labels | [profile-diagram.md](examples/profile-diagram.md) |
## Mxgraph Stencil Icons
draw-uml supports 9500+ mxgraph stencil icons (AWS, Azure, Cisco, Kubernetes, etc.) via the `mxgraph.*` syntax. Default colors are applied automatically — you do NOT need to specify `fillColor` or `strokeColor`.
**Full stencil reference:** See [stencils/README.md](stencils/README.md).
### Syntax
```
mxgraph.<namespace>.<icon> "Label" as <alias>
mxgraph.<namespace>.<icon> "Label" as <alias> #color
mxgraph.<namespace>.<icon> <alias>
```
- `mxgraph.<namespace>.<icon>` — the stencil shape key (e.g. `mxgraph.aws4.lambda`, `mxgraph.kubernetes.pod`)
- `"Label"` — display text (quoted if contains spaces, unquoted for single word)
- `as <alias>` — identifier for use in relationships
- `#color` — optional override color (e.g. `#FF6600`, `#LightBlue`)
### Examples
```plantuml
@startuml
' Simple icon declaration
mxgraph.aws4.lambda "Lambda\nFunction" as fn
mxgraph.aws4.api_gateway "API GW" as gw
mxgraph.aws4.dynamodb "DynamoDB" as db
gw --> fn
fn --> db
@enduml
```
```plantuml
@startuml
' Kubernetes architecture with icons
mxgraph.kubernetes.ing "Ingress" as ing
mxgraph.kubernetes.svc "Service" as svc
mxgraph.kubernetes.pod "Pod" as pod
mxgraph.kubernetes.deploy "Deployment" as deploy
ing --> svc
svc --> pod
deploy --> pod
@enduml
```
```plantuml
@startuml
' Mixing standard UML with stencil icons
node "Cloud" {
mxgraph.aws4.ec2 "EC2" as ec2
mxgraph.aws4.rds "RDS" as rds
}
database "Legacy DB" as legacy
ec2 --> rds
rds --> legacy
@enduml
```
章节与文件索引
按说明文件中的顺序排列。
关键规则
UML 图类型
Mxgraph 模具图标
语法
文件/命令 -> plantuml · puml · text · @startuml · @enduml · class · interface · abstract
内容校验值 -> 255795bba7a3
当前原文的自动摘译,尚未人工审校。
关键规则
每个图表都以
@startuml开头,以@enduml结尾 使用标准 PlantUML 关键字:class、interface、abstract、enum、actor、participant、component、node、database、package关系使用箭头语法:-->、<|--、*--、o--、..>、..|>使用skinparam进行全局样式和颜色使用#color特定颜色的各个元素UML 图类型
类型·目的·关键语法·示例类·类结构和关系·
class,interface,<\ · --·class-diagram.md序列·随时间推移的消息交互·participant,->,-->·sequence-diagram.md活动·工作流和处理流程·start,:action;,if/else· Activity-diagram.md 泳道活动 · 带泳道的多角色活动 ·\ · Lane\ ·,:action;· 泳道-activity-diagram.mdMxgraph 模具图标
draw-uml 通过
mxgraph.*语法支持 9500 多个 mxgraph 模板图标(AWS、Azure、Cisco、Kubernetes 等)。默认颜色会自动应用 - 您无需指定fillColor或strokeColor。完整的模板参考:请参阅 stencils/README.md。语法
mxgraph.<namespace>.<icon>— 模板形状键(例如mxgraph.aws4.lambda、mxgraph.kubernetes.pod)"Label"— 显示文本(如果包含空格则加引号,单个单词不加引号)as <alias>— 在关系中使用的标识符#color— 可选覆盖颜色(例如#FF6600、#LightBlue)