genart.dev
Design Mode

Plugin Architecture

How design plugins extend the layer system with new types, properties, and MCP tools.

The design system is extensible through plugins. Each plugin registers layer types with the PluginRegistry, making them available for use in any sketch.

Plugin Interface

Every plugin implements DesignPlugin:

interface DesignPlugin {
  id: string;                    // e.g. 'typography'
  name: string;                  // e.g. 'Typography'
  version: string;               // semver
  description: string;
  layerTypes: LayerTypeDefinition[];
  mcpTools: McpToolDefinition[];
}

Layer Type Definition

Each layer type declares its properties schema:

interface LayerTypeDefinition {
  typeId: string;          // e.g. 'typography:text'
  displayName: string;     // e.g. 'Text'
  properties: LayerPropertySchema[];
}

Property Types

11 property types are supported:

TypeDescriptionExample
stringText inputFont family, text content
numberNumeric sliderFont size, opacity
booleanToggle switchEnable/disable features
colorColor pickerFill color, stroke color
selectDropdown menuAlignment, blend mode
rangeMin/max rangeValue range
pointX/Y coordinatePosition
sizeWidth/heightDimensions
arrayList of valuesGradient stops
objectNested propertiesShadow settings
enumFixed set of valuesShape type

Built-in Plugins

17 plugins ship with the platform. See the Plugins reference for details on each one.

Registration

Plugins are registered at startup:

import { PluginRegistry } from '@genart-dev/core';
import typography from '@genart-dev/plugin-typography';
import filters from '@genart-dev/plugin-filters';

const registry = new PluginRegistry();
registry.register(typography);
registry.register(filters);

The desktop app and web editor register all 17 plugins automatically.