Skip to main content

Creating Custom Design Systems

A custom design system captures your brand rules once and reuses them everywhere. There are three ways to get one: generate it from source material, author it by hand, or copy a bundled system and modify it.

All three end up in the user registry with a user: id prefix, so they survive updates.

Generating from source material​

The daemon exposes extraction directly, so a system can be produced without a full design run:

SourceRoute
A public URLPOST /api/brand-guidelines/extract with { "url": "…" }
A public GitHub repoPOST /api/brand-guidelines/extract-github with { "repo" | "url": "…" } → 202 { runId }, then poll GET /api/brand-guidelines/extract-github/:runId
An existing specPOST /api/brand-guidelines/refine with { "body", "instruction" }

The GitHub path fetches design files through the API and synthesises a DESIGN.md, which is why it is a background job (202 + runId) rather than a synchronous call.

Over MCP, create_design_system accepts sourceNotes with a URL and derives a starter spec from it when body is omitted. You can also let the agent work from attachments inside a design run — attach a screenshot or brand-guide PDF and brief it to extract the system.

The extraction protocol​

When working from visual inputs, the agent follows a strict order:

  1. Locate — find the brand assets in the supplied material.
  2. Download — fetch and store them locally.
  3. Extract — pull actual hex values from the source rather than recalling them.
  4. Write brand-spec.md — document the extracted tokens with provenance.
  5. Vocalise — describe what was found before applying it.

The agent never guesses brand colours from memory. If a value cannot be extracted, it uses an honest placeholder rather than a fabricated hex — this is enforced by the anti-ai-slop craft rule, whose first target is invented brand values.

Creating over the CLI​

tfdesign design-systems create \
--title "Acme Corp" \
--category "Productivity & SaaS" \
--summary "Trust-focused enterprise palette." \
--body-file ./acme-DESIGN.md

# or from a URL, letting the daemon derive a starter spec
tfdesign design-systems create --title "Acme Corp" --source-notes https://acme.com
FlagPurpose
--titleDisplay title (required)
--body / --body-fileDESIGN.md markdown source; the file wins
--summaryOne-line picker summary
--categoryCategory label (default Custom)
--surfaceweb | image | video | audio
--statusdraft | published
--source-notesURL to derive a starter spec from when no body

Update and delete:

tfdesign design-systems update "user:acme-corp" --body-file ./acme-v2.md
tfdesign design-systems delete "user:acme-corp"

delete refuses a bundled id before making the round trip. Over MCP, delete_design_system additionally requires confirm to repeat the id exactly.

Authoring by hand​

Minimum viable system: one file.

<dataDir>/brand-guidelines/acme-corp/
└── DESIGN.md

Full package shape:

<dataDir>/brand-guidelines/acme-corp/
├── manifest.json
├── DESIGN.md
├── tokens.css
├── components.html
├── assets/
└── preview/

DESIGN.md​

# Acme Corp

> Category: Productivity & SaaS
> Surface: web
> Trust-focused enterprise language. Deep navy, restrained accent, dense tables.

## 1. Visual Theme & Atmosphere
...

## 2. Color Palette & Roles
| Role | Token | Hex |
|------|-------|-----|
| Primary | `--color-primary` | `#1a237e` |
| Secondary | `--color-secondary` | `#3949ab` |
| Accent | `--color-accent` | `#ff6f00` |
| Surface | `--color-surface` | `#f5f5f7` |

## 3. Typography Rules
...

## 4. Component Stylings
...

## 5. Layout Principles
...

## 6. Depth & Elevation
...

## 7. Do's and Don'ts
...

## 8. Responsive Behavior
...

## 9. Agent Prompt Guide
...

The parser reads the H1 as the picker title, > Category: for grouping, > Surface: for the surface badge, the first paragraph as the summary, and hex literals for the swatch strip. Everything else is prompt material.

tokens.css​

Compiled CSS custom properties matching the DESIGN.md values. Skipping it is legal; shipping it is better, because it gives the agent concrete values to copy instead of re-deriving them.

:root {
--color-primary: #1a237e;
--color-secondary: #3949ab;
--color-accent: #ff6f00;
--color-surface: #f5f5f7;
--font-body: 'Inter', system-ui, sans-serif;
--font-heading: 'Space Grotesk', 'Inter', sans-serif;
--radius-md: 8px;
--space-4: 16px;
}

manifest.json​

Required fields are schemaVersion, id, name, category, source, and files:

{
"schemaVersion": "od-brand-guideline-project/v1",
"id": "acme-corp",
"name": "Acme Corp",
"category": "Productivity & SaaS",
"description": "Trust-focused enterprise palette.",
"source": { "type": "local", "path": "/Users/me/brand/acme.pdf" },
"files": {
"design": "DESIGN.md",
"tokens": "tokens.css",
"components": "components.html"
},
"importMode": "normalized",
"craft": {
"applies": ["color", "accessibility-baseline"],
"suggested": ["form-validation"],
"exemptions": []
}
}

craft.applies forces craft rules on for this brand; craft.suggested offers them; craft.exemptions opts out (for example, a deliberately low-contrast editorial system may exempt accessibility-baseline, though that is rarely the right call).

components.html​

An optional standalone fixture showing buttons, inputs, cards, and nav rendered with the tokens. It powers the component showcase in the preview modal, and it gives the agent a concrete reference to imitate.

Validating​

pnpm guard validates manifest.json against the schema for any folder that ships one. Legacy DESIGN.md-only folders are skipped rather than failing, so hand-authored systems stay cheap.

Common validation failures:

SymptomCause
DESIGN.md not foundFolder name and files.design disagree
Schema error on idMust match /^[a-z0-9-]+$/
Missing token filefiles.tokens names a file that is not there
System not in pickerDirectory is not under the user registry, or DESIGN.md is unreadable

Using a custom system​

It appears in the picker as soon as it is readable — no restart. Bind it like any bundled system:

tfdesign run "Quarterly board deck" --design-system "user:acme-corp"

Because a bound system replaces the direction picker, your custom system fully controls the visual output on the first generation rather than after a re-roll.