$npx -y skills add tebjan/vvvv-skills --skill vvvv-fileformatDescribes the .vl XML file format used by vvvv gamma — document structure, element hierarchy, ID system (base62 GUIDs), NodeReference/Choice patterns, Pins, Pads (IOBoxes), Links, ProcessDefinition/Fragment lifecycle, regions (If/ForEach/Cache), type definitions, TypeAnnotations,
| 1 | # VL File Format (.vl) |
| 2 | |
| 3 | ## Overview |
| 4 | |
| 5 | A `.vl` file is an XML document encoding a visual dataflow program for vvvv gamma. Key elements: |
| 6 | |
| 7 | - **Document** — root element, contains dependencies and one top-level Patch |
| 8 | - **Patch** — container for visual elements (Nodes, Pads, Links, Canvases) |
| 9 | - **Node** — operation calls, type definitions, or regions |
| 10 | - **Pin** — input/output on a Node (defined at definition site) |
| 11 | - **Pad** — visual data element (IOBox) for displaying/editing values |
| 12 | - **Link** — connects two endpoints by referencing their IDs |
| 13 | - **Canvas** — visual grouping container (no logical scope) |
| 14 | - **ProcessDefinition** — lifecycle definition (Create, Update) via Fragments |
| 15 | - **Slot** — state field within a type definition |
| 16 | |
| 17 | ## XML Root and Namespaces |
| 18 | |
| 19 | ```xml |
| 20 | <?xml version="1.0" encoding="utf-8"?> |
| 21 | <Document xmlns:p="property" xmlns:r="reflection" Id="C2vqbtoStWoOI1eKIKZBBM" |
| 22 | LanguageVersion="2024.6.0" Version="0.128"> |
| 23 | <!-- dependencies and patch --> |
| 24 | </Document> |
| 25 | ``` |
| 26 | |
| 27 | | Prefix | URI | Purpose | |
| 28 | |--------|-----|---------| |
| 29 | | `p` | `property` | **Required.** Complex properties as child elements (`<p:NodeReference>`) | |
| 30 | | `r` | `reflection` | Optional. Only when using `r:IsNull="true"` for explicit null values | |
| 31 | |
| 32 | Root attributes: `Id` (base62 GUID), `LanguageVersion` (e.g. `"2024.6.0"`), `Version` (always `"0.128"`). |
| 33 | |
| 34 | ## ID System |
| 35 | |
| 36 | Every element has a unique `Id` — a **22-character base62-encoded GUID** using `[0-9A-Za-z]`. All IDs must be unique within the document. Generate via `GUIDEncoders.GuidTobase62(Guid.NewGuid())`. |
| 37 | |
| 38 | Link `Ids` attribute: comma-separated `"sourceId,sinkId"` (output first, input second). |
| 39 | |
| 40 | ## Element Hierarchy |
| 41 | |
| 42 | ``` |
| 43 | Document |
| 44 | ├── NugetDependency (0..n) |
| 45 | ├── DocumentDependency (0..n) |
| 46 | ├── PlatformDependency (0..n) |
| 47 | └── Patch (exactly 1, top-level) |
| 48 | ├── Canvas (DefaultCategory, CanvasType="FullCategory") |
| 49 | └── Node (Name="Application") |
| 50 | └── Patch (inner) |
| 51 | ├── Canvas (CanvasType="Group") |
| 52 | │ ├── Node (operation calls) |
| 53 | │ ├── Pad (IOBoxes) |
| 54 | │ └── ... |
| 55 | ├── Patch (Name="Create") |
| 56 | ├── Patch (Name="Update") |
| 57 | ├── ProcessDefinition |
| 58 | │ ├── Fragment → Create patch |
| 59 | │ └── Fragment → Update patch |
| 60 | └── Link (0..n) |
| 61 | ``` |
| 62 | |
| 63 | **Critical**: Dependencies are direct children of `Document`, NOT inside `Patch`. |
| 64 | |
| 65 | ## Dependencies |
| 66 | |
| 67 | ```xml |
| 68 | <NugetDependency Id="..." Location="VL.CoreLib" Version="2024.6.0" /> |
| 69 | <DocumentDependency Id="..." Location="./MyOtherFile.vl" /> |
| 70 | <PlatformDependency Id="..." Location="VL.Core.dll" /> |
| 71 | ``` |
| 72 | |
| 73 | Almost every document needs `VL.CoreLib`. Use `IsForward="true"` to re-export types to consumers. |
| 74 | |
| 75 | ## NodeReference System (Choices) |
| 76 | |
| 77 | The `<p:NodeReference>` property defines what a Node IS. It contains `<Choice>` elements that identify the target symbol. |
| 78 | |
| 79 | ### Operation Call |
| 80 | |
| 81 | ```xml |
| 82 | <p:NodeReference LastCategoryFullName="Primitive.Math" LastDependency="CoreLibBasics.vl"> |
| 83 | <Choice Kind="NodeFlag" Name="Node" Fixed="true" /> |
| 84 | <Choice Kind="OperationCallFlag" Name="+" /> |
| 85 | </p:NodeReference> |
| 86 | ``` |
| 87 | |
| 88 | - First Choice: `Kind="NodeFlag"` with `Fixed="true"` (shape indicator) |
| 89 | - Second Choice: `ProcessAppFlag` (stateful) or `OperationCallFlag` (stateless) |
| 90 | |
| 91 | ### Type Definitions |
| 92 | |
| 93 | ```xml |
| 94 | <!-- Process --> |
| 95 | <Choice Kind="ContainerDefinition" Name="Process" /> |
| 96 | <CategoryReference Kind="Category" Name="Primitive" /> |
| 97 | |
| 98 | <!-- Class / Record / Interface / Forward --> |
| 99 | <Choice Kind="ClassDefinition" Name="Class" /> |
| 100 | <Choice Kind="RecordDefinition" Name="Record" /> |
| 101 | <Choice Kind="InterfaceDefinition" Name="Interface" /> |
| 102 | <Choice Kind="ForwardDefinition" Name="Forward" /> |
| 103 | ``` |
| 104 | |
| 105 | ### Regions |
| 106 | |
| 107 | ```xml |
| 108 | <Choice Kind="StatefulRegion" Name="Region (Stateful)" Fixed="true" /> |
| 109 | <CategoryReference Kind="Category" Name="Primitive" /> |
| 110 | <Choice Kind="ApplicationStatefulRegion" Name="If" /> <!-- or ForEach, Cache --> |
| 111 | ``` |
| 112 | |
| 113 | Regions use `StatefulRegion` as the FIRST Choice (not `NodeFlag`). Use `ApplicationStatefulRegion` for If/ForEach or `ProcessStatefulRegion` for Cache. |
| 114 | |
| 115 | ## Node Element |
| 116 | |
| 117 | ```xml |
| 118 | <Node Name="MyNode" Bounds="300,200,65,19" Id="..."> |
| 119 | <p:NodeReference>...</p:NodeReference> |
| 120 | <Pin Id="..." Name="Input" Kind="InputPin" /> |
| 121 | <Pin Id="..." Name="Output" Kind="OutputPin" /> |
| 122 | </Node> |
| 123 | ``` |
| 124 | |
| 125 | Key attributes: `Id`, `Name`, `Bounds` (`"X,Y"` or `"X,Y,W,H"`), `Summary`, `Tags`. |
| 126 | |
| 127 | ## |