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.
- License 许可
- MIT
- 最近更新
- 2026-10-07
- Stars
- ★ 1
- Forks
- 1
01 前言 Front Matter
- name
- brand-ui
- description
- 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.
- allowed-tools
- [ "Bash(npx @elabs-ai/components-cli *)", "Bash(pnpm brand-ui *)", "Bash(npx brand-ui *)", "Bash(npx shadcn@latest *)", "Bash(pnpm dlx shadcn@latest *)" ]
- user-invocable
- false
02 资源文件 7
- 参考文档reference/agent-output.md16.1 KB
- 参考文档reference/chart-selection.md39.8 KB
- 参考文档reference/charts.md8.6 KB
- 参考文档reference/components.md11.4 KB
- 参考文档reference/composition.md4.4 KB
- 参考文档reference/rules.md3.1 KB
- 参考文档reference/theming.md3.0 KB
03 SKILL.md 正文
brand-ui
A source-owned, token-driven React component system (@elabs-ai/components-*),
themeable to any brand. This file is the router: follow the routine, and load a
reference file only when the task needs it.
Run the CLI as pnpm exec brand-ui <cmd> or npx brand-ui <cmd> once
@elabs-ai/components-cli is a dev dependency (pnpm add -D or npm install -D;
public npm, no token), or with no install as npx -y @elabs-ai/components-cli <cmd>.
Inside the brand-ui repo: pnpm brand-ui <cmd>. When the mcp__brand-ui__* tools are
connected they answer the same without a shell. Examples below say brand-ui.
The routine
brand-ui info: once per session. Packages present, themes, tokens, registry.brand-ui search <need>: the component, a copy-own registry block, or for a whole screen ("dashboard", "chatbot", "settings page") the playbook and template to start from.brand-ui docs <Component> --brief: its parts and real props. Never guess an API; drop--brieffor every prop.- Build: compose existing components, their variants and semantic tokens.
brand-ui audit <path>: the static token and type-role pass. For the rendered cross-theme and contrast pass, use thebrand-ui-auditskill.
Decisions
<!-- brand-ui:gen:decisions:start -->
<!-- Generated from the decision summary by pnpm gen; edit the decisions there. -->
- D1 · Which paradigm? Build-with components (you/the agent write the code) — the default, ~99%. Generative-UI (A2UI) is for screens the agent must design at runtime.
- D2 · Rendering agent output A conversation → AI SDK
UIMessage+@elabs-ai/components-ai. An agent-designed surface → A2UI: JSON validated against the catalog, rendered byA2uiSurface. - D3 · Which package
@elabs-ai/components-*: app UI → ui · data → data · chat → ai · canvas →@elabs-ai/components-flow· in-chat agent workspace graph →@elabs-ai/components-ai· KPIs → charts · landing → marketing · code → editor · files → viewer · shell → terminal · process mining → process · tokens → tokens · icons → icons · icon rail →ContextRail(ui), chat drill-down →ContextPanel(ai) · images/audio/video → uiImage/Audio/Video(every package composes them; ADR 0041) - D4 · Import vs copy-own Stable shared primitives → import
@elabs-ai/components-*. Prototype-specific blocks → copy-own (registry). - D5 · Scope boundary (what brand-ui ISN'T) brand-ui is a presentation layer, not an SDK/runtime. It renders models; it never owns model calls.
- D6 · Dependency & import discipline
ai(Vercel AI SDK) is types-only, peer, never runtime. Semantic tokens only; one-way dep graph. - D7 · Maintainer decisions New component → dedupe-gate → right package (D3) → built to rules → auto-registered (gate, not memory). <!-- brand-ui:gen:decisions:end -->
Packages
<!-- brand-ui:gen:catalogue:start -->
<!-- Generated from the manifest by pnpm gen; package purposes are PKG_PURPOSE in the CLI. -->
Themes (2): dark, light (default) · Tokens: 312 · Registry blocks: 245 · Components: 475 in 13 packages
@elabs-ai/components-tokens(2): Semantic CSS-variable themes + ThemeProvider/useTheme.@elabs-ai/components-icons(32): Brand/product-vocabulary icons + BrandLogo (generic glyphs use lucide-react).@elabs-ai/components-ui(141): Foundation + app UI (Button, Card, Dialog, Tabs, AppShell, …).@elabs-ai/components-data(16): TanStack DataTable, FilterBar, SearchInput, FacetFilter, ColumnPicker.@elabs-ai/components-ai(75): ChatShell, Conversation, Message, PromptInput, Tool, Reasoning, citations.@elabs-ai/components-flow(23): Branded React Flow canvas, nodes, edges, controls, inspector.@elabs-ai/components-maps(18): MapLibre GL maps: MapCanvas, markers, popups, controls, routes, arcs, GeoJSON, clusters.@elabs-ai/components-charts(105): MetricCard, MetricGrid, ChartCard, ChartFrame (expand/flip/download).@elabs-ai/components-marketing(8): Hero, FeatureGrid, UseCaseCard, StatsBand, CTASection, LogoStrip.@elabs-ai/components-editor(7): Token-themed Monaco editor: CodeEditor, DiffEditor, CodeWorkspace.@elabs-ai/components-viewer(5): FileViewer — any file (image, audio, video, text, code, JSON, CSV, markdown, PDF, docx, pptx, xlsx) via a pluggable adapter registry.@elabs-ai/components-terminal(17): Terminal surfaces: shell/agent output and coding-agent CLI look-alikes.@elabs-ai/components-process(26): Process mining and event-log analysis: process map, variants, cases, conformance — composes flow/charts/data.
One count per component; brand-ui docs <Component> lists its parts (CardHeader, …).
<!-- brand-ui:gen:catalogue:end -->
Rules that always apply
- Semantic tokens only (
bg-background,text-muted-foreground,bg-primary,border-border); never hex,rgb(),bg-[#…]or a palette class liketext-gray-500. - Type is a role:
text-title,text-body,text-caption, … or<Heading>/<Text>; nevertext-smortext-[17px]. classNameis for layout, never recoloring; use the component's variants.- Focus:
focus-ringon any interactive element you author; never remove the outline without it. - Overlays (
Dialog,Sheet,Popover,DropdownMenu) own focus, dismissal and stacking: no hand-rolled traps, no manualz-index.Dialog,SheetandDrawerneed a title (sr-onlyif hidden);AvatarneedsAvatarFallback. - Real elements (
<button>,<a>,<input>), labelled inputs,aria-labelon icon-only controls. Every async region shows loading, empty and error states (Skeleton,StatePanel). - It must read in every theme: rely on tokens, never
dark:. - Icons:
lucide-reactfor generic glyphs,@elabs-ai/components-iconsfor brand marks.
Load when needed
- Composing an app shell, dashboard, chat, flow or form: reference/composition.md
- Which component for a need; import or copy-own: reference/components.md
- Rendering agent output (chat messages, tool calls, JSX strings, A2UI surfaces): reference/agent-output.md
- Charts, KPI tiles,
ChartFrame: reference/charts.md - Which chart for a data shape:
brand-ui chart-for "<data shape>", or reference/chart-selection.md - Theming and re-branding: reference/theming.md
- The rules above with Incorrect/Correct code: reference/rules.md
04 同仓库更多 Skills
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.
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.
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.
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).
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`.
brand-ui-migrate
Bring an app that already exists onto brand-ui (@elabs-ai/components-*). Use when someone wants to migrate, port, adopt or "move to" the design system in a codebase they already have ("migrate this project to brand-ui", "we use MUI, can we switch", "adopt your design system in our admin app", "replace our components with yours"). Profiles the repo, maps every component it finds to a brand-ui verdict, writes a phased migration plan, and then walks the phases with the user approving each one. Read-only until the plan is approved. For a brand-new app use `brand-ui-new-app`; for using components in an app already on brand-ui use `brand-ui`.