@utopia-studio-design/design-system-cli 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/README.md +12 -41
  2. package/bin/utopia-ds-mcp.mjs +55 -0
  3. package/bin/utopia-ds.mjs +233 -318
  4. package/data/docs/ai-platform-plan.md +53 -0
  5. package/data/docs/arabic-friendly.md +72 -0
  6. package/data/docs/foundations.md +154 -0
  7. package/data/docs/guide.md +37 -0
  8. package/data/docs/quick-start-ai.md +122 -0
  9. package/data/docs/shadcn-conversion.md +35 -0
  10. package/data/docs/theme-authoring.md +46 -0
  11. package/data/manifests/catalog.json +546 -0
  12. package/data/manifests/components.json +4780 -0
  13. package/data/manifests/patterns.json +12 -0
  14. package/data/manifests/templates.json +96 -0
  15. package/data/manifests/theme-barrier-intelligence.json +123 -0
  16. package/data/manifests/theme-dextrum.json +255 -0
  17. package/data/manifests/theme-utopia-default.json +163 -0
  18. package/data/manifests/themes.json +417 -0
  19. package/data/templates/saas-solution-homepage/README.md +52 -0
  20. package/data/templates/saas-solution-homepage/agents/index.html +1 -0
  21. package/data/templates/saas-solution-homepage/changelog/index.html +1 -0
  22. package/data/templates/saas-solution-homepage/contact-sales/index.html +1 -0
  23. package/data/templates/saas-solution-homepage/customers/aster-labs/index.html +1 -0
  24. package/data/templates/saas-solution-homepage/customers/index.html +1 -0
  25. package/data/templates/saas-solution-homepage/index.html +17 -0
  26. package/data/templates/saas-solution-homepage/integrations/index.html +1 -0
  27. package/data/templates/saas-solution-homepage/integrations/slack/index.html +1 -0
  28. package/data/templates/saas-solution-homepage/main.tsx +642 -0
  29. package/data/templates/saas-solution-homepage/pricing/index.html +1 -0
  30. package/data/templates/saas-solution-homepage/product/index.html +1 -0
  31. package/data/templates/saas-solution-homepage/styles.css +863 -0
  32. package/data/templates/saas-solution-homepage/template.manifest.json +36 -0
  33. package/lib/api.mjs +146 -0
  34. package/package.json +13 -20
  35. package/LICENSE +0 -21
  36. package/templates/agent-docs/examples.md +0 -33
  37. package/templates/agent-docs/index.md +0 -78
  38. package/templates/agent-docs/llms.txt +0 -33
  39. package/templates/components/badge.tsx +0 -12
  40. package/templates/components/brand-action.tsx +0 -32
  41. package/templates/components/button-group.tsx +0 -30
  42. package/templates/components/button.tsx +0 -44
  43. package/templates/components/card.tsx +0 -23
  44. package/templates/components/cta-section.tsx +0 -34
  45. package/templates/components/icon-button.tsx +0 -44
  46. package/templates/components/page-hero.tsx +0 -47
  47. package/templates/components/tooltip.tsx +0 -48
  48. package/templates/components/topbar.tsx +0 -59
  49. package/templates/lib/utils.ts +0 -6
  50. package/templates/styles/styles.css +0 -271
  51. package/templates/styles/tokens.css +0 -21
  52. package/templates/tokens.json +0 -41
@@ -0,0 +1,53 @@
1
+ # Ceramic AI Platform Plan
2
+
3
+ ## Goal
4
+
5
+ Humans and AI agents must discover, understand, apply, and validate Ceramic through the same package-owned contracts. The docs website is a renderer. CLI, JSON, programmatic API, generated agent instructions, and MCP are transport layers over the same manifests.
6
+
7
+ ## Phase 1: Shared Contract - Complete
8
+
9
+ - Publishable `@utopia-studio-design/design-system` package with ESM, types, CSS, themes, and manifests.
10
+ - Publishable `@utopia-studio-design/design-system-cli` package.
11
+ - `manifest`, `search`, `component`, `template`, `theme`, `docs`, and `doctor` commands.
12
+ - Typed JSON success and error envelopes.
13
+ - `init` generation for AGENTS.md, Claude, Cursor, Copilot, Ceramic config, and MCP config.
14
+ - Programmatic API at `@utopia-studio-design/design-system-cli/api`.
15
+ - Stdio MCP server using the same query functions as the CLI.
16
+ - Package dry-run and external consumer smoke tests.
17
+
18
+ ## Phase 2: Authoring Operations
19
+
20
+ 1. Add `template apply` with dry-run, conflict reporting, and idempotent writes.
21
+ 2. Add `swizzle` to copy component source plus dependency and token metadata.
22
+ 3. Add `theme build` to validate and compile third-party theme manifests.
23
+ 4. Add `upgrade` codemods with versioned migration records.
24
+ 5. Add `discover` for approved external registries without silently installing code.
25
+
26
+ Every authoring command must support `--json`, `--dry-run`, deterministic output, explicit file lists, and non-zero failure codes.
27
+
28
+ ## Phase 3: Agent Evaluation
29
+
30
+ - Create prompt fixtures for common website, SaaS, chat, data, Arabic, and mixed-script tasks.
31
+ - Score imports, semantic tokens, accessibility, RTL behavior, theme compliance, and invented API usage.
32
+ - Run LTR and RTL browser checks against generated fixtures.
33
+ - Make regression scores a release gate for CLI, manifest, component, and theme changes.
34
+
35
+ ## MCP Client Setup
36
+
37
+ The generated `.mcp.json` works for clients that support project-local MCP configuration. Codex CLI can register the same stdio server explicitly:
38
+
39
+ ```sh
40
+ codex mcp add ceramic -- npx -y @utopia-studio-design/design-system-cli mcp
41
+ ```
42
+
43
+ The server exposes read-only design-system discovery. File-writing operations remain CLI commands with dry-run and explicit user control.
44
+
45
+ ## Release Gates
46
+
47
+ - Package build and external tarball import pass.
48
+ - CLI text and JSON return equivalent records.
49
+ - MCP tool responses match the CLI/programmatic API.
50
+ - `init` generates valid files in a clean consumer project.
51
+ - Component manifest audit passes.
52
+ - Docs render in LTR and RTL without horizontal overflow.
53
+ - No reusable component depends on raw theme primitives or invented localization copy.
@@ -0,0 +1,72 @@
1
+ # Arabic Friendly Design
2
+
3
+ Arabic-friendly support is a first-class design-system goal. It is broader than RTL.
4
+
5
+ - Use logical CSS properties.
6
+ - Support `dir="ltr"` and `dir="rtl"`.
7
+ - Use start/end naming, not left/right APIs.
8
+ - Mirror or replace directional icons in RTL contexts.
9
+ - Validate mixed English/Arabic labels.
10
+ - Do not invent Arabic copy.
11
+ - Require localized props for visible labels, `aria-label`, live-region status, empty-state copy, pagination controls, and formatter-generated accessibility text. Reusable components must not fall back to embedded English UI strings.
12
+
13
+ ## Side Navigation Requirements
14
+
15
+ Side navigation is a release-gate component for Arabic-friendly quality because it controls product IA.
16
+
17
+ - Keep page links and collapsible section titles separate. A page row such as `Side Nav` must not also be the disclosure trigger for its parts.
18
+ - Preserve scroll position when a persistent side navigation collapses and expands.
19
+ - Use `inline-start` and `inline-end` spacing for depth, nested section borders, badges, and trailing slots.
20
+ - In `dir="rtl"`, collapsed disclosure indicators must rotate toward inline start. Direction-neutral panel icons may stay unmirrored.
21
+ - Keep `icon`/`startContent` as inline-start slots and `badge`/`endContent` as inline-end slots.
22
+ - Test mixed-script labels, numeric badges, current page state, disabled state, focus-visible, hover, and collapse/expand in both `dir="ltr"` and `dir="rtl"`.
23
+ - Use Arabic strings only as supplied localization or explicitly marked test placeholders. Do not write production Arabic copy inside examples, manifests, or reusable components.
24
+
25
+ ## Arabic Typography Requirements
26
+
27
+ Arabic typography needs its own role contract. It is not Latin typography translated into Arabic.
28
+
29
+ - Required font roles: `--font-arabic`, `--font-arabic-body`, and `--font-arabic-display`.
30
+ - Required rhythm roles: `--line-height-arabic`, `--line-height-arabic-body`, and `--line-height-arabic-display`.
31
+ - Required display roles: `--font-size-arabic-display`, `--font-weight-arabic-display`, and `--tracking-arabic-display`.
32
+ - Required body roles: `--font-size-arabic-body`, `--font-size-arabic-body-lg`, `--font-weight-arabic-body`, and `--tracking-arabic`.
33
+ - Arabic display text must use scale, weight, rhythm, and Arabic display typeface rules. Do not map Latin all-caps styling to Arabic.
34
+ - Arabic display size should track the Latin display scale at about 95%, rather than becoming visually larger than the Latin equivalent.
35
+ - Arabic contexts must force `text-transform: none`.
36
+
37
+ ## RTL Layout Requirements
38
+
39
+ Every reusable component and template must be written in logical layout terms.
40
+
41
+ - Use `padding-inline`, `margin-inline`, `border-inline`, `inset-inline`, `inline-size`, and `block-size`.
42
+ - Use `start`, `end`, `inline`, `block`, `leading`, or `trailing` naming in APIs.
43
+ - Avoid `left`, `right`, `margin-left`, `padding-right`, and left/right-only prop names unless documenting a physical side.
44
+ - Navigation, drawer, sidebar, pagination, carousel, progress, timeline, stepper, tabs, and menu patterns require explicit RTL checks.
45
+
46
+ ## Directional Mirroring Requirements
47
+
48
+ Directional UI must mirror intentionally.
49
+
50
+ - Mirror or replace arrows and chevrons used for previous/next, expand/collapse, breadcrumb, carousel, and inline motion.
51
+ - Do not mirror direction-neutral icons by default: settings, add, home, camera, download, panel, and document icons.
52
+ - Progress indicators and steppers should reverse visual flow only when the product sequence follows reading direction.
53
+ - Motion should enter from inline start/end instead of physical left/right.
54
+
55
+ ## Accessibility Localization Contract
56
+
57
+ - Icon-only actions require a localized accessible label from the consumer.
58
+ - Composite widgets require localized landmark and slot labels, including Breadcrumb, Pagination, Input OTP, Chat actions, Spinner, and tool-call summaries.
59
+ - Numeric values remain machine-readable while visible and spoken formatting comes from product locale data.
60
+ - Direction-neutral icons such as loading spinners do not mirror; directional actions mirror through component direction.
61
+
62
+ ## Required Arabic Mockups
63
+
64
+ The design system should include Arabic/RTL previews for:
65
+
66
+ - Hero or display section.
67
+ - Form.
68
+ - Dashboard or table.
69
+ - Empty state.
70
+ - Side navigation.
71
+
72
+ Mockups may use clearly marked test placeholder Arabic. They must not invent production Arabic marketing copy.
@@ -0,0 +1,154 @@
1
+ # Foundations
2
+
3
+ Foundations define the semantic contract for humans, AI agents, themes, and reusable components. Components consume roles. Themes map those roles to visual primitives. The design-system app renders these pages at `/docs/foundations/*`.
4
+
5
+ ## Foundation Pages
6
+
7
+ - `All Tokens`: complete semantic contract and required roles.
8
+ - `Color`: role-based color, swatches, state matrix, and contrast/state guidance.
9
+ - `Typography`: Latin/default type, Arabic type, mixed-script rhythm, and code typography.
10
+ - `Spacing`: spacing scale plus RTL-aware logical layout rules.
11
+ - `Shape`: control, surface, size, border, and round roles across theme styles.
12
+ - `Motion`: duration/easing roles, disclosure motion, and directional motion rules.
13
+ - `Elevation`: surface hierarchy, popovers, dialogs, and border-led elevation.
14
+ - `Icons`: icon slots, icon-only actions, and directional mirroring.
15
+ - `Illustrations`: media rules, empty states, and illustration boundaries.
16
+
17
+ ## Token Contract
18
+
19
+ - Use semantic roles such as `--background`, `--foreground`, `--primary`, `--secondary`, `--surface`, `--surface-elevated`, `--border`, `--ring`, `--radius-control`, `--radius-surface`, `--font-sans`, `--font-arabic-body`, and `--font-arabic-display`.
20
+ - Do not hardcode Utopia Default primitives such as Brick Red, Special Black, TWK Lausanne, or IBM Plex Sans Arabic inside reusable components.
21
+ - Use logical CSS properties: `padding-inline`, `margin-inline`, `border-inline`, `inset-inline`, `block-size`, and `inline-size`.
22
+ - Use start/end API names instead of left/right names.
23
+
24
+ ## Color Contract
25
+
26
+ - Name tokens by purpose, not hue.
27
+ - Components use `--primary`, `--secondary`, `--destructive`, `--muted`, `--border`, and `--ring`.
28
+ - Themes may map those roles to brand primitives.
29
+ - Focus-visible color is required; do not remove it for visual polish.
30
+ - Disabled and selected states must remain readable in both LTR and RTL.
31
+
32
+ ## Typography Contract
33
+
34
+ Arabic support is not a translation pass. Themes must define Arabic body and display roles.
35
+
36
+ - `--font-arabic`
37
+ - `--font-arabic-body`
38
+ - `--font-arabic-display`
39
+ - `--font-weight-arabic-body`
40
+ - `--font-weight-arabic-display`
41
+ - `--font-size-arabic-body`
42
+ - `--font-size-arabic-body-lg`
43
+ - `--font-size-arabic-display`
44
+ - `--line-height-arabic`
45
+ - `--line-height-arabic-body`
46
+ - `--line-height-arabic-display`
47
+ - `--tracking-arabic`
48
+ - `--tracking-arabic-display`
49
+
50
+ Latin all-caps display styling does not transfer to Arabic. For Arabic display, use scale, weight, rhythm, and Arabic display typeface tokens. Keep `text-transform: none`.
51
+
52
+ Arabic display sizing should follow the Latin display scale at about 95%, rather than making Arabic headings larger than Latin headings. Keep Arabic line-height readable for connected letterforms and diacritics.
53
+
54
+ ## Spacing Contract
55
+
56
+ - Use the spacing scale through semantic layout decisions.
57
+ - Use `inline-start` and `inline-end` instead of physical left/right.
58
+ - Navigation, sidebars, drawers, tabs, pagination, carousels, progress indicators, and steppers require RTL smoke checks.
59
+ - Preserve DOM meaning and keyboard order. Do not reverse data or workflow meaning unless product rules require it.
60
+
61
+ ## Shape Contract
62
+
63
+ - Controls consume `--radius-control`.
64
+ - Cards, dialogs, popovers, and other framed surfaces consume `--radius-surface`.
65
+ - Avatars, pills, and circular affordances may consume a round role when present.
66
+ - Control dimensions use size roles such as `--size-control-sm`, `--size-control-md`, and `--size-control-lg`.
67
+ - Borders use semantic width/style roles such as `--border-width-hairline`, `--border-width-focus`, and `--border-style-default`.
68
+ - Utopia Default can be square. Future themes may be rounded without component rewrites.
69
+
70
+ ## Motion Contract
71
+
72
+ - Ceramic defines five semantic patterns: `press`, `page`, `expand`, `reveal`, and `icon`.
73
+ - Components consume `--motion-duration-*` and `--motion-ease-*` roles rather than hardcoded milliseconds or easing curves.
74
+ - `MotionProvider` sets the subtree default. Motion-aware components expose `motion?: boolean` for a local override.
75
+ - `motion={false}` and `prefers-reduced-motion: reduce` disable decorative movement while preserving state changes and accessibility.
76
+ - Directional motion follows logical inline start/end and mirrors in RTL when direction carries meaning.
77
+ - Icon motion follows the action: a bell swings from its top, download moves downward, and copy snaps once. Do not apply a generic bounce.
78
+
79
+ ```tsx
80
+ import { MotionProvider } from '@utopia-studio-design/design-system/Motion'
81
+ import { Button } from '@utopia-studio-design/design-system/Button'
82
+
83
+ export function App() {
84
+ return (
85
+ <MotionProvider motion>
86
+ <Button motion={false}>Static local action</Button>
87
+ </MotionProvider>
88
+ )
89
+ }
90
+ ```
91
+
92
+ ## Elevation Contract
93
+
94
+ - Elevation is semantic hierarchy, not a mandatory shadow style.
95
+ - Utopia Default prefers border-led surfaces.
96
+ - Popovers and dialogs use elevated surface roles and focus management.
97
+ - Do not hardcode `box-shadow` recipes inside reusable component logic.
98
+
99
+ ## Icon Contract
100
+
101
+ - Core owns icon slots, icon-only controls, labels, and accessibility.
102
+ - Theme manifests own icon philosophy and icon style.
103
+ - Use `lucide-react` as the default shadcn/ui icon baseline for examples and previews.
104
+ - Mirror arrows and chevrons when they mean previous/next, open/close, or inline movement.
105
+ - Do not mirror direction-neutral icons such as settings, add, download, home, camera, or panel icons unless a theme says otherwise.
106
+
107
+ ## Illustration Contract
108
+
109
+ - Illustrations are theme and product media, not core component requirements.
110
+ - Empty states must work without decorative imagery.
111
+ - Use real product/place/object media when inspection matters.
112
+ - Do not use generic gradients or decorative blobs as a substitute for system content.
113
+
114
+ ## Usage Sections
115
+
116
+ Every foundation page should expose:
117
+
118
+ 1. `Overview`: what the foundation controls and what it does not own.
119
+ 2. `Tokens`: the semantic roles and AI usage rule for each role.
120
+ 3. Foundation-specific visualization: swatches, type scale, spacing scale, shape preview, motion preview, elevation surfaces, icon mirroring, or empty state media.
121
+ 4. `Usage`: when to use the foundation in real UI.
122
+ 5. `Best Practices`: do/don't/check guidance.
123
+ 6. `AI Usage Rules`: machine-readable setup and generation instructions.
124
+ 7. `Arabic / RTL Check`: compact page-specific RTL guidance. Use `All Tokens` and the Arabic Friendly page for full product mockups.
125
+
126
+ ## Best Practice Baseline
127
+
128
+ - Keep primitive tokens inside theme manifests and semantic roles inside reusable components.
129
+ - Do not generate raw brand colors, shadcn visual defaults, or physical left/right spacing into reusable code.
130
+ - Verify hover, focus-visible, active, disabled, selected, expanded, loading, empty, and destructive states.
131
+ - Verify Arabic/RTL with mixed-script labels, Arabic numerals, truncation, badges, and direction-aware icons.
132
+ - Treat illustration, icon philosophy, brand-specific geometry, and display casing as theme-owned unless a component contract explicitly owns the behavior.
133
+
134
+ ## AI Usage Rules
135
+
136
+ Before generating UI:
137
+
138
+ 1. Read `packages/design-system/src/manifests/themes.json`.
139
+ 2. Read the active theme policy manifest.
140
+ 3. Read `packages/design-system/src/manifests/components.json`.
141
+ 4. Use semantic tokens only.
142
+ 5. Check Arabic/RTL behavior with `dir="rtl"`, `lang="ar"`, mixed-script labels, Arabic numerals, badges, truncation, focus-visible, and no invented production Arabic copy.
143
+
144
+ ## Required Arabic Mockups
145
+
146
+ All Tokens and the Arabic Friendly page must include or link to these RTL previews:
147
+
148
+ - Hero or display section
149
+ - Form
150
+ - Dashboard or table
151
+ - Empty state
152
+ - Side navigation
153
+
154
+ Individual Foundation pages should show a compact Arabic / RTL check instead of repeating the full product mockups.
@@ -0,0 +1,37 @@
1
+ # Guide
2
+
3
+ Guide pages are the operating layer of Ceramic. They define how humans and AI agents should use the design system before reaching for components, templates, or theme primitives.
4
+
5
+ ## Pages
6
+
7
+ - `Getting Started`: installation, theme CSS, first component, examples, CLI discovery, Arabic-friendly entrypoint.
8
+ - `What's New`: release notes for package, manifest, theme, and docs changes.
9
+ - `Quick Start with AI`: dense setup workflow for AI coding tools.
10
+ - `Working with AI`: how manifests, docs, and examples stay machine-readable.
11
+ - `Principles`: semantic-first, shadcn-founded, theme-extensible, Arabic-friendly, AI-readable rules.
12
+ - `Theme System`: required semantic roles, Utopia Default as first theme, and future theme boundaries.
13
+ - `Arabic Friendly`: RTL-first layout, Arabic typography, mixed-script resilience, localization readiness, and icon/motion mirroring.
14
+ - `Styling Components`: safe component styling through semantic tokens and app-layer className.
15
+ - `Styling Library Interop`: Tailwind, plain CSS, CSS modules, and CSS-in-JS bridges through Ceramic CSS variables.
16
+ - `Migration Guide`: safe migration from app-local UI or raw shadcn usage into `packages/design-system`.
17
+
18
+ ## Guide Contract
19
+
20
+ - Each guide page must include `Overview`, `Usage`, `Rules`, and `AI Checklist`.
21
+ - Migration pages may rename `Usage` to `Migration Order` and `Rules` to `Safe Boundaries`.
22
+ - Guide pages must not duplicate component API contracts that belong in `components.json`.
23
+ - Guide pages must not put Utopia Default visual philosophy into reusable core rules.
24
+ - Guide pages must link AI agents back to manifests, package exports, foundations, and Arabic-friendly rules.
25
+
26
+ ## AI Rule
27
+
28
+ Before generating UI, read:
29
+
30
+ 1. `docs/design-system/quick-start-ai.md`
31
+ 2. `docs/design-system/guide.md`
32
+ 3. `docs/design-system/foundations.md`
33
+ 4. `docs/design-system/arabic-friendly.md`
34
+ 5. `docs/design-system/shadcn-conversion.md`
35
+ 6. `packages/design-system/src/manifests/catalog.json`
36
+ 7. `packages/design-system/src/manifests/components.json`
37
+ 8. `packages/design-system/src/manifests/themes.json`
@@ -0,0 +1,122 @@
1
+ # Quick Start with AI
2
+
3
+ Ceramic follows the Astryx principle that humans, coding agents, build tools, and MCP clients use the same source of truth. The docs site does not maintain a separate component contract.
4
+
5
+ ## Paste This Into Your AI
6
+
7
+ ```text
8
+ Install @utopia-studio-design/design-system and @utopia-studio-design/design-system-cli. Run `npx utopia-ds init --theme utopia-default`. Read the generated AGENTS.md and active theme config. Before editing UI, run `npx utopia-ds manifest --json`, search for the intended pattern, inspect its component or template contract, and read the Arabic-friendly guide when the product supports Arabic or RTL. Do not invent props, imports, tokens, or localized copy.
9
+ ```
10
+
11
+ ## Install
12
+
13
+ ```sh
14
+ npm install @utopia-studio-design/design-system
15
+ npm install -D @utopia-studio-design/design-system-cli
16
+ npx utopia-ds init --theme utopia-default
17
+ ```
18
+
19
+ The init command creates:
20
+
21
+ - `AGENTS.md` and `CLAUDE.md`
22
+ - `.cursor/rules/ceramic-design-system.mdc`
23
+ - `.github/copilot-instructions.md`
24
+ - `.ceramic/config.json`
25
+ - `.mcp.json`
26
+ - stable `ceramic` and `ceramic:doctor` npm scripts
27
+
28
+ ## Add Theme CSS
29
+
30
+ ```css
31
+ @import '@utopia-studio-design/design-system/core.css';
32
+ @import '@utopia-studio-design/design-system/themes/utopia-default.css';
33
+ ```
34
+
35
+ ## Add A Component
36
+
37
+ ```tsx
38
+ import { Button } from '@utopia-studio-design/design-system/Button'
39
+
40
+ export function SaveAction() {
41
+ return <Button>Save changes</Button>
42
+ }
43
+ ```
44
+
45
+ ## Set Motion Policy
46
+
47
+ Ceramic maps BeUI-inspired interaction patterns to semantic roles: `press`, `page`, `expand`, `reveal`, and `icon`. Set the application default once and override only when a local workflow needs to be static.
48
+
49
+ ```tsx
50
+ import { MotionProvider } from '@utopia-studio-design/design-system/Motion'
51
+ import { Button } from '@utopia-studio-design/design-system/Button'
52
+
53
+ export function App() {
54
+ return (
55
+ <MotionProvider motion>
56
+ <Button>Animated by the press contract</Button>
57
+ <Button motion={false}>Static override</Button>
58
+ </MotionProvider>
59
+ )
60
+ }
61
+ ```
62
+
63
+ Never bypass `MotionProvider`, semantic motion tokens, or `prefers-reduced-motion`. The `motion` prop changes transition behavior, not component state or accessibility.
64
+
65
+ ## Discover Before Generating
66
+
67
+ ```sh
68
+ npx utopia-ds manifest --json
69
+ npx utopia-ds search "Arabic settings form" --json
70
+ npx utopia-ds component Button --json
71
+ npx utopia-ds template --list --json
72
+ npx utopia-ds template template-saas-solution-homepage --copy ./saas-solution-website
73
+ npx utopia-ds template template-saas-solution-homepage --theme dextrum --copy ./dextrum-website
74
+ npx utopia-ds theme utopia-default --json
75
+ npx utopia-ds theme create nova
76
+ npx utopia-ds docs arabic-friendly --dense
77
+ npx utopia-ds doctor --json
78
+ ```
79
+
80
+ Use `--dense` for small prompt context and `--json` for automation. Every JSON success response uses `{ apiVersion, type, data, meta }`; errors use `{ apiVersion, error, code, suggestions }`.
81
+
82
+ ## MCP
83
+
84
+ The MCP server exposes the same API as the CLI. A generated `.mcp.json` uses:
85
+
86
+ ```json
87
+ {
88
+ "mcpServers": {
89
+ "ceramic": {
90
+ "command": "npx",
91
+ "args": ["-y", "@utopia-studio-design/design-system-cli", "mcp"]
92
+ }
93
+ }
94
+ }
95
+ ```
96
+
97
+ Available tools include search, component/template/theme/doc discovery, and doctor. An MCP client must never receive capabilities that the CLI cannot expose.
98
+
99
+ ## Agent Decision Loop
100
+
101
+ 1. Run `manifest --json` to discover supported operations.
102
+ 2. Run `search <intent> --json` instead of guessing a component name.
103
+ 3. Inspect the chosen template and every component contract.
104
+ 4. Read the active theme and Arabic-friendly contract.
105
+ 5. Implement with package exports and semantic tokens.
106
+ 6. Run product tests and `doctor --json` before handoff.
107
+
108
+ ## Create A Theme
109
+
110
+ Run this from the Ceramic Design System workspace:
111
+
112
+ ```sh
113
+ npx utopia-ds theme create nova
114
+ npm run sync-data --workspace @utopia-studio-design/design-system-cli
115
+ npm run ds -- doctor
116
+ ```
117
+
118
+ The command creates `nova.css`, `theme-nova.json`, and registers the theme in `themes.json`. The scaffold includes dark, light, Arabic typography, shape, and semantic motion contracts. Replace its placeholder brand primitives before publishing it.
119
+
120
+ ## Core And Theme Boundary
121
+
122
+ Core owns shadcn-style architecture, semantic roles, accessibility, Arabic-friendly baseline behavior, and agent-readable contracts. Themes own brand visual philosophy. Utopia Default owns Brick Red, Special Black, TWK Lausanne, IBM Plex Sans Arabic, square geometry, and its declared icon policy.
@@ -0,0 +1,35 @@
1
+ # shadcn/ui Conversion Contract
2
+
3
+ Utopia Design System uses shadcn/ui as the implementation foundation, not as a visual theme.
4
+
5
+ ## Rules
6
+
7
+ - Keep `components.json` pointed at `packages/design-system/src/components`.
8
+ - Convert shadcn source into Utopia package exports before app usage.
9
+ - Components consume semantic tokens such as `--background`, `--foreground`, `--surface`, `--border`, `--radius-control`, and `--radius-surface`.
10
+ - Do not copy raw shadcn colors, default radius assumptions, or left/right-only layout rules into reusable components.
11
+ - Utopia Default Theme maps the semantic contract to the current Utopia brand. Other themes may map it differently.
12
+ - Arabic-friendly behavior is required: logical CSS properties, `dir="rtl"` checks, mixed-script text tolerance, and no invented Arabic production copy.
13
+
14
+ ## Workflow
15
+
16
+ ```bash
17
+ pnpm dlx shadcn@latest init
18
+ ```
19
+
20
+ The project already has a `components.json` file. Do not overwrite it unless the Utopia DS aliases are preserved.
21
+
22
+ ```bash
23
+ npm run ds -- component --list --dense
24
+ npm run ds -- component "Accordion" --dense
25
+ ```
26
+
27
+ Use the dense CLI output to pick the Utopia package import. If a component still points to `ShadcnPrimitives`, it has a safe semantic wrapper and should be specialized before complex production usage.
28
+
29
+ ## Current Source Of Truth
30
+
31
+ - shadcn setup: `components.json`
32
+ - Utopia catalog: `packages/design-system/src/manifests/catalog.json`
33
+ - Component contracts: `packages/design-system/src/manifests/components.json`
34
+ - Safe conversion wrappers: `packages/design-system/src/components/ShadcnPrimitives.tsx`
35
+ - Core semantic styling: `packages/design-system/src/core.css`
@@ -0,0 +1,46 @@
1
+ # Theme Authoring
2
+
3
+ Themes are token-contract and visual-policy implementations.
4
+
5
+ ## Scaffold A Theme
6
+
7
+ ```sh
8
+ npx utopia-ds theme create nova
9
+ ```
10
+
11
+ Run the command from the Design System workspace. It writes the theme CSS and policy manifest and registers the theme in the catalog. Theme IDs use lowercase kebab-case. The generated colors and typography are safe placeholders, not a finished brand direction.
12
+
13
+ ## Required Read Order
14
+
15
+ 1. `packages/design-system/src/core.css`
16
+ 2. `packages/design-system/src/manifests/themes.json`
17
+ 3. The active theme policy manifest, such as `theme-utopia-default.json`
18
+ 4. Component and template manifests
19
+
20
+ ## Core Boundary
21
+
22
+ Core owns semantic roles, component APIs, accessibility, Arabic-friendly requirements, and shadcn-style architecture.
23
+
24
+ Core does not own brand palette, brand typography, icon style, brand voice, or brand-specific layout philosophy.
25
+
26
+ ## Theme Boundary
27
+
28
+ A theme maps primitives to semantic roles and declares its own visual policy:
29
+
30
+ - Color primitives
31
+ - Typography family and weights
32
+ - Radius and shape
33
+ - Elevation model
34
+ - Icon policy
35
+ - Motion profile
36
+ - Copy and casing guidance
37
+
38
+ Theme CSS owns both `[data-theme="<id>"]` and `[data-theme="<id>"][data-color-mode="light"]`. Templates set theme and color-mode attributes but must not remap brand primitives themselves.
39
+
40
+ Utopia Default is strict about Brick Red, Special Black, TWK Lausanne, square geometry, and dot/bar icons. Those are not global design-system rules.
41
+
42
+ ## Motion Profile
43
+
44
+ Every theme implements the stable semantic roles `--motion-duration-press`, `--motion-duration-page`, `--motion-duration-expand`, `--motion-duration-reveal`, `--motion-duration-icon`, `--motion-ease-standard`, and `--motion-ease-emphasized`. A theme may change timing and easing, but it must preserve the intent of each pattern and reduced-motion behavior.
45
+
46
+ Components use `MotionProvider` and their optional `motion` prop. Theme authors must not introduce component-specific hardcoded milliseconds or a generic bounce animation.