mddd-cli 4.2.2 → 4.2.4

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.
@@ -64,13 +64,6 @@ diagramType
64
64
  - **Notes and comments** - Add context and explanations
65
65
  - **Alt/loop/opt blocks** - Complex flow control in sequences
66
66
 
67
- ### Integration Support
68
-
69
- - **GitHub/GitLab** - Automatic rendering in Markdown files
70
- - **VS Code** - Preview with Markdown Mermaid extension
71
- - **Notion, Obsidian, Confluence** - Built-in support
72
- - **Export** - PNG, SVG, PDF via Mermaid Live or CLI
73
-
74
67
  ## Usage Examples
75
68
 
76
69
  ### Example 1: Document a Domain Model
@@ -233,7 +226,6 @@ For comprehensive syntax and advanced features, see:
233
226
  - **[Mermaid Live Editor](https://mermaid.live)** - Interactive editor with instant preview and export
234
227
  - **[Official Documentation](https://mermaid.js.org)** - Comprehensive syntax reference
235
228
  - **Mermaid CLI** - `npm install -g @mermaid-js/mermaid-cli` for batch exports
236
- - **VS Code Extension** - "Markdown Preview Mermaid Support" for live preview
237
229
  - **GitHub** - Native rendering in all `.md` files
238
230
 
239
231
  ## Support
@@ -184,7 +184,6 @@ flowchart LR
184
184
 
185
185
  **Native support in:**
186
186
  - GitHub/GitLab - Automatically renders in Markdown
187
- - VS Code - With Markdown Mermaid extension
188
187
  - Notion, Obsidian, Confluence - Built-in support
189
188
 
190
189
  **Export options:**
package/bin/cli.js CHANGED
@@ -17,7 +17,7 @@ const program = new Command();
17
17
  program
18
18
  .name('md')
19
19
  .description('Manager for co-located specifications for Mermaid Diagram Driven Development (MDDD)')
20
- .version('4.2.2');
20
+ .version('4.2.4');
21
21
 
22
22
  // ==========================================
23
23
  // COMMAND: md init
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mddd-cli",
3
- "version": "4.2.2",
3
+ "version": "4.2.4",
4
4
  "description": "Official CLI for modular, co-located, and versioned Mermaid Diagram Driven Development (MDDD).",
5
5
  "type": "module",
6
6
  "exports": "./bin/cli.js",
package/readme.md CHANGED
@@ -67,8 +67,6 @@ Unlike traditional specification frameworks that generate dozens of text files a
67
67
 
68
68
  ## ✅ Mermaid Diagram Preview
69
69
 
70
- To preview Mermaid diagrams directly in your editor during the MDDD workflow, you can use extensions that render ````mermaid```` blocks in Markdown files:
71
-
72
70
  ### Architectural Diagram Example
73
71
 
74
72
  ```mermaid
@@ -130,26 +128,6 @@ sequenceDiagram
130
128
 
131
129
  ---
132
130
 
133
- ### VS Code and derivated
134
-
135
- * **Markdown Preview Mermaid Support** — Adds Mermaid diagram support to the native Markdown preview.
136
- * **Mermaid Editor** — Visual editor with side-by-side preview and export.
137
- * **bierner.markdown-mermaid** — Official extension that extends the Markdown preview to render Mermaid.
138
-
139
- ### JetBrains (IntelliJ, WebStorm, GoLand, etc.)
140
-
141
- * Native Mermaid support starting from **2024.1** — Just open the `.spec.md` file and use the built-in Markdown preview.
142
-
143
- ### Other Editors
144
-
145
- * **Neovim/Vim:** Use plugins like `iamcco/markdown-preview.nvim` (with `markdown-preview` configured for Mermaid).
146
- * **Sublime Text:** `Mermaid` package from Package Control that adds preview and snippets.
147
- * **Markdown Editors:** Tools like [Typora](https://typora.io), [Obsidian](https://obsidian.md), and [Notion](https://notion.so) already have native Mermaid support — just paste the `.spec.md` file and the diagram will render automatically.
148
-
149
- > 💡 **Tip:** The better you can visualize the diagrams, the easier it is to validate business flows before implementation.
150
-
151
- ---
152
-
153
131
  ## 📥 Installation
154
132
 
155
133
  Since the package is published on NPM, installation is global and simple:
@@ -216,12 +194,12 @@ Visual specifications are not centralized in distant folders. They live in the *
216
194
  ```
217
195
  src/
218
196
  └── home/
219
- ├── home.spec.md # 🌎 Global module map (stateDiagram-v2 connecting nodes)
197
+ ├── home.spec.md # 🌎 Global module map
220
198
  ├── guest/
221
- │ ├── guest.spec.md # 🔬 Screen flow (graph LR) + Decision Matrix
199
+ │ ├── guest.spec.md # 🔬 Screen flow with Decision Matrix
222
200
  │ └── guest_page.dart # 💻 Production code generated by AI
223
201
  └── consumer/
224
- └── consumer.spec.md # 🔬 Screen flow (graph LR) + Decision Matrix
202
+ └── consumer.spec.md # 🔬 Screen flow with Decision Matrix
225
203
 
226
204
  ```
227
205
 
@@ -391,26 +369,6 @@ sequenceDiagram
391
369
 
392
370
  ---
393
371
 
394
- ### VS Code e derivados
395
-
396
- * **Markdown Preview Mermaid Support** — Adiciona suporte a diagramas Mermaid no preview nativo do Markdown.
397
- * **Mermaid Editor** — Editor visual com preview lado a lado e exportação.
398
- * **bierner.markdown-mermaid** — Extensão oficial que estende o preview de Markdown para renderizar Mermaid.
399
-
400
- ### JetBrains (IntelliJ, WebStorm, GoLand, etc.)
401
-
402
- * Suporte nativo a Mermaid a partir do **2024.1** — Basta abrir o arquivo `.spec.md` e usar o preview de Markdown integrado.
403
-
404
- ### Outros Editores
405
-
406
- * **Neovim/Vim:** Utilize plugins como `iamcco/markdown-preview.nvim` (com `markdown-preview` configurado para Mermaid).
407
- * **Sublime Text:** Pacote `Mermaid` no Package Control que adiciona preview e snippets.
408
- * **Markdown Editors:** Ferramentas como [Typora](https://typora.io), [Obsidian](https://obsidian.md) e [Notion](https://notion.so) já possuem suporte nativo a Mermaid — basta colar o arquivo `.spec.md` e o diagrama será renderizado automaticamente.
409
-
410
- > 💡 **Dica:** Quanto melhor você conseguir visualizar os diagramas, mais fácil será validar os fluxos de negócio antes da implementação.
411
-
412
- ---
413
-
414
372
  ## 📥 Instalação
415
373
 
416
374
  Como o pacote está publicado no NPM, a instalação é global e simples:
@@ -476,12 +434,12 @@ As especificações visuais não ficam centralizadas em pastas distantes. Elas v
476
434
  ```
477
435
  src/
478
436
  └── home/
479
- ├── home.spec.md # 🌎 Mapa global do módulo (stateDiagram-v2 conectando nós)
437
+ ├── home.spec.md # 🌎 Mapa global do módulo
480
438
  ├── guest/
481
- │ ├── guest.spec.md # 🔬 Fluxo de tela (graph LR) + Matriz de Decisão
439
+ │ ├── guest.spec.md # 🔬 Fluxo de tela com Matriz de Decisão
482
440
  │ └── guest_page.dart # 💻 Código produtivo gerado pela IA
483
441
  └── consumer/
484
- └── consumer.spec.md # 🔬 Fluxo de tela (graph LR) + Matriz de Decisão
442
+ └── consumer.spec.md # 🔬 Fluxo de tela com Matriz de Decisão
485
443
 
486
444
  ```
487
445
 
@@ -1,8 +1,3 @@
1
- %% @spec-version 1.0.0
2
- %% @domain {{domain_name}}
3
- %% @feature {{feature_name}}
4
- %% @author {{author_name}}
5
-
6
1
  # {{Feature Title}} — Specification
7
2
 
8
3
  **SPEC_VERSION:** v1.0.0 — draft
@@ -28,12 +23,9 @@ Describe **what** this spec governs and **why** it exists.
28
23
 
29
24
  ## 2. Behavioral Flow (Mermaid)
30
25
 
31
- > Pick the diagram type that best fits the topology:
32
- > `stateDiagram-v2` for lifecycles, `graph TD/LR` for procedural flows,
33
- > `sequenceDiagram` for multi-actor protocols, `flowchart` for branching logic.
26
+ > Pick the diagram type that best fits the topology using mermaid-diagrams skill.
34
27
 
35
28
  ```mermaid
36
- %% @spec-version 1.0.0
37
29
  stateDiagram-v2
38
30
  [*] --> Idle: initial entry point
39
31
 
@@ -104,15 +96,7 @@ When a `HaltWithConflict` is triggered, document the resolution path here:
104
96
 
105
97
  ---
106
98
 
107
- ## 6. Change History
108
-
109
- | Version | Date | Author | Change Description | Change Type |
110
- | :---: | :--- | :--- | :--- | :---: |
111
- | 1.0.0 | {{YYYY-MM-DD}} | {{author_name}} | Initial spec creation via `md-new` | MAJOR |
112
-
113
- ---
114
-
115
- ## 7. Audit History
99
+ ## 6. Audit History
116
100
 
117
101
  <details>
118
102
  <summary>Click to expand</summary>
package/system_prompt.md CHANGED
@@ -3,9 +3,9 @@
3
3
  You are a Mermaid Diagram processing system. Your cognitive processing is guided by visual topologies and truth tables, eliminating text-based specification ambiguity.
4
4
  Consume the mermaid-diagrams skill to learn how to produce it.
5
5
 
6
+ Spec template path: node_modules/seu-pacote/src/templates/spec-template.md
7
+
6
8
  ```mermaid
7
- %% @spec-version v2.0.0
8
- %% @protocol-version 1.0.0
9
9
  stateDiagram-v2
10
10
  [*] --> CheckSpec: UNIVERSAL RULE — Check specification file
11
11
 
@@ -17,14 +17,14 @@ stateDiagram-v2
17
17
  state SkillCheck {
18
18
  MdNew --> ReadSpecification: Request Allowed.
19
19
  MdAudit --> ReadSpecification: Request Allowed.
20
- MdEdit --> ReadSpecification: Request Allowed.
21
20
  Other --> Denied: Specification file required.
22
21
  }
23
22
 
24
23
  Denied --> ConflictResolution: Explain missing spec
25
24
 
26
25
  state ReadSpecification {
27
- [*] --> ParseMermaidDiagrams: Extract all %% @spec-version diagrams
26
+ [*] --> CreateSpec: Create file from template
27
+ CreateSpec --> ParseMermaidDiagrams: Extract all diagrams
28
28
  ParseMermaidDiagrams --> ExtractDecisionMatrices: Map topology nodes/edges
29
29
  ExtractDecisionMatrices --> ValidatePrimitiveFactors: Check factor columns
30
30
  ValidatePrimitiveFactors --> [*]: Spec loaded into context
@@ -50,71 +50,13 @@ stateDiagram-v2
50
50
  UpdateDetailsFooter --> [*]
51
51
  ```
52
52
 
53
- ## 0. Spec File Format (.spec.md)
54
-
55
- Every `.spec.md` file MUST follow this structure:
56
-
57
- ```
58
- %% @spec-version 1.0.0
59
- %% @domain [domain_name]
60
- %% @feature [feature_name] (optional for domain-level specs)
61
- %% @author [author_name] (optional)
62
-
63
- # [Feature/Domain Name] Specification
64
-
65
- ## Context
66
- Brief description of the purpose and scope of this specification.
67
-
68
- ## Flow Diagram
69
- ```mermaid
70
- [One or more Mermaid diagrams defining the topology/flow]
71
- ```
72
-
73
- ## Decision Matrix
74
- | Primitive Factor 1 | Primitive Factor 2 | ... | Proposed Action | Decision |
75
- | --- | --- | --- | --- | --- |
76
- | ✅ YES / ❌ NO | ✅ YES / ❌ NO | ... | `ACTION_NAME` | ✅ ALLOW / ❌ DENY |
77
-
78
- ## Tasks
79
- - [ ] Task extracted from spec
80
-
81
- ## Change History
82
- | Version | Date | Author | Change Description |
83
- | --- | --- | --- | --- |
84
- | 1.0.0 | YYYY-MM-DD | ... | Initial spec creation |
85
- ```
86
-
87
- ## 1. Co-location Architecture Tree
88
-
89
- src/
90
- └── [domain_name]/
91
- ├── [domain_name].spec.md # 🌎 Macro Module Domain (stateDiagram-v2)
92
- ├── [feature_name]/
93
- │ ├── [feature_name].spec.md # 🔬 Micro Flow Contract + Decision Matrix
94
- │ └── [feature_name].[extension] # 💻 Target Production Code File (Any Extension)
95
- └── ... # Additional features per domain
96
-
97
- > **Note:** `[domain_name]` and `[feature_name]` are placeholders for your actual project names.
98
- > A single domain can contain multiple features, each in its own subdirectory.
99
-
100
- ## 2. Parent Interaction Logic
101
-
102
- ```mermaid
103
- graph TD
104
- A[Create/Change Sub-Feature] --> B[Open Indicated Parent File]
105
- B --> C[Locate Bifurcation Node in Parent Mermaid]
106
- C --> D[Modify Parent Graph: Point Arrow to New State]
107
- D --> E[Child File: Inherit Parent Context in Entry Node]
108
- E --> F[Update Parent @spec-version: Increment PATCH]
109
- ```
110
-
111
- ### 2.1 Reverse Consistency (Parent → Child)
53
+ ### 2 Reverse Consistency (Parent → Child)
112
54
 
113
55
  When a parent domain spec is modified, the following MUST be verified:
114
56
 
115
- 1. **Orphan Detection:** Check if any child feature references a state/transition in the parent that no longer exists.
116
- 2. **Cascade Update:** If a parent state is renamed or removed, all child specs referencing it MUST be updated.
117
- 3. **Version Bump:** Parent changes increment MINOR version. Child specs affected by the change increment PATCH version.
57
+ 2.1. **Orphan Detection:** Check if any child feature references a state/transition in the parent that no longer exists.
58
+ 2.2. **Cascade Update:** If a parent state is renamed or removed, all child specs referencing it MUST be updated.
59
+ 2.3. **Version Bump:** Parent changes increment MINOR version. Child specs affected by the change increment PATCH version.
118
60
 
119
61
  ## 3. Decision Matrix & Primitive Factors
120
62
 
@@ -162,23 +104,11 @@ Every `.spec.md` file carries a `%% @spec-version` header. Use **Semantic Versio
162
104
  | **MINOR** | Adding: new states/transitions, new factor columns, new features without breaking existing rows. | `1.2.3` → `1.3.0` |
163
105
  | **PATCH** | Fixing: typos, clarifying descriptions, reformatting, updating child references. | `1.2.3` → `1.2.4` |
164
106
 
165
- ### 4.2 Version Header Format
166
-
167
- The `%% @spec-version` comment MUST be the **first line** of the `.spec.md` file:
168
-
169
- ```markdown
170
- %% @spec-version 1.0.0
171
- %% @domain payment
172
- %% @feature refund-flow
173
- ```
174
-
175
- ### 4.3 Audit History (Change Log)
107
+ ### 4.2 Audit History (Change Log)
176
108
 
177
109
  Each change MUST append a row to the **Change History** table at the bottom of the `.spec.md` file:
178
110
 
179
111
  ```
180
- %% @spec-version 1.1.0
181
-
182
112
  ## Change History
183
113
  | Version | Date | Author | Change Description | Change Type |
184
114
  | --- | --- | --- | --- | --- |
@@ -218,7 +148,7 @@ The UNIVERSAL RULE is now integrated into the main processing diagram at the top
218
148
 
219
149
  **Before ANY action, the system MUST verify that a `.spec.md` file exists for the target domain/feature.** If no spec exists, only `md-new` and `md-audit` skills are allowed to proceed (to create or propose a spec). All other skills (`md-impl`, `md-edit`, etc.) are DENIED without an existing specification.
220
150
 
221
- Diagrams: Always use mmdc -i <path/to/diagram.md> --checkSyntax to validate diagram syntax (Mandatory)
151
+ Diagrams: Always use "npx md validate <path/to/diagram.md>" to validate diagram syntax (Mandatory)
222
152
 
223
153
  ```mermaid
224
154
  %% @spec-version v2.0.0