---
title: Use the design system
description: Apply Wurthy's shared design tokens, use the supplied brand assets, and organize UI code.
owner: engineering
sourceFiles:
  - apps/admin/src/styles/globals.css
  - apps/admin/src/components/ui/README.md
  - apps/server/src/domain/email/template.ts
  - apps/web/public/brand/wurthy-email-logo.png
  - apps/web/src/lib/actor-scope.ts
  - apps/web/src/components/feedback/actor-scope-recovery.tsx
  - apps/web/src/features/clients/components/client-navigation.tsx
  - apps/web/src/features/clients/components/client-settings-frame.tsx
  - apps/web/src/features/agent/components/agent-page.tsx
  - apps/web/src/features/agent/components/personal-messages.tsx
  - apps/web/src/features/conversation/components/conversation.tsx
  - apps/web/src/features/conversation/components/message-body.tsx
  - apps/web/src/features/work-items/components/work-item.tsx
  - apps/web/src/features/api.ts
  - apps/web/src/features/clients/api.ts
  - apps/web/src/features/spaces/components/space-catalog.tsx
  - apps/web/src/features/work-items/components/persisted-tasks.tsx
  - apps/web/src/styles/globals.css
  - apps/web/components.json
  - apps/web/src/components/ui/avatar.tsx
  - apps/web/src/components/ui/badge.tsx
  - apps/web/src/components/ui/button.tsx
  - apps/web/src/components/ui/card.tsx
  - apps/web/src/components/ui/command.tsx
  - apps/web/src/components/ui/empty.tsx
  - apps/web/src/components/ui/item.tsx
  - apps/web/src/components/ui/navigation-menu.tsx
  - apps/web/src/components/ui/toggle.tsx
  - apps/web/src/components/ui/toggle-group.tsx
  - apps/web/src/components/ui/attachment.tsx
  - apps/web/src/components/ui/bubble.tsx
  - apps/web/src/components/ui/input-group.tsx
  - apps/web/src/components/ui/marker.tsx
  - apps/web/src/components/ui/message.tsx
  - apps/web/src/components/ui/message-scroller.tsx
  - apps/web/src/components/ui/popover.tsx
  - apps/web/src/components/ui/sheet.tsx
  - apps/web/src/components/client-shell/client-shell.tsx
  - apps/web/src/components/ui/tabs.tsx
  - apps/web/src/components/ui/trace.tsx
  - apps/web/src/components/ui/alert.tsx
  - apps/web/src/components/avatars/author-avatar.tsx
  - apps/web/src/components/avatars/person-avatar.tsx
  - apps/web/src/components/avatars/wes-avatar.tsx
  - apps/web/src/components/client-shell/client-rail.tsx
  - apps/web/src/components/ui/sidebar.tsx
  - apps/web/src/components/ui/resizable.tsx
  - apps/web/src/features/conversation/components/space-conversation.tsx
  - apps/web/src/features/conversation/components/post.tsx
  - apps/web/src/components/client-shell/client-switcher.tsx
  - apps/web/src/lib/form.tsx
  - apps/web/src/features/conversation/components/composer.tsx
  - apps/web/src/features/conversation/validate-message.ts
  - apps/web/src/features/onboarding/validate-client.ts
  - apps/web/src/features/onboarding/components/add-client-form.tsx
  - apps/web/src/features/clients/components/client-list.tsx
  - apps/web/src/features/clients/navigation.ts
  - apps/web/src/components/connections/connection-source.tsx
  - apps/web/src/routes/index.tsx
  - apps/web/src/routes/clients/new/index.tsx
  - apps/web/src/routes/clients/$clientId/new-space/index.tsx
  - apps/web/src/features/settings/components/client-settings.tsx
  - apps/web/src/features/settings/components/settings-shell.tsx
  - apps/web/src/features/settings/components/settings-section.tsx
  - apps/web/src/components/connections/connection-media.tsx
  - apps/web/src/features/settings/components/profile-settings.tsx
  - apps/web/src/features/settings/components/settings-tabs.tsx
  - apps/web/src/features/settings/components/settings-rules.tsx
  - apps/web/src/features/settings/components/settings-skills.tsx
  - apps/web/src/features/settings/sections.ts
  - apps/web/src/components/client-shell/settings-rail.tsx
  - apps/web/src/routes/clients/$clientId/settings/$section/index.tsx
  - apps/web/src/routes/clients/$clientId/settings/spaces/$spaceId/index.tsx
  - apps/web/src/routes/_settings/route.tsx
  - apps/web/src/routes/_settings/you/$section/index.tsx
  - apps/web/src/routes/_settings/admin/$section/index.tsx
  - apps/web/src/features/settings/components/settings-list.tsx
  - apps/web/src/features/settings/components/reach-select.tsx
  - apps/web/src/features/settings/components/settings-agents.tsx
  - apps/web/src/features/work-items/types.ts
  - apps/web/src/features/conversation/components/channel.tsx
  - apps/web/src/features/apps/types.ts
  - apps/web/src/features/apps/components/canvas.tsx
  - apps/web/src/features/apps/components/app-card.tsx
  - apps/web/src/features/apps/components/app-chart.tsx
  - apps/web/src/features/apps/components/app-glyph.tsx
  - apps/web/src/features/apps/components/app-page-chart.tsx
  - apps/web/src/features/apps/components/app-page.tsx
  - apps/web/src/features/apps/components/app-output.tsx
  - apps/web/src/features/apps/components/app-settings.tsx
  - apps/web/src/features/spaces/components/space-page.tsx
  - apps/web/src/routes/clients/$clientId/$spaceId/apps/$appId/index.tsx
  - apps/web/src/components/page-tabs/page-tabs.tsx
  - apps/web/src/components/files/file-list.tsx
  - apps/web/src/components/feedback/list-skeleton.tsx
  - apps/web/src/routes/clients/$clientId/route.tsx
  - apps/web/src/routes/clients/$clientId/index.tsx
  - apps/web/src/routes/clients/$clientId/$spaceId/route.tsx
  - apps/web/src/routes/clients/$clientId/$spaceId/index.tsx
  - apps/web/src/routes/clients/$clientId/$spaceId/items/$itemId/index.tsx
  - scripts/oxlint/directory-routes.ts
  - vite.config.ts
  - apps/web/public/brand/wurthy-logo.svg
  - apps/web/public/brand/wurthy-mark.svg
  - apps/web/public/brand/wurthy-mark-lockup.svg
  - apps/web/public/brand/wurthy-wordmark.svg
  - apps/web/public/brand/gradient-blob.svg
  - apps/web/public/brand/wes-orb.png
  - apps/web/public/brand/agent-orb-green.png
  - apps/web/public/brand/quickbooks-logo.png
  - apps/web/public/brand/google.svg
  - apps/web/public/brand/auth-gradient.svg
  - apps/web/src/features/auth/components/sign-in.tsx
  - apps/web/src/features/auth/components/account-menu.tsx
  - apps/web/public/brand/fonts/STKBureauSerif-Book.woff2
  - apps/web/public/brand/fonts/STKBureauSerif-Regular.woff2
  - apps/web/public/brand/fonts/STKBureauSerif-Medium.woff2
---

Use shadcn's semantic utilities from `apps/web/src/styles/globals.css` with the existing controls in `apps/web/src/components/ui/`. Static brand artwork is served from `/brand/`; use the asset table below to choose a logo variant.

## Source values

[WB-3](https://linear.app/wurthy/issue/WB-3) tracks the integration. Wiebke's [Paper Theme and screens](https://app.paper.design/file/01M5MXK5NC2E4FA57582JKK7K1) supply the light values below. `globals.css` maps them directly to shadcn's semantic variables and Tailwind utilities.

| Role | Paper value |
| --- | --- |
| Canvas / text | `#EEF1F6` / `#0F172A` |
| Card and popover / text | `#FFFFFF` / `#0F172A` |
| Primary and focus / on primary | `#1201FF` / `#F8FAFC` |
| Secondary and accent / text | `#F1F5F9` / `#0F172A` |
| Muted / muted text | `#F8FAFC` / `#475569` |
| Border / input border | `#E2E8F0` / `#CBD5E1` |
| Tertiary icon / surface | `#94A3B8` / `#F1F5F9` |
| Info subtle | `#EEECFF` |
| Destructive / on destructive | `#DC2626` / `#F8FAFC` |
| Positive strong / muted / subtle / surface | `#047857` / `#10B981` / `#ECFDF5` / `#059669` |
| Warning strong / muted / subtle / surface | `#B45309` / `#F59E0B` / `#FFFBEB` / `#D97706` |
| Negative strong / muted / subtle / surface | `#B91C1C` / `#EF4444` / `#FEF2F2` / `#DC2626` |
| Font | Geist, supplied by the existing local Fontsource package |
| Small / medium / large radius | 12 / 14 / 16px |
| Small shadow, observed on floating screen controls | `0 1px 3px #0000001A, 0 1px 2px -1px #0000001A` |

Paper's screen text uses 12/16px captions, 14/20px controls, and 20/28px section headings with regular, medium, and semibold weights. Existing Tailwind type sizes cover these; no parallel typography system is required. Existing 4px spacing steps remain. Cards/dialogs use the same 16px radius as large controls; larger radius utilities retain 4px steps. Other elevation utilities retain Tailwind defaults.

For comparison, [SMB Portal's stylesheet](https://github.com/CreditWurthy/smb-portal/blob/main/packages/ui/src/styles/globals.css) shares the light colors and 16px base radius, but expresses its canvas as `hsl(217 30% 95%)` and includes serif heading helpers. Workbench follows Paper's exact canvas and Geist. Portal's [brand asset provenance](https://github.com/CreditWurthy/smb-portal/blob/main/docs/brand-assets.md) records historical ZIP artwork; it is not the token authority.

## Conversation surfaces

Team and client channel messages use a Slack-style feed: every author, including the viewer and Wes, shares one left avatar lane. The Message primitive’s `feed` variant places the author and timestamp together above plain text, with full-width content and no bubble surface or entrance spring. Bubble’s existing `ghost` variant retains the shared content composition. Channels and open threads use the same rows; the original message appears once above the replies, and parent-reference cards are omitted inside the thread. Both the viewer’s posts and other authors’ posts offer thread navigation.

Personal agent conversations reuse the same Message, Bubble, avatar, composer and MessageScroller primitives as a flat, one-to-one transcript without channel posts, reply actions, thread summaries or unread markers. Message’s `chat` variant supplies the layout: human messages appear on the right in muted bubbles, and agent replies appear on the left. Human profile photos come from the verified session. Both personal and team agent replies use the shared Pierre Words Markdown renderer inside Coss’s long-message expansion; human messages preserve typed text.

[Coss Chat UI](https://coss.com/ui/docs/chat) still supplies the adapted quoted reference, long-message expansion and reaction components under `features/conversation/components/coss/`, with their upstream MIT license. Wes’s direct answers join the original message’s thread and appear as a compact reply summary in the channel. Reminders and new topics without a reply target remain standalone posts. Reaction chips use the shared Toggle’s `reaction` variant, with a compact Base UI Popover for the emoji picker. Motion supplies the reaction selection bounce, respecting reduced motion. MessageScroller owns scrolling and anchoring.

## Brand artwork

Static artwork lives in `apps/web/public/brand/` and is served at `/brand/`.

| Asset URL | Use |
| --- | --- |
| `/brand/wurthy-logo.svg` | Full Wurthy logo exported from Paper; viewBox 105 × 24 |
| `/brand/wurthy-mark.svg` | Corrected Portal standalone mark; viewBox 100 × 100 |
| `/brand/wurthy-mark-lockup.svg` | Corrected Portal white mark on blue square; viewBox 150 × 150 |
| `/brand/wurthy-wordmark.svg` | Portal archive wordmark; viewBox 620 × 177 |
| `/brand/gradient-blob.svg` | Decorative gradient from the ZIP; viewBox 600 × 400 |
| `/brand/wes-orb.png` | Wes's avatar orb, rendered by `WesAvatar` |
| `/brand/agent-orb-green.png` | The viewer's own private agent, rendered by `WesAvatar` with `own`. Cropped to the orb and scaled to 65px from the Workbench prototype's `agent-orb-green.png` on November 19, 2026. |
| `/brand/quickbooks-logo.png` | The QuickBooks mark exported from Paper's Connect QuickBooks screen; 41 × 41, shown at 40px |
| `/brand/google.svg` | Google's standard color "G" for the Continue with Google button; viewBox 48 × 48, shown at 20px |
| `/brand/auth-gradient.svg` | The sign-in page's blurred gradient blob, exported from the design; viewBox 1407 × 877, covers the page |

`wurthy-logo.svg` is a native SVG export of the header logo in [Wiebke’s Paper file](https://app.paper.design/file/01M5MXK5NC2E4FA57582JKK7K1), copied with shell `cp` and verified with `cmp` against the export. Its paths, viewBox, and fills are unchanged. Use `alt="Wurthy"` and preserve the 105:24 aspect ratio.

`wurthy-email-logo.png` is a 210 × 48 transparent raster export of that unchanged header SVG, generated with macOS `sips` for transactional email clients. Display it at 105 × 24 on a white surface, with `alt="Wurthy"`. The shared email shell uses the existing brand blue and canvas colors with email-safe inline styles and system fonts; it does not load application CSS or webfonts.

The three Portal variants were copied with shell `cp` from the local SMB Portal clone on November 2, 2026 and checked with `cmp`. The source checkout was at `ba9ac9893e4d210e427bb746895517e4a3a0acfe`, with uncommitted corrections to its mark, lockup, and provenance notes. Workbench preserves that working-tree snapshot without modifying the source checkout or any SVG paths, transforms, canvas, or fills.

Portal’s [brand asset notes](https://github.com/CreditWurthy/smb-portal/blob/main/docs/brand-assets.md) explain the distinction: the wordmark comes from the historical ZIP; the mark and lockup were corrected after [Phil flagged their dot spacing](https://wurthyco.slack.com/archives/D0BTYEQSB0A/p1792612046869989), using geometry from Orchestrator’s [Figma-exported logo](https://github.com/CreditWurthy/wurthy-orchestrator/blob/a13a872c6e1c51e1eebc5b81f58b6e79ed6edd86/src/components/shell/wurthy-logo.tsx). These are existing corrected Portal assets, not untouched Figma exports. The ZIP’s rebuilt mark and inaccurate lockup are not used. Further original variants remain unavailable through the connected Figma accounts; do not reconstruct them.

The Portal mark and wordmark use `currentColor`, which resolves to black when served as external images rather than inheriting the surrounding page’s text color. Use a light surface for these external images and preserve their aspect ratios.

The gradient is copied unchanged from the ZIP, is decorative rather than a token palette source, and should use empty alt text.

## Fonts

Paper's UI uses the existing locally bundled `@fontsource-variable/geist` package. Its CSS declares `Geist Variable`, weights 100–900; that exact family remains the default for body text and headings.

The ZIP's original `fonts/STKBureauSerif-{Book,Regular,Medium}.woff2` files are copied unchanged into `public/brand/fonts/` using shell `cp`, verified with `cmp`, and served locally. `globals.css` declares Book at weight 300, Regular at 400, and Medium at 500. Use `font-serif` explicitly for brand/editorial surfaces requiring STK Bureau Serif; it does not replace the default Geist UI font. Other font weights/styles were not supplied as WOFF2 faces.

The ZIP references Geist Mono through Google Fonts but includes no Geist Mono font binary. Workbench has not installed that family; the existing monospace fallback remains. The archive's README describes STK as a trial font while its CSS and bundled skill call it licensed; those conflicting descriptions do not establish license terms.

## Compose controls

A change to a default in `components/ui/` reaches every current and future consumer, so keep base edits minimal. Choose in this order:

1. Use an existing prop, variant, or size.
2. Keep a one-off layout or visual adjustment in the product component that needs it, with `className` on its parts. A focused wrapper fits when several parts must change together.
3. Add a shared variant only for a treatment that is meant for reuse. The consumer opts in to it.
4. Change a base default only for an agreed, Workbench-wide design change.

Preserve Base UI's `render` composition and Hugeicons. The [official shadcn skill](https://ui.shadcn.com/docs/skills) documents customization and Base UI APIs.

Use paired semantic utilities: `bg-card text-card-foreground`, `bg-primary text-primary-foreground`, or `bg-warning-subtle text-warning-strong`. Paper status colors are light-only; use them on light surfaces. Strong status shades are for text; muted and surface shades are not general text colors. `--chart-1` to `--chart-4` are the Workbench prototype's four series: brand, teal, amber and pink. `--chart-5` and the dark theme keep the shadcn values. `--control-off` is the track of a large switch that is off.

### Paper adjustments to the shared controls

| Control | Change | Use |
| --- | --- | --- |
| `Button` | Every size is a pill. `outline` sits on the card surface with the input border; `ghost` text is muted until hover. `default` pads 12px, `lg` 16px. | Icon buttons in the band and in sheets use `ghost`. |
| `Badge` | `neutral` is a gray fill with muted text; `info` is the brand tint with brand text. | `neutral` for count pills and an app only the firm sees, `info` for Advisory, an app shared with the client and the brief line Wes asks about; keep `secondary` for dark text on gray. |
| `Card` | A 1px border and the large radius instead of a ring. `size="flush"` removes the padding and gap; `size="lg"` pads 24px; `variant="outline"` uses the input border; `variant="raised"` adds a small shadow. | `flush` around a drafted message and the answers over the composer, the default around an app card, `outline` for an empty state; `raised` for the answers over the composer. `lg` has no current use. |
| `Badge` | `status` is a gray pill with a hairline. `alert` is a white pill with a red hairline. `surface` is a white pill. `size="pill"` pads 8px for a count. | To-do flags; counts beside the To do tab, the rail's spaces and the tabs of settings. |
| `TabsList` | `size="pill"` is a 36px gray pill with a white pressed tab and a brand icon. `size="strip"` is a full-height strip of semibold tabs with the brand underline at its foot. | The Team and Client switch; a space's page tabs. |
| `Item` | `size="task"` is a top-aligned row with a medium 20px title over a 12px line. `size="card"` is a 12px-radius card with a regular title over a 12px line. | To-do rows, and the to-do under a drafted message; to-do cards in a message. |
| `Marker` | `variant="unread"` is a brand rule with its label at the end; `variant="replies"` puts the label first and a neutral rule after it. | The "New" line over the first unread post and the reply-count divider inside a thread. |
| `Avatar` | `size="md"` is 28px. `AvatarFallback` `tone="neutral"` is a letter on a gray disc; `tone="empty"` is an empty disc with a dashed edge; people keep their coloured tones. | The rail's client and account avatars; a client in the switcher; a to-do nobody holds. |
| `Button` | `size="inline"` is text only, on a 20px line. `variant="dotted"` is semibold text with a dotted underline, for text that opens more about itself. `variant="brand"` is an outlined action in the brand color on the card surface. | Clear beside the filters; the space link in the thread band; the value in a `FactSource`, which adds the amber of a stale one itself; New app and Upload on the private agent page and on a space's Apps & Files tab. |
| `InputGroup` | `variant="filter"` is a gray pill with no border and a 2px brand ring on focus. | The to-do search field. |
| `PopoverContent` (hint) | `variant="hint"` is one dark 12px line in the primary foreground color, as wide as its text, like a tooltip that opens on click. | Where a fact on a to-do comes from, and how fresh it is. |
| `Badge` | `variant="recipient"` is an 18px white pill with a hairline and a 12px icon. `size="pill"` is at least 28px wide with tabular digits. | `RecipientBadge` in a post header ("to Phil"); every count pill. |
| `Item` | `size="option"` is a 32px line with no border that tints on hover; an `ItemDescription` under its title is a 12px medium line, flush with it. | The answers Wes offers over the composer; an app to pick carries a line that says why. |
| `Attachment` | `variant="file"` has a 16px red icon with no tile, a 14px name and a 12px type line. | A file on a channel post. |
| `AvatarBadge` | `variant="icon"` is an amber 14px mark with a 9px icon. | The client mark in `AuthorAvatar`, on a post from someone at the client. |
| `ResizableHandle` | The grip is 32px and shows on hover or keyboard focus. | The handle between the conversation and the page. |
| `DropdownMenuCheckboxItem`, `DropdownMenuRadioItem` | `variant="filter"` puts the check before the label and makes the row 32px. `DropdownMenuSeparator variant="subtle"` is the lighter rule between its groups. | The Status and Owner menus over the to-do list. |
| `Button` | `variant="secondary"` has no border and turns one step darker on hover and while its menu is open. | The Status and Owner filter buttons. |
| `SidebarMenuButton` | `size="rail"` is a 36px link, muted until it is the open page. `size="rail-lg"` is the 48px button. | The rail's links; the client switcher and the account menu. |
| `Item` | `variant="flush"` with `size="row"` is a 44px list row with 16px padding and a regular-weight title. | No current use; `FileList` uses `size="task"`. |
| `CommandItem` | `variant="primary"` shows brand text until the item is highlighted. The `Command` padding defaults are unchanged. `CommandInput variant="flush"` is a flat 41px search row with the icon and a divider under it, for a list that runs edge to edge. | "Add client" in the client switcher. The switcher removes the popover, command, and group padding on its own parts to run its rows edge to edge; it uses `CommandInput variant="flush"`, the accent fill on highlighted items, and an 8px gap in its trigger. |
| `EmptyDescription` | Uses a 24px line height. | Every empty state. |
| `Empty` | `variant="note"` is left-aligned and unpadded: a semibold title flush over its description on 20px lines, with 16px before `EmptyContent`; place it with margins. `variant="plain"` keeps those two flush lines and centers them, with 24px above and below. | An empty channel, 24px from the top and the sides; a to-do without files; `plain` for a space without files and for "No apps yet", with New app in `EmptyContent`. `plain` also for a settings section with no rows, in `SettingsEmpty`. |
| `Empty` (outline) | `variant="outline"` is the dashed box on the card surface, with the input border and 24px padding. | No current use. |
| `AvatarFallback` | `tone` 1–8 picks one of the `--avatar-*` tints: a soft fill with same-hue semibold initials and no ring. | Use `PersonAvatar` (`components/avatars/`), which hashes a person's id onto a tone so each person keeps one color; Wes uses `WesAvatar`, the orb. |
| `Avatar` | `size="xs"` is the 20px face; an `AvatarGroup` of them overlaps by 6px; each face sits on the card colour with a 2px card ring and no outline, so a clean white gap separates neighbours. `AvatarBadge` with an `img` child is the 16px Wes orb in the corner. | Who replied, who is in a channel, and a post from a person's Wes. |
| `Badge` (conversation) | `size="lg"` is a 24px borderless tag with 14px icons; `variant="mention"` `size="inline"` is the 18px `@Name` pill inside text. | Mentions in message text; linked to-dos use the shared item rows beneath posts. |
| `Button` (conversation) | `raised` is a white pill with the light border, regular weight and a small shadow; `plain` is muted text that turns dark on hover; `muted` is the muted fill with the light border; `size="inline-xs"` is a 20px, unpadded 12px action with 14px icons. | `size="xl"` is 38px. Reply and reply-count links use `link` `inline-xs` beneath the message; `xl` has no current use. The checks and earlier versions under a to-do's draft use `plain` `inline-xs`; "2 replies" uses `link` `inline-xs` with a semibold label in the thread summary; the idle send button uses `muted`. |
| `Tabs` | `TabsList size="lg"` is the 40px full-width switch with a white active tab and semibold labels, 8px between a tab's parts; an icon with `data-icon="inline-end"` is a 14px muted mark, such as the private lock. The `Tabs` root around it has no gap. | The conversation's Wes / #channel switch. |
| `Message` | `variant="feed"` gives every author a left-aligned 28px avatar lane with a 12px gap, full-width content, 4px between parts and 24px text lines. The author and timestamp share the header. Persisted messages keep the lane while hiding repeated avatars and visually hiding repeated headers within a group. `MessageFooter reveal` shows the footer on hover or focus, and always on devices with any touch input. | Channel posts, saved messages and thread replies, including the viewer’s own messages. |
| `MessageScroller` | `Conversation` gives `MessageScrollerContent` `px-4 py-5` with a 16px gap; `ConversationItem` adds 8px padding. Grouped persisted rows use `-mt-4 pt-0` to tighten consecutive messages. Row padding keeps content away from the `content-visibility` clip; hovered and focused rows allow controls to remain visible. | Every conversation row. |
| `Bubble` | `variant="ghost"` provides transparent, unpadded content without rounded corners. Inside a `Message` `feed`, content has no border and uses 24px lines; human text preserves typed line breaks. | Channel and thread message bodies, and personal agent replies. Personal human turns use `muted`. |
| `Marker` | `size="sm"` uses 12px medium labels with 14px icons; `size="inline-xs"` tightens the icon gap to 4px. `MarkerIcon tone="positive"` is the green done icon. | Day separators and reply counts use `sm`; `inline-xs` and the positive tone have no current use. |
| `Attachment` | `variant="info"` is the brand-tinted 24px chip: 8px before the icon, 6px gaps, and a 20px round brand remove button with a 14px icon, 4px from the end. | No current use. |
| `InputGroup` | `variant="prompt"` draws a 1px brand ring on focus instead of the default 3px soft ring, uses medium-weight textarea text, sits on the card surface and stacks an optional chip, the textarea and a right-aligned send button; `InputGroupButton size="icon-lg"` is 36px and `size="action"` is the 32px pill with 12px semibold text. | The conversation composer; Cancel and Add inside the new-instruction field in space settings. |
| `Item` | `size="compact"` is a 34px row with 12px padding and a truncated regular-weight title. | No current use in conversation bodies. |
| `TraceIcon` | Holding an avatar, it is 24px with 4px more space before the title. | Wes’s inline activity, paired with a running `TraceLine` and a public activity label. |
| `SheetContent` | `size="full"` covers the visible screen with no border or gap; with `useVisualViewport` running it stays above an on-screen keyboard. | Below 1024px, `ClientShell` shows the conversation in it, opened by a `raised` `size="2xl"` (48px) Chat button at the bottom right; `?panel=conversation` keeps it open, so Back closes it; from `lg` the conversation shows beside the page instead, and the sheet stays closed. Switching Wes and #channel replaces history. |
| `Switch` | `size="lg"` is 44px by 24px with a white thumb and a small shadow on the track and the thumb; off, its track is `--control-off`. | The share switch in an app's settings. |
| `PopoverContent` | Takes `anchor`, so it can open from an element that is not its trigger. | `@` mentions above the composer. |
| `Button` (item) | `size="action"` is the 32px pill with 12px semibold text. `outline-muted` is `outline` with muted text that turns dark on hover. | New app and Upload on the private agent page and on a space's Apps & Files tab; `outline-muted` for Disconnect in a profile; `brand` `action` for what a settings list offers next, such as "Add someone". |
| `Card` (item) | `size="compact"` pads 12px above and below and 16px at the sides through `CardContent`, with no gap; its `CardFooter` is a plain 12px muted line right under the content; `size="label"` puts a 12px semibold `CardTitle` and its `CardDescription` on one line, 8px above the content. | `compact` for a rule that waits for approval in settings; `label` has no current use; a to-do's draft is a `raised` `flush` card. |
| `Alert` | `variant="band"` is a 48px gray band with 24px sides, a centered icon and a rule under it; `data-tone="warning"` makes the icon amber and `data-tone="negative"` red. The conversation's `Notice` maps a hold and a failed run to an icon and one of these tones. `variant="positive"` is the 48px borderless green bar with a centered icon; `AlertAction` sits 16px from the right. | `band` for a hold or a failed run over a to-do's conversation. `positive` has no current use. |
| `TraceLine` | `size="row"` is a 14px line on 24px lines that wraps, with a 20px icon column of 14px icons and its 12px medium time centered at the end; a `Trace` of them has no gap. In a `TraceCollapsible` its chevron is 14px and light, and the unfolded text sits under the line's text with no rule. A line outside one keeps 18px free at its end, so every time ends at the same place. `size="sm"` is a 12px line that wraps, with a 32px icon column. | `row` for the trail on a to-do's Record tab; a line that produced a text sits in a `TraceCollapsible` and unfolds to show it. `sm` has no current use. |
| `Button` (clients) | `size="action-lg"` is the 36px pill with semibold text and 20px icons 8px from the label, 12px after an end icon; a spinner is 20px. | Add client and Cancel under the Add client form. |
| `PopoverContent` (flush) | `variant="flush"` drops the padding and gap for content that lays out its own. | The client switcher. |
| `Item` (settings) | `size="entry"` pads 12px by 16px and lets lines wrap: a regular-weight 24px title, a medium `ItemHeader` with its badge on the right, a muted 24px description, a 12px medium muted `ItemFooter` and muted `ItemActions` text. | A rule and a memory in settings, through `SettingsRow kind="text"`. |
| `PopoverClose` | Base UI's `Popover.Close`. A popover with `modal="trap-focus"` keeps focus inside only when one is rendered in it. | No current use. |

The clients list, adding a client and adding a space keep their other looks in the components that use them, so the shadcn defaults stay unchanged:

- `lib/form.tsx`: Paper's text fields for every TanStack form: 40px controls with 12px padding on the card surface, a 2px brand focus ring that keeps the border, a red border without a ring when invalid, labels 6px above on 20px lines that stay dark when invalid, and 12px medium descriptions.
- `client-list.tsx`: a 40px search field on the card surface, and a semibold client name over its spaces.

The canvas does the same. Each look belongs to its feature component, so the shared primitives keep no app-specific variants:

- `app-audience.tsx`: the dashed 22px Draft badge.
- `app-card.tsx`: a 14px semibold title over a 24px figure, and the input border on hover.
- `app-output.tsx`: 12px semibold muted table headers in a 44px row, body cells that pad 12px and sit flush with the card's text, and a 16px-padded card with a red icon for why the last run failed.
- `app-settings.tsx`: a semibold label on a 20px line, centered beside the share switch.

The task page does it too. In `features/conversation/`, `task-files.tsx` draws the empty note as one 12px medium line and `saved-file-row.tsx` a file's name as dark text that wraps. In `features/work-items/`, `task-title.tsx`, `task-description-editor.tsx`, `task-status-select.tsx`, `task-owner-select.tsx` and `task-due-select.tsx` draw fields that look like the text they edit, where the read-only text sits. The title and the description have no box until they have focus, which shows the composer's 1px brand ring, or their text is invalid, which shows the red one. Status, Owner and Due date take the muted surface on hover, and the Owner list has a flat search field over a rule. The New task dialog (`new-task-dialog.tsx`) has the same Status, Owner and Due date fields, so a task looks the same before and after it is created. Its title, in the page’s 20px semibold, and its description have no box, even with focus: they show “Task title” and “Add description…” while empty, and their labels are for screen readers only; its 14px heading sits on the line of the space’s name. In `components/files/`, `file-chips.tsx` draws a chosen file as a 26px gray chip with a 14px icon colored by its kind, a 12px medium name and a 20px round remove button; the conversation and the private agent chat put it inside the message box.

These classes trigger `shadcn/no-restyle` warnings, because that rule allows only layout classes outside `components/ui/`.

Settings keeps its looks in its own components too. `SettingsList`, `SettingsRow` and `SettingsRowContent` in `settings-list.tsx` draw every list: hairlines that reach both edges, 12px above and below a row, and lines that sit flush; a row reuses the `task` and `entry` sizes of `Item` for its type. `ReachSelect` draws the gray field and its menu with the check before each answer. `ConnectionMedia` (`components/connections/`) draws the 40px white tile, and a skill's row is a `ghost` `Button` as wide as the list. These `className` adjustments also trigger `shadcn/no-restyle` warnings.

Each conversation sits on `bg-wes`: the muted surface under two soft brand glows, `--wes-glow-1` and `--wes-glow-2`. The sign-in page puts its card over `bg-auth-gradient`, with a `font-serif` heading.

Shipping routes use persisted client, space and task records. The collapsed clients shell retains the searchable list and Add client form; organization access is labelled separately and the active selection is persisted through Better Auth. Client pages retain `ClientShell`, `ClientRail`, `ClientSwitcher` and the existing space-page tabs. A provider client without accessible spaces opens the existing private-agent page, with honest task and unavailable private-content states, rather than constructing an empty space ID. Owner-facing discovery remains a separate restricted view.

Task rows reuse `Item`, `ItemGroup` and `Badge` to show persisted titles, status and assignment. Task details show only fields returned by the shared contract. A task page is one page: its title, properties, description and files, without tabs. Its description is Markdown, styled by `.task-markdown` in `globals.css` where it is read and where it is edited. The task conversation remains beside it. Source correspondence is distinct from task chat; see [task collaboration](/architecture/conversations#task-collaboration). Task pages use a task-specific conversation scope, never the space’s posts. Private-agent navigation, private page tabs, and client/space settings rails remain accessible in verified provider presentation. Attention, due dates, agent output, draft versions, evidence and history require their own persisted projections; raw tasks do not supply those semantics. Client-facing-only views exclude internal task links and the Team channel. Use each active space's capabilities rather than the client's aggregate permissions.

Client General settings reuse `SettingsTabs`, `SettingsSection` and `SettingsFacts` for authorized directory facts; other client sections name their unavailable integration directly. Conversation, canvas, app and remaining settings primitives remain unavailable until their adapters are connected. Unsupported controls use native disabled semantics with visible copy. The initial server-rendered error page and the hydrated page use the same existing error primitive. An actor-scope conflict replaces the entire old page before clearing private cache data and reloading the verified root; it never retries a mutation in a new context. The integration inventory lives in [frontend data fetching](/architecture/data-fetching).

## Build forms

Every form, including one-field forms and the conversation composers, uses the same base:

- **Values and submission:** TanStack Form through `useAppForm` from `lib/form.tsx`. Keep form values out of `useState`; UI state, such as an open popover, can stay local.
- **Validation:** an Effect schema in a colocated `validate-*.ts`, passed to TanStack Form through `Schema.toStandardSchemaV1`. Reuse a shared contract schema when the shapes match; the server stays authoritative. Do not add Zod.
- **Markup:** a native `<form noValidate action>` around shadcn `FieldGroup`, `Field` and `FieldLabel`. Give each control a label (`className="sr-only"` when Paper shows none). Take ids from `useId`, because several instances can render at once.
- **Submit:** the form keeps the encoded values, so decode them with `Schema.decodeSync` before passing them on, for example to trim text. Reset the form only after a successful submit.

Forms whose fields the viewer fixes, such as `add-client-form.tsx`, validate with `validators: { onDynamic: schema }` and `validationLogic: revalidateLogic()`: errors show after the first submit, then update on every change. Each error shows in `FieldError`, with `data-invalid` on `Field`, `aria-invalid` on the control and `aria-describedby` on the error. The `TextField` and `TextareaField` bindings do this.

The task page's title and description save when the viewer leaves them, so they have no `<form>` and no submit. They use `useAppForm` with the schemas in `validate-task.ts`; a blank title goes back to the saved one, and a failed save shows in a toast with Retry.

The composer, `composer.tsx`, shows no error, as in Paper. It validates with `validators: { onChange: schema }` and keeps Send muted, with `aria-disabled`, until the form is `isTouched && isValid`; a blank Send does nothing. It binds its own control through `form.Field`, so it keeps Enter to send, mentions and the context tag.

## Organize UI code

These are Workbench conventions, not folder names that TanStack or shadcn require. Paths are under `apps/web/`.

```text
public/brand/                     # static brand images: logo, Wes orb, QuickBooks mark, Google mark
src/
├── routes/                       # URL, params, search state, loading, not-found, page composition
│   ├── __root.tsx                # app root, session check, error and not-found boundaries
│   ├── index.tsx                 # the clients list, in ClientShell with the collapsed rail: owns the search in the URL
│   ├── sign-in/
│   │   └── index.tsx             # Google sign-in; a signed-in user goes on to their page
│   ├── _settings/                # no URL segment of its own
│   │   ├── route.tsx             # the frame around the viewer's profile and the firm's administration: owns `from`, renders SettingsShell around <Outlet />
│   │   ├── you/$section/
│   │   │   └── index.tsx         # /you/profile and /you/memory: loads the profile and its chat, renders ProfileSettings
│   │   └── admin/$section/
│   │       └── index.tsx         # /admin/people, /admin/rules and /admin/agents: loads the firm and its chat, renders FirmSettings
│   └── clients/
│       ├── new/
│       │   └── index.tsx         # adding a client: its name
│       └── $clientId/
│           ├── route.tsx         # loads the client and clients list, owns the conversation's search state, renders ClientShell, ClientRail and the conversation around <Outlet />
│           ├── index.tsx         # the viewer's private agent page: starts the agent chat, loads the canvas files, owns the tab and the to-do filters in the URL, renders AgentPage and WorkItemFilterBar
│           ├── new-space/
│           │   └── index.tsx     # adding a space: renders SpaceCatalog with persisted Finance creation/open links
│           ├── settings/
│           │   ├── $section/
│           │   │   └── index.tsx # client General uses directory facts; People and Connections load independently; Rules and memory are hidden
│           │   └── spaces/$spaceId/
│           │       └── index.tsx # one space's settings: renders SpaceSettings without a chat panel
│           └── $spaceId/
│               ├── route.tsx     # checks the space for every page of it, starts the conversation's queries
│               ├── index.tsx     # the space page: owns the tab and the to-do filters in the URL, starts the canvas query, renders SpacePage with PersistedTasks, WorkItemFilterBar and Canvas
│               ├── items/$itemId/
│               │   └── index.tsx # the task page: finds its task, renders WorkItem with TaskTitle, TaskCreated, TaskProperties, TaskDescription and TaskFiles
│               ├── apps/$appId/
│               │   └── index.tsx # the app page: loads the space's canvas, renders AppPage
├── features/work-items/          # one capability: its components, types and behavior
│   ├── components/               # Paper filters and ruled WorkItemRow lists over persisted tasks, the New task dialog, and the task page: WorkItem and the task-* fields, menu and dialogs
│   ├── queries.ts                # the people who can own a task
│   ├── due.ts                    # how a due date reads, and what was picked
│   ├── validate-task.ts          # the Effect schemas of a task's title and text fields
│   ├── editor-markdown.ts        # what the description editor can hold, and whether it keeps a text
│   ├── use-*.ts                  # the choices of owner; saving one field in place, with conflicts and retries
│   ├── todos.ts                  # persisted workflow status labels, open-task policy, and URL-backed status, owner and title-search filters
│   └── types.ts                  # Owner, OwnerOption and TodoFile
├── features/conversation/        # the conversation panel: Team and Client channels of a space or of one task, and the private agent chat
│   ├── components/               # space-conversation, conversation scroller, persisted-messages, channel day markers, post thread summaries, message-body, composer, conversation-skeleton
│   ├── queries.ts                # channel posts, the private agent chat and the team
│   ├── validate-message.ts       # the composer's Effect schema
│   └── types.ts                  # ChannelPost, SpacePosts, SpaceChannel, PostAsk, PostOffer, PostReply, PostDraft, PostAttachment, PostFacts, PostConnection, PostInvite, ConversationNotice, ConversationSample
├── features/agent/               # the viewer's private agent page at a client
│   ├── components/               # agent-page: private All to-dos and Apps & Files layout
│   └── queries.ts                # the files in the private canvas
├── features/clients/             # the clients list and the client switcher's navigation
│   ├── components/               # client-list
│   ├── navigation.ts             # navigation derivations and the generic private-agent label
│   ├── queries.ts                # clientKeys, the clients list, loadClients, useClient, useClientSpace
│   ├── use-client-switcher.ts    # opens a client's first space, the clients list, or starts adding a client
│   └── types.ts                  # Client, Space
├── features/onboarding/          # adding a client
│   ├── components/               # add-client-form
│   ├── validate-client.ts        # the Add client form's Effect schema
│   └── types.ts                  # NewClient
├── features/spaces/              # a space's page, and adding a space
│   ├── components/               # space-page (the To do and Apps & Files tabs), space-catalog
│   ├── queries.ts                # the space the viewer describes to Wes
│   └── types.ts                  # SpacePreset, SpaceDraft, SpaceDraftSample
├── features/apps/                # a space's canvas: its apps and files, and an app's page
│   ├── components/               # canvas, app-card, new-app-card, app-chart with app-glyph and app-page-chart, app-page and its -output, -runs, -settings, -brief, -facts, app-icon, app-audience, app-run-icon
│   ├── apps.ts                   # isBuilt: the apps that run
│   ├── queries.ts                # a space's canvas
│   └── types.ts                  # Canvas, App, BuiltApp, DraftApp, AppOutput, AppChart, ChartPoint, AppFigure, AppTable, AppVersion, AppRun, AppFact, AppSource
├── features/settings/            # settings of a client and its spaces, the viewer's profile, and the firm's administration
│   ├── components/               # settings-shell, the frame of every settings page; client-settings, space-settings, profile-settings, firm-settings; settings-tabs, -section, -list (the rows every list shares), -facts, -people, -rules, -memory, -agents, -skills; reach-select
│   ├── sections.ts               # the sections, their areas, names and tabs
│   ├── queries.ts                # firm administration and the chat beside a section
│   └── types.ts                  # ClientSettings, SpaceSettings, Firm, Profile, Fact, Member, Connection, Rule, ProposedRule, Memory, Skill, Agent
├── features/auth/                # sign-in, the session and the account menu
│   ├── components/               # sign-in, account-menu
│   ├── session.ts                # getSessionUser: reads the session on the web server
│   ├── redirect-target.ts        # the page to open after sign-in, limited to this site
│   ├── sign-in-errors.ts         # messages for a sign-in that failed
│   └── types.ts                  # SessionUser
├── components/                   # app components shared across features and pages
│   ├── client-shell/             # ClientShell, ClientRail, SettingsRail, ClientSwitcher, ClientName
│   ├── connections/              # ConnectionMedia: the 40px tile before a connected system; ConnectionSource: a 16px tile and a name
│   ├── avatars/                  # PersonAvatar, WesAvatar, AuthorAvatar
│   ├── feedback/                 # NotFoundPage, ErrorPage, ErrorFallback, PageSkeleton, ListSkeleton
│   ├── page-tabs/                # PageTabs: a page's tab strip under the band; PageStrip: the same strip with other content; inset="page" matches standalone settings padding, while the default matches split panels; TabCount: the count beside a tab or heading
│   ├── files/                    # FileList: files with a rule under each, an icon colored by the file's `kind`, and who added each one and when; FileRows and FileRow: the same rows, which can open their file; FileIcon: that colored icon on its own; `file-uploads.tsx`: the upload hook, FileInput, UploadButton, UploadStatus and FileDrafts; FileChips: chosen files as one-line chips
│   └── ui/                       # shadcn primitives and their shared variants
├── hooks/                        # hooks shared across features: use-breakpoint, use-time-zone, use-visual-viewport
├── lib/                          # form (TanStack Form on the shadcn fields, validated by Effect schemas), names, short-date, auth-client (Better Auth's browser client)
    # Shipping data flows never import prototype fixture records.
```

Dependencies point one way: route → feature component → shared component → `ui/` primitive.

```text
routes/clients/$clientId/route.tsx
├── ClientShell: Sidebar provider, top band, resizable split
│   ├── ClientRail: ClientSwitcher, private agent, spaces, the link to add a space, Settings, AccountMenu; SettingsRail inside settings
│   ├── SpaceConversation, left of the split; AgentConversation on the private agent page and inside settings
│   └── <Outlet /> → $spaceId/index.tsx → PersistedTasks → WorkItemRow
│                                                                        ├── AuthorAvatar
│                                                                        └── Item, Badge
```

- **Routes** use directories. A parent `route.tsx` loads shared data and composes the shared shell around `<Outlet />`; `index.tsx` is the exact page for its path. Routes own URL state and pass plain props down.
- **Features** live in `features/<capability>/`, named for the capability. Put its types in `types.ts`, so other modules do not import types from a component file.
- **Shared components** live in `components/<purpose>/`. They never import from `features/`. Move a component here when a second feature or page needs it; do not import another feature's component.
- **`ClientShell` and `ClientRail`** are separate: `ClientRail` is the left rail on shadcn's `Sidebar`, and `ClientShell` places it beside the top band and the page. Inside a space the page is the right side of a `ResizablePanelGroup`, with the conversation on the left. The parent route fills both with content, and passes router `Link`s to the rail, so the shared components import no feature. Pages outside a client, such as the clients list, use the same shell with the rail collapsed to the account, and put what the page offers in the band's `actions`. Inside settings `SettingsShell` passes `SettingsRail` instead, omits the conversation slot, and `area` puts the area's name before the title in the band. Below `md` the rail is the `Sidebar` sheet behind the band's trigger; below `lg` the conversation is a full-screen sheet behind the Chat button.
- **`components/ui/`** holds general shadcn primitives. Add a reusable look as a variant there; keep product composition in the feature.
- **Server state** goes through TanStack Query: `queryOptions` in `features/<capability>/queries.ts`, loaded by route loaders and read with `useSuspenseQuery`. See [frontend data fetching](/architecture/data-fetching).
- **Static images** go in `public/brand/`. Prototype fixture records are excluded from shipping data flows. Static product configuration belongs to its owning feature.

`workbench/directory-routes` enforces route filenames as an error in Vite Plus lint for `apps/web/src/routes/`. For example, use `items/$itemId/index.tsx` for an item page. The only special-route exceptions are the top-level `__root.tsx` and `api.$.ts` proxy. Colocated non-route files or folders use TanStack's `-` prefix, such as `-components/` or `-loader.ts`. Dot-prefixed entries are also excluded by TanStack. A helper without an exclusion prefix is a route candidate, even if it has no route export.

Diagnostics show the expected destination. Move files manually and update route IDs, regenerate `routeTree.gen.ts` through the frontend dev server or build, and adjust imports. The rule offers no automatic file moves because those changes require review. See the [CLI reference](/reference/cli#route-lint) for verification commands.

References: [TanStack file naming](https://tanstack.com/router/latest/docs/routing/file-naming-conventions), shadcn's [sidebar-16 block](https://github.com/shadcn-ui/ui/blob/main/apps/v4/registry/bases/base/blocks/sidebar-16/page.tsx) for the header and shell split, [Cobalt's routes](https://github.com/Cobalt-Money/Cobalt/tree/main/apps/web/src/routes/_auth), [shadcn-admin's tasks feature](https://github.com/satnaing/shadcn-admin/tree/main/src/features/tasks), and [T3 Code's voice-input feature](https://github.com/pingdotgg/t3code/tree/210b2e7c6a8be11441b7afc94742ce3c76860111/apps/mobile/src/features/voice-input).

## Accessibility and open decisions

Paper's placeholder `#94A3B8` has only 2.56:1 contrast on white. Workbench keeps `#475569` for placeholders (7.58:1). Tertiary icons retain the supplied shade for decorative use. Shared components retain their installed shadcn variants, including destructive states; review their translucent fills and text contrast with the design owner.

Paper's input and structural borders are subtle; retain visible labels and the existing focus/invalid indicators rather than relying on borders alone. Provide explicit invalid-field text. Review non-text boundary contrast with the design owner before changing the supplied border palette.

Paper has no dark tokens. The existing shadcn `.dark` block is preserved verbatim, with no added `color-scheme` declaration or custom dark palette. Shared font, radius, and shadow tokens apply in both modes.

Confirm low-contrast decorative/status indicators, non-text boundaries, destructive states, and control sizing with the design owner. A Wurthy dark palette remains future design work. Identify feature-specific component gaps when composing the MVP workflows.

The new-space route preserves the Paper catalog: Finance, Support, Growth and Build your own Space. Finance opens an authorized existing space by persisted type and ID, or creates it through the shared API when `canManageSpaces` permits. Support, Growth and Space Builder are greyed out with native disabled buttons and visible coming-soon text. Their availability is independent of role permissions. Catalog cards compose shared Card and Button primitives; Card’s `muted` variant supplies the tinted, borderless unavailable surface.

## Internal admin app

`apps/admin` follows the same TanStack Start, Query and Form structure as Workbench, with a separate coss UI component inventory and neutral token stylesheet. It does not import Workbench’s theme or branded components. Source provenance and the MIT license live beside the copied primitives. Invitation management adapts coss card, form and table particles; TanStack Form and the shared Effect schema own validation, using the coss Field components. Add future admin components from the configured coss registry. See [authentication](/architecture/authentication#internal-admin-app) for its separate origin and authorization boundary.
