@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.
- package/.claude/commands/dgmo.md +294 -0
- package/AGENTS.md +148 -0
- package/dist/cli.cjs +338 -163
- package/dist/index.cjs +1080 -319
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +28 -4
- package/dist/index.d.ts +28 -4
- package/dist/index.js +1078 -319
- package/dist/index.js.map +1 -1
- package/docs/ai-integration.md +33 -50
- package/package.json +8 -5
- package/src/c4/layout.ts +68 -10
- package/src/c4/parser.ts +0 -16
- package/src/c4/renderer.ts +1 -5
- package/src/class/layout.ts +0 -1
- package/src/class/parser.ts +28 -0
- package/src/class/renderer.ts +5 -26
- package/src/cli.ts +673 -2
- package/src/completion.ts +58 -0
- package/src/d3.ts +58 -106
- package/src/dgmo-router.ts +0 -57
- package/src/echarts.ts +96 -55
- package/src/er/classify.ts +206 -0
- package/src/er/layout.ts +259 -94
- package/src/er/parser.ts +30 -1
- package/src/er/renderer.ts +231 -18
- package/src/graph/flowchart-parser.ts +27 -4
- package/src/graph/flowchart-renderer.ts +1 -2
- package/src/graph/state-parser.ts +0 -1
- package/src/graph/state-renderer.ts +1 -3
- package/src/index.ts +10 -0
- package/src/infra/compute.ts +0 -7
- package/src/infra/layout.ts +60 -15
- package/src/infra/parser.ts +46 -4
- package/src/infra/renderer.ts +376 -47
- package/src/initiative-status/layout.ts +46 -30
- package/src/initiative-status/renderer.ts +5 -25
- package/src/kanban/parser.ts +0 -2
- package/src/org/layout.ts +0 -4
- package/src/org/renderer.ts +7 -28
- package/src/sequence/parser.ts +14 -11
- package/src/sequence/renderer.ts +0 -2
- package/src/sequence/tag-resolution.ts +0 -1
- package/src/sitemap/layout.ts +1 -14
- package/src/sitemap/parser.ts +1 -2
- package/src/sitemap/renderer.ts +0 -3
- package/src/utils/arrows.ts +7 -7
- package/src/utils/export-container.ts +40 -0
- package/.claude/skills/dgmo-chart/SKILL.md +0 -141
- package/.claude/skills/dgmo-flowchart/SKILL.md +0 -61
- package/.claude/skills/dgmo-generate/SKILL.md +0 -59
- 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`
|