AGENT SKILL

brand-ui-create-theme

Use when someone wants a new brand-ui theme built from a real brand — a company or product name, website links, brand guidelines, a logo, screenshots or a style sheet — e.g. "create a theme for <brand>", "make us a theme from these links", "theme it like <product>", "/create-theme". For retuning a theme family that already exists, use brand-ui-update-theme; for a single token tweak, brand-ui-theme.

License 许可
MIT
最近更新
2026-10-07
Stars
★ 1
Forks
1

01 前言 Front Matter

name
brand-ui-create-theme
description
Use when someone wants a new brand-ui theme built from a real brand — a company or product name, website links, brand guidelines, a logo, screenshots or a style sheet — e.g. "create a theme for <brand>", "make us a theme from these links", "theme it like <product>", "/create-theme". For retuning a theme family that already exists, use brand-ui-update-theme; for a single token tweak, brand-ui-theme.
allowed-tools
[ "WebSearch", "WebFetch", "Bash(node *theme-kit.mjs *)", "Bash(curl -sL *)", "Bash(pnpm theme:new *)", "Bash(pnpm check *)", "Bash(pnpm gen)" ]
argument-hint
<theme name> [links, file paths, brief]
user-invocable
true

02 资源文件 3

03 SKILL.md 正文

brand-ui-create-theme

Turn a brand's own material into a brand-ui theme family (light and/or dark), with every value traced to a source and a proposal the person approves before any file is written. A theme is colour, type, shape and motion — never logo art: the logo stays the app's own (see §3).

Research decides; the kit measures. scripts/theme-kit.mjs (next to this file, zero dependencies) does all colour conversion, contrast, token coverage and the proposal page. Never convert a colour or estimate a contrast ratio in your head. Below, <kit> is the absolute path of scripts/theme-kit.mjs inside this skill's directory; node <kit> with no arguments prints its usage.

The contract

  1. Nothing is written to the project before the person approves the proposal. Research notes, downloads, drafts and the proposal page live in a scratch folder.
  2. Every proposed value has a source row and a confidence (measured, guideline, derived, inferred). A value from memory is inferred.
  3. Every link and file the person gave is opened, and the ledger says whether it worked.
  4. The drafts pass theme-kit.mjs audit before they are presented — full token coverage, a color-scheme, and body text at WCAG AA (4.5:1) in every mode.

Steps

1 · Intake

From the arguments: theme name → slug (kebab-case) and label; every URL; every file path; any brief ("product UI, not marketing", "dark only"). If there is no brand name and no resource at all, ask for one before researching.

Find out where you are — it changes step 6 only:

  • brand-ui source repository — it has a themes/ folder with family subfolders and a theme:new script in the root package.json. The family goes into themes/<slug>/.
  • An app using brand-ui — @elabs-ai/components-tokens is a dependency. Ask where theme families live if there is no obvious src/themes/; default src/themes/<slug>/.

Pick a scratch folder (the session scratchpad if one exists, otherwise a temp directory) and keep every intermediate file there.

2 · Research

Follow reference/research.md: the person's material first, then official brand material, then the live product, then the marketing site. Build the source ledger as you go. Parallel fetches or subagents are welcome; each returns ledger rows and extracted values, not pages.

3 · Logo and typeface

Logo: none. A theme leaves --brand-logo-mark, --brand-logo-lockup and --brand-logo-lockup-aspect at initial, so brand-ui's own mark shows, inked by the theme; embedding someone else's mark in a theme is refused by pnpm check --rule community-themes. Tell the person how their APP sets those three tokens for its own logo (reference/research.md §4). Typeface: §5 — ship it only under an open licence.

4 · Map to tokens and draft

Write proposal.json and the drafts as described in reference/proposal.md:

node <kit> oklch "#0B5FFF"                       # every colour, before it goes in the proposal
node <kit> apply --base builtin:light --name <slug>-light --scheme light \
  --proposal proposal.json --header "<Label> — light. Downloadable theme family \"<slug>\"." \
  --out <scratch>/<slug>-light.css
node <kit> audit <scratch>/<slug>-light.css <scratch>/<slug>-dark.css

Fix every audit failure by adjusting the value, not by dropping the check; record each adjustment as a deviation.

5 · Propose and stop

node <kit> proposal proposal.json --draft light=<scratch>/<slug>-light.css \
  --draft dark=<scratch>/<slug>-dark.css --out <scratch>/<slug>-proposal.html

Show the page and present it as reference/proposal.md "Presenting it" describes, then ask Approve and write it / Change something / Cancel. On "Change something", revise, re-audit, re-render, ask again.

6 · Write (only after Approve)

brand-ui source repository:

  1. pnpm theme:new <slug> --label "<Label>" --hue <brand hue> (add --only light|dark for a single-mode family) — creates theme.ts, the README and the stylesheets.
  2. Replace each generated <slug>-<mode>.css with the approved draft.
  3. Fonts, if shipped: fonts/<face>/*.woff2 + licence file + <slug>-fonts.css (@font-face only).
  4. Replace the generated README body with the Qlik-style record: what the theme reproduces (element → source value → token), chart palette, typography, and the source ledger. Add the family's row to the table in themes/README.md.
  5. pnpm check --rule community-themes and pnpm gen; read the counts they print. The kit's audit warnings (chart series, recessed chrome) are not covered by that rule — resolve them before writing.
  6. Point the person at the Storybook Theme toolbar to try it on real components.

An app using brand-ui:

  1. Copy the drafts to <themes dir>/<slug>/<slug>-<mode>.css.

  2. Write theme.ts:

    import { defineTheme, type ThemeDefinition } from "@elabs-ai/components-tokens";
    
    export const <camelSlug>Themes: ThemeDefinition[] = [
      defineTheme({ value: "<slug>-light", label: "<Label> Light", dark: false, family: "<slug>", familyLabel: "<Label>" }),
      defineTheme({ value: "<slug>-dark", label: "<Label> Dark", dark: true, family: "<slug>" }),
    ];
    
  3. A README with the source ledger, the trademark note, and one line saying the family ships no logo art.

  4. Import the stylesheets after @elabs-ai/components-tokens/styles.css, register the family on ThemeProvider (spread BUILT_IN_THEME_DEFINITIONS to keep the defaults), and for a dark mode extend Tailwind's dark: variant with the new theme name: @custom-variant dark (&:where([data-theme="dark"], [data-theme="dark"] *, [data-theme="<slug>-dark"], [data-theme="<slug>-dark"] *));

  5. node <kit> audit <themes dir>/<slug>/*-light.css <themes dir>/<slug>/*-dark.css.

Report

What the family looks like and what it is based on; how to switch to it; open questions; under Problems every source that failed, every inferred value count, an unshipped proprietary font, and the trademark note.

Common mistakes

Mistake Instead
Palette from memory labelled as researched Fetch it, or mark it inferred and say the fetch failed
Hand-written oklch() values node <kit> oklch for every colour
Writing theme files, then asking Drafts in scratch → proposal → Approve → write
Scaffolding themes/<slug>/ "just to look" The kit's builtin: base drafts without touching the project
Brand colour that fails contrast silently swapped Keep it as the mark, change its ink or darken it, record the deviation
Embedding the brand's logo in the theme Themes carry no logo art; the app points the logo tokens at its own
Downloading a proprietary font into the theme Open-licence faces only; name the brand face first in the stack

04 同仓库更多 Skills

mreimitz
mreimitz/elabs-components

brand-ui

Build UI with the brand-ui component system (@elabs-ai/components-* packages — ui, data, ai, flow, maps, charts, marketing, editor, viewer, terminal, tokens, icons). Use when working in a project that depends on @elabs-ai/components-ui or any @elabs-ai/components-* package, when adding/composing components, building dashboards, data tables, AI/chat surfaces, React Flow canvases, MapLibre maps, code editors, file/document viewers, app shells, forms, or marketing sections, when theming with the token system, or when the user mentions brand-ui, @brand, light/dark themes, or "our design system". Provides live project context, the real component API, composition patterns, and the rules that keep components token-driven, accessible, and theme-safe.

★ 1
mreimitz
mreimitz/elabs-components

brand-ui-update-theme

Use when an existing brand-ui theme family should be improved from new material — updated brand guidelines, a new logo, product screenshots, a live site, feedback like "the green is off" or "match their new design system" — e.g. "update the qlik theme with these links", "refresh our theme from the new brand book", "/update-theme". For a brand with no theme yet, use brand-ui-create-theme.

★ 1
mreimitz
mreimitz/elabs-components

brand-ui-theme

Create or retune a brand-ui theme (token work). Use when adding a new theme, re-branding the system to a customer's palette, adjusting global radius/spacing/surfaces, or fixing token-level contrast across themes. Use when the user says "new theme", "brand it for <customer>", "make corners less rounded", "dark theme", "adjust the tokens", or "our colors". Every change is a token in a theme stylesheet — never a hardcoded value in a component.

★ 1
mreimitz
mreimitz/elabs-components

brand-ui-start

The front door for building UI with brand-ui — a router/concierge that asks what you want to do and hands you to the right flow. Use when someone is starting out and unsure where to begin ("help me with brand-ui", "where do I start", "I want to build something", "what can brand-ui do", "get me going"), or types /brand-ui-start. Routes to three flows — build a NEW app (brand-ui-new-app), improve/migrate an EXISTING app (brand-ui-migrate), or just help me USE brand-ui in an app that already has it (brand-ui). If the intent is already obvious (the person said "build me a dashboard" or "audit this screen"), skip the question and go straight to that flow.

★ 1
mreimitz
mreimitz/elabs-components

brand-ui-registry

Curate the brand-ui shadcn-compatible registry (maintainer workflow). Use when deciding whether something belongs as an imported @elabs-ai/components-* primitive vs a copy-own registry block/template, when adding or editing a registry item, or when validating/building the registry for distribution. Use when the user says "add a registry item", "make this a block", "publish to the registry", or "package vs registry". For consuming registry items in an app, use the `brand-ui` skill (npx shadcn add).

★ 1
mreimitz
mreimitz/elabs-components

brand-ui-new-app

Define-to-build — scaffold a new brand-ui app from a plain-language description (VP-02). Use when the user wants to START an app, page, or demo ("build me a sales dashboard", "I need an admin console for X", "new app", "scaffold a chat assistant", "create a landing page for a pitch") rather than add to an existing one. Runs a staged interview (quick 3-question mode or full 7-stage spec mode), writes an app-spec.md, then scaffolds from the matching template + playbook with every wiring point annotated and a starter CLAUDE.md so later agent sessions stay on-brand. For adding components to an existing app use `brand-ui`; for authoring library components use `brand-ui-component`.

★ 1