@reqvire-org/ads 0.0.0-stage → 0.2.9

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 (145) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +284 -2
  3. package/dist/assets.mjs +52 -0
  4. package/dist/bootstrap-ds/ADS.md +203 -0
  5. package/dist/bootstrap-ds/README.md +98 -0
  6. package/dist/bootstrap-ds/biome.css.json +21 -0
  7. package/dist/bootstrap-ds/design-system/assets/brand/README.md +28 -0
  8. package/dist/bootstrap-ds/design-system/assets/fonts/.gitkeep +0 -0
  9. package/dist/bootstrap-ds/design-system/components/.gitkeep +0 -0
  10. package/dist/bootstrap-ds/design-system/composition/.gitkeep +0 -0
  11. package/dist/bootstrap-ds/design-system/index.ts +5 -0
  12. package/dist/bootstrap-ds/design-system/patterns/.gitkeep +0 -0
  13. package/dist/bootstrap-ds/design-system/showcase/mcp/index.html +1 -0
  14. package/dist/bootstrap-ds/design-system/showcase/mcp/main.tsx +8 -0
  15. package/dist/bootstrap-ds/design-system/styles.css +5 -0
  16. package/dist/bootstrap-ds/design-system/tokens/Foundation.fixture.ts +47 -0
  17. package/dist/bootstrap-ds/design-system/tokens/Foundation.scenario.tsx +14 -0
  18. package/dist/bootstrap-ds/design-system/tokens/base.css +27 -0
  19. package/dist/bootstrap-ds/design-system/tokens/colors.css +29 -0
  20. package/dist/bootstrap-ds/design-system/tokens/elevation.css +15 -0
  21. package/dist/bootstrap-ds/design-system/tokens/spacing.css +15 -0
  22. package/dist/bootstrap-ds/design-system/tokens/typography.css +13 -0
  23. package/dist/bootstrap-ds/ds.config.json +13 -0
  24. package/dist/bootstrap-ds/gitignore.template +8 -0
  25. package/dist/bootstrap-ds/package-lock.json +4660 -0
  26. package/dist/bootstrap-ds/package.json +41 -0
  27. package/dist/bootstrap-ds/scripts/build-mcp-previews.mjs +33 -0
  28. package/dist/bootstrap-ds/src/vite-env.d.ts +7 -0
  29. package/dist/bootstrap-ds/tsconfig.build.json +12 -0
  30. package/dist/bootstrap-ds/tsconfig.json +20 -0
  31. package/dist/bootstrap-ds/vite.config.ts +21 -0
  32. package/dist/boundaries.mjs +130 -0
  33. package/dist/brand-assets.mjs +82 -0
  34. package/dist/check.mjs +222 -0
  35. package/dist/cli.mjs +106 -0
  36. package/dist/config.mjs +181 -0
  37. package/dist/contracts/tokens.json +52 -0
  38. package/dist/html.mjs +30 -0
  39. package/dist/index.mjs +9 -0
  40. package/dist/init.mjs +194 -0
  41. package/dist/lint-config.mjs +40 -0
  42. package/dist/mcp/THIRD_PARTY_NOTICES.md +786 -0
  43. package/dist/mcp/apps.mjs +53 -0
  44. package/dist/mcp/build-status.mjs +164 -0
  45. package/dist/mcp/catalog.mjs +65 -0
  46. package/dist/mcp/context.mjs +69 -0
  47. package/dist/mcp/mutations.mjs +301 -0
  48. package/dist/mcp/patch.mjs +114 -0
  49. package/dist/mcp/preview-watch.mjs +169 -0
  50. package/dist/mcp/preview-widget.bundle.js +113 -0
  51. package/dist/mcp/project-widget.bundle.js +113 -0
  52. package/dist/mcp/prompts.mjs +28 -0
  53. package/dist/mcp/resource-loader.js +138 -0
  54. package/dist/mcp/sandbox-host.mjs +22 -0
  55. package/dist/mcp/server.mjs +377 -0
  56. package/dist/mcp/showcase-host.mjs +68 -0
  57. package/dist/mcp/skills.mjs +77 -0
  58. package/dist/mcp/widget.bundle.js +150 -0
  59. package/dist/oxlint.mjs +81 -0
  60. package/dist/preview-resources.mjs +198 -0
  61. package/dist/project-documents.mjs +27 -0
  62. package/dist/public-props.mjs +74 -0
  63. package/dist/scenarios-compiler.mjs +287 -0
  64. package/dist/scenarios-vite.d.mts +3 -0
  65. package/dist/scenarios-vite.mjs +71 -0
  66. package/dist/scenarios.mjs +212 -0
  67. package/dist/showcase/client.bundle.js +127 -0
  68. package/dist/showcase/index.html +17 -0
  69. package/dist/showcase/sandbox.js +30 -0
  70. package/dist/showcase/style.css +7 -0
  71. package/dist/showcase-coverage.mjs +118 -0
  72. package/dist/showcase.mjs +77 -0
  73. package/dist/skills/README.md +68 -0
  74. package/dist/skills/ads-assimilate/SKILL.md +292 -0
  75. package/dist/skills/ads-assimilate/agents/openai.yaml +4 -0
  76. package/dist/skills/ads-assimilate/references/cli.md +111 -0
  77. package/dist/skills/ads-assimilate/references/lint-and-docs.md +87 -0
  78. package/dist/skills/ads-assimilate/references/native-implementation.md +98 -0
  79. package/dist/skills/ads-assimilate/references/testing.md +107 -0
  80. package/dist/skills/ads-break-ui/LICENSE.upstream +21 -0
  81. package/dist/skills/ads-break-ui/README.md +16 -0
  82. package/dist/skills/ads-break-ui/SKILL.md +235 -0
  83. package/dist/skills/ads-break-ui/agents/openai.yaml +4 -0
  84. package/dist/skills/ads-break-ui/references/catalog.md +135 -0
  85. package/dist/skills/ads-break-ui/references/verification.md +48 -0
  86. package/dist/skills/ads-designer/LICENSE.upstream +21 -0
  87. package/dist/skills/ads-designer/README.md +19 -0
  88. package/dist/skills/ads-designer/SKILL.md +400 -0
  89. package/dist/skills/ads-designer/agents/openai.yaml +4 -0
  90. package/dist/skills/ads-designer/assets/bootstrap-ds/ADS.md +203 -0
  91. package/dist/skills/ads-designer/assets/bootstrap-ds/README.md +98 -0
  92. package/dist/skills/ads-designer/assets/bootstrap-ds/biome.css.json +21 -0
  93. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/assets/brand/README.md +28 -0
  94. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/assets/fonts/.gitkeep +0 -0
  95. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/components/.gitkeep +0 -0
  96. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/composition/.gitkeep +0 -0
  97. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/index.ts +5 -0
  98. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/patterns/.gitkeep +0 -0
  99. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/showcase/mcp/index.html +1 -0
  100. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/showcase/mcp/main.tsx +8 -0
  101. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/styles.css +5 -0
  102. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/tokens/Foundation.fixture.ts +47 -0
  103. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/tokens/Foundation.scenario.tsx +14 -0
  104. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/tokens/base.css +27 -0
  105. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/tokens/colors.css +29 -0
  106. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/tokens/elevation.css +15 -0
  107. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/tokens/spacing.css +15 -0
  108. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/tokens/typography.css +13 -0
  109. package/dist/skills/ads-designer/assets/bootstrap-ds/ds.config.json +13 -0
  110. package/dist/skills/ads-designer/assets/bootstrap-ds/gitignore.template +8 -0
  111. package/dist/skills/ads-designer/assets/bootstrap-ds/package-lock.json +4660 -0
  112. package/dist/skills/ads-designer/assets/bootstrap-ds/package.json +41 -0
  113. package/dist/skills/ads-designer/assets/bootstrap-ds/scripts/build-mcp-previews.mjs +33 -0
  114. package/dist/skills/ads-designer/assets/bootstrap-ds/src/vite-env.d.ts +7 -0
  115. package/dist/skills/ads-designer/assets/bootstrap-ds/tsconfig.build.json +12 -0
  116. package/dist/skills/ads-designer/assets/bootstrap-ds/tsconfig.json +20 -0
  117. package/dist/skills/ads-designer/assets/bootstrap-ds/vite.config.ts +21 -0
  118. package/dist/skills/ads-designer/references/cli.md +111 -0
  119. package/dist/skills/ads-designer/references/design-craft.md +65 -0
  120. package/dist/skills/ads-designer/references/mobile.md +73 -0
  121. package/dist/skills/ads-import/SKILL.md +335 -0
  122. package/dist/skills/ads-import/agents/openai.yaml +4 -0
  123. package/dist/skills/ads-import/references/branding.md +44 -0
  124. package/dist/skills/ads-import/references/cli.md +111 -0
  125. package/dist/skills/ads-import/references/implementation.md +111 -0
  126. package/dist/skills/ads-import/references/tokens.md +96 -0
  127. package/dist/skills/ads-motion/LICENSE.upstream +21 -0
  128. package/dist/skills/ads-motion/README.md +22 -0
  129. package/dist/skills/ads-motion/SKILL.md +217 -0
  130. package/dist/skills/ads-motion/agents/openai.yaml +4 -0
  131. package/dist/skills/ads-motion/references/audit.md +44 -0
  132. package/dist/skills/ads-motion/references/build.md +81 -0
  133. package/dist/skills/ads-motion/references/performance.md +55 -0
  134. package/dist/skills/ads-motion/references/review.md +35 -0
  135. package/dist/skills/ads-motion/references/verification.md +39 -0
  136. package/dist/token-policy.mjs +10 -0
  137. package/dist/tokens.mjs +142 -0
  138. package/dist/ui-framework.mjs +59 -0
  139. package/dist/units.mjs +168 -0
  140. package/docs/ADS.md +310 -0
  141. package/docs/ARCHITECTURE.md +311 -0
  142. package/docs/CHANGELOG.md +106 -0
  143. package/docs/GUIDE.md +722 -0
  144. package/docs/MCP.md +690 -0
  145. package/package.json +107 -4
@@ -0,0 +1,400 @@
1
+ ---
2
+ name: ads-designer
3
+ description: Bootstrap an empty local React design system from bundled scaffolding, or build UI using a project's existing design system. Covers shared token contracts, local ownership, public APIs, external source integration, showcase inspection, and validation.
4
+ ---
5
+
6
+ Inspect the target before editing. Read its `README.md`, `docs/ARCHITECTURE.md`
7
+ and `docs/ADS.md` when present (or existing project guides), public exports, and relevant
8
+ component guides. Preserve its
9
+ framework and contracts. Starting from zero works from the bundled empty
10
+ scaffold without an example repository.
11
+
12
+ Linaria is required for ADS component and pattern styling. Preserve the target's
13
+ UI framework and integrate compatible Linaria extraction with both application
14
+ and preview builds. The bundled React/TypeScript starter already configures it;
15
+ `ads init` does not install or configure Linaria. Use the starter when its
16
+ framework is appropriate. Current core
17
+ guards inspect JS/TS/JSX, CSS, and imported Linaria templates, not Vue/Svelte
18
+ single-file components or general HTML component templates. Entry HTML mount
19
+ CSS is checked; that is not component-template coverage. Preserve the target stack and matching
20
+ framework checks; do not claim unchecked formats have full guard coverage.
21
+
22
+ React and native Preact are supported. Preserve the target runtime in both
23
+ production and scenario builds; never alias React to Preact just to shrink a
24
+ preview. Native Preact uses its own JSX transform, hooks and DOM events (live
25
+ text updates use `onInput`). Native SVG uses DOM names such as `stroke-width`,
26
+ not React presentation aliases. Keep Linaria extraction and the same public APIs.
27
+ The shipped empty starter uses React; the tool repository's working example
28
+ uses Preact. Neither is a component dependency of the receiving project.
29
+
30
+ When initializing a project without a saved framework, pass `--framework react`
31
+ or `--framework preact` for its actual runtime. Init saves the choice and later
32
+ runs reuse it. The bundled starter already declares React. Resolve any explicit
33
+ JSX/configuration conflict deliberately; do not change frameworks to make init
34
+ pass. Init does not install the runtime or configure the application's compiler.
35
+
36
+ ADS is tooling only. The target project owns its ADS source and token values;
37
+ applications use its local public barrel, normally through `@ds`. Components,
38
+ patterns, themes and scenarios come from external sources through explicit
39
+ ADS import/adaptation workflows. Do not treat the tool repository as a built-in
40
+ or optional UI catalogue. Tool upgrades preserve project values and customized
41
+ implementations; external source updates require explicit imports or merges.
42
+
43
+ ## MCP access when available
44
+
45
+ Use `ads_status` and `ads_catalog` to discover the connected project's public UI,
46
+ guides, showcase URL and addressable scenarios. `ads_tokens` inspects definitions; `ads_show_tokens` renders token scenarios;
47
+ `ads_scenarios` discovers previews and `ads_show_scenario` opens the selected real entry. Read relevant source
48
+ and inspect the actual view before changing it. HTML delivery alone is not a
49
+ rendering check. Use the normal showcase when the host lacks Apps support.
50
+ Use the returned `projectRoot` and `project.commands`; the connected ADS may be
51
+ inside a different or nested repository. Inspect the selected public API, owning
52
+ source/available guides and relevant tokens, then mount its discovered scenario.
53
+ Metadata and source reads do not prove rendered behavior.
54
+
55
+ When `ads_status.mutations.enabled`, discover the owner with `ads_units`, read
56
+ relevant ranges with `ads_read_file` and send only a Git unified diff through
57
+ `ads_apply_patch({ unit, patch, dryRun })`. A unit includes its own implementation,
58
+ scenarios and fixtures; imported peers remain separate. `tokens` is the token
59
+ foundation unit. Unit discovery and file ownership are distinct from preview IDs.
60
+ Include only that owner's required re-exports in the public entry. Use
61
+ `dryRun: true` to inspect validation; applying re-runs the gates. Fix rejected
62
+ patches in their owner. Shared styles/helpers use `foundation`, root guides use
63
+ `documentation`, and branding/fonts use their discovered `assets/*` unit.
64
+ Intentional configuration, rule exceptions, registered guard code and compiler
65
+ changes use `configuration`; validate the proposed settings and keep mandatory
66
+ ADS gates. For binary/large assets, generate `git diff --binary --full-index` into
67
+ `.ds/patches/<name>.patch` and send `patchFile` instead of inline `patch`, so bytes
68
+ stay out of model context. Binary changes require Git. When editing is disabled,
69
+ use the client's normal source-editing tools.
70
+
71
+ Check `ads_status.previewWatch` before launching another preview builder. With a
72
+ managed watcher, edit owned sources, wait for the rebuild and invoke the preview
73
+ again; the client already starts and stops the builder through `ads mcp`. Check
74
+ `ads_status.build` or `ads://project/build` explicitly: a running process, older
75
+ artifact or unreported freshness does not establish current source. Fix reported
76
+ diagnostics in the owning source; notifications may not reach the agent.
77
+ When this skill is served over MCP, resolve relative references/assets from its
78
+ `SKILL.md` URI and fetch supporting files lazily. The host controls native skill
79
+ activation; ordinary resource reads do not establish it. For a scaffold copy,
80
+ use the complete manifest and verify file bytes/digests rather than saving
81
+ truncated model-visible text or binary snippets.
82
+
83
+ ## Start from zero
84
+
85
+ Create the application first, then initialize ADS inside it. The CLI requires
86
+ an existing `package.json`; `ads init` accepts no directory argument and does not
87
+ generate an application. Read [references/cli.md](references/cli.md) to use an
88
+ actual published version or local tarball. Init adds the tool as a development
89
+ dependency and connects ADS checks to the existing build. If no tool distribution
90
+ is available, the bundled files below still support bootstrapping and general
91
+ checks; do not fetch the unpublished package.
92
+
93
+ Read [assets/bootstrap-ds/README.md](assets/bootstrap-ds/README.md) and its
94
+ [contract](assets/bootstrap-ds/ADS.md). The scaffold contains semantic token
95
+ defaults, React/TypeScript/Linaria configuration, general lint, an empty public
96
+ barrel, empty component/pattern directories, and a project preview compiler adapter. The browser shell is supplied by ADS tooling.
97
+ It contains no components, shell patterns, vendored fonts, or example screens.
98
+
99
+ Resolve assets relative to this skill's `SKILL.md`, including after installation
100
+ by `npx skills`. In the tool checkout, root `bootstrap-ds/` is canonical.
101
+ For a new empty project, copy its **contents**, including dotfiles:
102
+
103
+ ```sh
104
+ starter_dir="/absolute/path/to/ads-designer/assets/bootstrap-ds"
105
+ target_dir="/absolute/path/to/new-project"
106
+ mkdir -p "$target_dir"
107
+ cp -a "$starter_dir/." "$target_dir/"
108
+ cd "$target_dir"
109
+ # Run ads init here when an actual tool distribution is available.
110
+ npm install
111
+ npm run build
112
+ ```
113
+
114
+ Replace the example paths with actual directories. Set the project package
115
+ name. Add only requested components and patterns, export them through the
116
+ local barrel, and demonstrate their public API in the project showcase.
117
+ The bundled application defaults to npm. For a new Bun application,
118
+ translate nested npm script calls to `bun run` and omit the starter npm lockfile;
119
+ preserve an existing app's package manager and lockfile when merging.
120
+ Initialize/install ADS before running `npm run dev:showcase` for visual inspection.
121
+ Use an existing MCP runtime URL when connected; do not leave an unrequested
122
+ server running.
123
+
124
+ For an existing app without an ADS, run init inside that app when the tool is
125
+ available, then integrate its local public alias, CSS entry, and Linaria
126
+ extraction with the existing framework. Init detects the package manager from
127
+ the app and preserves its scripts and lockfile. Without a tool distribution,
128
+ merge only the required ADS source and dependencies from the bundled scaffold.
129
+ Inspect files before editing; preserve configuration and application entry
130
+ points. Never copy the standalone package/configuration over an existing app.
131
+
132
+ ## External references and content
133
+
134
+ Accept an external example/source repository URL or local path supplied with the
135
+ request. If source content is needed and no location is known, ask for the source;
136
+ continue independent local discovery first. Do not invent a repository URL or
137
+ use the tooling checkout's origin as an example library. Bootstrap needs no
138
+ external source.
139
+
140
+ Inspect the external repository's instructions, architecture, actual ADS folder,
141
+ public exports, item guides, token contract, styles, build, and license.
142
+ Do not assume it has a particular component, hook, font, or token helper.
143
+ Record the source revision and required dependencies.
144
+
145
+ Use the ADS import workflow to bring selected existing ADS items into the target,
146
+ or assimilation to create a native component from an upstream library. Follow
147
+ those workflows directly if the corresponding skills are unavailable: copy
148
+ selected source and its dependency closure, or study/reproduce the upstream
149
+ contract; integrate local ownership, exports, styles, assets, credits, applicable
150
+ notices, and checks. Do not copy the whole catalogue or source configuration.
151
+ Mocks and example screens remain development fixtures unless explicitly requested.
152
+
153
+ Preserve the target's performance strategy when changing ownership: lazy imports,
154
+ worker execution, caches, memoization, cancellation, and stale-result rejection.
155
+ Public exports must not eagerly load heavy renderers for unrelated consumers.
156
+ Compare relevant bundle loading and existing performance/lifecycle tests before
157
+ and after a migration. Shared screen patterns can accept injected services;
158
+ architectural reuse does not require moving application services into the ADS.
159
+
160
+ ## Token and component ownership
161
+
162
+ - Token names and prefixes are fixed by ADS architecture. Use existing shared
163
+ names; `--ds-*` belongs to components, `--ux-*` to patterns, and
164
+ `--showcase-*` is reserved for showcase-local boundaries, not fixture styling.
165
+ ADS-owned frame patterns use `--ux-*`. Do not introduce configurable or
166
+ product-prefixed token vocabularies.
167
+ - Shared token names, meanings, types, and alias relationships form the contract;
168
+ project values and theme overrides can differ. Item imports retain existing
169
+ values and add missing definitions. Explicit token-values imports adopt source
170
+ values and theme variants.
171
+ - Scaffold defaults are dense 13px UI text, a 4px grid, warm surfaces, slate
172
+ text, rose accents, restrained elevation, and system fonts. Treat these as
173
+ initial project values; honor requested branding and preserve existing themes.
174
+ - Reuse existing public components, patterns, and shared icons when compatible.
175
+ Add missing primitives in their owning layer; inspect exports rather than
176
+ assuming they exist.
177
+ - Components own hover, selected, active, focus, disabled, loading, and motion.
178
+ Change these through typed props/variants in the component. Consumers and
179
+ showcase CSS must not override internals.
180
+ - Put visual constants in tokens. Avoid inline visual styles, arbitrary visual
181
+ string props, and broad imperative style mutations. Measured geometry can use
182
+ a narrow documented boundary while visual policy stays in tokens and styles.
183
+ - Keep product data, routing, effects, and callbacks in application code.
184
+ Reusable layouts and controls belong in the local ADS.
185
+ - Document detailed API, behavior, motion, token hooks, validation, and source
186
+ credits beside each component or pattern. Shared project architecture belongs
187
+ in its ADS guide.
188
+
189
+ ## Branding
190
+
191
+ Discover existing tokens and artwork before changing identity. Keep UI values
192
+ in the existing token files using fixed ADS names, and original artwork plus its
193
+ usage, backgrounds, credits, and licenses in `assets/brand/`. Keep fonts in
194
+ `assets/fonts/`, with optional `tokens/fonts.css` imported first. Follow the
195
+ canonical foundation import order: fonts (if present), colors, typography,
196
+ spacing, elevation, base. Artwork can have fixed SVG colors; UI styles must
197
+ still use tokens and must not override primitive state.
198
+
199
+ For standard web icons, set `assets.iconSource` to an SVG under `assets/brand/`,
200
+ relative to the ADS folder. After init, the normal build runs ADS/Oxlint checks,
201
+ then `ads assets`, then existing prebuild/build steps. Mount ignored `.ds/assets/`
202
+ through the application's own bundler without public asset collisions. Keep
203
+ manifest metadata and other platform exports project-owned. Verify the actual
204
+ consumer paths, dimensions, and transparent/background variants. With no icon
205
+ source, generation is a no-op. Component imports retain destination branding;
206
+ artwork replacement and token-value adoption are explicit selections.
207
+
208
+ ## Design craft and mobile behavior
209
+
210
+ For component polish, state completeness, content/layout decisions, or showcase
211
+ quality, read [references/design-craft.md](references/design-craft.md). For touch,
212
+ small screens, browser chrome, safe areas, or mobile forms, read
213
+ [references/mobile.md](references/mobile.md). Load these when relevant rather
214
+ than imposing mobile application setup on every component task.
215
+
216
+ Implement motion inside the owner using existing tokens and reduced-motion
217
+ policy. Use the project's existing driver, preserve documented exceptions, and
218
+ verify interruption and cleanup. Dedicated motion or stress-test skills can
219
+ help when installed; they are not required for this workflow. Use the real
220
+ public-API showcase and the checks below when they are unavailable.
221
+
222
+ Selected guidance adapts Emil Kowalski's design/mobile skills. Preserve its
223
+ [credits](README.md) and [MIT notice](LICENSE.upstream) with redistributed material.
224
+
225
+ ## Use the showcase as the design workspace
226
+
227
+ Discover the existing showcase and its run/build commands before visual work.
228
+ Open its MCP-reported URL to inspect the current design. If the installed tool
229
+ supports the built-in client, use it; add the project compiler/scenario adapters
230
+ needed for real previews instead of building another browser app.
231
+
232
+ The showcase is a minimal shell plus an MCP client and Apps host, supplied by ADS
233
+ tooling. It discovers Tokens/Components/Patterns/Composition entries through MCP
234
+ tools and renders their scenarios in the preview App. Navigation, theme and
235
+ pane/header visibility belong to the tool client. Do not create page files,
236
+ copy its shell into the project or assemble a second catalogue/rendering pipeline.
237
+
238
+ When MCP is connected, open the running URL from `ads_status`. Otherwise run the
239
+ installed `ads showcase` or the project's `dev:showcase` script. Do not launch a
240
+ second runtime/compiler for the same connected project. A configured project
241
+ preview watcher publishes a shared graph on first demand and after source
242
+ changes. The built-in client refreshes discovery and the active scenario in the
243
+ same App after a successful build. Shared runtime, foundation CSS, fonts and
244
+ selected scenario modules load through MCP
245
+ resources inside the sandboxed App. Never inject project styles/runtime into
246
+ the outer host. Keep the configured framework, compiler and mount/unmount adapter
247
+ consistent; scenario teardown must release owned timers, portals and workers.
248
+ The host shows errors and marks retained output as stale. Other hosts may need an
249
+ explicit preview-tool invocation. Compilation remains project-owned and required
250
+ for TSX/Linaria; it is automatic, not eliminated.
251
+
252
+ Reusable review layouts belong in public project ADS patterns, while scenario
253
+ files define no CSS, custom classes or widget replicas. Keep real presentation in
254
+ its component/pattern owner. The tooling shell's CSS is outside that project
255
+ contract. Legacy custom showcase pages may be retained during migration; new
256
+ projects require no TokensPage/ComponentsPage/PatternsPage/CompositionPage files.
257
+
258
+ Colocate `Scenario.tsx` and `fixture.ts` with tokens and each component/pattern; flat owners
259
+ may use `<Owner>.scenario.tsx` and `<Owner>.fixture.ts`. Put larger entries under
260
+ `composition/<Name>/Scenario.tsx` with their own `fixture.ts`. Export a default
261
+ zero-input mountable view and literal metadata, for example
262
+ `export const scenario = { title: "Button states", covers: ["Button"] };`.
263
+ Import the real UI from the public ADS alias. Keep fixture inputs, simulated
264
+ services and initial state/callback adapters beside the scenario. Empty fixtures
265
+ are valid for an entry with no inputs. Extra development helpers use a
266
+ `scenario/` or `fixtures/` subfolder, or `<Owner>.scenario-adapter.ts`, so guards
267
+ recognize their role even beside runtime code. Never require a page, router or store to
268
+ initialize the entry. Several contextual public parts may share one scenario.
269
+
270
+ IDs derive from ADS-relative filenames: both `components/core/Button/Scenario.tsx`
271
+ and `components/core/Button.scenario.tsx` identify `components/core/Button`.
272
+ Use one form, no duplicate IDs or hand-maintained registry. Renames change IDs.
273
+ The showcase and external hosts mount the same discovered entry. The Vite
274
+ adapter uses `previewEntriesPlugin` and `createPreviewResources` with
275
+ `runScenarioCompiler` to publish the shared graph. Its framework mount adapter
276
+ returns cleanup; the project owns rendering and Linaria extraction. The older
277
+ `scenarioRegistryPlugin` is only for retained legacy browsers. MCP discovers
278
+ metadata without importing executable TSX. Existing apps need an explicitly
279
+ integrated compiler; init alone adds no compiler or extraction setup.
280
+ Use `ads_scenarios` (query/kind/limit) and `ads_show_scenario({id})` to open an exact
281
+ entry. Check its build freshness; HTML delivery is not browser verification.
282
+ If Apps or resource forwarding are unavailable, open that scenario in the real
283
+ showcase, using the tool result's URL. Do not build a preview-only replica.
284
+
285
+ For a production screen, find and render the application's public screen pattern.
286
+ Its owner supplies structure, controls, layout and presentation. Scenario fixtures
287
+ supply data/state/callbacks. Move shared presentation into a pattern if needed,
288
+ preserving existing behavior and lazy imports, workers, caching and cancellation.
289
+ Do not reassemble an alternative screen or substitute placeholder content.
290
+ Screen reuse remains skill guidance, not a dedicated screen-parity lint.
291
+
292
+ Resolve `scenario-contract`, `scenario-render` and `scenario-coverage` findings
293
+ with meaningful entries. Every public renderable component and pattern needs an
294
+ addressable scenario, including unused exports; types/constants/utilities do not.
295
+ Only public render references reachable from the default entry count. Tests and
296
+ unused imports/functions do not. Static reachability does not prove successful
297
+ mounting, correct content, every branch/state or visual parity: open each affected
298
+ entry independently and verify real behavior at narrow/wide sizes in both themes.
299
+ The older `showcase-coverage` policy separately checks application references.
300
+
301
+ Token previews use that same scenario pipeline. Colocate a token scenario and
302
+ fixture under the configured token directory. Use static metadata
303
+ `{ title: "Typography", covers: ["TokenSamples"], tokens: fixture.tokens }` with
304
+ literal const fixture fields; names/sample text are fixture data, values come
305
+ from the real foundation CSS. Reuse a public project review pattern for styled
306
+ samples. The minimal starter's foundation value scenario can have `covers: []`.
307
+ Every declared token needs reachable scenario coverage; adding/removing a token
308
+ requires fixture updates. Fix `token-scenario-reference`, `token-scenario-render`
309
+ and `token-scenario-coverage` findings. Metadata and unused fixture fields do not
310
+ count. Discover exact token IDs with `ads_scenarios({kind:"tokens"})`; mount them
311
+ with `ads_show_scenario({id})` or `ads_show_tokens({category:id})`. With the shared
312
+ resource compiler, omitting category opens the first project token scenario.
313
+ Legacy compilers retain the generic definition inspector. Use `ads_tokens` for
314
+ source definitions and values; inspecting definitions does not prove UI parity.
315
+ The tool keeps the shared naming contract; sample templates and their token
316
+ lists belong to the project.
317
+
318
+ Scenarios, colocated fixtures and helpers are development-only. Never export them
319
+ from the runtime barrel or import them in production, including through aliases,
320
+ re-exports or dynamic imports. They may not import application stores, routers,
321
+ providers or HTTP clients. Live business data is application-owned; UI uses typed
322
+ inputs or injected services/callbacks. Direct global fetch/XHR/WebSocket/EventSource
323
+ is rejected; custom clients and computed access require review/project guards.
324
+ Use local simulated services in fixtures. Tests may import fixtures; load real
325
+ foundation CSS rather than assigning shared token values in JavaScript. Keep
326
+ full-app integration harnesses and workflow coverage in application test support.
327
+
328
+
329
+
330
+ Register component/project Oxlint plugins and rules in `ds.config.json`. Use
331
+ scoped `oxlint.overrides` for justified file-specific settings; never edit
332
+ `.ds/oxlintrc.json`. These overrides configure Oxlint, not the independent
333
+ architecture checks in `ads check`. Measured renderer properties and documented
334
+ non-state hooks use explicit `boundaries`; shared token writes and primitive
335
+ state overrides cannot be allowlisted. Add generic architectural protections to
336
+ ADS core and keep domain/component-specific rules registered in project setup.
337
+
338
+ Examples and composition scenarios must consume the same public components, patterns,
339
+ foundation CSS, and token values as the application. Scenario adapters may own sample data,
340
+ state, callbacks, and example selection. A missing reusable control or pattern
341
+ must be implemented/exported in its owning ADS layer, then imported through the
342
+ public API. Never finish a mock with a separately styled component replica.
343
+ The outer shell, navigation and theme controls belong to the tool client.
344
+ Scenario labels and sample layouts use known public ADS entities with defined
345
+ APIs, owned by project patterns. Keep review layouts minimal so they do not
346
+ influence the product design. Showcase/scenario
347
+ files define no CSS, custom class names, inline styling, or widget markup.
348
+ Use semantic fixture content and public entities; a missing frame/layout is an
349
+ explicit ADS pattern change. Component appearance, states, sizing policy,
350
+ accessibility, and motion stay in the shared owner.
351
+
352
+ Update examples when creating/changing components, patterns, or token values.
353
+ Include meaningful variants, difficult content, supported states, themes, and
354
+ container sizes. Run ADS and registered project guards for both app and showcase
355
+ builds; do not exclude scenarios or loosen ownership rules to make a demo pass.
356
+ For unchecked source formats or styling engines, retain the project's matching
357
+ guards and report the gap. A clean static check does not prove all UI is shared.
358
+
359
+ Inspect the rendered examples and relevant interactions. Fix shared design in
360
+ the implementation so the showcase and application receive it together. Give
361
+ the human a full running URL, or an exact command when the server is stopped,
362
+ and identify what is ready to review. Continue already-authorized work without
363
+ adding an approval step solely because a showcase exists.
364
+
365
+ ## Notifications when a local Toast exists
366
+
367
+ Read the local notification guide before using its API; the empty scaffold has
368
+ no Toast. Follow its host/provider mounting, routing, scope, duration, and focus
369
+ contracts instead of assuming Sonner compatibility or a particular native API.
370
+
371
+ Create transient notifications from client handlers/callbacks, rather than render
372
+ or server execution. Follow documented stable-ID policy for effects. Use the
373
+ component's promise/loading lifecycle API when available and settle manual
374
+ loading notifications on success and failure. Keep field errors and persistent
375
+ information in the relevant form, inline alert, or dialog.
376
+
377
+ Customize through local tokens and documented variants. Stacking, gestures,
378
+ measured geometry, and animation belong to the component. Register applicable
379
+ component-local usage rules in project tooling; do not assume the empty scaffold
380
+ includes them or that core tooling bundles this component.
381
+
382
+ ## Validate
383
+
384
+ Use the target's actual lint/typecheck/build commands. The empty scaffold provides:
385
+
386
+ ```sh
387
+ npm run typecheck
388
+ npm run build
389
+ ```
390
+
391
+ Run meaningful component/rule tests when behavior or enforcement changes.
392
+ Follow [references/cli.md](references/cli.md) to integrate the tool as a
393
+ development dependency in the target's actual lint/build pipeline. Initialization
394
+ already does this. Routine builds refresh configuration and run core checks
395
+ automatically; npx remains useful for bootstrap or ad hoc inspection. Core checks do
396
+ not replace framework type checking, component rules, or interaction tests.
397
+ For visual work, inspect the real project showcase, including keyboard/focus,
398
+ relevant pointer/touch behavior, dark theme, and reduced motion as needed.
399
+ A screenshot alone does not prove behavior or animation. Validate public imports,
400
+ CSS/asset resolution, required setup, and local documentation links.
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "ADS Designer"
3
+ short_description: "Bootstrap a local ADS or build UI with its public API"
4
+ default_prompt: "Use $ads-designer to build UI using this project’s local design system, or bootstrap an empty one."
@@ -0,0 +1,203 @@
1
+ # Design-system contract
2
+
3
+ This is the local contract for the copied starter. The project owns its source,
4
+ token values, and branding. Tool updates preserve those values and customized
5
+ code; source and theme imports are explicit operations.
6
+
7
+ For the architectural rationale, see the
8
+ [ADS architecture](https://github.com/reqvire-org/design-system/blob/main/docs/ARCHITECTURE.md).
9
+ The rules and commands needed to use this starter are included locally.
10
+
11
+ ## Ownership
12
+
13
+ | Layer | Owns | Location |
14
+ |-------|------|----------|
15
+ | Tokens | Colors, typography, spacing, radii, motion, elevation | `tokens/` |
16
+ | Primitives | Generic controls, states, interaction and accessibility | `components/` |
17
+ | Patterns | Reusable layout and composition | `patterns/` |
18
+ | Scenarios | Colocated development entries and inputs | Beside their owner; larger entries in `composition/` |
19
+ | Showcase host | Navigation and MCP client | Packaged ADS tooling |
20
+ | Preview compiler adapter | Framework mount/unmount and foundation imports | `showcase/mcp/` |
21
+ | Application | Domain data, routing, effects and callbacks | Consuming application |
22
+
23
+ The starter declares React in `ds.config.json`. Keep that choice, JSX, runtime
24
+ dependencies and the preview mount adapter consistent. Init records a choice for
25
+ an unconfigured project; it does not convert copied React source to Preact.
26
+
27
+ The starter has no components or patterns yet. Add only what the product needs.
28
+ Keep the ADS in root `design-system/`, beside application `src/`.
29
+ Keep public exports in `design-system/index.ts`; consumers use its `@ds` alias.
30
+ `styles.css` is the foundation CSS entry and contains token imports only.
31
+
32
+ ## Visual and interaction policy
33
+
34
+ Use semantic CSS tokens for visual values. Raw values belong in the token files.
35
+ Projects sharing this ADS use the same token names, meanings, and value types;
36
+ their concrete values and theme overrides can differ. Reuse existing local values
37
+ when importing components/patterns, add missing shared definitions, and import
38
+ source token values only when adopting that theme is requested.
39
+ Token names and prefixes are fixed by ADS architecture; foreign brand prefixes
40
+ are rejected. Shared assignments belong in token files. Components own
41
+ `--ds-*`, patterns `--ux-*`, and the showcase `--showcase-*`; token files cannot
42
+ assign those local variables or override component state.
43
+ Own primitive markup, focus, hover, selected, disabled, loading, and motion in
44
+ the primitive. Use typed props for variations. Keep reusable structure and skin
45
+ in colocated Linaria blocks using `css` and `cx` from `@linaria/atomic`.
46
+ Linaria is required for component and pattern styling. This starter already
47
+ configures extraction in both builds; `ads init` does not install or configure it.
48
+
49
+ Use `ads-*` classes and `--ds-*` variables for primitives, and `ux-*` for patterns,
50
+ including the ADS-owned frame. Scenario files define no CSS or custom
51
+ class names and must not target component internals. Avoid inline visual styles and arbitrary visual
52
+ string props. Omit `style` from inherited DOM prop types. Document narrow measured
53
+ geometry exceptions if a component needs them.
54
+
55
+ Use semantic HTML and test relevant keyboard/focus behavior. Motion should
56
+ consume duration/easing tokens and respect reduced motion. Brand changes belong
57
+ in tokens or documented component hooks. The starter uses system fonts and has
58
+ no icon component; add a shared icon primitive when it is needed.
59
+
60
+ ## Showcase
61
+
62
+ The showcase is a minimal shell plus an MCP client and Apps host, shipped with
63
+ ADS tooling. It discovers token/component/pattern/composition
64
+ scenarios from MCP tool results, invokes preview tools and responds to resource
65
+ notifications. The project does not author a second catalogue or browser app.
66
+
67
+ `ads mcp` starts the loopback website alongside stdio. Open the URL returned by
68
+ `ads_status`. Without an agent connection, `ads showcase` starts the same runtime
69
+ for browser use. Both transports share one configured preview compiler.
70
+
71
+ The shell owns section tabs, collapsible navigation, theme controls and the App
72
+ slot. Components, patterns, token values, scenarios, fixtures and their Linaria
73
+ styles remain project-owned. Only the sandboxed App loads and applies project
74
+ runtime, CSS and fonts, through MCP resources. App presentation comes from the
75
+ selected compiled scenario; reusable review layouts live in public ADS patterns. Do not recreate
76
+ production widgets inside the client or scenario.
77
+
78
+ There are four sections: Tokens, Components, Patterns and Composition. There are
79
+ no required `TokensPage`/`ComponentsPage`/`PatternsPage`/`CompositionPage` files.
80
+ Legacy custom browsing pages remain checked when present, but new projects use
81
+ the built-in client. Its tooling CSS is separate from the project style contract.
82
+
83
+ The shared resource compiler builds one graph for all discovered scenarios on
84
+ first demand. Selections reuse the App and load their dependency closure. The
85
+ project's `mountScenario(Scenario, container)` adapter returns an unmount callback
86
+ that releases owned roots, listeners, timers, portals and workers. Switching or
87
+ rebuilding a scenario resets its state while retaining unchanged shared modules.
88
+ Host context selects the project theme; it does not replace the project's skin.
89
+
90
+
91
+ Colocate development entries and fixture inputs:
92
+
93
+ ```text
94
+ design-system/
95
+ tokens/
96
+ typography.css
97
+ Typography.scenario.tsx
98
+ Typography.fixture.ts
99
+ components/core/Button/
100
+ Button.tsx
101
+ Scenario.tsx
102
+ fixture.ts
103
+ patterns/Editor/
104
+ Editor.tsx
105
+ Scenario.tsx
106
+ fixture.ts
107
+ composition/Workspace/
108
+ Scenario.tsx
109
+ fixture.ts
110
+ showcase/mcp/ Project compiler adapter
111
+ main.tsx
112
+ ```
113
+
114
+ Flat owners may use `Button.scenario.tsx` and `Button.fixture.ts` instead.
115
+ `Scenario.tsx` exports a default independently mountable view and literal metadata
116
+ `export const scenario = { title: "Button states", covers: ["Button"] };`.
117
+ Token entries under the configured token directory also declare `tokens`:
118
+ `export const scenario = { title: "Typography", covers: ["TokenSamples"], tokens: fixture.tokens };`.
119
+ Metadata may read literal const fixture fields; it cannot run expressions,
120
+ functions, wildcard lists or token discovery. The same fixture list must be
121
+ consumed by the default entry. `covers: []` is valid for a minimal token value
122
+ inspection entry without public UI; styled samples use a real public review
123
+ pattern. Names and sample text belong to the fixture, values to foundation CSS.
124
+ It imports real public UI through `@ds` and its local fixture. The adapter supplies
125
+ initial state, callbacks and simulated services. The default entry needs no
126
+ mandatory caller inputs or prior page initialization. Related parts may share a
127
+ scenario containing their required public parent. Larger composition scenarios
128
+ reuse production screen patterns; that screen reuse remains skill guidance.
129
+
130
+ IDs derive from the ADS-relative path: `components/core/Button/Scenario.tsx` and
131
+ `components/core/Button.scenario.tsx` both identify `components/core/Button`.
132
+ Use one form per owner. Renaming moves the ID. No manually assigned ID or parallel
133
+ registry is maintained. Fixture files use `fixture.ts`/`<Owner>.fixture.ts`; JS,
134
+ TSX or JSON equivalents are supported. An empty fixture is valid without inputs. Extra development helpers use
135
+ `scenario/` or `fixtures/` subfolders, or `<Owner>.scenario-adapter.ts`.
136
+
137
+ `scenario-contract`, `scenario-render` and `scenario-coverage` checks require valid
138
+ entries and reachable public render references for every public renderable
139
+ component/pattern, including unused exports and Linaria styled exports. Types, constants and utility functions
140
+ are excluded. Coverage is a static source policy; it does not prove runtime
141
+ mounting, correct props, every branch/state or visual parity. The older
142
+ `showcase-coverage` policy also checks application render references.
143
+
144
+ `token-scenario-reference` rejects undeclared token names in metadata and reachable
145
+ inputs. `token-scenario-render` rejects claimed tokens with no reachable input
146
+ reference; `token-scenario-coverage` requires every discovered foundation token
147
+ to have coverage. A new or removed token therefore needs a scenario/fixture
148
+ update. All three are errors in `ads check`, run by `lint:ds` and the build.
149
+ Coverage is static reachability, not proof that every branch actually renders
150
+ or applies the right CSS property. Browser review still verifies the samples.
151
+
152
+ Scenarios and fixture helpers are development-only wherever colocated. Runtime
153
+ source and the public barrel cannot import or re-export them. Showcase/scenario
154
+ code defines no CSS, custom classes or native controls; use public ADS APIs.
155
+ Neither ADS implementations nor scenarios import application code. Live business
156
+ data belongs to application adapters; ADS receives inputs or injected callbacks.
157
+ Direct global `fetch`, XHR, WebSocket and EventSource use is rejected. Renderer
158
+ workers, lazy imports and injected services remain supported; custom HTTP clients
159
+ and computed API access need project checks and review.
160
+
161
+ Tests may import local fixtures. Load real foundation CSS in DOM/browser tests
162
+ instead of assigning shared tokens in JavaScript. Full application harnesses
163
+ belong in application test support. Run ADS/project checks before application,
164
+ preview builds; review meaningful states in both themes and sizes.
165
+
166
+ ## Branding
167
+
168
+ Keep original artwork, variants, usage, credits, and licenses in
169
+ `design-system/assets/brand/`. This starter has only guidance there, no artwork.
170
+ Font assets belong in `assets/fonts/`; add optional `tokens/fonts.css` first in
171
+ the import-only foundation entry. The fixed import order is fonts (when
172
+ present), colors, typography, spacing, elevation, base.
173
+
174
+ Select an SVG with `assets.iconSource` in `ds.config.json`, relative to the ADS
175
+ folder. Initialized builds run checks and Oxlint, then `ads assets`, then existing
176
+ build steps. Standard icons go into ignored `.ds/assets/`; integrate that
177
+ directory with the application's asset mount and reject duplicate paths.
178
+ Application metadata and custom platform exports remain project-owned. See
179
+ [brand guidance](design-system/assets/brand/README.md).
180
+
181
+ ## Component guides and rules
182
+
183
+ Keep detailed API, examples, interactions, token hooks, tests, and source credits
184
+ in a README beside the component. When adapting another library, record its
185
+ version, author, links, concrete influences, and agreed differences. Shared
186
+ architecture belongs here rather than duplicating each component contract.
187
+
188
+ General Oxlint and Biome CSS checks are included. They do not enforce the entire
189
+ ownership or token contract. Add component-local lint only for concrete,
190
+ statically provable misuse; register tooling centrally and keep it outside the
191
+ runtime barrel. Core checks must work without any particular component library.
192
+ Use configured token and ownership guards as the system grows; bring applicable
193
+ component-specific rules with an external item and register them in project
194
+ tooling. Configure project plugins, rules, and scoped `oxlint.overrides` in
195
+ `ds.config.json`. Overrides configure Oxlint, not independent `ads check` policies.
196
+ Use explicit `boundaries` for documented renderer properties and non-state hooks.
197
+
198
+ ## Verification
199
+
200
+ Run `npm run build` after adding or changing components. Add meaningful tests
201
+ for stateful behavior, accessibility, gestures, or async lifecycle where needed.
202
+ Run `npm run dev` to inspect the real showcase. A screenshot alone does not
203
+ verify interaction or animation. Generated output and dependencies are not source.