feat: add deterministic Diagram IR v2 authoring
This commit is contained in:
@@ -4,16 +4,28 @@ This file lists all capabilities an agent can use from this skill.
|
||||
|
||||
---
|
||||
|
||||
## Capability 1 — Diagram generation
|
||||
## Capability 1 — Deterministic YAML generation
|
||||
|
||||
Build native `.drawio` XML from a validated semantic Diagram IR:
|
||||
|
||||
```bash
|
||||
node dist/cli/commands.js --action build --file architecture.yaml --output architecture.drawio
|
||||
```
|
||||
|
||||
IR v1 remains compatible. IR v2 adds multiple pages, containers and semantic kinds, explicit geometry, waypoints, provenance/properties/extensions, and `linear`, `layered`, `tree`, `grid`, or `manual` layout. Dependency-aware placement and obstacle-aware orthogonal routing are deterministic. The builder rejects reserved/duplicate IDs, unknown parents/endpoints, malformed geometry, and unsupported versions before writing output. See `schemas/diagram-ir-v2.schema.json` and `examples/platform-v2.yaml`.
|
||||
|
||||
---
|
||||
|
||||
## Capability 2 — Direct XML generation
|
||||
|
||||
Create `.drawio` files (and optionally export to PNG/SVG/PDF) from a description or requirements.
|
||||
|
||||
See [SKILL.md](./SKILL.md) for the generation workflow, XML format, page sizes, element shapes, and well-formedness rules.
|
||||
See [SKILL.md](../SKILL.md) for the generation workflow, XML format, page sizes, element shapes, and well-formedness rules.
|
||||
See [rules-layout.md](./rules-layout.md) for mandatory connector and layout rules.
|
||||
|
||||
---
|
||||
|
||||
## Capability 2 — Diagram analysis (drawio-tools CLI)
|
||||
## Capability 3 — Diagram analysis (drawio-tools CLI)
|
||||
|
||||
A **TypeScript / Node.js** CLI tool for programmatic analysis of `.drawio` files.
|
||||
Entry point: `node dist/cli/commands.js` (run from the skill's `scripts/` directory), or `task run -- --file=… --action=…`.
|
||||
@@ -22,8 +34,8 @@ Entry point: `node dist/cli/commands.js` (run from the skill's `scripts/` direct
|
||||
|
||||
```bash
|
||||
cd <skill>/scripts
|
||||
node dist/cli/commands.js --file <path-to-file.drawio> --action <action> [--page <index>]
|
||||
# short flags: -f, -a, -p, -h
|
||||
node dist/cli/commands.js --file <path> --action <action> [--page <index>] [--output <path>]
|
||||
# short flags: -f, -a, -p, -o, -h
|
||||
```
|
||||
|
||||
`--page` selects the diagram tab (0-based, default 0). Ignored by `summary` (processes all pages).
|
||||
@@ -31,6 +43,12 @@ Always prints YAML to stdout. Exit code `0` on success, `1` on error.
|
||||
|
||||
### Actions
|
||||
|
||||
#### Authoring
|
||||
|
||||
| Action | Scope | Description |
|
||||
|---|---|---|
|
||||
| `build` | YAML Diagram IR | Validate and convert a YAML specification to native `.drawio`; requires `--output` |
|
||||
|
||||
#### Inventory
|
||||
|
||||
| Action | Scope | Description |
|
||||
@@ -46,6 +64,7 @@ Always prints YAML to stdout. Exit code `0` on success, `1` on error.
|
||||
| Action | Scope | Description |
|
||||
|---|---|---|
|
||||
| `validate` | All pages | **Mandatory final gate** — XML well-formedness + maxGraph compile + sanity check (vertices/edges > 0). Run before finishing any diagram work |
|
||||
| `quality` | All pages | Objective clipping, overflow, placeholder, external-asset, palette, page-density, and edge-density checks with explicit severity |
|
||||
| `page-connectors-validation` | Page 0 | Connector-shape overlaps + connector crossings |
|
||||
| `page-labels-validation` | Page 0 | Empty labels, duplicate labels, labels > 80 chars |
|
||||
| `page-shape-bbox-validation` | Page 0 | Non-containment bounding box overlaps between shapes |
|
||||
|
||||
Reference in New Issue
Block a user