@diagrammo/dgmo 0.2.26 → 0.2.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/.claude/skills/dgmo-chart/SKILL.md +107 -0
  2. package/.claude/skills/dgmo-flowchart/SKILL.md +61 -0
  3. package/.claude/skills/dgmo-generate/SKILL.md +58 -0
  4. package/.claude/skills/dgmo-sequence/SKILL.md +83 -0
  5. package/.cursorrules +117 -0
  6. package/.github/copilot-instructions.md +117 -0
  7. package/.windsurfrules +117 -0
  8. package/README.md +10 -3
  9. package/dist/cli.cjs +116 -108
  10. package/dist/index.cjs +563 -356
  11. package/dist/index.cjs.map +1 -1
  12. package/dist/index.d.cts +39 -24
  13. package/dist/index.d.ts +39 -24
  14. package/dist/index.js +560 -355
  15. package/dist/index.js.map +1 -1
  16. package/docs/ai-integration.md +125 -0
  17. package/docs/language-reference.md +784 -0
  18. package/package.json +10 -3
  19. package/src/c4/parser.ts +90 -74
  20. package/src/c4/renderer.ts +13 -12
  21. package/src/c4/types.ts +6 -4
  22. package/src/chart.ts +3 -2
  23. package/src/class/parser.ts +2 -10
  24. package/src/class/types.ts +1 -1
  25. package/src/cli.ts +135 -19
  26. package/src/d3.ts +1 -1
  27. package/src/dgmo-mermaid.ts +1 -1
  28. package/src/dgmo-router.ts +1 -1
  29. package/src/echarts.ts +33 -13
  30. package/src/er/parser.ts +34 -43
  31. package/src/er/types.ts +1 -1
  32. package/src/graph/flowchart-parser.ts +2 -25
  33. package/src/graph/types.ts +1 -1
  34. package/src/index.ts +5 -0
  35. package/src/initiative-status/parser.ts +57 -11
  36. package/src/initiative-status/types.ts +1 -1
  37. package/src/kanban/parser.ts +32 -53
  38. package/src/kanban/renderer.ts +9 -8
  39. package/src/kanban/types.ts +6 -14
  40. package/src/org/parser.ts +47 -87
  41. package/src/org/resolver.ts +11 -12
  42. package/src/sequence/parser.ts +97 -15
  43. package/src/sequence/renderer.ts +62 -69
  44. package/src/utils/arrows.ts +75 -0
  45. package/src/utils/inline-markdown.ts +75 -0
  46. package/src/utils/parsing.ts +67 -0
  47. package/src/utils/tag-groups.ts +76 -0
@@ -0,0 +1,784 @@
1
+ # DGMO Language Reference
2
+
3
+ DGMO is a text-based diagram markup language. Files use the `.dgmo` extension. Render with the `dgmo` CLI, the Diagrammo desktop app, or the `@diagrammo/dgmo` npm library.
4
+
5
+ ## Common Patterns
6
+
7
+ Every `.dgmo` file can start with optional directives, followed by content.
8
+
9
+ ### Directives
10
+
11
+ ```
12
+ chart: bar // explicit chart type (optional — auto-detected)
13
+ title: My Diagram // diagram title
14
+ palette: nord // color palette
15
+ ```
16
+
17
+ ### Comments
18
+
19
+ ```
20
+ // This is a comment (only // is supported)
21
+ ```
22
+
23
+ ### Inline Colors
24
+
25
+ Append `(colorname)` to labels, nodes, or data points:
26
+
27
+ ```
28
+ Port Royal(red): 850
29
+ [Process(blue)]
30
+ person Customer(green)
31
+ ```
32
+
33
+ Named colors: `red`, `orange`, `yellow`, `green`, `blue`, `purple`, `teal`, `cyan`, `gray`. Palette-specific colors also available.
34
+
35
+ ### Palettes and Themes
36
+
37
+ 8 palettes: `nord` (default), `solarized`, `catppuccin`, `rose-pine`, `gruvbox`, `tokyo-night`, `one-dark`, `bold`
38
+
39
+ 3 themes per palette: `light`, `dark`, `transparent`
40
+
41
+ Set via CLI: `dgmo diagram.dgmo --palette catppuccin --theme dark`
42
+
43
+ ### Inline Markdown
44
+
45
+ Text fields support: `*italic*`, `**bold**`, `` `code` ``, `[link text](url)`. Bare URLs are auto-linked.
46
+
47
+ ---
48
+
49
+ ## Chart Types
50
+
51
+ ### bar
52
+
53
+ ```
54
+ chart: bar
55
+ title: Revenue by Region
56
+ series: Revenue
57
+
58
+ North: 850
59
+ South: 620
60
+ East: 1100
61
+ West: 430
62
+ ```
63
+
64
+ Options: `series`, `xlabel`, `ylabel`, `orientation` (`horizontal`/`vertical`), `labels` (`name`/`value`/`percent`/`full`), `color`.
65
+
66
+ Colors per item: `North(red): 850`
67
+
68
+ ### line
69
+
70
+ ```
71
+ title: Quarterly Performance
72
+ series: Sales(red), Costs(blue)
73
+
74
+ Q1: 100, 50
75
+ Q2: 120, 55
76
+ Q3: 110, 60
77
+ Q4: 130, 58
78
+ ```
79
+
80
+ Multi-series: comma-separated values matching the `series` list. Single series omits `series` directive. Also works as `chart: multi-line`.
81
+
82
+ Options: `series`, `xlabel`, `ylabel`, `labels`.
83
+
84
+ ### area
85
+
86
+ Same syntax as `line`. Renders as a filled area chart.
87
+
88
+ ### pie
89
+
90
+ ```
91
+ chart: pie
92
+ title: Market Share
93
+ labels: percent
94
+
95
+ Company A: 40
96
+ Company B: 35
97
+ Company C: 25
98
+ ```
99
+
100
+ Options: `labels` (`name`/`value`/`percent`/`full`).
101
+
102
+ ### doughnut
103
+
104
+ Same syntax as `pie`. Renders as a doughnut (ring) chart.
105
+
106
+ ### polar-area
107
+
108
+ Same syntax as `pie`. Renders as a polar area (rose) chart.
109
+
110
+ ### radar
111
+
112
+ ```
113
+ chart: radar
114
+ title: Team Skills
115
+
116
+ Frontend: 85
117
+ Backend: 70
118
+ DevOps: 60
119
+ Design: 90
120
+ Testing: 75
121
+ ```
122
+
123
+ ### bar-stacked
124
+
125
+ ```
126
+ chart: bar-stacked
127
+ title: Budget Allocation
128
+ series: Engineering, Marketing, Sales
129
+
130
+ Q1: 100, 50, 30
131
+ Q2: 110, 55, 35
132
+ Q3: 105, 60, 40
133
+ ```
134
+
135
+ Options: `series` (required), `xlabel`, `ylabel`, `orientation`.
136
+
137
+ ### scatter
138
+
139
+ ```
140
+ chart: scatter
141
+ title: Performance Metrics
142
+ labels: on
143
+ xlabel: Experience (years)
144
+ ylabel: Output
145
+
146
+ Alice: 3, 85
147
+ Bob: 7, 92
148
+ Carol: 2, 70
149
+ ```
150
+
151
+ Data: `Label: x, y` or `Label: x, y, size` (bubble chart). Group with `## Category(color)` headers.
152
+
153
+ Options: `labels` (`on`/`off`), `xlabel`, `ylabel`, `sizelabel`.
154
+
155
+ ### heatmap
156
+
157
+ ```
158
+ chart: heatmap
159
+ title: Activity by Month
160
+ columns: Jan, Feb, Mar, Apr, May, Jun
161
+
162
+ Team A: 5, 4, 5, 3, 4, 5
163
+ Team B: 2, 3, 2, 4, 3, 2
164
+ Team C: 3, 2, 1, 2, 3, 4
165
+ ```
166
+
167
+ Options: `columns` (required).
168
+
169
+ ### sankey
170
+
171
+ ```
172
+ chart: sankey
173
+ title: Resource Flow
174
+
175
+ Source A -> Processing: 300
176
+ Source B -> Processing: 200
177
+ Processing -> Output X: 350
178
+ Processing -> Output Y: 150
179
+ ```
180
+
181
+ Data: `Source -> Target: value`
182
+
183
+ ### chord
184
+
185
+ Same syntax as `sankey`. Renders as a circular chord diagram.
186
+
187
+ ### funnel
188
+
189
+ ```
190
+ chart: funnel
191
+ title: Conversion Pipeline
192
+
193
+ Visitors: 1000
194
+ Signups: 500
195
+ Trials: 200
196
+ Customers: 100
197
+ ```
198
+
199
+ ### function
200
+
201
+ ```
202
+ chart: function
203
+ title: Trajectories
204
+ xlabel: Distance (m)
205
+ ylabel: Height (m)
206
+ x: 0 to 250
207
+
208
+ Low(blue): -0.001*x^2 + 0.27*x
209
+ High(red): -0.003*x^2 + 0.75*x
210
+ ```
211
+
212
+ Options: `x: start to end` (required), `xlabel`, `ylabel`.
213
+
214
+ Expressions support: `+`, `-`, `*`, `/`, `^`, `sin`, `cos`, `sqrt`, `abs`, `log`, `exp`, `pi`, `e`.
215
+
216
+ ### slope
217
+
218
+ ```
219
+ chart: slope
220
+ title: Before vs After
221
+
222
+ Period A, Period B
223
+
224
+ Item 1: 40, 80
225
+ Item 2: 30, 50
226
+ Item 3: 60, 40
227
+ ```
228
+
229
+ First data line defines the two period labels. Options: `orientation` (`horizontal`/`vertical`).
230
+
231
+ ### wordcloud
232
+
233
+ ```
234
+ chart: wordcloud
235
+ title: Top Terms
236
+
237
+ kubernetes: 95
238
+ docker: 80
239
+ terraform: 65
240
+ ansible: 50
241
+ ```
242
+
243
+ Data: `word: weight` (higher = larger). Options: `rotate` (`none`/`mixed`/`angled`), `max` (word limit), `size: min, max` (font range).
244
+
245
+ ### arc
246
+
247
+ ```
248
+ chart: arc
249
+ title: Team Collaboration
250
+
251
+ ## Frontend(blue)
252
+ Alice -> Bob: 8
253
+ Alice -> Carol: 5
254
+
255
+ ## Backend(green)
256
+ Dave -> Carol: 10
257
+ ```
258
+
259
+ Data: `Source -> Target: weight`. Group nodes with `## Group(color)` headers.
260
+
261
+ Options: `order` (`appearance`/`name`/`group`/`degree`), `orientation`.
262
+
263
+ ### venn
264
+
265
+ ```
266
+ chart: venn
267
+ title: Skill Overlap
268
+
269
+ dev(blue): 120 "Development"
270
+ ops(green): 100 "Operations"
271
+ sec(red): 80 "Security"
272
+
273
+ dev & ops: 35 "DevOps"
274
+ ops & sec: 40 "SecOps"
275
+ dev & sec: 30 "DevSec"
276
+ dev & ops & sec: 10 "DevSecOps"
277
+ ```
278
+
279
+ Sets: `id(color): size "label"`. Overlaps: `id1 & id2: size "label"`. Options: `values` (`on`/`off`).
280
+
281
+ ### quadrant
282
+
283
+ ```
284
+ chart: quadrant
285
+ title: Priority Matrix
286
+ x-axis: Low Impact, High Impact
287
+ y-axis: Low Effort, High Effort
288
+
289
+ top-right: Quick Wins(green)
290
+ top-left: Big Bets(yellow)
291
+ bottom-left: Skip(red)
292
+ bottom-right: Reconsider(gray)
293
+
294
+ Task A: 0.9, 0.8
295
+ Task B: 0.2, 0.3
296
+ Task C: 0.7, 0.4
297
+ ```
298
+
299
+ Options: `x-axis: low, high`, `y-axis: low, high`. Quadrant labels: `top-right`, `top-left`, `bottom-left`, `bottom-right`. Data: `Label: x, y` where x,y are 0–1.
300
+
301
+ ### timeline
302
+
303
+ ```
304
+ chart: timeline
305
+ title: Project History
306
+
307
+ era 2023->2024: Phase 1
308
+ marker 2023-06: Launch(orange)
309
+
310
+ ## Team A(blue)
311
+ 2023-01->2023-06: Planning
312
+ 2023-06->2024-01: Development
313
+ 2024-02: Release
314
+
315
+ ## Team B(green)
316
+ 2023-03->2023-09: Research
317
+ 2023-09->2024-03?: Implementation
318
+ ```
319
+
320
+ Date formats: `YYYY`, `YYYY-MM`, `YYYY-MM-DD`. Ranges: `start->end`. Durations: `start->1y`, `start->6m`, `start->2w`, `start->30d`. Uncertain end: append `?` (e.g., `2024-03?`).
321
+
322
+ Elements: `era start->end: Label(color)`, `marker date: Label(color)`, `## Group(color)` headers.
323
+
324
+ Options: `scale` (`on`/`off`), `sort` (`time`/`group`), `swimlanes` (`on`/`off`).
325
+
326
+ ---
327
+
328
+ ## Diagram Types
329
+
330
+ ### sequence
331
+
332
+ Minimal example:
333
+
334
+ ```
335
+ User -> API: login
336
+ API -> DB: findUser
337
+ DB -> API: <- user
338
+ API -> User: <- token
339
+ ```
340
+
341
+ Full example:
342
+
343
+ ```
344
+ chart: sequence
345
+ title: Authentication Flow
346
+
347
+ // participant declarations (optional)
348
+ User is an actor
349
+ API is a service
350
+ DB is a database
351
+ NotifyQueue is a queue aka Notifications
352
+
353
+ User -Login request-> API
354
+ API -Find user by email-> DB
355
+ DB -> API: <- user record
356
+ note on DB:
357
+ Indexed lookup on email column
358
+
359
+ if credentials valid
360
+ API -Create session-> DB
361
+ DB -> API: <- session token
362
+ API -> User: <- 200 OK + token
363
+ API ~session.created~> NotifyQueue
364
+ else
365
+ API -> User: <- 401 Unauthorized
366
+
367
+ == Logout ==
368
+
369
+ User -Logout-> API
370
+ API -Delete session-> DB
371
+ API -> User: <- 200 OK
372
+ ```
373
+
374
+ **Participants**: Auto-inferred from message names. Declare explicitly for type/positioning:
375
+ - `Name is a [actor|service|database|queue|cache|gateway|external|networking|frontend]`
376
+ - `Name aka Display Label` — alias for display
377
+ - `Name at position 2` — manual left-to-right ordering (0-based; negative from right)
378
+
379
+ **Messages**:
380
+ - Sync: `A -> B: label` or `A -label-> B`
381
+ - Async: `A ~> B: label` or `A ~label~> B`
382
+ - Return: `B -> A: <- response` (on the calling line) or separate line
383
+ - Bidirectional: `A <-> B: label` or `A <-label-> B`
384
+ - Bidirectional async: `A <~> B: label` or `A <~label~> B`
385
+
386
+ **Blocks** (indentation-scoped):
387
+ - `if condition` ... `else` ... (no explicit `end` needed — indentation closes blocks)
388
+ - `loop label` ...
389
+ - `parallel label` ...
390
+
391
+ **Notes**:
392
+ - `note: text` — standalone
393
+ - `note on Participant: text` — anchored
394
+ - Multi-line: indent continuation lines under `note:`
395
+
396
+ **Sections**: `== Section Title ==` or `== Section Title(color) ==`
397
+
398
+ **Groups**: `## Group Name` — visual grouping box around messages
399
+
400
+ **Options**: `activations: off`, `collapse-notes: no`
401
+
402
+ ### flowchart
403
+
404
+ Minimal example:
405
+
406
+ ```
407
+ (Start) -> [Process] -> (End)
408
+ ```
409
+
410
+ Full example:
411
+
412
+ ```
413
+ chart: flowchart
414
+ title: Decision Process
415
+
416
+ (Start) -> <Valid Input?>
417
+ -yes-> [Process Data] -> [[Run Subroutine]]
418
+ -no-> /Get User Input/ -> <Valid Input?>
419
+ [[Run Subroutine]] -> [Document~] -> (Done)
420
+ ```
421
+
422
+ **Node shapes**:
423
+ - `(Terminal)` — oval
424
+ - `[Process]` — rectangle
425
+ - `<Decision?>` — diamond
426
+ - `/Input Output/` — parallelogram
427
+ - `[[Subroutine]]` — double-bordered rectangle
428
+ - `[Document~]` — document (wavy bottom)
429
+
430
+ **Arrows**: `-label-> Target`, `-(color)-> Target`, `-label(color)-> Target`
431
+
432
+ Colors on nodes: `[Process(blue)]`
433
+
434
+ ### class
435
+
436
+ Minimal example:
437
+
438
+ ```
439
+ Animal
440
+ + name: string
441
+ + speak(): void
442
+
443
+ Dog extends Animal
444
+ Cat extends Animal
445
+ ```
446
+
447
+ Full example:
448
+
449
+ ```
450
+ chart: class
451
+ title: Type Hierarchy
452
+
453
+ Printable [interface]
454
+ + print(): void
455
+
456
+ Shape [abstract]
457
+ # x: number
458
+ # y: number
459
+ + area(): number
460
+ {static} count: number
461
+
462
+ Circle
463
+ - radius: number
464
+ + area(): number
465
+
466
+ Rectangle
467
+ - width: number
468
+ - height: number
469
+
470
+ Circle extends Shape
471
+ Rectangle extends Shape
472
+ Shape implements Printable
473
+ Shape *-- Circle : contains
474
+ ```
475
+
476
+ **Class modifiers**: `[abstract]`, `[interface]`, `[enum]`
477
+
478
+ **Member visibility**: `+` public, `#` protected, `-` private. Static: `{static}`.
479
+
480
+ **Relationships** (keyword or arrow):
481
+ - Inheritance: `A extends B` or `A --|> B`
482
+ - Implementation: `A implements B` or `A ..|> B`
483
+ - Composition: `A contains B` or `A *-- B`
484
+ - Aggregation: `A has B` or `A o-- B`
485
+ - Dependency: `A uses B` or `A ..> B`
486
+ - Association: `A -> B`
487
+ - Optional label: `A extends B : description`
488
+
489
+ ### er
490
+
491
+ Minimal example:
492
+
493
+ ```
494
+ users
495
+ id: int [pk]
496
+ name: varchar
497
+
498
+ posts
499
+ id: int [pk]
500
+ user_id: int [fk]
501
+
502
+ users 1--* posts : writes
503
+ ```
504
+
505
+ Full example:
506
+
507
+ ```
508
+ chart: er
509
+ title: Blog Schema
510
+
511
+ users
512
+ id: int [pk]
513
+ email: varchar [unique]
514
+ name: varchar
515
+
516
+ posts
517
+ id: int [pk]
518
+ title: varchar
519
+ body: text
520
+ author_id: int [fk]
521
+ category_id: int [fk, nullable]
522
+
523
+ categories
524
+ id: int [pk]
525
+ name: varchar [unique]
526
+
527
+ users 1--* posts : writes
528
+ categories 1--* posts : contains
529
+ users ?--* categories : moderates
530
+ ```
531
+
532
+ **Columns**: `name: type [constraints]`. Constraints: `pk`, `fk`, `unique`, `nullable`. Multiple: `[fk, nullable]`.
533
+
534
+ **Relationships** (symbolic cardinality):
535
+ - `1--1` — one-to-one
536
+ - `1--*` — one-to-many
537
+ - `?--1` — zero-or-one to one
538
+ - `?--*` — zero-or-more
539
+ - Optional label: `table1 1--* table2 : description`
540
+
541
+ ### c4
542
+
543
+ Minimal example:
544
+
545
+ ```
546
+ chart: c4
547
+
548
+ person User
549
+ system MyApp | description: The main application
550
+ -Uses-> User
551
+ ```
552
+
553
+ Full example:
554
+
555
+ ```
556
+ chart: c4
557
+ title: Banking System
558
+
559
+ tag: Scope alias sc
560
+ Internal(blue) default
561
+ External(gray)
562
+
563
+ person Customer | description: A customer of the bank
564
+
565
+ system Internet Banking | description: Online banking portal
566
+ -Delivers content [HTTPS]-> Customer
567
+ -Sends emails [SMTP]-> Email
568
+
569
+ containers:
570
+ container Web App | description: SPA, tech: React
571
+ -API calls [JSON/HTTPS]-> API
572
+
573
+ container API | description: Backend, tech: Node.js
574
+ -Reads/writes [SQL]-> Database
575
+
576
+ container Database | description: Data store, tech: PostgreSQL
577
+
578
+ system Email | description: Email delivery, sc: External
579
+ ~Sends emails~> Customer
580
+
581
+ deployment:
582
+ Vercel is a cloud
583
+ container Web App
584
+ Railway
585
+ container API
586
+ Neon is a database
587
+ container Database
588
+ ```
589
+
590
+ **Element types**: `person`, `system`, `container`, `component`
591
+
592
+ **Metadata** (pipe-delimited): `element Name | description: text, tech: stack, tagalias: value`
593
+
594
+ **Sections**: `containers:` (inside system), `components:` (inside container), `deployment:`
595
+
596
+ **Deployment nodes**: `NodeName is a [cloud|database|cache|queue|external]`
597
+
598
+ **Relationships**:
599
+ - Sync: `-> Target` or `-label [tech]-> Target`
600
+ - Async: `~> Target` or `~label [tech]~> Target`
601
+ - Bidirectional: `<-> Target`, `<~> Target`
602
+
603
+ **Tag groups**: See tag group syntax below.
604
+
605
+ ### org
606
+
607
+ Minimal example:
608
+
609
+ ```
610
+ chart: org
611
+
612
+ CEO
613
+ VP Engineering
614
+ Team Lead
615
+ VP Marketing
616
+ ```
617
+
618
+ Full example:
619
+
620
+ ```
621
+ chart: org
622
+ title: Engineering Org
623
+ sub-node-label: Reports
624
+ show-sub-node-count: yes
625
+
626
+ tag: Level alias lv
627
+ Director(red)
628
+ Manager(blue)
629
+ IC(green) default
630
+
631
+ CTO | lv: Director
632
+ VP Engineering | lv: Director
633
+ [Platform]
634
+ Lead | lv: Manager
635
+ Dev 1
636
+ Dev 2
637
+ [Product]
638
+ Lead | lv: Manager
639
+ Dev 3
640
+ ```
641
+
642
+ Hierarchy via indentation. `[Group Name]` creates collapsible sub-groups.
643
+
644
+ **Metadata**: `Name | tagalias: value, tag2: value2`
645
+
646
+ Options: `sub-node-label`, `show-sub-node-count` (`yes`/`no`).
647
+
648
+ **Imports**: `import: path/to/file.dgmo` (indented under a parent node), `tags: path/to/tags.dgmo` (top-level).
649
+
650
+ ### kanban
651
+
652
+ Minimal example:
653
+
654
+ ```
655
+ chart: kanban
656
+
657
+ == To Do ==
658
+ Task 1
659
+ Task 2
660
+
661
+ == Done ==
662
+ Task 3
663
+ ```
664
+
665
+ Full example:
666
+
667
+ ```
668
+ chart: kanban
669
+ title: Sprint Board
670
+
671
+ tag: Priority
672
+ Critical(red)
673
+ High(orange)
674
+ Low(green) default
675
+
676
+ tag: Owner alias o
677
+ Alice(blue)
678
+ Bob(green)
679
+
680
+ == Backlog(gray) ==
681
+ Research API options | priority: High, o: Alice
682
+
683
+ == In Progress [wip: 3](orange) ==
684
+ Build auth module | priority: Critical, o: Bob
685
+ Integrate OAuth2
686
+ Add session management
687
+
688
+ == Done(green) ==
689
+ Setup CI pipeline | priority: High, o: Alice
690
+ ```
691
+
692
+ **Columns**: `== Column Name ==`, `== Column Name(color) ==`, `== Column Name [wip: N] ==`
693
+
694
+ **Cards**: `Card Title | tag: value`. Indented lines below become card details.
695
+
696
+ ### initiative-status
697
+
698
+ Minimal example:
699
+
700
+ ```
701
+ chart: initiative-status
702
+
703
+ Auth | done
704
+ -> UserService | wip
705
+ -> NotifyService | todo
706
+ UserService | wip
707
+ NotifyService | todo
708
+ ```
709
+
710
+ Full example:
711
+
712
+ ```
713
+ chart: initiative-status
714
+ title: Platform Roadmap
715
+
716
+ Auth | done
717
+ -depends-> UserService | wip
718
+ -feeds-> Dashboard | todo
719
+ Dashboard | todo
720
+ UserService | wip
721
+ -calls-> DBLayer | done
722
+ DBLayer | done
723
+
724
+ [External]
725
+ PaymentGW | na
726
+ EmailProvider | na
727
+ ```
728
+
729
+ **Status values**: `done`, `wip`, `todo`, `na`
730
+
731
+ **Relationships**: `-label-> Target | status` or indented children.
732
+
733
+ **Groups**: `[Group Name]` for visual grouping.
734
+
735
+ ---
736
+
737
+ ## Tag Groups
738
+
739
+ Define reusable metadata categories for org charts, kanban boards, and C4 diagrams:
740
+
741
+ ```
742
+ tag: Priority
743
+ Critical(red)
744
+ High(orange)
745
+ Medium(yellow)
746
+ Low(green) default
747
+
748
+ tag: Team alias t
749
+ Frontend(blue)
750
+ Backend(green)
751
+ ```
752
+
753
+ - `tag:` keyword (case-insensitive)
754
+ - Optional `alias` for shorthand in metadata: `| t: Frontend`
755
+ - `default` keyword marks the fallback value
756
+ - Indented entries with `Value(color)`
757
+
758
+ Assign to elements via pipe metadata: `Element Name | priority: High, t: Frontend`
759
+
760
+ ---
761
+
762
+ ## Anti-Patterns
763
+
764
+ **Common mistakes to avoid:**
765
+
766
+ - `# comment` — wrong. Use `// comment`
767
+ - `async A -> B: msg` — wrong. Use `A ~> B: msg` or `A ~msg~> B`
768
+ - `parallel else` — not supported. Use separate `parallel` blocks
769
+ - Hex colors in sections `== Foo(#ff0000) ==` — wrong. Use named colors: `== Foo(red) ==`
770
+ - `->` inside labeled arrows `A -routes to /api-> B` — ambiguous. Rephrase the label
771
+ - Missing `chart:` for ambiguous content — when auto-detection picks the wrong type, add an explicit `chart:` directive
772
+ - `end` keyword in sequence blocks — not needed. Indentation closes blocks
773
+
774
+ ---
775
+
776
+ ## CLI Usage
777
+
778
+ ```bash
779
+ dgmo diagram.dgmo # PNG output (default)
780
+ dgmo diagram.dgmo -o output.svg # SVG output
781
+ dgmo diagram.dgmo -o url # Shareable URL
782
+ dgmo diagram.dgmo --palette catppuccin --theme dark
783
+ dgmo diagram.dgmo -o output.png --palette bold
784
+ ```