Tutti UI System
Use this skill as the single entrypoint for @tutti-os/ui-system component
reuse, extraction, promotion, metadata, and storyboard work.
Non-Negotiable Standard
Any UI promoted into @tutti-os/ui-system must fully follow the UI-system
design standard before it can be reported as complete.
Treat these as hard requirements, not cleanup suggestions:
- use UI-system semantic tokens and existing shared CSS variables; do not leave
raw
hex, rgb(...), rgba(...), ad hoc gradients, or app-local palette
values in promoted components or their storyboard examples unless the source
of truth already exposes them as approved tokens
- compose existing UI-system
base primitives such as Card, Button,
Tooltip, Dialog, and related vocabulary before creating custom panel,
button, field, or overlay treatments
- use icon components from
@tutti-os/ui-system/icons for promoted
components and storyboard examples. Do not inline SVG/data URI assets, import
app-local icon files, or pull third-party icon packages directly from promoted
UI. If the source UI depends on an icon that is not in the UI system, promote
the source-derived icon into packages/ui/system/src/icons with metadata
first, then consume the UI-system icon export.
- make storyboard examples render the real component surface and states; do not
rely on surrounding docs chrome to hide component-level visual drift or to
fake the final panel/surface language
- when a consumer is migrated, its final rendered result must also follow the
same UI-system visual standard; a temporary bridge may help wiring, but it is
not acceptable as the final visual implementation if it keeps a second token
system or divergent component styling
If these conditions are not met, report the promotion as incomplete or blocked,
not complete.
Source Of Truth
Read these before editing:
- nearest
AGENTS.md for the target code
- local
AGENTS.md bundled with this skill
- local
ui-system.md bundled with this skill
- component metadata from the first available source:
GET http://127.0.0.1:4100/components
packages/ui/system/src/metadata/components.json
@tutti-os/ui-system/metadata from the installed package
Use stable public imports only:
@tutti-os/ui-system
@tutti-os/ui-system/components
@tutti-os/ui-system/icons
@tutti-os/ui-system/metadata
@tutti-os/ui-system/styles.css
@tutti-os/ui-system/utils
Never deep import @tutti-os/ui-system/src/* or per-file component paths.
Route The Task
Read only the reference file that matches the task.
- Using or querying existing components:
references/use-existing-component.md
- Extracting a low-level base primitive:
references/extract-base-component.md
- Promoting reusable business UI into a shared component:
references/promote-business-component.md
- Maintaining ids, metadata, exports, or storyboard inventory:
references/maintain-inventory.md
Global Boundaries
Keep these outside @tutti-os/ui-system components:
- daemon, Electron, filesystem, router, or host adapter calls
- data fetching, cache mutation, persistence, polling, and global store
ownership
- workflow orchestration such as onboarding, workspace registration, install or
uninstall flows, confirmation dialogs, queueing, or navigation
- i18n key lookup and business-specific copy derivation unless supplied by
props, children, or labels
For any promoted public component, add stable exports, metadata, and storyboard
coverage that match the chosen reference workflow.
For promoted base components, preview coverage is not satisfied by metadata
alone. DOM components need a real renderable example in apps/ui-storyboard.
React Native components need a real renderable example in the Mobile
development gallery because the DOM storyboard cannot render their final
surface. In both cases, the example must use the stable public entrypoint and
show the component's public states.
For business component promotion, use a copy-first workflow: move the existing
business component structure as intact as possible, preserve the real DOM,
visual hierarchy, state branches, and interaction layout, then progressively
remove host dependencies and standardize the public API. Do not begin by
inventing a cleaner abstraction or new visual treatment. The state matrix,
props boundary, and candidate source UI define what to copy, what to keep
caller-owned, and what to standardize after parity exists.
Treat business component promotion as an iterative migration-review loop, not a
single extraction pass:
- migrate the source UI copy-first
- recreate source-backed states in storyboard
- run independent review against the original source and screenshot
- migrate again to close review findings
- repeat review until source/design parity is acceptable
Only after that loop should the API be generalized further. Do not report the
component as complete after the first migration if review still shows material
DOM, visual, token, state, icon, or storyboard coverage drift.
The promoted UI must follow the original design exactly unless the user
explicitly approves a visual change. Do not add new decoration, controls,
icons, layout chrome, copy, motion, states, spacing, or visual hierarchy that
does not exist in the source UI or provided screenshot. If UI-system token or
primitive replacement is needed, it must preserve the observed design and
interaction path rather than becoming a redesign.
Copy-first also applies to dependent presentational subcomponents and
third-party-library wrappers used by the candidate UI. Do not copy only the top
level JSX and recreate nested behavior from memory. Trace the dependency tree:
pure display helpers should move with the component; reusable wrappers around
Radix, floating UI, resizable panels, virtualization, or similar libraries
should be promoted or reused as base primitives first; host-coupled children
must be split into caller-owned data, labels, callbacks, or slots before the
business component is considered promoted.
Design Foundation Verification
Every promoted component must comply with
ui-system.md, especially the shared tokens,
theme variables, spacing, radius, typography, surface language, interactive
states, and existing base primitive vocabulary.
Explicitly check and report all of these before completion:
- color and surface styling come from UI-system semantic tokens rather than raw
palette values
- panels, rows, controls, and overlays compose existing base primitives where
applicable instead of recreating them locally
- storyboard shows the component's real promoted surface rather than only a
documentation wrapper
- migrated consumers no longer depend on a separate visual token system for the
promoted surface
Run the Tutti promotion review gate before reporting completion. The gate is
adapted from frontend design review practice but constrained to Tutti's dense
workbench product language:
- Frictionless: the migrated consumer preserves the original task path, keeps a
clear action hierarchy, and does not bury primary or recovery actions.
- Quality craft: visual parity evidence is captured for selected states, shared
tokens and primitives are used, light/dark and interactive states work, and no
unapproved raw palette, spacing, radius, typography, or motion drift remains.
- Trustworthy: empty, loading, disabled, error-like, permission-limited, and
AI-generated-content states keep clear labels, actionable recovery, and
host-owned policy or provenance outside the shared component.
After promoting a base or business component, start an independent subagent to
review design-foundation compliance before reporting completion. Provide the
subagent with the promoted files, source usage, selected states, storyboard and
metadata entries, and the UI-system guidelines. If subagents are unavailable,
state that design-foundation verification is blocked and do not claim full
compliance.
Report the gate result with:
- context: source usage, promoted component id/layer, user task, selected states
- status: pass, needs work, or blocked
- pillar assessment: Frictionless, Quality craft, Trustworthy
- issues grouped as blocking, major, and minor
- validation commands and exact results
- remaining risks, uncovered states, or approved visual deltas
API Composition Review
When converting source states into public props, review the API shape before
writing the promoted component:
- avoid boolean prop proliferation for rendering modes; mode axes such as
isFoo, showBar, or withBaz must come from code evidence and usually
become a finite variant, discriminated union, explicit component variant,
slot, or composed child
- keep standard UI booleans such as
disabled, loading, selected, open,
required, and invalid only when they represent real component state and
cannot create impossible combinations
- prefer
children or named slots for caller-owned visual regions; use render
props only when the shared component must pass data back to the caller
- use compound components and context only for genuinely complex reusable
structures where consumers need to compose subparts without prop drilling
- if shared state is needed, define a narrow context value as
state,
actions, and meta; providers may inject state but must not own daemon,
Electron, router, store, query, persistence, or workflow side effects
- for new React components in this React 19 codebase, prefer the React 19 API
shape such as
ref as a prop; do not churn shadcn or Radix-acquired code only
to normalize style when behavior and public API are already sound
Report the API composition decision with the state matrix: which differences
became props, variants, slots, children, explicit variants, provider state, or
stayed host-owned.
Validation Commands
Run the smallest relevant checks from the selected reference. Common checks are:
node tools/scripts/check-ui-metadata.mjs
pnpm check:ui-boundaries
pnpm --filter @tutti-os/ui-storyboard typecheck
If runtime component code changed, also run the relevant package typecheck or
consumer build.
When a base component is promoted, verify both of these conditions before
reporting completion:
- the component metadata opts into storyboard visibility when appropriate
apps/ui-storyboard contains a concrete rendered example for the promoted
component states, not just inventory wiring
1---2name: tutti-ui-system3description: Use when working with @tutti-os/ui-system components, replacing local UI with shared components, querying component ids or metadata, promoting UI into shared base or business components, or maintaining UI-system storyboard inventory.4---5
6# Tutti UI System
7
8Use this skill as the single entrypoint for `@tutti-os/ui-system` component
9reuse, extraction, promotion, metadata, and storyboard work.
10
11## Non-Negotiable Standard
12
13Any UI promoted into `@tutti-os/ui-system` must fully follow the UI-system
14design standard before it can be reported as complete.
15
16Treat these as hard requirements, not cleanup suggestions:
17
18- use UI-system semantic tokens and existing shared CSS variables; do not leave
19 raw `hex`, `rgb(...)`, `rgba(...)`, ad hoc gradients, or app-local palette
20 values in promoted components or their storyboard examples unless the source
21 of truth already exposes them as approved tokens
22- compose existing UI-system `base` primitives such as `Card`, `Button`,
23 `Tooltip`, `Dialog`, and related vocabulary before creating custom panel,
24 button, field, or overlay treatments
25- use icon components from `@tutti-os/ui-system/icons` for promoted
26 components and storyboard examples. Do not inline SVG/data URI assets, import
27 app-local icon files, or pull third-party icon packages directly from promoted
28 UI. If the source UI depends on an icon that is not in the UI system, promote
29 the source-derived icon into `packages/ui/system/src/icons` with metadata
30 first, then consume the UI-system icon export.
31- make storyboard examples render the real component surface and states; do not
32 rely on surrounding docs chrome to hide component-level visual drift or to
33 fake the final panel/surface language
34- when a consumer is migrated, its final rendered result must also follow the
35 same UI-system visual standard; a temporary bridge may help wiring, but it is
36 not acceptable as the final visual implementation if it keeps a second token
37 system or divergent component styling
38
39If these conditions are not met, report the promotion as incomplete or blocked,
40not complete.
41
42## Source Of Truth
43
44Read these before editing:
45
461. nearest `AGENTS.md` for the target code
472. local `AGENTS.md` bundled with this skill
483. local `ui-system.md` bundled with this skill
494. component metadata from the first available source:
50 - `GET http://127.0.0.1:4100/components`
51 - `packages/ui/system/src/metadata/components.json`
52 - `@tutti-os/ui-system/metadata` from the installed package
53
54Use stable public imports only:
55
56- `@tutti-os/ui-system`
57- `@tutti-os/ui-system/components`
58- `@tutti-os/ui-system/icons`
59- `@tutti-os/ui-system/metadata`
60- `@tutti-os/ui-system/styles.css`
61- `@tutti-os/ui-system/utils`
62
63Never deep import `@tutti-os/ui-system/src/*` or per-file component paths.
64
65## Route The Task
66
67Read only the reference file that matches the task.
68
69- Using or querying existing components:
70 `references/use-existing-component.md`
71- Extracting a low-level base primitive:
72 `references/extract-base-component.md`
73- Promoting reusable business UI into a shared component:
74 `references/promote-business-component.md`
75- Maintaining ids, metadata, exports, or storyboard inventory:
76 `references/maintain-inventory.md`
77
78## Global Boundaries
79
80Keep these outside `@tutti-os/ui-system` components:
81
82- daemon, Electron, filesystem, router, or host adapter calls
83- data fetching, cache mutation, persistence, polling, and global store
84 ownership
85- workflow orchestration such as onboarding, workspace registration, install or
86 uninstall flows, confirmation dialogs, queueing, or navigation
87- i18n key lookup and business-specific copy derivation unless supplied by
88 props, children, or labels
89
90For any promoted public component, add stable exports, metadata, and storyboard
91coverage that match the chosen reference workflow.
92
93For promoted base components, preview coverage is not satisfied by metadata
94alone. DOM components need a real renderable example in `apps/ui-storyboard`.
95React Native components need a real renderable example in the Mobile
96development gallery because the DOM storyboard cannot render their final
97surface. In both cases, the example must use the stable public entrypoint and
98show the component's public states.
99
100For business component promotion, use a copy-first workflow: move the existing
101business component structure as intact as possible, preserve the real DOM,
102visual hierarchy, state branches, and interaction layout, then progressively
103remove host dependencies and standardize the public API. Do not begin by
104inventing a cleaner abstraction or new visual treatment. The state matrix,
105props boundary, and candidate source UI define what to copy, what to keep
106caller-owned, and what to standardize after parity exists.
107
108Treat business component promotion as an iterative migration-review loop, not a
109single extraction pass:
110
1111. migrate the source UI copy-first
1122. recreate source-backed states in storyboard
1133. run independent review against the original source and screenshot
1144. migrate again to close review findings
1155. repeat review until source/design parity is acceptable
116
117Only after that loop should the API be generalized further. Do not report the
118component as complete after the first migration if review still shows material
119DOM, visual, token, state, icon, or storyboard coverage drift.
120
121The promoted UI must follow the original design exactly unless the user
122explicitly approves a visual change. Do not add new decoration, controls,
123icons, layout chrome, copy, motion, states, spacing, or visual hierarchy that
124does not exist in the source UI or provided screenshot. If UI-system token or
125primitive replacement is needed, it must preserve the observed design and
126interaction path rather than becoming a redesign.
127
128Copy-first also applies to dependent presentational subcomponents and
129third-party-library wrappers used by the candidate UI. Do not copy only the top
130level JSX and recreate nested behavior from memory. Trace the dependency tree:
131pure display helpers should move with the component; reusable wrappers around
132Radix, floating UI, resizable panels, virtualization, or similar libraries
133should be promoted or reused as `base` primitives first; host-coupled children
134must be split into caller-owned data, labels, callbacks, or slots before the
135business component is considered promoted.
136
137## Design Foundation Verification
138
139Every promoted component must comply with
140`ui-system.md`, especially the shared tokens,
141theme variables, spacing, radius, typography, surface language, interactive
142states, and existing `base` primitive vocabulary.
143
144Explicitly check and report all of these before completion:
145
146- color and surface styling come from UI-system semantic tokens rather than raw
147 palette values
148- panels, rows, controls, and overlays compose existing base primitives where
149 applicable instead of recreating them locally
150- storyboard shows the component's real promoted surface rather than only a
151 documentation wrapper
152- migrated consumers no longer depend on a separate visual token system for the
153 promoted surface
154
155Run the Tutti promotion review gate before reporting completion. The gate is
156adapted from frontend design review practice but constrained to Tutti's dense
157workbench product language:
158
159- Frictionless: the migrated consumer preserves the original task path, keeps a
160 clear action hierarchy, and does not bury primary or recovery actions.
161- Quality craft: visual parity evidence is captured for selected states, shared
162 tokens and primitives are used, light/dark and interactive states work, and no
163 unapproved raw palette, spacing, radius, typography, or motion drift remains.
164- Trustworthy: empty, loading, disabled, error-like, permission-limited, and
165 AI-generated-content states keep clear labels, actionable recovery, and
166 host-owned policy or provenance outside the shared component.
167
168After promoting a base or business component, start an independent subagent to
169review design-foundation compliance before reporting completion. Provide the
170subagent with the promoted files, source usage, selected states, storyboard and
171metadata entries, and the UI-system guidelines. If subagents are unavailable,
172state that design-foundation verification is blocked and do not claim full
173compliance.
174
175Report the gate result with:
176
177- context: source usage, promoted component id/layer, user task, selected states
178- status: pass, needs work, or blocked
179- pillar assessment: Frictionless, Quality craft, Trustworthy
180- issues grouped as blocking, major, and minor
181- validation commands and exact results
182- remaining risks, uncovered states, or approved visual deltas
183
184## API Composition Review
185
186When converting source states into public props, review the API shape before
187writing the promoted component:
188
189- avoid boolean prop proliferation for rendering modes; mode axes such as
190 `isFoo`, `showBar`, or `withBaz` must come from code evidence and usually
191 become a finite variant, discriminated union, explicit component variant,
192 slot, or composed child
193- keep standard UI booleans such as `disabled`, `loading`, `selected`, `open`,
194 `required`, and `invalid` only when they represent real component state and
195 cannot create impossible combinations
196- prefer `children` or named slots for caller-owned visual regions; use render
197 props only when the shared component must pass data back to the caller
198- use compound components and context only for genuinely complex reusable
199 structures where consumers need to compose subparts without prop drilling
200- if shared state is needed, define a narrow context value as `state`,
201 `actions`, and `meta`; providers may inject state but must not own daemon,
202 Electron, router, store, query, persistence, or workflow side effects
203- for new React components in this React 19 codebase, prefer the React 19 API
204 shape such as `ref` as a prop; do not churn shadcn or Radix-acquired code only
205 to normalize style when behavior and public API are already sound
206
207Report the API composition decision with the state matrix: which differences
208became props, variants, slots, children, explicit variants, provider state, or
209stayed host-owned.
210
211## Validation Commands
212
213Run the smallest relevant checks from the selected reference. Common checks are:
214
215```bash
216node tools/scripts/check-ui-metadata.mjs
217pnpm check:ui-boundaries
218pnpm --filter @tutti-os/ui-storyboard typecheck
219```
220
221If runtime component code changed, also run the relevant package typecheck or
222consumer build.
223
224When a base component is promoted, verify both of these conditions before
225reporting completion:
226
227- the component metadata opts into storyboard visibility when appropriate
228- `apps/ui-storyboard` contains a concrete rendered example for the promoted
229 component states, not just inventory wiring