@diagrammo/dgmo 0.6.1 → 0.6.3

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 (52) hide show
  1. package/.claude/commands/dgmo.md +294 -0
  2. package/AGENTS.md +148 -0
  3. package/dist/cli.cjs +338 -163
  4. package/dist/index.cjs +1080 -319
  5. package/dist/index.cjs.map +1 -1
  6. package/dist/index.d.cts +28 -4
  7. package/dist/index.d.ts +28 -4
  8. package/dist/index.js +1078 -319
  9. package/dist/index.js.map +1 -1
  10. package/docs/ai-integration.md +33 -50
  11. package/package.json +8 -5
  12. package/src/c4/layout.ts +68 -10
  13. package/src/c4/parser.ts +0 -16
  14. package/src/c4/renderer.ts +1 -5
  15. package/src/class/layout.ts +0 -1
  16. package/src/class/parser.ts +28 -0
  17. package/src/class/renderer.ts +5 -26
  18. package/src/cli.ts +673 -2
  19. package/src/completion.ts +58 -0
  20. package/src/d3.ts +58 -106
  21. package/src/dgmo-router.ts +0 -57
  22. package/src/echarts.ts +96 -55
  23. package/src/er/classify.ts +206 -0
  24. package/src/er/layout.ts +259 -94
  25. package/src/er/parser.ts +30 -1
  26. package/src/er/renderer.ts +231 -18
  27. package/src/graph/flowchart-parser.ts +27 -4
  28. package/src/graph/flowchart-renderer.ts +1 -2
  29. package/src/graph/state-parser.ts +0 -1
  30. package/src/graph/state-renderer.ts +1 -3
  31. package/src/index.ts +10 -0
  32. package/src/infra/compute.ts +0 -7
  33. package/src/infra/layout.ts +60 -15
  34. package/src/infra/parser.ts +46 -4
  35. package/src/infra/renderer.ts +376 -47
  36. package/src/initiative-status/layout.ts +46 -30
  37. package/src/initiative-status/renderer.ts +5 -25
  38. package/src/kanban/parser.ts +0 -2
  39. package/src/org/layout.ts +0 -4
  40. package/src/org/renderer.ts +7 -28
  41. package/src/sequence/parser.ts +14 -11
  42. package/src/sequence/renderer.ts +0 -2
  43. package/src/sequence/tag-resolution.ts +0 -1
  44. package/src/sitemap/layout.ts +1 -14
  45. package/src/sitemap/parser.ts +1 -2
  46. package/src/sitemap/renderer.ts +0 -3
  47. package/src/utils/arrows.ts +7 -7
  48. package/src/utils/export-container.ts +40 -0
  49. package/.claude/skills/dgmo-chart/SKILL.md +0 -141
  50. package/.claude/skills/dgmo-flowchart/SKILL.md +0 -61
  51. package/.claude/skills/dgmo-generate/SKILL.md +0 -59
  52. package/.claude/skills/dgmo-sequence/SKILL.md +0 -104
@@ -1,104 +0,0 @@
1
- ---
2
- name: dgmo-sequence
3
- description: Generate a DGMO sequence diagram by analyzing a code flow, API interaction, or process description.
4
- argument-hint: <flow or module to diagram>
5
- allowed-tools: Read, Write, Bash, Glob, Grep
6
- ---
7
-
8
- # Generate DGMO Sequence Diagram
9
-
10
- Analyze a code flow, API interaction, or process and generate a `.dgmo` sequence diagram.
11
-
12
- ## Instructions
13
-
14
- 1. Understand what to diagram from `$ARGUMENTS` — this could be:
15
- - A description of an interaction ("the login flow")
16
- - A reference to code ("trace the checkout process in src/")
17
- - An API flow ("POST /orders end-to-end")
18
- 2. If referencing code, explore the codebase to trace the actual flow
19
- 3. Generate a valid DGMO sequence diagram
20
-
21
- ## Sequence Diagram Syntax
22
-
23
- ```
24
- chart: sequence
25
- title: Flow Title
26
-
27
- // Participant declarations (optional — auto-inferred from messages)
28
- User is an actor
29
- API is a service
30
- DB is a database
31
- Queue is a queue
32
-
33
- // Messages — always left-to-right
34
- User -Login-> API
35
- API -Find user-> DB
36
- DB -user record-> API
37
-
38
- // Async messages
39
- API ~event~> Queue
40
-
41
- // Notes
42
- note on DB:
43
- Indexed lookup on email column
44
-
45
- // Conditional blocks (indentation-scoped, no "end" needed)
46
- if credentials valid
47
- API -200 OK-> User
48
- else
49
- API -401 Unauthorized-> User
50
-
51
- // Loops
52
- loop retry 3 times
53
- API -> ExternalService: request
54
-
55
- // Sections (phase dividers)
56
- == Phase 2 ==
57
-
58
- // Visual groups
59
- [Backend]
60
- OrderAPI
61
- DB
62
-
63
- // Tag groups — define color-coded metadata dimensions
64
- tag: Concern alias c
65
- Caching(blue)
66
- Auth(green)
67
-
68
- // Pipe metadata — attach tags to participants and messages
69
- API is a service | concern: Caching
70
- User -login-> API | concern: Auth
71
- [Backend | concern: Caching]
72
- OrderAPI
73
- DB
74
-
75
- // Activate a tag group for recoloring
76
- active-tag: Concern
77
- ```
78
-
79
- **Participant types**: `actor`, `service`, `database`, `queue`, `cache`, `gateway`, `external`, `networking`, `frontend`
80
-
81
- **Arrow types** (always left-to-right):
82
- - Sync: `A -label-> B`
83
- - Async: `A ~label~> B`
84
-
85
- **Tag groups** — color-coded metadata for interactive recoloring:
86
- - `tag: Name alias x` — declare a group with optional alias
87
- - Entry: `Value(color)` — named color; add `default` for untagged elements
88
- - Pipe metadata: `| key: value` on participants, messages, groups
89
- - `active-tag: Name` — activate a group for CLI/export rendering
90
-
91
- **Key rules**:
92
- - Indentation closes blocks (no `end` keyword)
93
- - Use `//` for comments (not `#`)
94
- - `aka` for display names: `PaymentGW aka Payment Gateway`
95
- - `at position N` for ordering: `DB at position 3`
96
-
97
- ## Output
98
-
99
- Write to a descriptive `.dgmo` file, then check if `dgmo` CLI is available (`command -v dgmo`). If not installed, tell the user:
100
- - `brew install diagrammo/dgmo/dgmo` (macOS, recommended)
101
- - `npm install -g @diagrammo/dgmo`
102
- - Or: `npx @diagrammo/dgmo <file>.dgmo`
103
-
104
- If available, offer to render: `dgmo <file>.dgmo -o <file>.svg` or `dgmo <file>.dgmo -o url`