nomnoml
2
总安装量
1
周安装量
#64303
全站排名
安装命令
npx skills add https://github.com/knoopx/pi --skill nomnoml
Agent 安装分布
amp
1
cline
1
opencode
1
cursor
1
continue
1
kimi-cli
1
Skill 文档
nomnoml
Convert plain-text descriptions into nomnoml markup and (optionally) render it via CLI.
Primary reference: https://nomnoml.com
Quick start
Minimal diagram
[User]->[AuthService]
[AuthService]->[DB]
Typical class box
[Order|
+id: UUID;
+total: Money;
|
+addItem(item);
+checkout();
]
Syntax essentials
Nodes (boxes)
- Basic:
[A] - With compartments (title | attributes | methods):
[A|x; y|do();] - Escape newlines with actual newlines (preferred) or
\nwhen needed.
Relationships (common)
[A]->[B] # association / dependency
[A]-->[B] # dotted
[A]-:>[B] # composition-like (varies by style)
[A]<-[B] # reverse arrow
[A]-[B] # line without arrow
If arrow semantics are ambiguous, prefer clear labels:
[API]->[DB]
[API] "reads/writes" -> [DB]
Cardinalities / labels
[Customer] 1->* [Order]
[Order] 1->* [OrderLine]
Grouping
[<frame> Payments|
[API]
[Worker]
]
[API]->[Worker]
Common containers:
<frame>: big box grouping<package>: package-like grouping<actor>: actor stick figure
Styling / directives
Add directives at the top using #:
#direction: right
#spacing: 40
#ranker: tight-tree
[Client]->[API]
Common directives:
#direction: right|down#spacing: <number>#padding: <number>#ranker: network-simplex|tight-tree|longest-path
Workflow: generate a diagram from a description
-
Identify the diagram type:
- Class/data model â boxes with compartments + inheritance/associations
- Architecture/services â frames/packages + arrows + labeled edges
- Flow/steps â simple boxes + arrows; keep it readable
-
Choose names:
- Use stable nouns for nodes (
AuthService,TokenStore,Frontend). - Keep node names short; put details in compartments or labels.
- Use stable nouns for nodes (
-
Produce nomnoml code:
- Start with
#direction: rightfor architecture diagrams. - Use frames/packages to group by bounded context.
- Add labels for anything non-obvious.
- Start with
-
Iterate:
- If diagram is too dense, split into multiple diagrams (by subsystem).
Rendering (tool)
If a rendered asset is needed, use the nomnoml tools instead of CLI.
Option A: quick preview
Use the tool to render directly in chat:
nomnoml-displaywith inlinesourcefor a quick preview.
Option B: render to SVG
Use the tool to render and optionally write a file:
nomnoml-renderwith inlinesourceand optionaloutputFile.nomnoml-render-filewithinputFileand optionaloutputFile.
If rendering isnât required, still produce the .nomnoml source file so it can be rendered later.
Patterns
Architecture sketch (recommended default)
#direction: right
[<actor> User]->[WebApp]
[<frame> Backend|
[API]
[Worker]
]
[WebApp]->[API]
[Worker]->[DB]
[API]->[DB]
[DB]
Class diagram with inheritance
[<abstract> Animal|+name: string|+speak()]
[Dog|+breed: string|+speak()]
[Cat|+color: string|+speak()]
[Animal]<:-[Dog]
[Animal]<:-[Cat]
Entity relationship (simple)
#direction: down
[User|id; email]
[Session|id; userId; expiresAt]
[User] 1->* [Session]
When asked to âupdate an existing diagramâ
- Preserve existing node names unless thereâs a clear rename.
- Apply the smallest diff:
- add one box/edge at a time
- keep direction/ranker consistent
- If you change meaning, update edge labels to stay explicit.