Skip to content

feat(design-system): catalog synced to claude.ai/design + /cron & /shells redesigns#84

Merged
JayantDevkar merged 25 commits into
mainfrom
feat/design-system
Jun 25, 2026
Merged

feat(design-system): catalog synced to claude.ai/design + /cron & /shells redesigns#84
JayantDevkar merged 25 commits into
mainfrom
feat/design-system

Conversation

@JayantDevkar

@JayantDevkar JayantDevkar commented Jun 24, 2026

Copy link
Copy Markdown
Owner

What & why

A design system for Claude Karma that mirrors the real code and is synced to claude.ai/design, plus the first two page redesigns driven through that round-trip. The frontend had a rich token layer buried in app.css and ~150 components, but no canonical catalog and nothing tying a design change back to source. This adds the catalog, syncs it, and uses it to redesign /cron and /shells.

Specs/plan: docs/superpowers/specs/2026-06-23-claude-karma-design-system-design.md, docs/superpowers/plans/2026-06-23-claude-karma-design-system.md. Catalog usage: frontend/design-system/README.md.

Design system

  • Single-source tokens — extracted the :root / dark / prefers-color-scheme blocks out of frontend/src/app.css into frontend/src/styles/tokens.css (verbatim, byte-identical: 374/374 declarations, zero visual change). App and catalog both import it.
  • In-repo catalog (frontend/design-system/): 8 generated foundation cards (Colors/Type/Spacing/Radius/Shadow/Motion/Focus/Brand), 13 hand-authored ui/ primitive previews, and a Pages layer (pages/cron.html, pages/shells.html). mapping.json links every card to its Svelte source(s).
  • Toolingnpm run ds:build (copy tokens → generate foundations → validate every <!-- @dsCard … --> marker → enforce the mapping.json contract → write render-check.json) and npm run ds:drift (flags cards older than their mapped source). Pure Node built-ins, node:test tests, no new deps.
  • Synced to claude.ai/design — project Claude Karma Design System (5fdd2fba-3802-4151-98ba-586d685cebf5); re-syncs are incremental (only changed files upload).

Page redesigns (the Design→Code round-trip)

Explored as a canvas in claude.ai/design, then built in the real SvelteKit routes — pure presentation; all data wiring preserved and verified byte-identical to the originals:

  • /cron → "The Ledger" — status-grouped table with an inline "did it really run" trust column (confirmed / inferred / TTL-expired / deleted) and the last outcome inline, instead of behind a click.
  • /shells → "The Process Monitor" — triage table with running shells pinned to the top, an always-visible inline Kill, and an output sparkline.

The page cards were then refreshed to the new designs and re-synced, so the catalog stays an honest mirror of the app.

Fixes surfaced along the way

  • WCAG AA — the catalog revealed light-mode colored badges failing contrast; darkened 7 light-mode tokens (--warning/--success/--error/--info, --model-haiku/--model-sonnet, --event-command) to 4.6–6.0:1. Tints and dark mode untouched.
  • Brand fonts — the app loaded no web fonts (it relied on locally-installed Inter / JetBrains Mono). Self-hosted both, app-wide (static/fonts/) and in the catalog bundle (catalog/shared/fonts/).
  • StatsCard — value rows misaligned when a label wrapped to two lines; reserved a consistent 2-line label height (fixes every stats grid app-wide).

Quality

Built subagent-driven: per-task reviews + a whole-branch code review + a UI/UX review for the catalog; both page redesigns were opus-reviewed (behavior preservation confirmed at source) and visually verified on live data.

Follow-ups (not blocking)

  • Enrich the 6 intentionally-brief foundation cards for a stricter render-check.
  • Optional: restore row-level spawn-time on the shells triage rows.
  • Focus-ring recipe unification across previews; generated catalog index page; tokenize --radius-xl; reconcile the documented dark-block token inconsistencies (--*-rgb, --subagent-*, --nav-amber/cyan).

🤖 Generated with Claude Code

JayantDevkar and others added 25 commits June 23, 2026 20:09
Design system that mirrors real code (extracted tokens.css single source)
and syncs an in-repo catalog to claude.ai/design via DesignSync. Approach B:
generated foundation cards + hand-authored previews for the 13 ui/ primitives
+ a mapping.json round-trip contract.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- exact token line ranges (12-211/264-403/406-539) + keep @theme & import order
- git strategy: commit authored sources, gitignore derived (tokens copy/foundations)
- generator: zero-dep state-machine parser; skip --plugin-*, alias --data-*; 8 spacing
- per-primitive notes: bits-ui DOM hardcoding, TierBadge hardcoded hex, KarmaIcon SVG
- build hygiene: .prettierignore catalog (marker on line 1), .gitignore, eslint
- known dark-block token inconsistencies tracked as future cleanup

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…cable)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…scripts

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…cator, text-input, select, empty-state, tier-badge, theme-toggle)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…l, switch, tabs, collapsible-group, modal)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…, drop text-input ring litter

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…st render-check, segmented-control + chrome fidelity

- build-catalog: load mapping.json and enforce bidirectional contract (card without key → exit 1; key without file → exit 1)
- build-catalog: compute honest thin counter (body < 200 non-WS chars); drop variantsIdentical (was always 0)
- generate-foundations: exclude --shadow* and --focus* from color grid (they have own cards); group remaining swatches into 10 labeled sections (Core/Semantic/Model/Event/Subagent/Provider/Ticket Status/Live Status/Nav/Scope + Other catch-all); Core RGB values shown as text notes not broken chips; subtitle count is now accurate (110)
- preview.css: add border-bottom on .ds-swatch__chip so near-invisible alpha tints show bounds; .ds-section-label and .ds-swatch__val raised from --text-faint/--text-muted to --text-secondary (AA contrast)
- segmented-control.html: active label color changed from #fff to var(--bg-base) matching real SegmentedControl.svelte
- README: update render-check description to match actual counters

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… AA contrast

Seven light-mode foreground tokens failed WCAG AA on their -subtle tint backgrounds
(ratios ranged from 1.99:1 to 3.29:1). Darkened each to its Tailwind -700 shade:
  warning  #f59e0b → #b45309 (amber-700,   4.65:1)
  success  #10b981 → #047857 (emerald-700,  4.99:1)
  error    #ef4444 → #b91c1c (red-700,      5.66:1)
  info     #3b82f6 → #1d4ed8 (blue-700,     5.99:1)
  model-haiku  = success; model-sonnet = info (same hue pairs)
  event-command #14b8a6 → #0f766e (teal-700, 4.63:1)
Tint backgrounds and dark-mode blocks unchanged. Adds WCAG note to badge catalog card.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Two static HTML page cards in catalog/pages/ snapshot the current
/cron and /shells routes with spec sample data and real var(--…) tokens.
Adds mapping.json entries, a Pages-layer README section, and task report.
ds:build → "catalog OK — 23 cards validated"; ds:drift → no drift.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Updated README.md to reflect 23 cards validated (was 21), and made session slug clickable in shells.html with accent-colored link styling.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… show brand fonts

Catalog previews named the brand families via tokens but loaded no web font,
so claude.ai/design (and direct-opened HTML) fell back to system fonts. Vendor
the woff2 weights actually used (Inter 400/500/600/700, JetBrains Mono 400/500/600)
under shared/fonts/ and add @font-face to preview.css. Re-synced to claude.ai/design.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The app named these brand families via tokens but loaded no web font,
silently falling back to system fonts on any machine without them installed.
Vendor the used weights (Inter 400/500/600/700, JetBrains Mono 400/500/600)
under static/fonts/ and add @font-face to app.css. Verified: build copies them
to build/client/fonts/ and the bundled CSS references /fonts/*.woff2.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…+ inline outcome)

Surface the two things hidden behind a click onto every row: a trust verdict
(Confirmed/Inferred/TTL expired/Deleted + fire subline) and the inline last
outcome. Group rows by status (Active / Expired & deleted) into bordered tables,
reframe the stat strip around trust, add a legend. Presentation only — all data
wiring, filters, URL state, expand, TTL, rescan, and the System tab preserved.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… running + inline kill + sparkline)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…(Ledger, Process Monitor)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@JayantDevkar JayantDevkar changed the title feat(design-system): token-derived catalog mapped to claude.ai/design + WCAG AA token fix feat(design-system): catalog synced to claude.ai/design + /cron & /shells redesigns Jun 24, 2026
@JayantDevkar JayantDevkar merged commit 3eafd06 into main Jun 25, 2026
7 checks passed
@JayantDevkar JayantDevkar deleted the feat/design-system branch June 25, 2026 04:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants