Skip to content

Frame-Relay Kit Format Specification (v1.0) ​

The Frame-Relay design kit is the standardized contract between the Figma export plugin, AI coding agents, the Frame-Relay CLI, and local MCP servers.

Folder Layout ​

Every kit is contained within a folder named frame-relay-kit/:

text
frame-relay-kit/
├── frame-relay.json                # Root manifest identifying kit metadata and components
├── tokens.json                     # Design tokens in W3C DTCG format with mode overrides
├── components/
│   └── <ComponentName>.json        # Individual component specifications (one per component)
├── screenshots/
│   └── <Component>--<Variants>--<State>.png   # Visual snapshots rendered from Figma
└── icons/
    └── <icon-name>.svg             # Scalable vector assets referenced in component specs

1. Manifest Specification (frame-relay.json) ​

The manifest file signals a valid kit and catalogs all components and modes:

FieldTypeMeaning
$schemastring (optional)URI pointing to the hosted JSON Schema for validation.
kitVersionstringThe version of the Frame-Relay specification used (must be "1.0").
namestringHuman-readable title of the design kit.
generator.namestringName of the tool that generated the kit (e.g. "frame-relay-plugin").
generator.versionstringVersion of the tool that exported the kit.
source.type"figma"The source platform for the design kit.
source.fileKeystringUnique Figma file identifier where the designs originate.
source.fileNamestringDisplay name of the source Figma document.
source.pagestring (optional)Specific page within the Figma file exported from.
exportedAtstringISO 8601 UTC timestamp recording when the kit was produced.
tokensFilestringRelative path to the tokens file (defaults to "tokens.json").
modesstring[]Available visual themes or modes (e.g. ["light", "dark"]).
componentsobject[]List of components included in the kit.
components[].namestringPascalCase name matching the component specification.
components[].filestringRelative file path to the component specification JSON file.

2. Tokens Specification (tokens.json) ​

Tokens adhere to the W3C Design Tokens Community Group (DTCG) specification with mode support:

Field / ConceptTypeMeaning
$valueunknownBase default value (light mode), object definition, or token reference alias.
$typestring (optional)Token category: color, dimension, fontFamily, fontWeight, duration, number, shadow, typography, or border.
$descriptionstring (optional)Context explaining intended usage of the token.
$extensionsobject (optional)Custom metadata dictionary for tool extensions.
$extensions["frame-relay"].modesobjectAlternative values keyed by mode name (e.g. {"dark": "#0B1220"}).
Group nestingobjectHierarchical containers organizing tokens (groups inherit $type to children).
Token ReferencesstringAn alias formatted as {path.to.token} resolving to another token in the tree.

3. Component Specification (components/<ComponentName>.json) ​

Each component is described by an anatomy, property schema, base styles, variant modifiers, and interactive states:

FieldTypeMeaning
$schemastring (optional)URI pointing to the component JSON Schema.
namestringPascalCase identifier matching the component filename.
descriptionstringSingle-sentence summary of the component's UI purpose.
categorystring (optional)Classification: action, input, display, layout, feedback, or navigation.
anatomyobject[]Declared layer structure identifying sub-parts of the component.
anatomy[].namestringkebab-case name of the sub-part (e.g. root, icon-left, label).
anatomy[].descriptionstringFunctional role of this layer within the component.
anatomy[].requiredbooleanIndicates whether the sub-part is always rendered or optional.
propsobject[]Public configurable properties accepted by the component.
props[].namestringcamelCase prop name or standard variant property (Variant, Size, State).
props[].typestringProp data type: variant, boolean, text, or instance.
props[].optionsstring[]Set of unique possible values (required when type is variant).
props[].defaultstring | boolean | numberFallback initial value when prop is omitted.
props[].descriptionstring (optional)Guidance on how this prop influences component rendering.
layoutobject (optional)Auto layout rules applied to the root part.
layout.direction"row" | "column"Primary flex distribution axis.
layout.gapStyleValue (optional)Spacing between direct child parts.
layout.paddingobject (optional)Inset padding (top, right, bottom, left).
layout.justifystring (optional)Main-axis alignment (start, center, end, space-between).
layout.alignstring (optional)Cross-axis alignment (start, center, end, baseline, stretch).
layout.width"hug" | "fill" | { fixed }Horizontal sizing constraint.
layout.height"hug" | "fill" | { fixed }Vertical sizing constraint.
baseobjectMap of anatomy part name to default StyleBlock.
variantsobject[]Style overrides activated when specific props match.
variants[].propsobjectKey-value pairs of prop conditions that activate this variant.
variants[].stylesobjectPartial map of anatomy part name to style overrides.
statesobject[]Visual overrides for interactive states.
states[].namestringAllowed state: Default, Hover, Focus, Pressed, Disabled, Loading, Error.
states[].stylesobjectPartial map of anatomy part name to style overrides for this state.
usage.dostring[]Recommended implementation practices for developers and agents.
usage.dontstring[]Anti-patterns and discouraged patterns.
accessibility.rolestring (optional)Semantic WAI-ARIA role (e.g. "button", "textbox").
accessibility.notesstring[] (optional)Keyboard interaction, aria attributes, and assistive guidelines.
screenshotsobject[]Visual snapshot references for multimodal agents and verification.
screenshots[].variantobjectProp values depicted in the image.
screenshots[].statestringInteractive state depicted (must be in states or "Default").
screenshots[].pathstringRelative path to screenshot file under screenshots/.
sourceobject (optional)Figma layer IDs for bidirectional sync (figmaNodeId, figmaComponentKey).

Style Values (StyleValue) ​

A StyleValue represents any styling parameter and must be either:

  1. Token Reference: A path wrapped in curly braces (e.g. "{radius.md}", "{color.primary.500}").
  2. Raw Value: An object with a raw string (e.g. { "raw": "13px" }), recording values not yet tokenized in Figma.

Style Blocks (StyleBlock) ​

A StyleBlock contains optional StyleValue fields: background, color, borderColor, borderWidth, borderRadius, boxShadow, typography, opacity, iconSize.


4. Annotated Button Example ​

The example below uses comments to explain each block. Remove the comments to get valid JSON.

jsonc
{
  "$schema": "https://joseph-brendan.github.io/Frame-Relay/schemas/v1/component.schema.json",
  "name": "Button",
  "description": "Trigger an immediate action or submission.",
  "category": "action",

  /* 1. Declared layer anatomy */
  "anatomy": [
    { "name": "root", "description": "Interactive container", "required": true },
    { "name": "icon-left", "description": "Optional leading icon", "required": false },
    { "name": "label", "description": "Button label text", "required": true },
  ],

  /* 2. Public component properties */
  "props": [
    {
      "name": "variant",
      "type": "variant",
      "options": ["Primary", "Secondary", "Ghost"],
      "default": "Primary",
    },
    { "name": "disabled", "type": "boolean", "default": false },
  ],

  /* 3. Auto layout settings for root part */
  "layout": {
    "direction": "row",
    "gap": "{space.2}",
    "padding": {
      "top": "{space.2}",
      "right": "{space.4}",
      "bottom": "{space.2}",
      "left": "{space.4}",
    },
    "justify": "center",
    "align": "center",
    "width": "hug",
    "height": "hug",
  },

  /* 4. Default baseline appearance */
  "base": {
    "root": {
      "background": "{color.primary.500}",
      "color": "{color.neutral.0}",
      "borderRadius": "{radius.md}",
      "typography": "{typography.button}",
    },
    "label": { "color": "{color.neutral.0}", "typography": "{typography.button}" },
  },

  /* 5. Variant visual overrides */
  "variants": [
    {
      "props": { "variant": "Secondary" },
      "styles": {
        "root": { "background": "{color.neutral.100}", "color": "{color.neutral.900}" },
        "label": { "color": "{color.neutral.900}" },
      },
    },
  ],

  /* 6. Interactive state overrides */
  "states": [
    { "name": "Default", "styles": {} },
    { "name": "Hover", "styles": { "root": { "background": "{color.primary.600}" } } },
  ],

  /* 7. Usage guidelines for agents & devs */
  "usage": {
    "do": ["Use Primary variant for the main intended action on a screen"],
    "dont": ["Do not place more than one Primary button in the same container"],
  },

  /* 8. Accessibility roles and expectations */
  "accessibility": {
    "role": "button",
    "notes": ["Supports activation via Enter and Space keys"],
  },

  /* 9. Visual screenshot references */
  "screenshots": [
    {
      "variant": { "variant": "Primary", "disabled": false },
      "state": "Default",
      "path": "screenshots/Button--Primary-false--Default.png",
    },
  ],
}

Released under the MIT License.