$npx -y skills add tebjan/vvvv-skills --skill vvvv-node-librariesHelps set up C# library projects that provide nodes to vvvv gamma — project directory structure, Initialization.cs with AssemblyInitializer, service registration via RegisterService, IResourceProvider factories, ImportAsIs / ImportNamespace / ImportType selection, category organi
| 1 | # Creating vvvv gamma Node Libraries |
| 2 | |
| 3 | A node library is a project that provides multiple nodes to vvvv gamma as a distributable package. This skill covers the project-level concerns: directory structure, naming conventions, category organization, service registration, and node factories. |
| 4 | |
| 5 | For writing individual node classes (ProcessNode, Update, pins, change detection), see vvvv-custom-nodes. For consuming services inside node constructors (IFrameClock, Game, logging), see vvvv-custom-nodes/services.md. |
| 6 | |
| 7 | **Creating your own library vs. contributing to one you don't own** are different tasks. This SKILL.md and its design/publishing references cover *creating and distributing* a package. To change or submit a PR to an **existing/upstream** library (fork → branch → PR workflow, editable source packages, the `.vl` diff problem), see [contributing.md](contributing.md). |
| 8 | |
| 9 | ## Library Recognition Pattern |
| 10 | |
| 11 | vvvv recognizes a directory as a library when the **folder name, .vl file, and .nuspec all share the same name**: |
| 12 | |
| 13 | ``` |
| 14 | VL.MyLibrary/ # Folder name = package name |
| 15 | ├── VL.MyLibrary.vl # .vl document — MUST match folder name |
| 16 | ├── VL.MyLibrary.nuspec # NuGet spec — MUST match folder name |
| 17 | ├── lib/ |
| 18 | │ └── net8.0/ # Compiled DLLs go here |
| 19 | │ └── VL.MyLibrary.dll |
| 20 | ├── src/ |
| 21 | │ ├── Initialization.cs # [assembly:] attributes + AssemblyInitializer |
| 22 | │ ├── Nodes/ |
| 23 | │ │ ├── MyProcessNode.cs # [ProcessNode] classes |
| 24 | │ │ └── MyOperations.cs # Static methods (stateless nodes) |
| 25 | │ ├── Services/ |
| 26 | │ │ └── MyService.cs # Per-app singletons |
| 27 | │ └── VL.MyLibrary.csproj |
| 28 | ├── shaders/ # Optional: SDSL shaders (auto-discovered) |
| 29 | │ └── MyEffect_TextureFX.sdsl |
| 30 | └── help/ # Optional: .vl help patches |
| 31 | └── HowTo Use MyNode.vl |
| 32 | ``` |
| 33 | |
| 34 | **Critical conventions**: |
| 35 | - Folder name, `.vl` file, and `.nuspec` must be identical (e.g., all `VL.MyLibrary`) |
| 36 | - The `.csproj` must output DLLs to `lib/net8.0/` relative to the package root |
| 37 | - No `.vl` file within a package should reference a `.csproj` — this forces the package into editable mode |
| 38 | - The library directory must be in a configured **package-repository** directory for vvvv to find it |
| 39 | |
| 40 | ### .csproj Output Path |
| 41 | |
| 42 | The `.csproj` must compile into the library's `lib/net8.0/` folder: |
| 43 | |
| 44 | ```xml |
| 45 | <PropertyGroup> |
| 46 | <TargetFramework>net8.0</TargetFramework> |
| 47 | <OutputPath>..\..\lib\net8.0\</OutputPath> |
| 48 | <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath> |
| 49 | </PropertyGroup> |
| 50 | ``` |
| 51 | |
| 52 | ## What gets imported as a node — the foundational rule |
| 53 | |
| 54 | A type becomes a node in vvvv's node browser when **two** conditions are both true: |
| 55 | |
| 56 | 1. The type is `public` (and lives in an imported assembly). |
| 57 | 2. The type's C# namespace is covered by an `[assembly: ImportAsIs]` / `[assembly: ImportNamespace]` declaration, OR the type is listed by an `[assembly: ImportType]` declaration. |
| 58 | |
| 59 | If either condition is false, the type is invisible to vvvv. **Importing is opt-in by namespace, not by type accessibility alone.** A `public` class in a namespace nobody imports is just as hidden from the node browser as an `internal` class. |
| 60 | |
| 61 | When a type IS imported, vvvv generates nodes from its full public surface: |
| 62 | |
| 63 | - Public classes and structs → constructor + public methods/properties become nodes |
| 64 | - Public static methods → operation nodes |
| 65 | - Public enums → split + values become nodes |
| 66 | - Public records and interfaces → handled like classes |
| 67 | |
| 68 | **`[ProcessNode]` does NOT gate node visibility.** It is purely lifecycle sugar — it tells vvvv |