Skip to content

feat(design-sync): generator for claude.ai design-system bundle#149

Merged
TortoiseWolfe merged 1 commit into
mainfrom
feat/design-sync-generator
Jun 24, 2026
Merged

feat(design-sync): generator for claude.ai design-system bundle#149
TortoiseWolfe merged 1 commit into
mainfrom
feat/design-sync-generator

Conversation

@TortoiseWolfe

Copy link
Copy Markdown
Owner

What

Adds scripts/design-sync/ — a one-command builder that turns ScriptHammer's real DaisyUI components + brand themes into a Claude Design (/design-sync) bundle of self-contained @dsCard preview HTML files.

A live design system was already pushed to claude.ai from this generator (project "ScriptHammer": tokens + 15 components, each rendered in both brand themes). This PR commits the tooling so re-syncs / new forks are one command.

How /design-sync actually works

It does not publish npm or upload .tsx. It writes self-contained preview HTML cards into a claude.ai design-system project; each card's first line is <!-- @dsCard group="…" --> and the pane builds its index from those markers.

Files

  • manifest.js — curated component list; class strings copied verbatim from component source (Button.tsx etc.) so cards stay faithful.
  • gen-theme.js — compiles theme.css via @tailwindcss/postcss + DaisyUI scoped to the two brand themes only (scripthammer-dark/light), OKLCH tokens.
  • gen-cards.js — emits @dsCard HTML, theme.css inlined, side-by-side dark + light.
  • build.js — orchestrates classes → theme → cards into a build dir.
  • README.md — how it works, Docker-first build, adding a component, scope, DaisyUI v5 drift notes.

Build (Docker-first)

docker compose exec -w /app scripthammer node scripts/design-sync/build.js

Output goes to /tmp/ds-bundle inside the container — a build artifact, nothing written to the repo. Verified end-to-end: produces theme.css + 18 cards, every emitted class present in the compiled CSS, each card render-checked in Chromium (OKLCH resolves, dark ≠ light).

Scope

Tokens + the portable atomic/presentational tier. Excludes state/data-driven components (auth/payment/admin/map/game).

Surfaced: DaisyUI v5 class drift

Building exposed several v4 classes the app still uses that are renamed/removed in DaisyUI 5 beta — card-borderedcard-border, card-compactcard-sm, and input-bordered/form-control/label-text removed. The manifest uses the v5 names so cards render; the app components still carry the v4 names (dead, harmless, worth a future cleanup pass).

🤖 Generated with Claude Code

Adds scripts/design-sync/ — a one-command builder that turns ScriptHammer's
real DaisyUI components + brand themes into a Claude Design (/design-sync)
bundle of self-contained @DSCARD preview HTML files.

- manifest.js: curated component list; class strings copied verbatim from
  component source (Button/Card/TagBadge/Text/etc.) so cards stay faithful.
- gen-theme.js: compiles theme.css via @tailwindcss/postcss + DaisyUI scoped
  to the two brand themes only (scripthammer-dark/light), OKLCH tokens.
- gen-cards.js: emits @DSCARD HTML, theme.css inlined, side-by-side dark+light.
- build.js: orchestrates classes -> theme -> cards into a build dir (/tmp).
- README.md: how /design-sync works, build (Docker-first), how to add a
  component, scope, and DaisyUI v5 class-drift notes.

Output is a build artifact (/tmp inside the container) — nothing written to
the repo. Covers tokens + the portable atomic/presentational tier; excludes
state/data-driven components (auth/payment/admin/map/game).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@TortoiseWolfe TortoiseWolfe merged commit 5a03948 into main Jun 24, 2026
17 checks passed
@TortoiseWolfe TortoiseWolfe deleted the feat/design-sync-generator branch June 24, 2026 00:06
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