d2-to-drawio 1.0.0 → 1.0.1

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 (2) hide show
  1. package/README.md +10 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -47,6 +47,16 @@ Open the committed outputs directly in your browser:
47
47
 
48
48
  Plenty of teams standardize on draw.io and Confluence for documentation, while the engineers drawing the systems would rather write diagrams as code, version them, and review them in pull requests. Exporting D2 to SVG or PNG hands the team a static picture nobody can edit; switching the whole team to D2 rarely happens. This tool removes that one-way door: engineers keep the `.d2` source of truth, everyone else gets a native `.drawio` file they can open, edit, and paste into Confluence.
49
49
 
50
+ ## AI-generated diagrams that stay editable
51
+
52
+ There is a second door this opens: diagrams drafted by an AI. Language models like Claude and ChatGPT write D2 fluently, because D2 is compact text and its layout is automatic: the model writes `api -> queue: enqueue` and never has to decide where anything goes. What models are consistently bad at is spatial placement, which is exactly what generating draw.io XML directly demands (hundreds of hand-invented x/y coordinates that end up overlapping). The workflow this enables:
53
+
54
+ 1. Ask your model: "Describe my architecture as a D2 diagram" and save the answer as `arch.d2`.
55
+ 2. `npx d2-to-drawio arch.d2 -o arch.drawio` (a real layout engine, not the model, places everything).
56
+ 3. Open it in draw.io and fix the 10 percent a human should fix, by dragging.
57
+
58
+ The AI does the structure, the layout engine does the geometry, you keep an editable file. None of the three steps fights the other.
59
+
50
60
  ## Quick start
51
61
 
52
62
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "d2-to-drawio",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "scripts": {
5
5
  "test": "node --test test/unit.test.mjs test/snapshot.test.mjs test/cli.test.mjs",
6
6
  "snapshots": "node test/run-fixtures.mjs",