@reqvire-org/ads 0.4.6 → 0.5.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 (1071) hide show
  1. package/README.md +265 -420
  2. package/dist/accessibility-declarations.mjs +43 -0
  3. package/dist/active-clock.d.mts +30 -0
  4. package/dist/active-clock.mjs +26 -17
  5. package/dist/ads-errors.mjs +3421 -0
  6. package/dist/ads-view-choices.mjs +17 -0
  7. package/dist/ads-views.mjs +12 -0
  8. package/dist/analysis/captured-content.mjs +16 -0
  9. package/dist/analysis/compiler-options.mjs +3 -7
  10. package/dist/analysis/context.mjs +14 -20
  11. package/dist/analysis/controller-gates.mjs +119 -0
  12. package/dist/analysis/design-usage.mjs +126 -0
  13. package/dist/analysis/file-tree.mjs +44 -29
  14. package/dist/analysis/framework-imports.mjs +62 -0
  15. package/dist/analysis/glyph-macros.mjs +103 -0
  16. package/dist/analysis/helpers.mjs +119 -91
  17. package/dist/analysis/impact.mjs +25 -12
  18. package/dist/analysis/inputs.mjs +19 -13
  19. package/dist/analysis/mock-check.mjs +98 -0
  20. package/dist/analysis/module-graph.mjs +156 -0
  21. package/dist/analysis/module-resolvers.mjs +30 -28
  22. package/dist/analysis/native-adapter.mjs +139 -146
  23. package/dist/analysis/native-boundary.mjs +52 -0
  24. package/dist/analysis/native-project.mjs +331 -231
  25. package/dist/analysis/native-session.mjs +20 -0
  26. package/dist/analysis/owner-accessibility.mjs +74 -0
  27. package/dist/analysis/owner-analysis-cache.mjs +125 -0
  28. package/dist/analysis/owner-analysis-key.mjs +114 -0
  29. package/dist/analysis/owner-choices.mjs +763 -0
  30. package/dist/analysis/owner-composition.mjs +612 -0
  31. package/dist/analysis/owner-discovery.mjs +164 -0
  32. package/dist/analysis/owner-failures.mjs +19 -0
  33. package/dist/analysis/owner-outcomes.mjs +42 -0
  34. package/dist/analysis/owner-reuse.mjs +100 -0
  35. package/dist/analysis/owner-source.mjs +1506 -0
  36. package/dist/analysis/public-imports.mjs +31 -0
  37. package/dist/analysis/queries.mjs +72 -54
  38. package/dist/analysis/runtime-setters.mjs +114 -0
  39. package/dist/analysis/scenario-keys.mjs +151 -0
  40. package/dist/analysis/service.mjs +111 -70
  41. package/dist/analysis/standalone.mjs +40 -37
  42. package/dist/analysis/styling-ownership.mjs +276 -0
  43. package/dist/analysis/svg-attributes.mjs +199 -0
  44. package/dist/analysis/syntax.mjs +82 -78
  45. package/dist/analysis/visual-bindings.mjs +68 -0
  46. package/dist/analysis/worker-protocol.mjs +302 -0
  47. package/dist/analysis/worker.mjs +234 -166
  48. package/dist/api-signature.mjs +53 -0
  49. package/dist/app-icon-checks.mjs +298 -0
  50. package/dist/app-icon-declaration.d.mts +53 -0
  51. package/dist/app-icon-declaration.mjs +66 -0
  52. package/dist/asset-binding.mjs +35 -0
  53. package/dist/asset-catalog.mjs +83 -0
  54. package/dist/asset-declaration.d.mts +42 -0
  55. package/dist/asset-declaration.mjs +108 -0
  56. package/dist/asset-macro.d.mts +63 -0
  57. package/dist/asset-macro.mjs +22 -0
  58. package/dist/asset-model.mjs +74 -0
  59. package/dist/asset-usage.mjs +14 -0
  60. package/dist/asset-view-facts.mjs +41 -0
  61. package/dist/authoring-macro.d.mts +11 -0
  62. package/dist/authoring-macro.mjs +21 -0
  63. package/dist/autocomplete-hints.mjs +31 -0
  64. package/dist/availability.mjs +9 -0
  65. package/dist/behavior-macro.d.mts +31 -0
  66. package/dist/behavior-macro.mjs +3 -0
  67. package/dist/behavior-registry.mjs +358 -0
  68. package/dist/boundaries.mjs +50 -212
  69. package/dist/browser-runtime.mjs +73 -0
  70. package/dist/browser-test.d.mts +3 -0
  71. package/dist/browser-test.mjs +2 -0
  72. package/dist/bun-bundler.mjs +10 -0
  73. package/dist/bun-compiler.mjs +30 -18
  74. package/dist/bun-runtime.mjs +4 -0
  75. package/dist/bun-worker.mjs +10 -4
  76. package/dist/capture/request.mjs +81 -0
  77. package/dist/capture/worker.mjs +69 -40
  78. package/dist/capture/worker.page.mjs +6 -0
  79. package/dist/capture-store.mjs +159 -75
  80. package/dist/capture.mjs +232 -95
  81. package/dist/check-service.mjs +27 -33
  82. package/dist/check.mjs +200 -904
  83. package/dist/cli-arguments.mjs +278 -0
  84. package/dist/cli.mjs +374 -304
  85. package/dist/color-values.mjs +294 -242
  86. package/dist/composed-contrast.mjs +628 -0
  87. package/dist/config.mjs +162 -454
  88. package/dist/construction-output.mjs +217 -0
  89. package/dist/construction-spec.d.mts +712 -0
  90. package/dist/construction-spec.mjs +937 -0
  91. package/dist/css-length.mjs +80 -0
  92. package/dist/css-quantity.mjs +173 -0
  93. package/dist/deletion-model.mjs +56 -0
  94. package/dist/deletion-plan.mjs +364 -0
  95. package/dist/dependency-manifest.mjs +56 -0
  96. package/dist/design-context-model.d.mts +61 -0
  97. package/dist/design-context-model.mjs +79 -0
  98. package/dist/design-contexts.mjs +105 -0
  99. package/dist/design-foundation.mjs +527 -0
  100. package/dist/design-inputs.mjs +156 -0
  101. package/dist/design-modules.mjs +27 -0
  102. package/dist/design-rejection.d.mts +23 -0
  103. package/dist/design-rejection.mjs +29 -0
  104. package/dist/design-system-closure.mjs +108 -0
  105. package/dist/design-usage.mjs +48 -0
  106. package/dist/development-modules.mjs +2 -0
  107. package/dist/development-runtime.mjs +0 -7
  108. package/dist/digest.mjs +2 -0
  109. package/dist/draft-boundary.mjs +1 -27
  110. package/dist/draft-workspace.mjs +11 -5
  111. package/dist/emit/accept.mjs +33 -0
  112. package/dist/emit/app-icon-emission.mjs +124 -0
  113. package/dist/emit/app-icon-render.mjs +126 -0
  114. package/dist/emit/asset-imports.mjs +18 -0
  115. package/dist/emit/cli-report.mjs +97 -0
  116. package/dist/emit/contract.mjs +136 -0
  117. package/dist/emit/emission.mjs +175 -0
  118. package/dist/emit/font-emission.mjs +91 -0
  119. package/dist/emit/foundation-sheet.mjs +55 -0
  120. package/dist/emit/icon-containers.mjs +46 -0
  121. package/dist/emit/integrity.mjs +61 -0
  122. package/dist/emit/lock.mjs +66 -0
  123. package/dist/emit/namespace.mjs +79 -0
  124. package/dist/emit/operation-reply.mjs +3 -0
  125. package/dist/emit/operation.mjs +36 -0
  126. package/dist/emit/output-location.mjs +20 -0
  127. package/dist/emit/output-package.mjs +7 -0
  128. package/dist/emit/owner-emission-cache.mjs +52 -0
  129. package/dist/emit/palette-module.mjs +19 -0
  130. package/dist/emit/palette-refresh.mjs +77 -0
  131. package/dist/emit/preview-emitter.mjs +110 -0
  132. package/dist/emit/preview-tree.mjs +174 -0
  133. package/dist/emit/scheduler.mjs +75 -0
  134. package/dist/emit/service.mjs +249 -0
  135. package/dist/emit/sync.mjs +38 -0
  136. package/dist/emit/watch.mjs +74 -0
  137. package/dist/emit/writer.mjs +102 -0
  138. package/dist/evidence.mjs +6 -8
  139. package/dist/example-babel.mjs +7 -0
  140. package/dist/example-literals.mjs +88 -0
  141. package/dist/finding-rules.mjs +71 -77
  142. package/dist/focus-checks.mjs +93 -0
  143. package/dist/font-checks.mjs +143 -0
  144. package/dist/font-declaration.d.mts +54 -0
  145. package/dist/font-declaration.mjs +77 -0
  146. package/dist/font-macro.d.mts +32 -0
  147. package/dist/font-macro.mjs +6 -0
  148. package/dist/font-model.mjs +37 -0
  149. package/dist/form-states.mjs +82 -0
  150. package/dist/foundation-macro.d.mts +108 -0
  151. package/dist/foundation-macro.mjs +6 -0
  152. package/dist/frame-regions.mjs +190 -0
  153. package/dist/glyph-set-declaration.d.mts +27 -0
  154. package/dist/glyph-set-declaration.mjs +36 -0
  155. package/dist/grid-checks.mjs +94 -0
  156. package/dist/grid-facts.mjs +92 -0
  157. package/dist/grid-lowering.mjs +257 -0
  158. package/dist/guard/cli.mjs +51 -0
  159. package/dist/guard/config.mjs +67 -0
  160. package/dist/guard/files.mjs +31 -0
  161. package/dist/guard/index.mjs +3 -0
  162. package/dist/guard/run.mjs +56 -0
  163. package/dist/guard/tsconfig.declarations.json +13 -0
  164. package/dist/index.mjs +2 -7
  165. package/dist/init-project.mjs +134 -0
  166. package/dist/init.mjs +225 -261
  167. package/dist/input-digests.mjs +216 -0
  168. package/dist/input-scope.mjs +18 -41
  169. package/dist/inspected-svg.d.mts +28 -0
  170. package/dist/inspected-svg.mjs +40 -0
  171. package/dist/inventories.mjs +149 -0
  172. package/dist/inventory-query.mjs +15 -0
  173. package/dist/investigations.mjs +177 -99
  174. package/dist/json.d.mts +10 -0
  175. package/dist/json.mjs +36 -0
  176. package/dist/linaria/atomic-processor.json +96 -0
  177. package/dist/linaria/atomic-processor.mjs +2452 -0
  178. package/dist/linaria/backend-identity.mjs +26 -0
  179. package/dist/linaria/compatibility.json +61 -0
  180. package/dist/linaria/css-shape.mjs +94 -0
  181. package/dist/linaria/custom-property-css.mjs +56 -0
  182. package/dist/linaria/delivery.mjs +111 -0
  183. package/dist/linaria/direct-extract.mjs +43 -0
  184. package/dist/linaria/extraction-cache.mjs +31 -0
  185. package/dist/linaria/extraction-model.mjs +5 -0
  186. package/dist/linaria/fingerprint.mjs +183 -0
  187. package/dist/linaria/pair-manifest.json +2315 -0
  188. package/dist/linaria/persisted-extraction-cache.mjs +352 -0
  189. package/dist/linaria/preservation.mjs +13 -0
  190. package/dist/linaria/priority-emitted-rank.mjs +40 -0
  191. package/dist/linaria/priority-manifest.mjs +87 -0
  192. package/dist/linaria/priority-table.mjs +47 -0
  193. package/dist/linaria/priority-tiers.mjs +27 -0
  194. package/dist/linaria/processor-host.mjs +42 -0
  195. package/dist/linaria/processor-runtime.mjs +36 -0
  196. package/dist/linaria-processor-NOTICES.md +147 -0
  197. package/dist/lowering-components.mjs +14 -0
  198. package/dist/lowering-effects.mjs +38 -0
  199. package/dist/lowering-emitter.mjs +29 -0
  200. package/dist/lowering-hidden.mjs +30 -0
  201. package/dist/lowering-layer.mjs +141 -0
  202. package/dist/lowering-motion.mjs +37 -0
  203. package/dist/lowering-normalize.mjs +194 -0
  204. package/dist/lowering-overlaps.mjs +328 -0
  205. package/dist/lowering-paint.mjs +32 -0
  206. package/dist/lowering-properties.mjs +144 -0
  207. package/dist/lowering-region-layout.mjs +191 -0
  208. package/dist/lowering-serialize.mjs +40 -0
  209. package/dist/lowering-session.mjs +130 -0
  210. package/dist/lowering-tiers.mjs +23 -0
  211. package/dist/lowering-transitions.mjs +39 -0
  212. package/dist/mcp/ads-mcp.mjs +423 -0
  213. package/dist/mcp/apps.mjs +3 -25
  214. package/dist/mcp/behavior-pages.mjs +58 -51
  215. package/dist/mcp/build-status.mjs +242 -254
  216. package/dist/mcp/catalog.mjs +21 -128
  217. package/dist/mcp/compiler-channel.mjs +280 -0
  218. package/dist/mcp/context.mjs +50 -40
  219. package/dist/mcp/deletions.mjs +147 -0
  220. package/dist/mcp/draft-discovery.mjs +43 -38
  221. package/dist/mcp/drafts.mjs +654 -755
  222. package/dist/mcp/execution-context.mjs +33 -22
  223. package/dist/mcp/execution-coordinator.mjs +367 -354
  224. package/dist/mcp/execution-results.mjs +440 -173
  225. package/dist/mcp/mutation-limits.mjs +1 -2
  226. package/dist/mcp/mutations.mjs +515 -553
  227. package/dist/mcp/patch.mjs +117 -75
  228. package/dist/mcp/preview-http.bundle.js +3 -7
  229. package/dist/mcp/preview-http.mjs +220 -107
  230. package/dist/mcp/preview-owner-guard.mjs +81 -43
  231. package/dist/mcp/preview-watch.mjs +492 -353
  232. package/dist/mcp/preview-widget.bundle.js +42 -46
  233. package/dist/mcp/preview-work.mjs +25 -13
  234. package/dist/mcp/prompts.mjs +22 -16
  235. package/dist/mcp/resource-loader.js +1 -1
  236. package/dist/mcp/result-pages.mjs +94 -54
  237. package/dist/mcp/sandbox-host.mjs +41 -19
  238. package/dist/mcp/server-discovery.mjs +96 -0
  239. package/dist/mcp/server-guides.mjs +43 -0
  240. package/dist/mcp/server-host.mjs +203 -0
  241. package/dist/mcp/server-observation.mjs +225 -0
  242. package/dist/mcp/server-project.mjs +371 -0
  243. package/dist/mcp/server-resources.mjs +466 -0
  244. package/dist/mcp/server-shared.mjs +79 -0
  245. package/dist/mcp/server-tools.mjs +791 -0
  246. package/dist/mcp/server.mjs +2 -2794
  247. package/dist/mcp/showcase-host.mjs +209 -135
  248. package/dist/mcp/showcase-http.mjs +50 -28
  249. package/dist/mcp/skills.mjs +32 -36
  250. package/dist/mcp/text-diff.mjs +18 -36
  251. package/dist/measured-geometry.mjs +157 -0
  252. package/dist/motion-model.mjs +50 -0
  253. package/dist/non-text-contrast.mjs +118 -0
  254. package/dist/owner-analysis-check.mjs +651 -0
  255. package/dist/owner-design.mjs +15 -0
  256. package/dist/owner-errors.mjs +200 -0
  257. package/dist/owner-lowering.mjs +186 -0
  258. package/dist/owner-scenarios.mjs +832 -0
  259. package/dist/ownership-model.d.mts +6 -0
  260. package/dist/ownership-model.mjs +124 -0
  261. package/dist/package-declarations.mjs +34 -0
  262. package/dist/paint-contrast.mjs +181 -0
  263. package/dist/palette-generated.mjs +101 -116
  264. package/dist/pictogram-model.mjs +13 -51
  265. package/dist/placeholder-contrast.mjs +34 -0
  266. package/dist/platform-features.mjs +377 -0
  267. package/dist/press-scale.mjs +26 -0
  268. package/dist/preview-bun.mjs +335 -406
  269. package/dist/preview-compile-inputs.mjs +78 -0
  270. package/dist/preview-contexts.mjs +7 -0
  271. package/dist/preview-failure.mjs +20 -10
  272. package/dist/preview-files.mjs +18 -36
  273. package/dist/preview-imports.mjs +76 -70
  274. package/dist/preview-incremental.mjs +322 -222
  275. package/dist/preview-inputs.mjs +28 -19
  276. package/dist/preview-manifest-update.mjs +67 -49
  277. package/dist/preview-requests.mjs +10 -17
  278. package/dist/preview-resources.mjs +275 -323
  279. package/dist/preview-scope.mjs +15 -17
  280. package/dist/preview-source.mjs +182 -0
  281. package/dist/preview-spatial.mjs +27 -0
  282. package/dist/profile-macro.d.mts +41 -0
  283. package/dist/profile-macro.mjs +6 -0
  284. package/dist/profile-model.d.mts +65 -0
  285. package/dist/profile-model.mjs +213 -0
  286. package/dist/profile-view-facts.mjs +42 -0
  287. package/dist/program-cache.mjs +9 -7
  288. package/dist/project-boundary.mjs +8 -13
  289. package/dist/project-documents.mjs +25 -29
  290. package/dist/property-registrations.mjs +44 -35
  291. package/dist/public-catalog.mjs +76 -0
  292. package/dist/recipe-defaults.mjs +117 -0
  293. package/dist/recipe-macro.d.mts +400 -0
  294. package/dist/recipe-macro.mjs +23 -0
  295. package/dist/recipe-model.d.mts +26 -0
  296. package/dist/recipe-model.mjs +190 -0
  297. package/dist/region-lowering.mjs +523 -0
  298. package/dist/registration-css.mjs +41 -0
  299. package/dist/registration-roles.mjs +35 -0
  300. package/dist/render-audit/axe-run.page.mjs +28 -0
  301. package/dist/render-audit/first-render.page.mjs +35 -0
  302. package/dist/render-audit/image-shape.page.mjs +42 -0
  303. package/dist/render-audit/layout-overflow.page.mjs +240 -0
  304. package/dist/render-audit/layout-shift.page.mjs +36 -0
  305. package/dist/render-audit/non-text-contrast.page.mjs +138 -0
  306. package/dist/render-audit/render-states.mjs +66 -293
  307. package/dist/render-audit/render-states.page.mjs +177 -0
  308. package/dist/render-audit/text-scale.mjs +42 -0
  309. package/dist/render-audit/text-scale.page.mjs +25 -0
  310. package/dist/render-audit/worker.mjs +125 -112
  311. package/dist/render-audit/worker.page.mjs +21 -0
  312. package/dist/render-audit.mjs +465 -500
  313. package/dist/resource-limits.mjs +185 -212
  314. package/dist/result.d.mts +34 -0
  315. package/dist/result.mjs +60 -0
  316. package/dist/role-vocabulary.d.mts +224 -0
  317. package/dist/role-vocabulary.mjs +223 -0
  318. package/dist/runtime-paint-contrast.mjs +97 -0
  319. package/dist/runtime-paint.mjs +42 -0
  320. package/dist/runtime-requirements.mjs +10 -11
  321. package/dist/runtime-style.mjs +21 -0
  322. package/dist/scenario-groups.mjs +42 -33
  323. package/dist/scenario-inspector.mjs +4 -4
  324. package/dist/scenario-kit.d.mts +79 -0
  325. package/dist/scenario-kit.mjs +18 -0
  326. package/dist/scenario-registry-model.mjs +2 -0
  327. package/dist/scenario-registry.mjs +89 -108
  328. package/dist/scenarios-compiler.mjs +901 -642
  329. package/dist/showcase/ads-views.mjs +103 -0
  330. package/dist/showcase/assets-view.mjs +221 -0
  331. package/dist/showcase/client.bundle.js +222 -59
  332. package/dist/showcase/guide-controls.d.mts +28 -0
  333. package/dist/showcase/guide-controls.mjs +31 -0
  334. package/dist/showcase/http-client.bundle.js +172 -9
  335. package/dist/showcase/index.html +1 -1
  336. package/dist/showcase/preview-frame.css +16 -0
  337. package/dist/showcase/preview-frame.d.mts +5 -0
  338. package/dist/showcase/preview-frame.mjs +4 -0
  339. package/dist/showcase/preview-root.d.mts +2 -0
  340. package/dist/showcase/preview-root.mjs +9 -0
  341. package/dist/showcase/profiles-view.mjs +280 -0
  342. package/dist/showcase/project-rules.mjs +9 -0
  343. package/dist/showcase/sandbox.bundle.js +1 -1
  344. package/dist/showcase/scenario-page.d.mts +39 -0
  345. package/dist/showcase/scenario-page.mjs +90 -0
  346. package/dist/showcase/style.css +2 -0
  347. package/dist/showcase/token-sample.mjs +46 -0
  348. package/dist/showcase/tokens-view.mjs +185 -0
  349. package/dist/showcase/ui/apple-touch-icon-9zwv3w79.png +0 -0
  350. package/dist/showcase/{favicon.ico → ui/favicon-c2c9kvtf.ico} +0 -0
  351. package/dist/showcase/ui/icon-192-t5zh7mxx.png +0 -0
  352. package/dist/showcase/ui/icon-512-ed6yz0n0.png +0 -0
  353. package/dist/showcase/ui/ui.css +1 -1353
  354. package/dist/showcase/ui/ui.js +165 -1064
  355. package/dist/showcase-http-routes.mjs +28 -21
  356. package/dist/skills/README.md +26 -26
  357. package/dist/skills/ads-designer/README.md +1 -1
  358. package/dist/skills/ads-designer/SKILL.md +311 -550
  359. package/dist/skills/ads-designer/references/accessibility.md +162 -114
  360. package/dist/skills/ads-designer/references/atomic-styles.md +61 -273
  361. package/dist/skills/ads-designer/references/behaviors.md +144 -278
  362. package/dist/skills/ads-designer/references/branding.md +132 -222
  363. package/dist/skills/ads-designer/references/captures.md +13 -7
  364. package/dist/skills/ads-designer/references/cli.md +80 -63
  365. package/dist/skills/ads-designer/references/contracts.md +218 -286
  366. package/dist/skills/ads-designer/references/design-craft.md +1 -1
  367. package/dist/skills/ads-designer/references/design-data.md +299 -323
  368. package/dist/skills/ads-designer/references/drafts.md +83 -22
  369. package/dist/skills/ads-designer/references/evidence.md +2 -1
  370. package/dist/skills/ads-designer/references/forms.md +199 -0
  371. package/dist/skills/ads-designer/references/guarded-editing.md +37 -48
  372. package/dist/skills/ads-designer/references/layers.md +64 -76
  373. package/dist/skills/ads-designer/references/layout.md +185 -330
  374. package/dist/skills/ads-designer/references/mobile.md +2 -2
  375. package/dist/skills/ads-designer/references/motion.md +30 -25
  376. package/dist/skills/ads-designer/references/performance.md +48 -49
  377. package/dist/skills/ads-designer/references/pictograms.md +62 -127
  378. package/dist/skills/ads-designer/references/recipes.md +307 -0
  379. package/dist/skills/ads-designer/references/review.md +51 -95
  380. package/dist/skills/ads-designer/references/runtimes.md +34 -33
  381. package/dist/skills/ads-designer/references/scenarios.md +255 -216
  382. package/dist/skills/ads-designer/references/stress-test.md +13 -5
  383. package/dist/skills/ads-designer/references/validation.md +28 -21
  384. package/dist/skills/ads-designer/references/workflows.md +7 -5
  385. package/dist/skills/ads-import/SKILL.md +29 -29
  386. package/dist/skills/ads-import/references/atomic-styles.md +61 -273
  387. package/dist/skills/ads-import/references/behaviors.md +144 -278
  388. package/dist/skills/ads-import/references/branding.md +24 -41
  389. package/dist/skills/ads-import/references/captures.md +13 -7
  390. package/dist/skills/ads-import/references/cli.md +80 -63
  391. package/dist/skills/ads-import/references/compatibility.md +3 -3
  392. package/dist/skills/ads-import/references/contracts.md +218 -286
  393. package/dist/skills/ads-import/references/design-data.md +299 -323
  394. package/dist/skills/ads-import/references/drafts.md +83 -22
  395. package/dist/skills/ads-import/references/evidence.md +2 -1
  396. package/dist/skills/ads-import/references/forms.md +199 -0
  397. package/dist/skills/ads-import/references/guarded-editing.md +37 -48
  398. package/dist/skills/ads-import/references/implementation.md +20 -20
  399. package/dist/skills/ads-import/references/layers.md +64 -76
  400. package/dist/skills/ads-import/references/layout.md +185 -330
  401. package/dist/skills/ads-import/references/recipes.md +307 -0
  402. package/dist/skills/ads-import/references/review.md +51 -95
  403. package/dist/skills/ads-import/references/runtimes.md +34 -33
  404. package/dist/skills/ads-import/references/scenarios.md +255 -216
  405. package/dist/skills/ads-import/references/tokens.md +26 -17
  406. package/dist/skills/ads-import/references/validation.md +28 -21
  407. package/dist/skills/ads-import/references/workflows.md +7 -5
  408. package/dist/skills/ads-migrate/SKILL.md +20 -5
  409. package/dist/skills/ads-migrate/references/0.4.1-to-0.4.2.md +6 -0
  410. package/dist/skills/ads-migrate/references/0.4.6-to-0.4.7.md +46 -0
  411. package/dist/skills/ads-migrate/references/0.4.7-to-0.5.0-boundary.md +71 -0
  412. package/dist/skills/ads-migrate/references/0.4.7-to-0.5.0-grid.md +204 -0
  413. package/dist/skills/ads-migrate/references/0.4.7-to-0.5.0.md +727 -0
  414. package/dist/skills/ads-port/SKILL.md +27 -28
  415. package/dist/skills/ads-port/references/atomic-styles.md +61 -273
  416. package/dist/skills/ads-port/references/behaviors.md +144 -278
  417. package/dist/skills/ads-port/references/captures.md +13 -7
  418. package/dist/skills/ads-port/references/cli.md +80 -63
  419. package/dist/skills/ads-port/references/contracts.md +218 -286
  420. package/dist/skills/ads-port/references/design-data.md +299 -323
  421. package/dist/skills/ads-port/references/drafts.md +83 -22
  422. package/dist/skills/ads-port/references/evidence.md +2 -1
  423. package/dist/skills/ads-port/references/forms.md +199 -0
  424. package/dist/skills/ads-port/references/guarded-editing.md +37 -48
  425. package/dist/skills/ads-port/references/layers.md +64 -76
  426. package/dist/skills/ads-port/references/layout.md +185 -330
  427. package/dist/skills/ads-port/references/lint-and-docs.md +2 -3
  428. package/dist/skills/ads-port/references/native-implementation.md +23 -33
  429. package/dist/skills/ads-port/references/recipes.md +307 -0
  430. package/dist/skills/ads-port/references/review.md +51 -95
  431. package/dist/skills/ads-port/references/runtimes.md +34 -33
  432. package/dist/skills/ads-port/references/scenarios.md +255 -216
  433. package/dist/skills/ads-port/references/validation.md +28 -21
  434. package/dist/skills/ads-port/references/workflows.md +7 -5
  435. package/dist/source-inventory.mjs +33 -0
  436. package/dist/source-values.mjs +272 -262
  437. package/dist/spatial-css.mjs +403 -0
  438. package/dist/spatial-metadata.mjs +11 -11
  439. package/dist/spatial-model.mjs +422 -0
  440. package/dist/spatial-reading.mjs +127 -0
  441. package/dist/stage-timing.mjs +27 -0
  442. package/dist/starter-files.mjs +155 -0
  443. package/dist/starter-overlay.mjs +189 -0
  444. package/dist/starters/preact/design-system/assets/avatars/avatar.ads.ts +10 -0
  445. package/dist/starters/preact/design-system/assets/avatars/member.svg +1 -0
  446. package/dist/starters/preact/design-system/assets/brand/emblem.ads.ts +18 -0
  447. package/dist/starters/preact/design-system/assets/brand/emblem.svg +4 -0
  448. package/dist/starters/preact/design-system/assets/brand/iris-emblem.ads.ts +14 -0
  449. package/dist/starters/preact/design-system/assets/brand/iris-emblem.svg +4 -0
  450. package/dist/starters/preact/design-system/assets/brand/mark.ads.ts +14 -0
  451. package/dist/starters/preact/design-system/assets/brand/mark.svg +1 -0
  452. package/dist/starters/preact/design-system/assets/glyphs/arrow.ads.ts +14 -0
  453. package/dist/starters/preact/design-system/assets/glyphs/arrow.svg +1 -0
  454. package/dist/starters/preact/design-system/assets/glyphs/chevron-20.svg +1 -0
  455. package/dist/starters/preact/design-system/assets/glyphs/chevron-24.svg +1 -0
  456. package/dist/starters/preact/design-system/assets/glyphs/chevron.ads.ts +20 -0
  457. package/dist/starters/preact/design-system/assets/glyphs/close.ads.ts +13 -0
  458. package/dist/starters/preact/design-system/assets/glyphs/close.svg +1 -0
  459. package/dist/starters/preact/design-system/assets/glyphs/favorite.ads.ts +23 -0
  460. package/dist/starters/preact/design-system/assets/glyphs/favorite.normal.svg +1 -0
  461. package/dist/starters/preact/design-system/assets/glyphs/favorite.selected.svg +1 -0
  462. package/dist/starters/preact/design-system/assets/glyphs/search.ads.ts +10 -0
  463. package/dist/starters/preact/design-system/assets/glyphs/search.svg +1 -0
  464. package/dist/starters/preact/design-system/assets/illustrations/journey.ads.ts +32 -0
  465. package/dist/starters/preact/design-system/assets/illustrations/journey.contrast.svg +6 -0
  466. package/dist/starters/preact/design-system/assets/illustrations/journey.dark.svg +13 -0
  467. package/dist/starters/preact/design-system/assets/illustrations/journey.light.svg +13 -0
  468. package/dist/starters/preact/design-system/assets/logos/harbor-pay.ads.ts +17 -0
  469. package/dist/starters/preact/design-system/assets/logos/harbor-pay.dark.svg +10 -0
  470. package/dist/starters/preact/design-system/assets/logos/harbor-pay.light.svg +10 -0
  471. package/dist/starters/preact/design-system/assets/logos/lumen-cloud.ads.ts +15 -0
  472. package/dist/starters/preact/design-system/assets/logos/lumen-cloud.dark.svg +9 -0
  473. package/dist/starters/preact/design-system/assets/logos/lumen-cloud.light.svg +9 -0
  474. package/dist/starters/preact/design-system/assets/status/error.svg +1 -0
  475. package/dist/starters/preact/design-system/assets/status/outcomes.ads.ts +31 -0
  476. package/dist/starters/preact/design-system/assets/status/status.ads.ts +16 -0
  477. package/dist/starters/preact/design-system/assets/status/success.svg +1 -0
  478. package/dist/starters/preact/design-system/assets/status/sync-status.ads.ts +14 -0
  479. package/dist/starters/preact/design-system/assets/status/sync-status.svg +7 -0
  480. package/dist/starters/preact/design-system/assets/status/warning.svg +1 -0
  481. package/dist/starters/preact/design-system/components/Actions/Button/Button.ads.scenario.tsx +12 -0
  482. package/dist/starters/preact/design-system/components/Actions/Button/Button.tsx +198 -0
  483. package/dist/starters/preact/design-system/components/Actions/IconButton/IconButton.tsx +95 -0
  484. package/dist/starters/preact/design-system/components/Actions/ToggleTile/ToggleTile.ads.scenario.tsx +22 -0
  485. package/dist/starters/preact/design-system/components/Actions/ToggleTile/ToggleTile.tsx +60 -0
  486. package/dist/starters/preact/design-system/components/Containers/Disclosure/Disclosure.ads.scenario.tsx +24 -0
  487. package/dist/starters/preact/design-system/components/Containers/Disclosure/Disclosure.tsx +50 -0
  488. package/dist/starters/preact/design-system/components/Content/Artwork/Artwork.ads.scenario.tsx +8 -0
  489. package/dist/starters/preact/design-system/components/Content/Artwork/Artwork.tsx +110 -0
  490. package/dist/starters/preact/design-system/components/Content/BarChart/BarChart.ads.scenario.tsx +25 -0
  491. package/dist/starters/preact/design-system/components/Content/BarChart/BarChart.tsx +72 -0
  492. package/dist/starters/preact/design-system/components/Content/GuideGrid/GuideGrid.ads.scenario.tsx +8 -0
  493. package/dist/starters/preact/design-system/components/Content/GuideGrid/GuideGrid.tsx +43 -0
  494. package/dist/starters/preact/design-system/components/Content/Icon/Icon.ads.scenario.tsx +21 -0
  495. package/dist/starters/preact/design-system/components/Content/Icon/Icon.tsx +41 -0
  496. package/dist/starters/preact/design-system/components/Content/Icon/glyphs/arrow.tsx +10 -0
  497. package/dist/starters/preact/design-system/components/Content/Icon/glyphs/close.tsx +10 -0
  498. package/dist/starters/preact/design-system/components/Content/Icon/glyphs/search.tsx +10 -0
  499. package/dist/starters/preact/design-system/components/Content/Image/Image.ads.fixture.ts +9 -0
  500. package/dist/starters/preact/design-system/components/Content/Image/Image.ads.scenario.tsx +12 -0
  501. package/dist/starters/preact/design-system/components/Content/Image/Image.tsx +83 -0
  502. package/dist/starters/preact/design-system/components/Content/InspectedGlyph/InspectedGlyph.ads.scenario.tsx +27 -0
  503. package/dist/starters/preact/design-system/components/Content/InspectedGlyph/InspectedGlyph.tsx +46 -0
  504. package/dist/starters/preact/design-system/components/Content/PartnerLogo/PartnerLogo.ads.scenario.tsx +17 -0
  505. package/dist/starters/preact/design-system/components/Content/PartnerLogo/PartnerLogo.tsx +41 -0
  506. package/dist/starters/preact/design-system/components/Content/StatusIcon/StatusIcon.ads.scenario.tsx +20 -0
  507. package/dist/starters/preact/design-system/components/Content/StatusIcon/StatusIcon.tsx +37 -0
  508. package/dist/starters/preact/design-system/components/Forms/TextField/TextField.ads.scenario.tsx +24 -0
  509. package/dist/starters/preact/design-system/components/Forms/TextField/TextField.tsx +173 -0
  510. package/dist/starters/preact/design-system/components/Identity/Identity.ads.scenario.tsx +13 -0
  511. package/dist/starters/preact/design-system/components/Identity/Identity.tsx +146 -0
  512. package/dist/starters/preact/design-system/components/Overlays/Menu/Menu.ads.scenario.tsx +27 -0
  513. package/dist/starters/preact/design-system/components/Overlays/Menu/Menu.tsx +194 -0
  514. package/dist/starters/preact/design-system/components/Overlays/Popover/Popover.ads.scenario.tsx +19 -0
  515. package/dist/starters/preact/design-system/components/Overlays/Popover/Popover.tsx +37 -0
  516. package/dist/starters/preact/design-system/controllers/FormField/FormField.ads.behavior.ts +70 -0
  517. package/dist/starters/preact/design-system/controllers/FormField/FormField.behavior.spec.ts +237 -0
  518. package/dist/starters/preact/design-system/controllers/FormField/FormField.ts +343 -0
  519. package/dist/starters/preact/design-system/controllers/FormField/useFormField.ts +70 -0
  520. package/dist/starters/preact/design-system/controllers/Palette/Palette.ts +165 -0
  521. package/dist/starters/preact/design-system/foundation.ads.ts +22 -0
  522. package/dist/starters/preact/design-system/index.ts +51 -0
  523. package/dist/starters/preact/design-system/mocks/ConstructionProofs/ConstructionProofs.ads.fixture.ts +5 -0
  524. package/dist/starters/preact/design-system/mocks/ConstructionProofs/ConstructionProofs.ads.scenario.tsx +22 -0
  525. package/dist/starters/preact/design-system/mocks/Inspector/Inspector.ads.fixture.ts +12 -0
  526. package/dist/starters/preact/design-system/mocks/Inspector/Inspector.ads.scenario.tsx +21 -0
  527. package/dist/starters/preact/design-system/mocks/Workspace/Layouts.ads.scenario.tsx +24 -0
  528. package/dist/starters/preact/design-system/mocks/Workspace/Media.ads.scenario.tsx +24 -0
  529. package/dist/starters/preact/design-system/mocks/Workspace/Stress.ads.scenario.tsx +36 -0
  530. package/dist/starters/preact/design-system/mocks/Workspace/Workspace.ads.fixture.ts +13 -0
  531. package/dist/starters/preact/design-system/mocks/Workspace/Workspace.ads.scenario.tsx +27 -0
  532. package/dist/starters/preact/design-system/mocks/Workspace/media/ads.svg +1 -0
  533. package/dist/starters/preact/design-system/palette.generated.ts +188 -0
  534. package/dist/starters/preact/design-system/patterns/ArtworkCatalogue/ArtworkCatalogue/ArtworkCatalogue.tsx +73 -0
  535. package/dist/starters/preact/design-system/patterns/ConstructionWorkbench/ConstructionWorkbench/ConstructionWorkbench.ads.scenario.tsx +23 -0
  536. package/dist/starters/preact/design-system/patterns/ConstructionWorkbench/ConstructionWorkbench/ConstructionWorkbench.tsx +94 -0
  537. package/dist/starters/preact/design-system/patterns/Forms/InviteMember/InviteMember.ads.scenario.tsx +21 -0
  538. package/dist/starters/preact/design-system/patterns/Forms/InviteMember/InviteMember.tsx +137 -0
  539. package/dist/starters/preact/design-system/patterns/Inspector/Inspector/Inspector.ads.scenario.tsx +22 -0
  540. package/dist/starters/preact/design-system/patterns/Inspector/Inspector/Inspector.tsx +248 -0
  541. package/dist/starters/preact/design-system/patterns/Shell/Shell.ads.scenario.tsx +26 -0
  542. package/dist/starters/preact/design-system/patterns/Shell/Shell.tsx +254 -261
  543. package/dist/starters/preact/design-system/patterns/Workspace/Workspace/Workspace.ads.scenario.tsx +28 -0
  544. package/dist/starters/preact/design-system/patterns/Workspace/Workspace/Workspace.tsx +105 -0
  545. package/dist/starters/preact/design-system/patterns/Workspace/Workspace/WorkspacePanels.tsx +179 -0
  546. package/dist/starters/preact/design-system/profiles/Containers/containers.ads.ts +67 -0
  547. package/dist/starters/preact/design-system/profiles/Containers/frames.ads.ts +32 -0
  548. package/dist/starters/preact/design-system/profiles/Containers/geometry.ads.ts +30 -0
  549. package/dist/starters/preact/design-system/profiles/Containers/spacing.ads.ts +26 -0
  550. package/dist/starters/preact/design-system/profiles/Controls/controls.ads.ts +157 -0
  551. package/dist/starters/preact/design-system/profiles/Controls/frames.ads.ts +50 -0
  552. package/dist/starters/preact/design-system/profiles/Controls/spacing.ads.ts +29 -0
  553. package/dist/starters/preact/design-system/profiles/Focus/keyboard.ads.ts +13 -0
  554. package/dist/starters/preact/design-system/profiles/Identity/identity.ads.ts +25 -0
  555. package/dist/starters/preact/design-system/profiles/Identity/spacing.ads.ts +22 -0
  556. package/dist/starters/preact/design-system/profiles/Layout/grid.ads.ts +69 -0
  557. package/dist/starters/preact/design-system/profiles/Layout/inspector.ads.ts +146 -0
  558. package/dist/starters/preact/design-system/profiles/Layout/overlays.ads.ts +94 -0
  559. package/dist/starters/preact/design-system/profiles/Layout/regions.ads.ts +296 -0
  560. package/dist/starters/preact/design-system/profiles/Motion/feedback.ads.ts +92 -0
  561. package/dist/starters/preact/design-system/profiles/Surfaces/controls.ads.ts +142 -0
  562. package/dist/starters/preact/design-system/profiles/Surfaces/document.ads.ts +2 -0
  563. package/dist/starters/preact/design-system/profiles/Surfaces/materials.ads.ts +18 -0
  564. package/dist/starters/preact/design-system/profiles/Surfaces/surfaces.ads.ts +48 -0
  565. package/dist/starters/preact/design-system/profiles/Typography/details.ads.ts +19 -0
  566. package/dist/starters/preact/design-system/profiles/Typography/document.ads.ts +2 -0
  567. package/dist/starters/preact/design-system/profiles/Typography/headings.ads.ts +15 -0
  568. package/dist/starters/preact/design-system/profiles/Typography/text.ads.ts +73 -0
  569. package/dist/starters/preact/design-system/profiles/Visuals/artwork.ads.ts +46 -0
  570. package/dist/starters/preact/design-system/profiles/Visuals/charts.ads.ts +31 -0
  571. package/dist/starters/preact/design-system/profiles/Visuals/content.ads.ts +52 -0
  572. package/dist/starters/preact/design-system/profiles/Visuals/glyphs.ads.ts +35 -0
  573. package/dist/starters/preact/design-system/profiles/Visuals/identity.ads.ts +24 -0
  574. package/dist/starters/preact/design-system/tokens/Artwork/paint.ads.css +7 -0
  575. package/dist/starters/preact/design-system/tokens/Artwork/visual-size.ads.css +12 -0
  576. package/dist/starters/preact/design-system/tokens/Brand/paint.ads.css +7 -0
  577. package/dist/starters/preact/design-system/tokens/Charts/paint.ads.css +19 -0
  578. package/dist/starters/preact/design-system/tokens/Containers/border-width.ads.css +1 -0
  579. package/dist/starters/preact/design-system/tokens/Containers/content-gap.ads.css +5 -0
  580. package/dist/starters/preact/design-system/tokens/Containers/frame-inset.ads.css +6 -0
  581. package/dist/starters/preact/design-system/tokens/Containers/frame-size.ads.css +11 -0
  582. package/dist/starters/preact/design-system/tokens/Containers/radius.ads.css +1 -0
  583. package/dist/starters/preact/design-system/tokens/Controls/border-width.ads.css +4 -0
  584. package/dist/starters/preact/design-system/tokens/Controls/content-gap.ads.css +6 -0
  585. package/dist/starters/preact/design-system/tokens/Controls/control-min-size.ads.css +17 -0
  586. package/dist/starters/preact/design-system/tokens/Controls/frame-inset.ads.css +21 -0
  587. package/dist/starters/preact/design-system/tokens/Controls/radius.ads.css +1 -0
  588. package/dist/starters/preact/design-system/tokens/Controls/target-min-size.ads.css +2 -0
  589. package/dist/starters/preact/design-system/tokens/Controls/visual-size.ads.css +2 -0
  590. package/dist/starters/preact/design-system/tokens/Focus/border-width.ads.css +1 -0
  591. package/dist/starters/preact/design-system/tokens/Focus/focus-offset.ads.css +1 -0
  592. package/dist/starters/preact/design-system/tokens/Foundation/spacing.ads.css +20 -0
  593. package/dist/starters/preact/design-system/tokens/Grid/grid-gutter.ads.css +6 -0
  594. package/dist/starters/preact/design-system/tokens/Grid/layer.ads.css +2 -0
  595. package/dist/starters/preact/design-system/tokens/Grid/layout-size.ads.css +15 -0
  596. package/dist/starters/preact/design-system/tokens/Grid/spacing.ads.css +12 -0
  597. package/dist/starters/preact/design-system/tokens/Grid/track-count.ads.css +1 -0
  598. package/dist/starters/preact/design-system/tokens/Identity/content-gap.ads.css +6 -0
  599. package/dist/starters/preact/design-system/tokens/Identity/visual-size.ads.css +1 -0
  600. package/dist/starters/preact/design-system/tokens/Motion/duration.ads.css +6 -0
  601. package/dist/starters/preact/design-system/tokens/Motion/easing.ads.css +5 -0
  602. package/dist/starters/preact/design-system/tokens/Motion/motion-angle.ads.css +1 -0
  603. package/dist/starters/preact/design-system/tokens/Motion/motion-distance.ads.css +2 -0
  604. package/dist/starters/preact/design-system/tokens/Motion/motion-scale.ads.css +9 -0
  605. package/dist/starters/preact/design-system/tokens/Surfaces/blur.ads.css +2 -0
  606. package/dist/starters/preact/design-system/tokens/Surfaces/gradient.ads.css +2 -0
  607. package/dist/starters/preact/design-system/tokens/Surfaces/opacity.ads.css +2 -0
  608. package/dist/starters/preact/design-system/tokens/Surfaces/paint.ads.css +58 -0
  609. package/dist/starters/preact/design-system/tokens/Surfaces/shadow.ads.css +20 -0
  610. package/dist/starters/preact/design-system/tokens/Typography/font-family.ads.css +1 -0
  611. package/dist/starters/preact/design-system/tokens/Typography/font-features.ads.css +1 -0
  612. package/dist/starters/preact/design-system/tokens/Typography/font-size.ads.css +9 -0
  613. package/dist/starters/preact/design-system/tokens/Typography/font-stretch.ads.css +1 -0
  614. package/dist/starters/preact/design-system/tokens/Typography/font-variations.ads.css +1 -0
  615. package/dist/starters/preact/design-system/tokens/Typography/font-weight.ads.css +1 -0
  616. package/dist/starters/preact/design-system/tokens/Typography/letter-spacing.ads.css +1 -0
  617. package/dist/starters/preact/design-system/tokens/Typography/line-height.ads.css +11 -0
  618. package/dist/starters/preact/design-system/tokens/Typography/word-spacing.ads.css +1 -0
  619. package/dist/starters/preact/starter.json +11 -0
  620. package/dist/starters/react/design-system/assets/avatars/avatar.ads.ts +10 -0
  621. package/dist/starters/react/design-system/assets/avatars/member.svg +1 -0
  622. package/dist/starters/react/design-system/assets/brand/emblem.ads.ts +18 -0
  623. package/dist/starters/react/design-system/assets/brand/emblem.svg +4 -0
  624. package/dist/starters/react/design-system/assets/brand/iris-emblem.ads.ts +14 -0
  625. package/dist/starters/react/design-system/assets/brand/iris-emblem.svg +4 -0
  626. package/dist/starters/react/design-system/assets/brand/mark.ads.ts +14 -0
  627. package/dist/starters/react/design-system/assets/brand/mark.svg +1 -0
  628. package/dist/starters/react/design-system/assets/glyphs/arrow.ads.ts +14 -0
  629. package/dist/starters/react/design-system/assets/glyphs/arrow.svg +1 -0
  630. package/dist/starters/react/design-system/assets/glyphs/chevron-20.svg +1 -0
  631. package/dist/starters/react/design-system/assets/glyphs/chevron-24.svg +1 -0
  632. package/dist/starters/react/design-system/assets/glyphs/chevron.ads.ts +20 -0
  633. package/dist/starters/react/design-system/assets/glyphs/close.ads.ts +13 -0
  634. package/dist/starters/react/design-system/assets/glyphs/close.svg +1 -1
  635. package/dist/starters/react/design-system/assets/glyphs/favorite.ads.ts +23 -0
  636. package/dist/starters/react/design-system/assets/glyphs/favorite.normal.svg +1 -0
  637. package/dist/starters/react/design-system/assets/glyphs/favorite.selected.svg +1 -0
  638. package/dist/starters/react/design-system/assets/glyphs/search.ads.ts +10 -0
  639. package/dist/starters/react/design-system/assets/glyphs/search.svg +1 -1
  640. package/dist/starters/react/design-system/assets/illustrations/journey.ads.ts +32 -0
  641. package/dist/starters/react/design-system/assets/illustrations/journey.contrast.svg +6 -0
  642. package/dist/starters/react/design-system/assets/illustrations/journey.dark.svg +13 -0
  643. package/dist/starters/react/design-system/assets/illustrations/journey.light.svg +13 -0
  644. package/dist/starters/react/design-system/assets/logos/harbor-pay.ads.ts +17 -0
  645. package/dist/starters/react/design-system/assets/logos/harbor-pay.dark.svg +10 -0
  646. package/dist/starters/react/design-system/assets/logos/harbor-pay.light.svg +10 -0
  647. package/dist/starters/react/design-system/assets/logos/lumen-cloud.ads.ts +15 -0
  648. package/dist/starters/react/design-system/assets/logos/lumen-cloud.dark.svg +9 -0
  649. package/dist/starters/react/design-system/assets/logos/lumen-cloud.light.svg +9 -0
  650. package/dist/starters/react/design-system/assets/status/error.svg +1 -0
  651. package/dist/starters/react/design-system/assets/status/outcomes.ads.ts +31 -0
  652. package/dist/starters/react/design-system/assets/status/status.ads.ts +16 -0
  653. package/dist/starters/react/design-system/assets/status/success.svg +1 -0
  654. package/dist/starters/react/design-system/assets/status/sync-status.ads.ts +14 -0
  655. package/dist/starters/react/design-system/assets/status/sync-status.svg +7 -0
  656. package/dist/starters/react/design-system/assets/status/warning.svg +1 -0
  657. package/dist/starters/react/design-system/components/Actions/Button/Button.ads.scenario.tsx +11 -12
  658. package/dist/starters/react/design-system/components/Actions/Button/Button.tsx +187 -45
  659. package/dist/starters/react/design-system/components/Actions/IconButton/IconButton.tsx +83 -48
  660. package/dist/starters/react/design-system/components/Actions/ToggleTile/ToggleTile.ads.scenario.tsx +22 -0
  661. package/dist/starters/react/design-system/components/Actions/ToggleTile/ToggleTile.tsx +60 -0
  662. package/dist/starters/react/design-system/components/Containers/Disclosure/Disclosure.ads.scenario.tsx +24 -0
  663. package/dist/starters/react/design-system/components/Containers/Disclosure/Disclosure.tsx +50 -0
  664. package/dist/starters/react/design-system/components/Content/Artwork/Artwork.ads.scenario.tsx +8 -0
  665. package/dist/starters/react/design-system/components/Content/Artwork/Artwork.tsx +110 -0
  666. package/dist/starters/react/design-system/components/Content/BarChart/BarChart.ads.scenario.tsx +25 -0
  667. package/dist/starters/react/design-system/components/Content/BarChart/BarChart.tsx +72 -0
  668. package/dist/starters/react/design-system/components/Content/GuideGrid/GuideGrid.ads.scenario.tsx +8 -0
  669. package/dist/starters/react/design-system/components/Content/GuideGrid/GuideGrid.tsx +43 -0
  670. package/dist/starters/react/design-system/components/Content/Icon/Icon.ads.scenario.tsx +21 -16
  671. package/dist/starters/react/design-system/components/Content/Icon/Icon.tsx +32 -33
  672. package/dist/starters/react/design-system/components/Content/Icon/glyphs/arrow.tsx +10 -0
  673. package/dist/starters/react/design-system/components/Content/Icon/glyphs/close.tsx +10 -0
  674. package/dist/starters/react/design-system/components/Content/Icon/glyphs/search.tsx +10 -0
  675. package/dist/starters/react/design-system/components/Content/Image/Image.ads.fixture.ts +9 -2
  676. package/dist/starters/react/design-system/components/Content/Image/Image.ads.scenario.tsx +10 -11
  677. package/dist/starters/react/design-system/components/Content/Image/Image.tsx +74 -42
  678. package/dist/starters/react/design-system/components/Content/InspectedGlyph/InspectedGlyph.ads.scenario.tsx +27 -0
  679. package/dist/starters/react/design-system/components/Content/InspectedGlyph/InspectedGlyph.tsx +46 -0
  680. package/dist/starters/react/design-system/components/Content/PartnerLogo/PartnerLogo.ads.scenario.tsx +17 -0
  681. package/dist/starters/react/design-system/components/Content/PartnerLogo/PartnerLogo.tsx +41 -0
  682. package/dist/starters/react/design-system/components/Content/StatusIcon/StatusIcon.ads.scenario.tsx +20 -0
  683. package/dist/starters/react/design-system/components/Content/StatusIcon/StatusIcon.tsx +37 -0
  684. package/dist/starters/react/design-system/components/Forms/TextField/TextField.ads.scenario.tsx +23 -12
  685. package/dist/starters/react/design-system/components/Forms/TextField/TextField.tsx +161 -49
  686. package/dist/starters/react/design-system/components/Identity/Identity.ads.scenario.tsx +13 -0
  687. package/dist/starters/react/design-system/components/Identity/Identity.tsx +146 -0
  688. package/dist/starters/react/design-system/components/Overlays/Menu/Menu.ads.scenario.tsx +27 -0
  689. package/dist/starters/react/design-system/components/Overlays/Menu/Menu.tsx +194 -0
  690. package/dist/starters/react/design-system/components/Overlays/Popover/Popover.ads.scenario.tsx +19 -0
  691. package/dist/starters/react/design-system/components/Overlays/Popover/Popover.tsx +37 -0
  692. package/dist/starters/react/design-system/controllers/FormField/FormField.ads.behavior.ts +70 -0
  693. package/dist/starters/react/design-system/controllers/FormField/FormField.behavior.spec.ts +237 -0
  694. package/dist/starters/react/design-system/controllers/FormField/FormField.ts +343 -0
  695. package/dist/starters/react/design-system/controllers/FormField/useFormField.ts +70 -0
  696. package/dist/starters/react/design-system/controllers/Palette/Palette.ts +5 -4
  697. package/dist/starters/react/design-system/foundation.ads.ts +22 -0
  698. package/dist/starters/react/design-system/index.ts +51 -12
  699. package/dist/starters/react/design-system/mocks/ConstructionProofs/ConstructionProofs.ads.fixture.ts +5 -0
  700. package/dist/starters/react/design-system/mocks/ConstructionProofs/ConstructionProofs.ads.scenario.tsx +22 -0
  701. package/dist/starters/react/design-system/mocks/Inspector/Inspector.ads.fixture.ts +12 -0
  702. package/dist/starters/react/design-system/mocks/Inspector/Inspector.ads.scenario.tsx +21 -0
  703. package/dist/starters/react/design-system/mocks/Workspace/Layouts.ads.scenario.tsx +24 -0
  704. package/dist/starters/react/design-system/mocks/Workspace/Media.ads.scenario.tsx +24 -0
  705. package/dist/starters/react/design-system/mocks/Workspace/Stress.ads.scenario.tsx +36 -0
  706. package/dist/starters/react/design-system/mocks/Workspace/Workspace.ads.fixture.ts +13 -0
  707. package/dist/starters/react/design-system/mocks/Workspace/Workspace.ads.scenario.tsx +27 -0
  708. package/dist/starters/react/design-system/mocks/Workspace/media/ads.svg +1 -0
  709. package/dist/starters/react/design-system/palette.generated.ts +188 -0
  710. package/dist/starters/react/design-system/patterns/ArtworkCatalogue/ArtworkCatalogue/ArtworkCatalogue.tsx +73 -0
  711. package/dist/starters/react/design-system/patterns/ConstructionWorkbench/ConstructionWorkbench/ConstructionWorkbench.ads.scenario.tsx +23 -0
  712. package/dist/starters/react/design-system/patterns/ConstructionWorkbench/ConstructionWorkbench/ConstructionWorkbench.tsx +94 -0
  713. package/dist/starters/react/design-system/patterns/Forms/InviteMember/InviteMember.ads.scenario.tsx +21 -0
  714. package/dist/starters/react/design-system/patterns/Forms/InviteMember/InviteMember.tsx +137 -0
  715. package/dist/starters/react/design-system/patterns/Inspector/Inspector/Inspector.ads.scenario.tsx +22 -0
  716. package/dist/starters/react/design-system/patterns/Inspector/Inspector/Inspector.tsx +248 -0
  717. package/dist/starters/react/design-system/patterns/Shell/Shell.ads.scenario.tsx +26 -21
  718. package/dist/starters/react/design-system/patterns/Shell/Shell.tsx +255 -261
  719. package/dist/starters/react/design-system/patterns/Workspace/Workspace/Workspace.ads.scenario.tsx +28 -0
  720. package/dist/starters/react/design-system/patterns/Workspace/Workspace/Workspace.tsx +105 -0
  721. package/dist/starters/react/design-system/patterns/Workspace/Workspace/WorkspacePanels.tsx +179 -0
  722. package/dist/starters/react/design-system/profiles/Containers/containers.ads.ts +67 -0
  723. package/dist/starters/react/design-system/profiles/Containers/frames.ads.ts +32 -0
  724. package/dist/starters/react/design-system/profiles/Containers/geometry.ads.ts +30 -0
  725. package/dist/starters/react/design-system/profiles/Containers/spacing.ads.ts +26 -0
  726. package/dist/starters/react/design-system/profiles/Controls/controls.ads.ts +157 -0
  727. package/dist/starters/react/design-system/profiles/Controls/frames.ads.ts +50 -0
  728. package/dist/starters/react/design-system/profiles/Controls/spacing.ads.ts +29 -0
  729. package/dist/starters/react/design-system/profiles/Focus/keyboard.ads.ts +13 -0
  730. package/dist/starters/react/design-system/profiles/Identity/identity.ads.ts +25 -0
  731. package/dist/starters/react/design-system/profiles/Identity/spacing.ads.ts +22 -0
  732. package/dist/starters/react/design-system/profiles/Layout/grid.ads.ts +69 -0
  733. package/dist/starters/react/design-system/profiles/Layout/inspector.ads.ts +146 -0
  734. package/dist/starters/react/design-system/profiles/Layout/overlays.ads.ts +94 -0
  735. package/dist/starters/react/design-system/profiles/Layout/regions.ads.ts +296 -0
  736. package/dist/starters/react/design-system/profiles/Motion/feedback.ads.ts +92 -0
  737. package/dist/starters/react/design-system/profiles/Surfaces/controls.ads.ts +142 -0
  738. package/dist/starters/react/design-system/profiles/Surfaces/document.ads.ts +2 -0
  739. package/dist/starters/react/design-system/profiles/Surfaces/materials.ads.ts +18 -0
  740. package/dist/starters/react/design-system/profiles/Surfaces/surfaces.ads.ts +48 -0
  741. package/dist/starters/react/design-system/profiles/Typography/details.ads.ts +19 -0
  742. package/dist/starters/react/design-system/profiles/Typography/document.ads.ts +2 -0
  743. package/dist/starters/react/design-system/profiles/Typography/headings.ads.ts +15 -0
  744. package/dist/starters/react/design-system/profiles/Typography/text.ads.ts +73 -0
  745. package/dist/starters/react/design-system/profiles/Visuals/artwork.ads.ts +46 -0
  746. package/dist/starters/react/design-system/profiles/Visuals/charts.ads.ts +31 -0
  747. package/dist/starters/react/design-system/profiles/Visuals/content.ads.ts +52 -0
  748. package/dist/starters/react/design-system/profiles/Visuals/glyphs.ads.ts +35 -0
  749. package/dist/starters/react/design-system/profiles/Visuals/identity.ads.ts +24 -0
  750. package/dist/starters/react/design-system/tokens/Artwork/paint.ads.css +7 -0
  751. package/dist/starters/react/design-system/tokens/Artwork/visual-size.ads.css +12 -0
  752. package/dist/starters/react/design-system/tokens/Brand/paint.ads.css +7 -0
  753. package/dist/starters/react/design-system/tokens/Charts/paint.ads.css +19 -0
  754. package/dist/starters/react/design-system/tokens/Containers/border-width.ads.css +1 -0
  755. package/dist/starters/react/design-system/tokens/Containers/content-gap.ads.css +5 -0
  756. package/dist/starters/react/design-system/tokens/Containers/frame-inset.ads.css +6 -0
  757. package/dist/starters/react/design-system/tokens/Containers/frame-size.ads.css +11 -0
  758. package/dist/starters/react/design-system/tokens/Containers/radius.ads.css +1 -0
  759. package/dist/starters/react/design-system/tokens/Controls/border-width.ads.css +4 -0
  760. package/dist/starters/react/design-system/tokens/Controls/content-gap.ads.css +6 -0
  761. package/dist/starters/react/design-system/tokens/Controls/control-min-size.ads.css +17 -0
  762. package/dist/starters/react/design-system/tokens/Controls/frame-inset.ads.css +21 -0
  763. package/dist/starters/react/design-system/tokens/Controls/radius.ads.css +1 -0
  764. package/dist/starters/react/design-system/tokens/Controls/target-min-size.ads.css +2 -0
  765. package/dist/starters/react/design-system/tokens/Controls/visual-size.ads.css +2 -0
  766. package/dist/starters/react/design-system/tokens/Focus/border-width.ads.css +1 -0
  767. package/dist/starters/react/design-system/tokens/Focus/focus-offset.ads.css +1 -0
  768. package/dist/starters/react/design-system/tokens/Foundation/spacing.ads.css +20 -0
  769. package/dist/starters/react/design-system/tokens/Grid/grid-gutter.ads.css +6 -0
  770. package/dist/starters/react/design-system/tokens/Grid/layer.ads.css +2 -0
  771. package/dist/starters/react/design-system/tokens/Grid/layout-size.ads.css +15 -0
  772. package/dist/starters/react/design-system/tokens/Grid/spacing.ads.css +12 -0
  773. package/dist/starters/react/design-system/tokens/Grid/track-count.ads.css +1 -0
  774. package/dist/starters/react/design-system/tokens/Identity/content-gap.ads.css +6 -0
  775. package/dist/starters/react/design-system/tokens/Identity/visual-size.ads.css +1 -0
  776. package/dist/starters/react/design-system/tokens/Motion/duration.ads.css +6 -0
  777. package/dist/starters/react/design-system/tokens/Motion/easing.ads.css +5 -0
  778. package/dist/starters/react/design-system/tokens/Motion/motion-angle.ads.css +1 -0
  779. package/dist/starters/react/design-system/tokens/Motion/motion-distance.ads.css +2 -0
  780. package/dist/starters/react/design-system/tokens/Motion/motion-scale.ads.css +9 -0
  781. package/dist/starters/react/design-system/tokens/Surfaces/blur.ads.css +2 -0
  782. package/dist/starters/react/design-system/tokens/Surfaces/gradient.ads.css +2 -0
  783. package/dist/starters/react/design-system/tokens/Surfaces/opacity.ads.css +2 -0
  784. package/dist/starters/react/design-system/tokens/Surfaces/paint.ads.css +58 -0
  785. package/dist/starters/react/design-system/tokens/Surfaces/shadow.ads.css +20 -0
  786. package/dist/starters/react/design-system/tokens/Typography/font-family.ads.css +1 -0
  787. package/dist/starters/react/design-system/tokens/Typography/font-features.ads.css +1 -0
  788. package/dist/starters/react/design-system/tokens/Typography/font-size.ads.css +9 -0
  789. package/dist/starters/react/design-system/tokens/Typography/font-stretch.ads.css +1 -0
  790. package/dist/starters/react/design-system/tokens/Typography/font-variations.ads.css +1 -0
  791. package/dist/starters/react/design-system/tokens/Typography/font-weight.ads.css +1 -0
  792. package/dist/starters/react/design-system/tokens/Typography/letter-spacing.ads.css +1 -0
  793. package/dist/starters/react/design-system/tokens/Typography/line-height.ads.css +11 -0
  794. package/dist/starters/react/design-system/tokens/Typography/word-spacing.ads.css +1 -0
  795. package/dist/starters/react/starter.json +11 -0
  796. package/dist/state-conditions.d.mts +51 -0
  797. package/dist/state-conditions.mjs +67 -0
  798. package/dist/static-values.mjs +94 -0
  799. package/dist/surface-contrast.mjs +194 -0
  800. package/dist/target-size.mjs +177 -0
  801. package/dist/task-cache.mjs +142 -136
  802. package/dist/task-worker.mjs +18 -18
  803. package/dist/test-boundaries.mjs +50 -189
  804. package/dist/token-checks.mjs +21 -0
  805. package/dist/token-dtcg.mjs +135 -0
  806. package/dist/token-expression.mjs +19 -0
  807. package/dist/token-inventory.mjs +146 -0
  808. package/dist/token-operations.mjs +37 -0
  809. package/dist/token-overlap.mjs +29 -0
  810. package/dist/token-provenance.mjs +260 -0
  811. package/dist/token-references.mjs +71 -0
  812. package/dist/token-registrations.mjs +116 -0
  813. package/dist/token-resolution.mjs +38 -0
  814. package/dist/token-sections.mjs +123 -0
  815. package/dist/token-shapes.mjs +121 -0
  816. package/dist/token-sheet-check.mjs +54 -0
  817. package/dist/token-type-check.mjs +89 -0
  818. package/dist/token-view-facts.mjs +62 -0
  819. package/dist/tsconfig.declarations.json +24 -0
  820. package/dist/types/css-tree.d.ts +45 -0
  821. package/dist/ui-framework.mjs +34 -34
  822. package/dist/units.mjs +186 -226
  823. package/dist/unknown.d.mts +9 -0
  824. package/dist/unknown.mjs +13 -0
  825. package/dist/validation-checks.mjs +62 -71
  826. package/dist/validation-inputs.mjs +287 -184
  827. package/dist/validation.mjs +132 -159
  828. package/dist/verification/browser.d.mts +21 -25
  829. package/dist/verification/browser.mjs +281 -124
  830. package/dist/verification/browser.page.d.mts +22 -0
  831. package/dist/verification/browser.page.mjs +19 -0
  832. package/dist/verification/paint-audit.page.d.mts +55 -0
  833. package/dist/verification/paint-audit.page.mjs +144 -0
  834. package/dist/verification/playwright-reporter.mjs +160 -0
  835. package/dist/verification/preview-startup.d.mts +51 -0
  836. package/dist/verification/preview-startup.mjs +76 -0
  837. package/dist/verification/request.d.mts +28 -0
  838. package/dist/verification/request.mjs +30 -0
  839. package/dist/verification/unit-preload.mjs +37 -0
  840. package/dist/verification.mjs +574 -607
  841. package/docs/ADS.md +562 -565
  842. package/docs/ARCHITECTURE.md +1857 -1345
  843. package/docs/ASSETS.md +416 -0
  844. package/docs/BEHAVIORS.md +339 -370
  845. package/docs/CACHING.md +365 -154
  846. package/docs/CHANGELOG.md +171 -21
  847. package/docs/COMPARISON.md +21 -26
  848. package/docs/DESIGN-REFERENCES.md +39 -26
  849. package/docs/GUIDE.md +2306 -1288
  850. package/docs/LANGUAGE.md +893 -0
  851. package/docs/LOWERING.md +168 -0
  852. package/docs/MCP.md +1461 -1179
  853. package/docs/MOTION.md +265 -0
  854. package/docs/PROFILE-KINDS.md +390 -0
  855. package/docs/PROFILES.md +176 -0
  856. package/docs/RULES.md +559 -0
  857. package/docs/STARTER.md +167 -0
  858. package/docs/TOKEN-ROLES.md +375 -0
  859. package/docs/benchmarks/README.md +26 -27
  860. package/package.json +59 -45
  861. package/dist/a11y.mjs +0 -187
  862. package/dist/assets.mjs +0 -159
  863. package/dist/atomic-composition.mjs +0 -337
  864. package/dist/atomic-trace.mjs +0 -162
  865. package/dist/behavior-libraries.mjs +0 -162
  866. package/dist/behaviors.mjs +0 -306
  867. package/dist/brand-assets.mjs +0 -458
  868. package/dist/brands.mjs +0 -141
  869. package/dist/component-contrast.mjs +0 -256
  870. package/dist/construction-styles.cjs +0 -10
  871. package/dist/contracts/foundation.json +0 -211
  872. package/dist/contracts/tokens.json +0 -52
  873. package/dist/contracts.d.mts +0 -30
  874. package/dist/contrast-composition.mjs +0 -80
  875. package/dist/contrast-styles.mjs +0 -88
  876. package/dist/control-padding.mjs +0 -113
  877. package/dist/css-values.mjs +0 -27
  878. package/dist/declarative-flow.mjs +0 -244
  879. package/dist/design-values.mjs +0 -173
  880. package/dist/font-rules.mjs +0 -108
  881. package/dist/fonts-generated.mjs +0 -112
  882. package/dist/foundation-views.mjs +0 -242
  883. package/dist/foundation.mjs +0 -154
  884. package/dist/generated-entries.mjs +0 -198
  885. package/dist/html.mjs +0 -30
  886. package/dist/icons.mjs +0 -154
  887. package/dist/image-attributes.mjs +0 -187
  888. package/dist/image-size.mjs +0 -28
  889. package/dist/layers.mjs +0 -461
  890. package/dist/layout-widths.mjs +0 -332
  891. package/dist/linaria/atomic-css.cjs +0 -2
  892. package/dist/linaria/atomic-styled.cjs +0 -2
  893. package/dist/linaria/preserve-values.cjs +0 -58
  894. package/dist/linaria/spatial-inputs.cjs +0 -56
  895. package/dist/linaria.d.mts +0 -1
  896. package/dist/linaria.mjs +0 -9
  897. package/dist/lockup-composition.mjs +0 -44
  898. package/dist/lockup-model.cjs +0 -64
  899. package/dist/paint-contracts.mjs +0 -216
  900. package/dist/pictograms.mjs +0 -52
  901. package/dist/public-api.mjs +0 -121
  902. package/dist/public-props.mjs +0 -91
  903. package/dist/render-audit/axe-run.mjs +0 -17
  904. package/dist/render-audit/first-render.mjs +0 -40
  905. package/dist/render-audit/image-shape.mjs +0 -46
  906. package/dist/render-audit/layout-overflow.mjs +0 -167
  907. package/dist/render-audit/layout-shift.mjs +0 -32
  908. package/dist/render-audit/non-text-contrast.mjs +0 -151
  909. package/dist/render-audit/pictograms.mjs +0 -88
  910. package/dist/render-color-probe.mjs +0 -202
  911. package/dist/render-composition.mjs +0 -186
  912. package/dist/runtime-contracts.mjs +0 -506
  913. package/dist/scenario-program.mjs +0 -19
  914. package/dist/scenario-selectors.mjs +0 -237
  915. package/dist/scenario-slots.mjs +0 -217
  916. package/dist/scenario-trace.mjs +0 -314
  917. package/dist/scenarios-vite.d.mts +0 -2
  918. package/dist/scenarios-vite.mjs +0 -2
  919. package/dist/scenarios.mjs +0 -616
  920. package/dist/selector-match.mjs +0 -94
  921. package/dist/showcase/comparison.js +0 -48
  922. package/dist/showcase/connection.js +0 -10
  923. package/dist/showcase/draft-navigation.js +0 -59
  924. package/dist/showcase/foundation-view.css +0 -58
  925. package/dist/showcase/foundation-view.mjs +0 -255
  926. package/dist/showcase/guide-controls.ads.review.mjs +0 -32
  927. package/dist/showcase/http-connection.js +0 -86
  928. package/dist/showcase/http-preview.js +0 -81
  929. package/dist/showcase/icons.js +0 -2
  930. package/dist/showcase/navigation.js +0 -13
  931. package/dist/showcase/pictogram-view.mjs +0 -53
  932. package/dist/showcase/preview-frame.ads.review.css +0 -46
  933. package/dist/showcase/preview-frame.ads.review.d.mts +0 -11
  934. package/dist/showcase/preview-frame.ads.review.mjs +0 -22
  935. package/dist/showcase/preview-state.js +0 -11
  936. package/dist/showcase/refresh-scheduler.js +0 -23
  937. package/dist/showcase/resource-reader.js +0 -37
  938. package/dist/showcase-coverage.mjs +0 -139
  939. package/dist/source-symbols.mjs +0 -4
  940. package/dist/spatial-composition.mjs +0 -322
  941. package/dist/spatial-contexts.cjs +0 -56
  942. package/dist/spatial-css.cjs +0 -351
  943. package/dist/spatial-inputs.cjs +0 -80
  944. package/dist/spatial-model.cjs +0 -322
  945. package/dist/spatial.mjs +0 -21
  946. package/dist/stage-timing.cjs +0 -21
  947. package/dist/starters/preact/design-system/patterns/Conversation/Conversation.tsx +0 -105
  948. package/dist/starters/preact/design-system/review/demo-frame/DemoFrame.ads.review.tsx +0 -7
  949. package/dist/starters/preact/design-system/review/screen-frame/ScreenFrame.ads.review.tsx +0 -10
  950. package/dist/starters/preact/design-system/showcase/mcp/main.ads.mount.tsx +0 -8
  951. package/dist/starters/preact/ds.config.json +0 -37
  952. package/dist/starters/preact/package.json +0 -35
  953. package/dist/starters/preact/src/vite-env.d.ts +0 -7
  954. package/dist/starters/preact/tsconfig.json +0 -35
  955. package/dist/starters/preact/vite.config.ts +0 -23
  956. package/dist/starters/react/ADS.md +0 -286
  957. package/dist/starters/react/README.md +0 -184
  958. package/dist/starters/react/biome.css.json +0 -21
  959. package/dist/starters/react/design-system/assets/brand/README.md +0 -41
  960. package/dist/starters/react/design-system/assets/brand/app-icon.svg +0 -4
  961. package/dist/starters/react/design-system/assets/brand/logo.dark.svg +0 -6
  962. package/dist/starters/react/design-system/assets/brand/logo.svg +0 -6
  963. package/dist/starters/react/design-system/assets/glyphs/README.md +0 -15
  964. package/dist/starters/react/design-system/assets/glyphs/aliases.json +0 -1
  965. package/dist/starters/react/design-system/assets/glyphs/check.svg +0 -1
  966. package/dist/starters/react/design-system/assets/glyphs/chevron-down.svg +0 -1
  967. package/dist/starters/react/design-system/assets/glyphs/chevron-right.svg +0 -1
  968. package/dist/starters/react/design-system/assets/glyphs/external-link.svg +0 -1
  969. package/dist/starters/react/design-system/assets/glyphs/info.svg +0 -1
  970. package/dist/starters/react/design-system/assets/glyphs/menu.svg +0 -1
  971. package/dist/starters/react/design-system/assets/glyphs/plus.svg +0 -1
  972. package/dist/starters/react/design-system/assets/glyphs/warning.svg +0 -1
  973. package/dist/starters/react/design-system/assets/pictograms/catalog.ads.json +0 -13
  974. package/dist/starters/react/design-system/assets/pictograms/journey.dark.svg +0 -7
  975. package/dist/starters/react/design-system/assets/pictograms/journey.svg +0 -7
  976. package/dist/starters/react/design-system/components/Actions/Button/Button.ads.exports.ts +0 -1
  977. package/dist/starters/react/design-system/components/Actions/Button/Button.ads.fixture.ts +0 -1
  978. package/dist/starters/react/design-system/components/Actions/Button/README.md +0 -12
  979. package/dist/starters/react/design-system/components/Actions/IconButton/IconButton.ads.exports.ts +0 -1
  980. package/dist/starters/react/design-system/components/Actions/IconButton/IconButton.ads.fixture.ts +0 -9
  981. package/dist/starters/react/design-system/components/Actions/IconButton/IconButton.ads.scenario.tsx +0 -16
  982. package/dist/starters/react/design-system/components/Actions/IconButton/README.md +0 -17
  983. package/dist/starters/react/design-system/components/Content/Icon/Icon.ads.exports.ts +0 -1
  984. package/dist/starters/react/design-system/components/Content/Icon/Icon.ads.fixture.ts +0 -6
  985. package/dist/starters/react/design-system/components/Content/Icon/README.md +0 -17
  986. package/dist/starters/react/design-system/components/Content/Icon/glyphs.ts +0 -17
  987. package/dist/starters/react/design-system/components/Content/Image/Image.ads.exports.ts +0 -1
  988. package/dist/starters/react/design-system/components/Content/Image/README.md +0 -20
  989. package/dist/starters/react/design-system/components/Content/Logo/Logo.ads.exports.ts +0 -1
  990. package/dist/starters/react/design-system/components/Content/Logo/Logo.ads.fixture.ts +0 -1
  991. package/dist/starters/react/design-system/components/Content/Logo/Logo.ads.scenario.tsx +0 -12
  992. package/dist/starters/react/design-system/components/Content/Logo/Logo.tsx +0 -35
  993. package/dist/starters/react/design-system/components/Content/Logo/README.md +0 -12
  994. package/dist/starters/react/design-system/components/Content/Pictogram/Pictogram.ads.exports.ts +0 -1
  995. package/dist/starters/react/design-system/components/Content/Pictogram/Pictogram.ads.fixture.ts +0 -1
  996. package/dist/starters/react/design-system/components/Content/Pictogram/Pictogram.ads.scenario.tsx +0 -7
  997. package/dist/starters/react/design-system/components/Content/Pictogram/Pictogram.tsx +0 -26
  998. package/dist/starters/react/design-system/components/Forms/TextField/README.md +0 -14
  999. package/dist/starters/react/design-system/components/Forms/TextField/TextField.ads.exports.ts +0 -1
  1000. package/dist/starters/react/design-system/components/Forms/TextField/TextField.ads.fixture.ts +0 -6
  1001. package/dist/starters/react/design-system/composition/Search/SearchPage/README.md +0 -4
  1002. package/dist/starters/react/design-system/composition/Search/SearchPage/SearchPage.ads.fixture.ts +0 -7
  1003. package/dist/starters/react/design-system/composition/Search/SearchPage/SearchPage.ads.scenario.tsx +0 -16
  1004. package/dist/starters/react/design-system/composition/Workspace/WorkspacePage/README.md +0 -5
  1005. package/dist/starters/react/design-system/composition/Workspace/WorkspacePage/WorkspacePage.ads.fixture.ts +0 -13
  1006. package/dist/starters/react/design-system/composition/Workspace/WorkspacePage/WorkspacePage.ads.scenario.tsx +0 -22
  1007. package/dist/starters/react/design-system/controllers/Palette/Palette.ads.exports.ts +0 -1
  1008. package/dist/starters/react/design-system/patterns/Conversation/Conversation.ads.exports.ts +0 -1
  1009. package/dist/starters/react/design-system/patterns/Conversation/Conversation.ads.fixture.ts +0 -7
  1010. package/dist/starters/react/design-system/patterns/Conversation/Conversation.ads.scenario.tsx +0 -15
  1011. package/dist/starters/react/design-system/patterns/Conversation/Conversation.tsx +0 -105
  1012. package/dist/starters/react/design-system/patterns/Conversation/README.md +0 -9
  1013. package/dist/starters/react/design-system/patterns/Search/SearchBar/README.md +0 -12
  1014. package/dist/starters/react/design-system/patterns/Search/SearchBar/SearchBar.ads.exports.ts +0 -1
  1015. package/dist/starters/react/design-system/patterns/Search/SearchBar/SearchBar.ads.fixture.ts +0 -1
  1016. package/dist/starters/react/design-system/patterns/Search/SearchBar/SearchBar.ads.scenario.tsx +0 -11
  1017. package/dist/starters/react/design-system/patterns/Search/SearchBar/SearchBar.tsx +0 -41
  1018. package/dist/starters/react/design-system/patterns/Shell/Floating.ads.fixture.ts +0 -5
  1019. package/dist/starters/react/design-system/patterns/Shell/Floating.ads.scenario.tsx +0 -21
  1020. package/dist/starters/react/design-system/patterns/Shell/README.md +0 -43
  1021. package/dist/starters/react/design-system/patterns/Shell/Shell.ads.exports.ts +0 -1
  1022. package/dist/starters/react/design-system/patterns/Shell/Shell.ads.fixture.ts +0 -5
  1023. package/dist/starters/react/design-system/review/demo-frame/DemoFrame.ads.exports.ts +0 -1
  1024. package/dist/starters/react/design-system/review/demo-frame/DemoFrame.ads.review.tsx +0 -7
  1025. package/dist/starters/react/design-system/review/index.ads.review.ts +0 -4
  1026. package/dist/starters/react/design-system/review/region-block/RegionBlock.ads.exports.ts +0 -1
  1027. package/dist/starters/react/design-system/review/region-block/RegionBlock.ads.review.tsx +0 -6
  1028. package/dist/starters/react/design-system/review/screen-frame/ScreenFrame.ads.exports.ts +0 -1
  1029. package/dist/starters/react/design-system/review/screen-frame/ScreenFrame.ads.review.tsx +0 -10
  1030. package/dist/starters/react/design-system/showcase/mcp/main.ads.mount.tsx +0 -10
  1031. package/dist/starters/react/design-system/styles.css +0 -7
  1032. package/dist/starters/react/design-system/tokens/base.css +0 -36
  1033. package/dist/starters/react/design-system/tokens/catalog.ads.json +0 -1221
  1034. package/dist/starters/react/design-system/tokens/colors.css +0 -215
  1035. package/dist/starters/react/design-system/tokens/elevation.css +0 -53
  1036. package/dist/starters/react/design-system/tokens/spacing.css +0 -87
  1037. package/dist/starters/react/design-system/tokens/spatial.ads.json +0 -70
  1038. package/dist/starters/react/design-system/tokens/themes.generated.css +0 -142
  1039. package/dist/starters/react/design-system/tokens/themes.generated.ts +0 -402
  1040. package/dist/starters/react/design-system/tokens/typography.css +0 -31
  1041. package/dist/starters/react/ds.config.json +0 -37
  1042. package/dist/starters/react/gitignore.template +0 -8
  1043. package/dist/starters/react/package.json +0 -39
  1044. package/dist/starters/react/scripts/build-mcp-previews.mjs +0 -3
  1045. package/dist/starters/react/src/vite-env.d.ts +0 -7
  1046. package/dist/starters/react/tsconfig.build.json +0 -20
  1047. package/dist/starters/react/tsconfig.json +0 -34
  1048. package/dist/starters/react/vite.config.ts +0 -23
  1049. package/dist/style-boundaries.mjs +0 -106
  1050. package/dist/style-token-rules.mjs +0 -51
  1051. package/dist/themes-generated.mjs +0 -161
  1052. package/dist/themes-watch.mjs +0 -83
  1053. package/dist/themes.mjs +0 -360
  1054. package/dist/token-export.mjs +0 -94
  1055. package/dist/token-origins.mjs +0 -24
  1056. package/dist/token-policy.mjs +0 -26
  1057. package/dist/token-quality.mjs +0 -149
  1058. package/dist/token-samples.mjs +0 -19
  1059. package/dist/tokens.mjs +0 -194
  1060. package/dist/unit-contracts.mjs +0 -396
  1061. package/dist/usage.mjs +0 -184
  1062. package/dist/verification/playwright-reporter.cjs +0 -87
  1063. package/docs/CONTRACTS.md +0 -285
  1064. package/docs/HTTP-SHOWCASE-POC.md +0 -397
  1065. package/docs/SPATIAL-CHECKS.md +0 -69
  1066. package/docs/benchmarks/http-showcase-optimized.json +0 -1879
  1067. package/docs/benchmarks/http-showcase-profile.json +0 -308
  1068. package/docs/benchmarks/http-showcase.json +0 -3069
  1069. /package/dist/{starters/react/design-system/assets/fonts/.gitkeep → analysis/semantic.mjs} +0 -0
  1070. /package/dist/{starters/react/design-system/controllers/.gitkeep → lowering-model.mjs} +0 -0
  1071. /package/dist/showcase/{favicon.svg → ui/favicon-scavmehf.svg} +0 -0
package/docs/GUIDE.md CHANGED
@@ -1,368 +1,400 @@
1
1
  # ADS tool guide
2
2
 
3
- Choose [direct code editing or MCP-only editing](../skills/ads-designer/references/workflows.md).
4
- Direct editors change owned files normally and use MCP for preview and validation;
5
- ordinary edits do not require drafts or acceptance. MCP-only iterative editing
6
- uses [tracked drafts](../skills/ads-designer/references/drafts.md), rendered review
7
- and exact-revision acceptance. Direct editors may choose drafts for isolation and
8
- Accepted/Draft comparison too. Complete any required tracked proposals before
9
- reporting the design change finished. Both editing routes use ADS's own compiler.
10
-
11
- ADS is development tooling for a project's local design system. This package
12
- contains a Bun CLI, shared token contract, asynchronous native static checks and
13
- foundation scaffolding. Default initialization creates an empty design system;
14
- `--include-starter` adds the shared example design and application source. ADS
15
- adds no runtime dependency to the application's shipped UI.
16
-
17
- For an existing installation, use the [ads-migrate skill](../skills/ads-migrate/SKILL.md).
18
- The [0.4.3 → 0.4.4 guide](../skills/ads-migrate/references/0.4.3-to-0.4.4.md)
19
- covers dependency updates, restarting the managed runtime and checking incremental
20
- previews without rewriting project components or deleting active drafts.
3
+ ADS is development tooling for a project's local design system. The package
4
+ contains a Bun CLI, asynchronous native static checks, the design-system
5
+ compiler and a starter design system that `ads init` installs. `ads emit`
6
+ compiles the design system into plain modules and stylesheets. ADS adds no
7
+ runtime dependency to the application's shipped UI.
8
+
9
+ There are two [editing routes](../skills/ads-designer/references/workflows.md).
10
+ Both use ADS's own compiler.
11
+
12
+ - **Direct editing.** Change the owned files normally, and use MCP for preview
13
+ and validation. Drafts and acceptance are not required, but you can use drafts
14
+ for isolation and for the Accepted/Draft comparison.
15
+ - **MCP-only editing.** Change source through
16
+ [tracked drafts](../skills/ads-designer/references/drafts.md), review the
17
+ rendered result, then accept the exact revision.
18
+
19
+ Complete each required tracked proposal before you report a design change as
20
+ finished.
21
21
 
22
22
  ## Use ADS through MCP
23
23
 
24
- Connect your coding agent using the [MCP client setup](MCP.md#connect-codex-or-claude).
25
- The client launches `ads mcp` in your project; add `--mutations` to enable guarded
26
- source editing. Initialization also supplies `ads-mcp` and `ads-read-mcp` launch
27
- scripts. The server starts its showcase and ADS-managed preview compiler, so use
28
- the returned showcase URL rather than starting a separate preview application.
29
-
30
- An agent uses the MCP tools to inspect, edit and review the project:
31
-
32
- 1. Call `ads_status` to identify the connected project, available commands,
33
- mutation mode, showcase URL and build freshness.
34
- 2. Find public UI/behavior APIs with `ads_catalog`, inspect relevant definitions
35
- with `ads_tokens`, and discover preview IDs with `ads_scenarios`. Read one
36
- relevant workflow skill before editing: natively, or through `ads_skills` and
37
- `ads_read_skill` on a 2025-era connection.
38
- 3. Open a discovered preview, including the token and brand views ADS renders, with `ads_show_scenario`. It
39
- renders the project's actual scenario, fixtures and adapter through MCP Apps.
40
- Use the returned showcase link when the client cannot render Apps.
41
- 4. Select the editing route, independently of `mutations.enabled`. With direct
42
- source access, edit owned files and use the existing compiler/preview; run
43
- current gates and relevant project/behavior checks before finishing. With
44
- MCP-only access and mutation tools enabled, every change goes through a draft:
45
- discover owners with `ads_units`, use `ads_create_draft`,
46
- `ads_read_file`/`ads_update_draft` (file contents or a Git diff), rendered
47
- `ads_show_draft` review, an optional `ads_accept` dry run and exact-revision
48
- `ads_accept`. An owner is in at most one open draft. Accept dependencies first and
49
- review dependents again. After a series of accepted drafts, run
50
- `ads_validate({scope:"changed"})`. A read-only MCP connection
51
- supports direct editors; it cannot edit for an MCP-only client.
52
- 5. Review diagnostics, registered behavior evidence and the rendered result.
53
- `ads_behaviors` discovers guarantees; the gates run them, and `ads verify` runs
54
- one unit's checks from the CLI. Recheck `ads_status.build` after changes; notifications alone do not
55
- establish current output.
56
-
57
- For an on-demand screenshot, call `ads_capture` with a discovered scenario ID and
58
- optionally a named `captureTargets` element, theme and viewport. To compare a
59
- draft with accepted source, pass its `draft` id and exact `revision`; acceptance and
60
- its dry run create no screenshots. Capture uses project-installed
61
- Playwright and its browser; ADS installs neither (`ads init` declares
62
- `@playwright/test`; run `npx playwright install chromium` once).
63
-
64
- For layout inspection, add `guides:["tracks","gaps","padding","mini"]`.
65
- The selectable layers are `bounds`, `tracks`, `gaps`, `padding`, `margins`, and
66
- `mini`; they use the showcase overlay on all visible elements. Omit `guides` or
67
- pass `[]` for a clean visual review. Guides work on components, patterns,
68
- compositions and `tokens/Layout`, and are recorded in image settings. Read the
69
- annotated image before requesting a clean capture: each scenario/target has one
70
- current slot, so the next capture replaces it. A draft comparison uses the same
71
- layers for current and candidate.
72
-
73
- Read `ads://project/captures` and the returned PNG image URIs through MCP
74
- `resources/read`. Each target keeps only current and candidate: a successful
75
- standalone screenshot replaces current and clears candidate; a screenshot-enabled
76
- dry run replaces the pair; applying matching source promotes candidate. Source
77
- changes mark images stale. There is no previous slot, history or TTL.
78
- `ads_capture_clear` discards candidate or clears both images. Subscribe to resource
79
- updates when supported, and explicitly reread otherwise. Screenshots provide visual
80
- evidence for one state; they do not replace behavior checks.
81
-
82
- ADS serves its skills over MCP, by what the client speaks:
83
-
84
- | Client | How it gets skills |
24
+ Connect your coding agent with the [MCP client setup](MCP.md#connect-codex-or-claude).
25
+ The client launches `ads mcp` in your project; `--mutations` enables guarded
26
+ source editing. The server starts its showcase and the ADS-managed preview
27
+ compiler. Use the returned showcase URL; do not start a separate preview
28
+ application. The [MCP guide](MCP.md) gives the tool and resource schemas,
29
+ prompts, skills and notifications.
30
+
31
+ An agent works in these steps:
32
+
33
+ 1. Call `ads_status`. It identifies the connected project, the available
34
+ commands, the mutation mode, the showcase URL, the declared themes and brands,
35
+ and the build freshness.
36
+ 2. Find the public UI and behavior with `ads_catalog`, the tokens with
37
+ `ads_tokens`, the files of an owner with `ads_units` and the preview IDs with
38
+ `ads_scenarios`.
39
+ 3. Read one relevant workflow [skill](MCP.md#skills) before you edit: natively,
40
+ or through `ads_skills` and `ads_read_skill` on an earlier protocol. The host
41
+ decides whether a skill is loaded into an agent's context. `npx skills`
42
+ installs the skills locally for a host that does not read them over MCP.
43
+ 4. Open a discovered preview with `ads_show_scenario`. It renders the project's
44
+ actual scenario through MCP Apps. If the client cannot render Apps, use the
45
+ returned showcase link.
46
+ 5. Select the editing route. The route does not depend on `mutations.enabled`.
47
+ - With direct source access, edit the owned files. Run `ads check` and the
48
+ relevant project checks before you finish.
49
+ - With MCP-only access and mutation tools enabled, every change goes through
50
+ a draft: `ads_create_draft`, `ads_read_file` and `ads_update_draft` (file
51
+ contents or a Git diff), a rendered `ads_show_draft` review, an optional
52
+ `ads_accept` dry run, then `ads_accept` of the exact revision. An owner is
53
+ in at most one open draft. Accept dependencies first and review dependents
54
+ again.
55
+ - After a series of accepted drafts, run `ads_validate({scope:"changed"})`.
56
+ - To remove declared targets, use `ads_delete`
57
+ ([Deleting declared targets](#deleting-declared-targets)).
58
+ - A read-only MCP connection supports direct editors. It cannot edit for an
59
+ MCP-only client.
60
+ 6. Review the diagnostics, the execution evidence and the rendered result. Check
61
+ `ads_status.build` again after changes. Notifications alone do not prove that
62
+ the output is current.
63
+
64
+ **Nothing to inspect or run.** A feature with nothing to inspect or run does not
65
+ report an empty match or a pass. Its result carries
66
+ `{ "status": "not-available", "reason", "message" }`:
67
+
68
+ | Reason | Meaning |
85
69
  |---|---|
86
- | Protocol `2026-07-28` | The `io.modelcontextprotocol/skills` extension: `skills/list` and `skills/get` give each skill's frontmatter and its complete file list with digests and sizes, `resources/directory/read` lists a folder, and `resources/read` gets a file |
87
- | Earlier protocols | `skill://` resources through `resources/list` and `resources/read`, and the `ads_skills` and `ads_read_skill` tools |
70
+ | `no-scenarios` | No scenarios are registered, so nothing can be rendered, captured or audited |
71
+ | `no-behavior-checks` | No behavior checks are registered |
72
+ | `no-token-inventory` | The design system declares no token sheet (`ads tokens`, `ads_tokens`, `ads://project/tokens`, `ads://project/tokens/dtcg`) |
73
+ | `no-catalog` | The design system has no public barrel, or it exports nothing (`ads_catalog`, `ads://project/catalog`) |
74
+ | `none-selected` | Entries are registered, but the change set or selection reaches none of them |
75
+ | `turned-off` | The project's configuration turns the stage off |
76
+
77
+ A gate stage that ran nothing is listed as skipped, never as passed or
78
+ established.
79
+
80
+ **Screenshots.** For an on-demand screenshot, call `ads_capture` with a
81
+ discovered scenario ID and, optionally, a named `captureTargets` element, one
82
+ of the scenario's named states, a theme, a viewport and layout `guides`. To compare a draft with accepted source,
83
+ pass the `draft` id and the exact `revision`. Acceptance and its dry run create
84
+ no screenshots. A screenshot is visual evidence for one state; it does not
85
+ replace behavior checks. See
86
+ [screenshots and candidate comparison](MCP.md#screenshots-and-candidate-comparison)
87
+ and the portable [capture guide](../skills/ads-designer/references/captures.md)
88
+ (`ads://guides/captures`) for guides, named targets, limits and the
89
+ current/candidate image lifecycle.
90
+
91
+ Capture and the render audit use ADS's own Playwright; the project installs
92
+ nothing. The first capture or audit on a machine installs Playwright's browser
93
+ into its shared cache, with progress. To provision CI or an offline machine
94
+ ahead of time, run the command that a failed installation names:
95
+ `bunx playwright@<ADS's Playwright version> install chromium`.
88
96
 
89
- Whether a skill is loaded into an agent's context is up to the host. `npx skills` installs them locally
90
- for a host that does not read them over MCP.
97
+ ## Implementation support
91
98
 
92
- The [MCP guide](MCP.md) details tool/resource schemas, prompts, skills and
93
- notifications. The portable [capture guide](../skills/ads-designer/references/captures.md)
94
- explains screenshot setup, named targets, limits and comparison usage; MCP serves
95
- the same guide at `ads://guides/captures`.
99
+ [Design system source](#design-system-source) describes what you author and what
100
+ `ads check` enforces. [Emitting the design system](#emitting-the-design-system)
101
+ describes the output that an application imports.
96
102
 
97
- Watched previews keep the isolated frame alive during compatible edits. Component
98
- state, entered text and focus can survive code and style updates; changed hook
99
- signatures follow React or Preact's reset rules. Incompatible module changes and
100
- restoring rejected revisions may reset the preview. “Checking changes…” is live
101
- feedback, not acceptance: source gates and selected browser checks still decide
102
- whether the revision passes. Application production builds are unchanged.
103
+ The starter and the emitted output target the project's framework: React, or
104
+ native Preact (owners typed by Preact's own JSX runtime, `preact/hooks`, no
105
+ `preact/compat`).
103
106
 
104
- ## Implementation support
107
+ The guards do not parse Vue or Svelte single-file components, or HTML templates.
108
+ Keep the framework-specific checks for them. A clean ADS check does not validate
109
+ a surface that ADS does not check.
105
110
 
106
- Linaria is required for component and pattern styling. Projects choose their
107
- UI framework and visual design; `init` preserves framework configuration and
108
- adds no React runtime dependency. See the
109
- [architecture](https://github.com/reqvire-org/ads/blob/main/docs/ARCHITECTURE.md#linaria-is-the-implementation-mechanism)
110
- for the rationale.
111
-
112
- Current source checking supports `.js`, `.jsx`, `.ts`, `.tsx`, their module
113
- variants, `.css`, and imported Linaria `css` and `styled` templates. JSX style/type checks
114
- support React and native Preact, including imported factory aliases and
115
- DOM/CSS types. Scenario discovery, coverage, ownership checks and MCP delivery
116
- apply to both. The empty application starter comes for React and for Preact; this
117
- checkout’s working example uses native Preact 11 with TypeScript and Linaria. ADS adds neither runtime
118
- to a receiving application and never silently aliases React to Preact.
119
-
120
- Vue/Svelte single-file components and HTML templates are not parsed by these
121
- guards. Web Component JS/TS logic and separate CSS can be checked, but HTML
122
- template strings and Shadow DOM style constructs lack equivalent coverage.
123
- Retain framework-specific checks; a clean ADS check does not validate those
124
- unchecked surfaces.
111
+ For product MCP Apps, make the widget's entry the root of the production bundle,
112
+ and import the necessary public design-system UI by name from the emitted
113
+ output. The app's own MCP server serves the built widget; it does not need ADS's
114
+ server or showcase. Check the runtime code and the emitted CSS and assets for
115
+ unrelated owners. See the
116
+ [product widget integration proof](MCP.md#product-widgets-and-payload-scope).
125
117
 
126
118
  ### Controllers and behavior checks
127
119
 
128
- Keep private controllers with their consumer; share reusable behavior through
129
- `design-system/controllers/<Name>/`. Use the configured framework and declared
130
- project dependencies. Controllers own lifecycle/measurements while components and
131
- patterns own presentation. A shared context provider is a behavioral API too.
132
-
133
- Optional `<Owner>.ads.contract.ts` registers guarantees and maintained checks using actual implementation references.
134
- Scenario `exercises` records demonstrations separately from rendered `covers`.
135
- Use `ads behaviors --json` for discovery and `ads verify --unit <discovered-id>`
136
- to run registered cases; MCP exposes `ads_behaviors`, and its gates run the cases. Tests and
137
- contracts stay outside production exports. See the [complete schema and runner
138
- integration](BEHAVIORS.md), including browser and React development StrictMode profiles.
139
-
140
- ### Linaria integration
141
-
142
- Before authoring components or patterns, integrate Linaria extraction with the
143
- project's existing build:
144
-
145
- - Install compatible Linaria packages and the extraction integration for the
146
- project's bundler. ADS implementations use `css` and `cx` from
147
- `@linaria/atomic`.
148
- - For Vite, run `@wyw-in-js/vite` before the framework transform. Apply equivalent
149
- extraction to application and project preview builds.
150
- - Resolve `@ds` to the local public entry in the bundler and TypeScript, and load
151
- the foundation CSS once. Preserve intentional CSS side effects.
152
- - Compile an actual styled component and inspect its emitted CSS and browser
153
- result. Static source checks do not establish complete extraction or
154
- unused-style removal.
155
-
156
- For product MCP Apps, make the widget's entry the production bundle root and
157
- import the needed public design-system UI by name. The app's own MCP server
158
- serves that built widget; it does not need ADS's server or showcase. Check both
159
- runtime code and emitted CSS/assets for unrelated owners. See the
160
- [product widget integration proof](MCP.md#product-widgets-and-payload-scope).
120
+ A controller is a plain module that the barrel exports, with no recipe and no
121
+ markup. Keep a private controller with its consumer; share reusable behavior
122
+ through `design-system/controllers/<Name>/`. A controller owns lifecycle and
123
+ measurements, and components and patterns own presentation. It can read computed
124
+ styles and use an offscreen canvas. It renders no markup, sets no class or
125
+ style, and writes no styling through the DOM (`source/plain-*`). Use the
126
+ configured framework and the declared project dependencies.
127
+
128
+ Owners register behavior in `<Owner>.ads.behavior.ts`. ADS runs every check
129
+ itself: `unit` specs under its own Bun, `browser` and `strict` (React) specs
130
+ with its own Playwright. The project installs and configures no test runner;
131
+ `mcp.behaviorProfiles` can only set the `timeoutMs` of a built-in profile. A
132
+ design system that registers no checks reports `not-available`
133
+ (`no-behavior-checks`). See
134
+ [registered checks and their status](BEHAVIORS.md#registered-checks-and-their-status).
135
+
136
+ The starter's form-field bridge (`controllers/FormField`) registers eight
137
+ guarantees with unit checks. On an installed starter, `ads behaviors` lists them
138
+ and `ads verify` runs them under the built-in `unit` profile.
139
+
140
+ ### Forms
141
+
142
+ A field shows a constraint error only after the user interacts with it (a
143
+ commit, a blur after an edit, a failed submit). It shows an application error (a
144
+ server's verdict) immediately. The starter's form-field bridge
145
+ (`controllers/FormField`: `bindFormField`, `bindForm`, and the hooks
146
+ `useFormField` and `useFormBridge`) mirrors that timing onto the field's root as
147
+ `data-user-invalid`, `data-user-valid` and `data-autofill`, which recipes select
148
+ as ordinary attribute states. It also sets `aria-invalid` explicitly, links the
149
+ error message with `aria-describedby` only while it is shown, announces an error
150
+ that appears on blur once through the form's one polite live region, and after a
151
+ failed submit focuses the form's error summary, or the first invalid field.
152
+ Where the browser lacks `:user-invalid`, its own tracked events give the same
153
+ timing.
154
+
155
+ The starter's `TextField` takes `type`, `autoComplete`, `inputMode`,
156
+ `enterKeyHint`, `spellCheck`, `autoCorrect` and `autoCapitalize` (off by default
157
+ for email, tel, url and password), `pattern`, `minLength`, `maxLength`,
158
+ `required`, `error` (the application's), `validationMessage` and
159
+ `nativeValidation`. Its invalid and autofill states draw inset rings, which take
160
+ no space and are not colour alone.
161
+
162
+ `ads check` blocks an error or autofill state shown by colour alone
163
+ (`source/form-state-colour-only`) and an autofill treatment that moves layout
164
+ (`source/autofill-layout-shift`). It reviews a text field that names what it
165
+ collects without `autoComplete` (`review/autocomplete-missing`). Read the forms
166
+ guide ([forms.md](../skills/ads-designer/references/forms.md),
167
+ `ads://guides/forms`) for the timing, the bridge's API, the recipe states and
168
+ the browser limits. ADS's browser tests run in Chromium only.
169
+
170
+ ## Set up a design package
171
+
172
+ A design system lives in its own package, the *design package*: a folder with
173
+ its own `package.json`, `ds.config.json`, `tsconfig.json` and `design-system/`.
174
+ ADS runs only there. Applications consume what `ads emit` writes and never
175
+ install ADS. Install Bun 1.4.1 or later for ADS tooling and previews. ADS ships
176
+ everything else it needs (its own Playwright and browser, its test runners) and
177
+ needs nothing from the application.
178
+
179
+ There are two layouts.
180
+
181
+ **Several applications, one design system.** The design package has its own
182
+ repository. Its output is `dist/`, which its `exports` publish and which is
183
+ committed, so a Git reference installs it:
161
184
 
162
- The [starter's dependencies](https://github.com/reqvire-org/ads/blob/main/starters/shared/package.json),
163
- [entry build](https://github.com/reqvire-org/ads/blob/main/starters/shared/vite.config.ts),
164
- and [native mounts](https://github.com/reqvire-org/ads/tree/main/starters)
165
- provide the React/Vite setup. Merge the needed integration into an existing
166
- project instead of replacing its configuration.
185
+ ```sh
186
+ bunx @reqvire-org/ads init acme-design --framework react # or npx … init
187
+ cd acme-design && bun install
188
+ bun run lint:ds # ads check
189
+ bun run emit:ds # ads emit → dist/
190
+ git add . && git commit -m "Design system 1.0.0" && git tag v1.0.0
191
+ ```
167
192
 
168
- `ads init` does not install Linaria, configure extraction, or verify the complete
169
- styling pipeline. It sets up token/source checks and build hooks. The copied
170
- standalone starter already includes Linaria dependencies and Vite integration.
193
+ ```json
194
+ {
195
+ "name": "@acme/ui",
196
+ "version": "1.0.0",
197
+ "type": "module",
198
+ "exports": { ".": "./dist/index.ts", "./foundation.css": "./dist/foundation.css" },
199
+ "files": ["dist"],
200
+ "sideEffects": ["*.css"],
201
+ "peerDependencies": { "react": "^19.0.0" },
202
+ "devDependencies": { "@reqvire-org/ads": "^0.5.0", "react": "19.2.7", "react-dom": "19.2.7", "@types/react": "19.2.17" },
203
+ "scripts": { "lint:ds": "ads check .", "emit:ds": "ads emit" }
204
+ }
205
+ ```
171
206
 
172
- ### Native Preact integration
207
+ An application in another repository depends on it by Git reference (or a packed
208
+ tarball, or a registry release), and installs its own React:
173
209
 
174
- An existing Preact project keeps its own runtime. Use `preact` for rendering and
175
- DOM types, `preact/hooks` for hooks, and optionally `@preact/signals` for reactive
176
- state. Configure TypeScript with `"jsx": "react-jsx"` and
177
- `"jsxImportSource": "preact"`. A Vite build can use its native transform:
210
+ ```json
211
+ {
212
+ "name": "shop-app",
213
+ "private": true,
214
+ "type": "module",
215
+ "dependencies": {
216
+ "@acme/ui": "git+ssh://git@github.com/acme/acme-design.git#v1.0.0",
217
+ "react": "^19.0.0",
218
+ "react-dom": "^19.0.0"
219
+ },
220
+ "devDependencies": { "vite": "^7.0.0", "@vitejs/plugin-react": "^5.0.0", "typescript": "^5.9.0" },
221
+ "scripts": { "dev": "vite", "build": "vite build" }
222
+ }
223
+ ```
178
224
 
179
- ```ts
180
- esbuild: { jsx: "automatic", jsxImportSource: "preact" },
181
- plugins: [wyw({ tagResolver: linariaTagResolver }), /* project plugins */],
225
+ ```tsx
226
+ import "@acme/ui/foundation.css";
227
+ import { Button } from "@acme/ui";
182
228
  ```
183
229
 
184
- Apply that configuration to the application build. ADS's preview compiler uses
185
- the declared `framework` and shared Linaria resolver automatically. Mount preview
186
- entries with `render(<Scenario />, root)` from `preact`; React entries use their
187
- existing React mount. Keep Linaria's `css`/`cx` extraction; native Preact does not
188
- need `@linaria/react`'s React `styled` wrapper. Use `onInput` for live text updates
189
- and `event.currentTarget` for the typed element. Native SVG uses DOM names such as
190
- `stroke-width` and `stroke-linecap`; React’s camel-case presentation aliases are
191
- not normalized by the native renderer. The `svg-attribute` guard checks those
192
- attributes when the project/file JSX runtime or factory is native Preact. Preact 11 accepts refs as props
193
- and exports DOM types such as `HTMLAttributes` directly; Preact 10's `JSX` type
194
- namespace is also recognized by guards. See the [Preact upgrade guide](https://preactjs.com/guide/v11/upgrade-guide/).
195
-
196
- The [shared starter](https://github.com/reqvire-org/ads/tree/main/starters/shared)
197
- and its [native generator](https://github.com/reqvire-org/ads/blob/main/scripts/build-starters.mjs)
198
- show the setup. `ads init --framework preact --include-starter` adds the generated
199
- Preact variant of that source. The generator changes runtime dependencies, JSX
200
- settings, framework imports and the native mount together. For a Preact app without a saved framework, run
201
- `ads init --framework preact`; newly generated foundation scenarios use native
202
- hooks. Init preserves the application's compiler, dependencies and mount adapter.
203
-
204
- ### CSS correctness in the tool and starter
205
-
206
- The tool and starter use Biome only for CSS, configured in
207
- `biome.css.json`. Parsing rejects malformed CSS and invalid hex colors, including
208
- token values. Explicit lint rules reject duplicate font names and selectors;
209
- the starter also rejects duplicate properties. Formatting is disabled. ADS directly checks architecture, token usage and
210
- ownership in JavaScript/TypeScript. The tool repository uses Oxlint for its own
211
- ordinary JavaScript linting; consumers do not need that extra pass. `ads init` preserves an existing project's lint tools.
212
-
213
- CSS regression tests cover rejected input, valid theme/nesting
214
- contexts, and exclusion of JavaScript and generated outputs.
215
-
216
- ## Set up an existing project
217
-
218
- Install Bun 1.4.1+ for ADS tooling and previews. The application keeps its own
219
- Node/npm or Bun pipeline. Run inside the project containing `package.json`:
230
+ To upgrade, move the ref (`#v1.1.0`). To try an unreleased change, use a branch
231
+ ref or a packed tarball. Git references, tarballs and registries install a copy
232
+ without the design package's `devDependencies`. Its React for authoring is thus
233
+ never installed into the application: one React, no bundler setting. Symlinked
234
+ local dependencies (`file:` to a folder, `link:`, `npm link`) are not supported:
235
+ the application would resolve the design package's own `node_modules` first and
236
+ could load a second React.
237
+
238
+ **One application, one design system.** The design package is a folder in the
239
+ application's repository and emits directly into the application's source:
220
240
 
221
241
  ```sh
222
- npx @reqvire-org/ads init --framework react
223
- npm install
224
- npx playwright install chromium # browser for the accessibility audit
225
- npm run build
242
+ cd shop-app
243
+ bunx @reqvire-org/ads init design --framework react --out ../src/ui
244
+ cd design && bun install && bun run emit:ds # → ../src/ui
226
245
  ```
227
246
 
228
- For a Bun-managed project, use
229
- `bunx @reqvire-org/ads init --framework react`, followed by `bun install`,
230
- `bunx playwright install chromium` and `bun --bun run build`. Node is unnecessary. No archive or directory argument is needed for a published
231
- release. `init` requires an existing project; it does not create an application.
232
- To start from ADS's TypeScript/Linaria starter, add `--include-starter`: init also adds
233
- the starter's example design system, Vite and TypeScript setup, scripts and development
234
- dependencies that the project lacks. It never replaces an existing file and never writes
235
- a lockfile.
236
-
237
- Choose `--framework react` or `--framework preact` when the project has no saved
238
- framework. Init persists it as `framework` in `ds.config.json`. Subsequent runs
239
- reuse the saved value.
240
- There is no implicit framework detection or default for initialization.
241
-
242
- A conflicting flag stops init before writes. Init also checks available
243
- TypeScript/JavaScript JSX settings, including inherited configurations and project
244
- references, for clear React/Preact conflicts. It preserves compiler files and
245
- does not install a framework or establish that the complete bundler setup works.
246
- Projects without JSX settings can still record their choice and configure the
247
- compiler separately. Svelte and other frameworks are not accepted yet.
248
-
249
- Existing ADS configs without `framework` remain readable by checks and inspection.
250
- On the next init, supply the flag once; init adds that field while preserving
251
- other settings and existing source. To migrate frameworks, update the project
252
- and its saved choice explicitly; init is not a framework conversion command.
253
-
254
- Initialization:
255
-
256
- - Adds the tool to `devDependencies`, with the executing version pinned by
257
- default. Keeps an existing tool version unless `--tool-package` overrides it.
258
- - Creates missing `ds.config.json`, foundation CSS, a public entry, and empty
259
- component/pattern directories, brand guidance, and an empty font directory.
260
- Seeds token defaults only when the configured
261
- token folder contains no CSS. New foundation scenarios use the selected
262
- framework's hooks. Existing ADS source and token values remain unchanged;
263
- incomplete existing token contracts need an explicit migration.
264
- - Adds `lint:ds`, which runs native `ads check` directly. Project linter and test
265
- commands remain explicitly owned by the project.
266
- - Adds `assets:ds` (`ads assets`) after those checks and before the existing
267
- `prebuild` hook, preserving the actual
268
- `build` command. If the project has no build script, adds a validation/generation
269
- build. Repeating init does not duplicate the hook.
270
- - Adds the same checks and generation to `prebuild:showcase` when a standalone
271
- `build:showcase` script exists, preserving its existing hook and build command.
272
- - Adds `dev:showcase` as `ads showcase` when absent. An existing run command is
273
- preserved; deliberately switch it when migrating to the built-in showcase.
274
- - Adds `ads-mcp` with guarded editing enabled and `ads-read-mcp` with editing
275
- disabled, preserving existing scripts with those names. Both start the showcase.
276
- - Appends `.ds/` to the project's ignore file and supplies a framework mount
277
- adapter for ADS's native preview compiler when one is missing.
278
-
279
- Application files, framework configuration, unrelated scripts/dependencies,
280
- and lockfiles are preserved. `init` does not install dependencies or configure
281
- framework aliases, CSS extraction, or application entry points. Resolve `@ds`
282
- to the local public entry in TypeScript and the bundler, and load foundation CSS
283
- once when integrating ADS source into the app. Complete the
284
- [Linaria integration](#linaria-integration) using the existing framework.
285
-
286
- An unrelated custom `lint:ds` or `assets:ds` script causes init to stop before writing files;
287
- rename it or integrate the checks deliberately. Writes are preflighted and do
288
- not follow symlinks. Keep normal version control review of the resulting changes.
289
-
290
- After installation, normal builds use the project's installed tool; they do not rely
291
- on the initializing npx cache. Commit the
292
- updated lockfile. npm CI can use `npm ci`, then `npm run build`.
247
+ ```
248
+ shop-app/
249
+ ├── package.json the application (no ADS)
250
+ ├── src/ui/ emitted by ADS, committed
251
+ └── design/
252
+ ├── package.json the design package (private)
253
+ ├── ds.config.json { "compile": { "outDir": "../src/ui" } }
254
+ └── design-system/
255
+ ```
256
+
257
+ The application imports the output as its own code
258
+ (`import { Button } from "./ui"` and `import "./ui/foundation.css"`). Emitted
259
+ files import `react` and resolve it upward from their folder, so `src/ui`
260
+ reaches the application's `node_modules` and its one React. This is why the
261
+ output does not stay inside the design folder in this layout. The design package
262
+ stays private, with no peers and no `exports`.
263
+
264
+ **Dependencies.** Each package that the emitted output imports must reach the
265
+ application:
266
+
267
+ | Kind | Example | Several applications (design package) | One application |
268
+ | --- | --- | --- | --- |
269
+ | Framework | `react`, `preact` | `peerDependencies` (range), pinned in `devDependencies` | application `dependencies` |
270
+ | Headless library holding shared state (context, focus) | `react-aria` | `peerDependencies` (range), pinned in `devDependencies` | application `dependencies` |
271
+ | Stateless library | `date-fns` | `dependencies` (installed with the design package) | application `dependencies` |
272
+ | Types only | `@types/react` | `devDependencies` | application `devDependencies` if it typechecks the output |
273
+
274
+ A library that holds shared state must be the application's one copy, so it is a
275
+ peer. npm 7+, pnpm and Bun install a missing peer and report a range conflict.
276
+
277
+ - With the output inside the design package, `ads check` reports
278
+ `package-dependency-undeclared` when the output imports a package at runtime
279
+ that the design package declares only in `devDependencies` or nowhere.
280
+ - In the one-application layout, the application's build enforces the rule: a
281
+ missing package is an unresolved import that names it.
282
+ - In both layouts, `ads emit` writes `ads-dependencies.json`: the packages that
283
+ the application must satisfy, with ranges and runtime or types use.
284
+
285
+ `<outDir>/package.json` declares `"sideEffects": ["*.css"]` in both layouts
286
+ ([Consuming the output](#consuming-the-output)).
287
+
288
+ **Framework.** `--framework react` or `--framework preact` is required on the
289
+ first init. Init saves it as `framework` in `ds.config.json`, and later runs use
290
+ the saved value. ADS does not detect a framework and has no default. A Preact
291
+ design system gets the native Preact starter: the same design system, with
292
+ owners that import `preact/hooks` and Preact's types (`ComponentChildren`). If
293
+ the flag differs from the saved framework, init stops; change `ds.config.json`
294
+ explicitly.
295
+
296
+ **What init does.** `ads init [folder]` (the current folder by default):
297
+
298
+ - Creates the folder and its `package.json` when absent (name from the folder,
299
+ `version` `0.1.0`, `type: "module"`, and `private` with `--out`).
300
+ - Copies the starter's declared file set into an empty or absent design-system
301
+ folder: role token sheets, profiles, `foundation.ads.ts`, asset declarations
302
+ and drawings, controllers, owners, mocks, `palette.generated.ts` and
303
+ the authored barrel `index.ts`. Init generates nothing else.
304
+ - Writes `ds.config.json` with `schemaVersion`, `framework`, `dsDir` and the
305
+ `compile` defaults (`outDir` from `--out`). If the file exists, init keeps
306
+ every saved field and adds only the missing ones. Themes and brands are
307
+ declared in `foundation.ads.ts`, never in `ds.config.json`.
308
+ - Adds the tool and the framework's packages (`react`, `react-dom` and
309
+ `@types/react`, or `preact`) to `devDependencies` when neither dependency map
310
+ declares them. It keeps an existing tool version unless `--tool-package`
311
+ overrides it.
312
+ - Without `--out`, also adds the framework to `peerDependencies` and, when
313
+ absent, `exports`, `files` and `sideEffects` that publish `dist/`.
314
+ - Adds `lint:ds` (`ads check .`) and `emit:ds` (`ads emit`), in the spelling of
315
+ the package's package manager.
316
+ - Writes `tsconfig.json` and `ads-env.d.ts` when the package has no tsconfig:
317
+ bundler resolution, the framework's JSX, `@ds` mapped to the barrel, and SVG
318
+ module declarations. Editors and the package's own typecheck thus never use
319
+ the tsconfig of an enclosing application.
320
+ - Never edits `.gitignore`, never writes a lockfile, never follows symlinks and
321
+ never overwrites a project file. Ignore `.ds/` (ADS's caches and working
322
+ files) yourself.
323
+
324
+ A second run changes nothing. If the design-system folder already has content
325
+ and the package has a `ds.config.json`, init keeps the folder unchanged,
326
+ completes only the configuration and dependencies, and prints a notice. Without
327
+ a `ds.config.json`, init stops (`design-system-exists`): move the folder, or add
328
+ a `ds.config.json` (with another `dsDir` if that folder is not the design
329
+ system).
330
+
331
+ Init also stops before any write for an unrelated custom `lint:ds` or `emit:ds`
332
+ script, and for an `--out` folder that ADS cannot own
333
+ ([The output folder](#the-output-folder)).
334
+
335
+ The JSON result of `ads init` reports `framework`, `packageManager`,
336
+ `toolDependency`, `designSystem` (`installed` with a file count, or `kept`),
337
+ `notices` and `updatedFiles`.
293
338
 
294
339
  ## Package manager detection
295
340
 
296
- `init` reads npm or Bun from the project:
341
+ This version supports npm and Bun. `init` reads the package manager from the
342
+ design package:
297
343
 
298
- 1. Its `packageManager` field in `package.json`.
344
+ 1. The `packageManager` field in its `package.json`.
299
345
  2. Its Bun (`bun.lock` or `bun.lockb`) or npm (`package-lock.json`) lockfile.
300
346
 
301
- A project that declares neither stops init with an error naming what to add; with both
302
- lockfile types and no `packageManager`, keep one or set the field. This version supports
303
- npm and Bun. It never replaces or removes a lockfile. How ADS was launched (`npx` or
304
- `bunx`) does not change the project's choice.
305
-
306
- Init
307
- does not translate the app's existing scripts. Bun hooks explicitly use `bun --bun run` so package executables,
308
- including ADS, run on Bun despite Node shebangs.
309
- Launch the MCP server with `bunx @reqvire-org/ads mcp`, or its generated
310
- `ads-mcp` script. Managed workers and screenshot capture inherit the interpreter.
311
- Use `command: "runtime"` for portable preview compiler/behavior profiles;
312
- explicit `node`, `bun` or other commands are respected. Project-specific tools
313
- must themselves support the selected runtime. `ads_status.project.runtime`
314
- reports the actual name, version and executable; package manager and UI framework
315
- are separate choices.
316
-
317
- ## Migrating from DS
318
-
319
- ADS uses the package `@reqvire-org/ads`, CLI `ads`, MCP tools named `ads_*`,
320
- resource namespaces `ads://`, `ui://ads` and `skill://ads`, and skills named
321
- `ads-*`. Replace the old `@reqvire-org/ds` dependency and package imports, install
322
- dependencies, then run `ads init` to refresh managed build hooks. Existing
323
- `ds.config.json`, `.ds/`, `design-system/`, `@ds`, shared token names and
324
- `--ds-*`/`--ux-*` ownership prefixes remain valid. Project UI requires no rewrite.
325
-
326
- Use `ads-mcp` and `ads-read-mcp` for the editing and read-only launch scripts.
327
- Update MCP client configuration to the new package/server name and reconnect;
328
- tool names and resource URIs have changed. Install the renamed `ads-*` skills
329
- when using local skill installation. Rebuild previews with the new tool to
330
- refresh generated resource manifests. Existing `DS.md` project guides are still
331
- discovered; the tool's contract and new scaffold use `ADS.md`.
332
-
333
- npm has no in-place package rename: publish `@reqvire-org/ads` as a new package.
334
- Set up its own trusted publisher for `reqvire-org/ads`, workflow
335
- `release.yml`, allowing `npm publish` and `npm dist-tag`. Once ADS is available,
336
- deprecate the old package with a migration message:
337
-
338
- ```sh
339
- npm deprecate @reqvire-org/ds "Renamed to @reqvire-org/ads. Install that package instead."
340
- ```
347
+ A new design package follows the repository it is created in: the nearest
348
+ enclosing folder with a `packageManager` field or a lockfile (an application, in
349
+ the one-application layout). Otherwise it uses Bun, which runs ADS. An existing
350
+ package that declares neither stops init with an error that names what to add.
351
+ With both lockfile types and no `packageManager`, keep one lockfile or set the
352
+ field. ADS never replaces or removes a lockfile. The launcher (`npx` or `bunx`)
353
+ does not change the package's choice.
341
354
 
342
- Keep old releases available for existing consumers. See npm's
343
- [package rename guidance](https://docs.npmjs.com/unpublishing-packages-from-the-registry/),
344
- [deprecation guidance](https://docs.npmjs.com/deprecating-and-undeprecating-packages-or-package-versions/)
345
- and [trusted publishing setup](https://docs.npmjs.com/trusted-publishers/).
355
+ Launch the MCP server with `bunx @reqvire-org/ads mcp` or
356
+ `npx @reqvire-org/ads mcp` in the design package. `ads_status.project.runtime`
357
+ reports the actual name, version and executable. The package manager and the UI
358
+ framework are separate choices.
346
359
 
347
360
  ## Develop ADS locally
348
361
 
349
- To run this checkout's MCP server and showcase together:
362
+ These commands are for work on the ADS repository. Projects that use the
363
+ published package do not need them.
364
+
365
+ **Playground.** `bun run dev` (or `bun run dev:react`, the same command) builds
366
+ the tool and serves the showcase for a playground: a working copy of
367
+ `tests/fixtures/reference-project` in the ignored folder `.ds/playground/`.
368
+ Serving, drafts and accepted changes thus never change the fixture that the
369
+ tests read. `scripts/playground.mjs` creates the copy once.
370
+ `bun scripts/playground.mjs showcase --fresh` replaces it with the fixture's
371
+ current files, and the same script runs `mcp`, `check`, `validate`, `emit` or
372
+ `sync` on it. Playground edits are experiments: promote deliberate changes to
373
+ the fixture or the starter by hand.
374
+
375
+ To run the playground's MCP server and showcase together:
350
376
 
351
377
  ```sh
352
- npm run ads-mcp -- --port 4191 # guarded editing enabled
378
+ bun run ads-mcp -- --port 4191 # guarded editing enabled
353
379
  # or:
354
- npm run ads-read-mcp -- --port 4191 # read-only
380
+ bun run ads-read-mcp -- --port 4191 # read-only
355
381
  ```
356
382
 
357
- Run one at a time and open **http://127.0.0.1:4191/**. Both build the local tool
358
- before starting stdio MCP, the showcase and its managed preview compiler. For an
359
- MCP client's launch configuration, use `npm --silent run ads-mcp` or
360
- `npm --silent run ads-read-mcp` so npm's banner does not enter the JSON-RPC stream.
361
- The local tool build logs go to stderr. Use `--no-showcase` after `--` when only
362
- the stdio connection is needed. `npm run dev:showcase` remains browser-only.
383
+ Run one at a time and open **http://127.0.0.1:4191/**. Each command builds the
384
+ local tool (build logs go to stderr), then starts stdio MCP, the showcase and
385
+ its managed preview compiler. For an MCP client's launch configuration, run the
386
+ script silently (`npm --silent run ads-mcp`), so that a package manager banner
387
+ does not enter the JSON-RPC stream. If you need only the stdio connection, add
388
+ `--no-showcase` after `--`.
389
+
390
+ **Showcase UI.** `bun run dev:ui` serves ADS's own showcase design system
391
+ (`showcase-ui/`) in place, so its scenarios refresh as you edit them.
392
+ `bun run check:ui` validates it. Both build ADS first and link this checkout
393
+ into `showcase-ui/node_modules` (ignored). `bun run build` builds the showcase's
394
+ bundle from it.
363
395
 
364
- Use `npm link` to try changes from this checkout in a project already set up
365
- with ADS. From the ADS repository root:
396
+ **Link the checkout.** Use `npm link` to try changes from this checkout in a
397
+ project that is already set up with ADS. From the ADS repository root:
366
398
 
367
399
  ```sh
368
400
  npm install
@@ -370,49 +402,58 @@ npm run build
370
402
  npm link
371
403
  ```
372
404
 
373
- Then run inside the test project, after installing its normal dependencies:
405
+ Then, in the test project, after you install its normal dependencies:
374
406
 
375
407
  ```sh
376
408
  npm link @reqvire-org/ads
377
409
  npm exec -- ads --version
378
- npm run build
410
+ npm run lint:ds
379
411
  ```
380
412
 
381
- The project now uses your checkout through a symlink. Keep the normal published
382
- dependency in its `package.json`; linking is local development setup. The
383
- versionless `npx -y @reqvire-org/ads mcp` configuration uses that linked copy when
384
- the client starts in this project. The version check confirms which build is
385
- running. See [npm's linking documentation](https://docs.npmjs.com/cli/v11/commands/npm-link/)
413
+ The project now uses your checkout through a symlink, and the version check
414
+ confirms which build runs. See
415
+ [npm's linking documentation](https://docs.npmjs.com/cli/v11/commands/npm-link/)
386
416
  and [local-package resolution](https://docs.npmjs.com/cli/v11/commands/npm-exec/).
387
417
 
388
- After changing ADS tool code, packaged skills, starter files or the showcase
389
- client, run `npm run build` in this checkout and reconnect MCP. The link points
390
- to the rebuilt `dist/`; it does not compile source automatically. Changes to
391
- the test project's components and styles still use its managed preview watcher.
392
- After another `npm install` or `npm ci` in the test project, run
393
- `npm link @reqvire-org/ads` again if the install replaced the link.
394
-
395
- To return to the published version, run `npm unlink --no-save @reqvire-org/ads`
396
- then `npm install` in the test project. To remove the global development link,
397
- run `npm unlink --global @reqvire-org/ads`.
398
-
399
- For this checkout's diagnostic MCP client, run:
418
+ - Keep the normal published dependency in the project's `package.json`.
419
+ - The versionless `npx -y @reqvire-org/ads mcp` configuration uses the linked
420
+ copy when the client starts in this project.
421
+ - The link points to the built `dist/`; it does not compile source. After you
422
+ change ADS tool code, packaged skills, the starter or the showcase client, run
423
+ `npm run build` in this checkout and reconnect MCP.
424
+ - Changes to the test project's design system still use its managed preview
425
+ watcher.
426
+ - If `npm install` or `npm ci` in the test project replaces the link, run
427
+ `npm link @reqvire-org/ads` again.
428
+ - To return to the published version, run
429
+ `npm unlink --no-save @reqvire-org/ads` and then `npm install` in the test
430
+ project. To remove the global development link, run
431
+ `npm unlink --global @reqvire-org/ads`.
432
+
433
+ **MCP Explorer.** For this checkout's diagnostic MCP client, run:
400
434
 
401
435
  ```sh
402
436
  npm run dev:mcp-explorer
403
437
  ```
404
438
 
405
- Open **http://127.0.0.1:4190/**. It builds ADS and starts the real stdio server,
406
- its showcase and ADS-managed preview compiler. The
407
- [explorer guide](../mcp-explorer/README.md) covers tools, resources, prompts, skills,
408
- notifications and widget checks. Run `npm run dev:showcase` instead for normal
409
- visual review. These development commands are not required in projects using
410
- the published package.
439
+ Open **http://127.0.0.1:4190/**. The command builds ADS and starts the real
440
+ stdio server, its showcase and the ADS-managed preview compiler. The
441
+ [explorer guide](../mcp-explorer/README.md) covers tools, resources, prompts,
442
+ skills, notifications and widget checks.
443
+
444
+ ### CSS correctness in the tool
445
+
446
+ The tool repository uses Biome only for CSS, configured in `biome.css.json`.
447
+ Parsing rejects malformed CSS and invalid hex colors. Explicit lint rules reject
448
+ duplicate font names and duplicate selectors. Formatting is disabled. The tool
449
+ repository uses Oxlint for its own JavaScript linting; consumers do not need
450
+ that pass. `ads init` preserves an existing project's lint tools.
411
451
 
412
452
  ## Test a local package
413
453
 
414
- Use a tarball to verify the packed release and a clean install before publishing.
415
- For iterative development, use the linking workflow above. From the repository root:
454
+ Use a tarball to verify the packed release and a clean install before you
455
+ publish. For iterative development, link the checkout
456
+ ([Develop ADS locally](#develop-ads-locally)). From the repository root:
416
457
 
417
458
  ```sh
418
459
  npm install
@@ -421,130 +462,134 @@ npm run pack:tool
421
462
  ads_tool_package="$PWD/output/npm/reqvire-org-ads-$(bun -p 'require("./package.json").version').tgz"
422
463
  ```
423
464
 
424
- Then change into an existing test project containing `package.json`:
465
+ Then create a design package beside (or inside) a test application:
425
466
 
426
467
  ```sh
427
- cd /absolute/path/to/test-project
428
- npx --yes --package "$ads_tool_package" ads init --framework react --tool-package "$ads_tool_package"
468
+ cd /absolute/path/to/test-application
469
+ npx --yes --package "$ads_tool_package" ads init design --framework react --out ../src/ui --tool-package "$ads_tool_package"
470
+ cd design
429
471
  npm install
430
- npm run build
472
+ npm run lint:ds
473
+ npm run emit:ds
431
474
  ```
432
475
 
433
- Use `bun install` and `bun run build` for Bun. Keep npx options before `ads`.
434
- `--tool-package` accepts an absolute local tarball path, a version, or a matching
435
- package/version. A tarball becomes a `file:` development dependency, so keep it
436
- available for subsequent installs. A published pinned version is portable
437
- between machines without an archive. Routine builds need no global install.
476
+ For Bun, use `bun install` and `bun run lint:ds`. Keep the npx options before
477
+ `ads`. `--tool-package` accepts an absolute local tarball path, a version, or a
478
+ matching package/version. A tarball becomes a `file:` development dependency, so
479
+ keep it available for subsequent installs. A published pinned version is
480
+ portable between machines without an archive. Routine builds need no global
481
+ install.
438
482
 
439
483
  ## Commands and checks
440
484
 
441
485
  | Command | Behavior |
442
486
  |---------|----------|
443
- | `ads init --framework react` | Add ADS tooling to the current project; accepts `react` or `preact`; saved choices can omit the flag |
444
- | `ads check [directory]` | Read-only core token, source import, and style checks |
445
- | `ads tokens [directory]` | List declared values and theme/media scopes |
446
- | `ads assets [directory]` | Generate standard icons from `assets.iconSource` |
487
+ | `ads init [folder] --framework react [--out ../src/ui]` | Set up the design package: tooling, configuration and the starter design system ([Set up a design package](#set-up-a-design-package)). A saved framework can omit the flag |
488
+ | `ads check [directory]` | Read-only check of the design system: structure, imports, owner analysis, mocks and the emitted output ([Design system source](#design-system-source)) |
489
+ | `ads compile [directory]` | Build ADS previews with Bun (`--watch` for incremental previews) |
490
+ | `ads emit [directory]` | Check, then write the compiled design system to its output folder ([Emitting the design system](#emitting-the-design-system)) |
491
+ | `ads sync [directory]` | Regenerate stale generated source files ([Regenerating generated source](#regenerating-generated-source)) |
492
+ | `ads validate [directory]` | The project gate (`--changed` limits it to what changed since the last successful full run) |
493
+ | `ads behaviors [directory]` | Registered behavior checks and current verification evidence |
494
+ | `ads verify [directory]` | Run registered behavior checks (`--unit` and `--check` select) |
495
+ | `ads audit [directory]` | Render audit of registered scenarios (`--scenario`, `--theme` and `--brand` select) |
496
+ | `ads tokens [directory]` | The design system's tokens: values per theme, brand and condition, declarations, profiles, owners and value-shape status (`--query`, `--role`, `--group`, `--limit`; `--format dtcg` exports DTCG JSON) ([Inspecting tokens and the public API](#inspecting-tokens-and-the-public-api)) |
447
497
  | `ads mcp [directory]` | Serve tools, resources, prompts, skills and preview Apps; start the local showcase |
448
498
  | `ads mcp --mutations` | Enable guarded edits to the local ADS, validated before application |
449
499
  | `ads showcase [directory]` | Start the same MCP runtime and showcase for browser-only use |
450
500
  | `ads --version`, `ads --help` | Version and usage |
451
501
 
452
- `init` accepts no directory argument. Other commands default to the current
453
- directory and can inspect another directory. `--json` gives structured results
454
- for inspection/setup commands; `mcp` uses stdout exclusively for JSON-RPC.
455
- Exit codes are 0 for success, 1 for check findings, and 2 for invalid
456
- input/configuration or execution errors.
457
-
458
- Guarded MCP editing is opt-in. Its mandatory checks and optional project
459
- `acceptance.scripts` run in a temporary project copy with installed
460
- dependencies. Project scripts default to 60 seconds each; use the explicit
461
- `mcp.mutationCheckTimeoutMs` budget (100–300000 ms) for measured slower builds.
462
- A preview waits up to 5 minutes for its build, including the first build after the
463
- MCP server starts; set `mcp.previewBuildTimeoutMs` (1000–3600000 ms) to change it.
464
- Behavior profiles have a separate whole-run budget.
465
- Draft acceptance runs the draft owners' own registered tests unless
466
- `acceptance.behavior` is false, and their render audit unless `acceptance.audit` is
467
- false. `ads validate` runs `acceptance.scripts` and then `validation.scripts`, so list
468
- each script once. Both script lists default to empty; no names are inferred. Direct
469
- source edits run `ads validate --changed`. See [the two gates](../skills/ads-designer/references/validation.md).
470
- When acceptance runs the owners' registered behavior checks (or a capture was
471
- requested), ADS builds and shares production previews with browser verification.
472
- Acceptance's render audit renders the owners' UI scenarios in the candidate on that
473
- host, or compiles only those scenarios when nothing else needs previews. Core-only
474
- acceptance does not build the whole graph. Remove `build:mcp-previews` from
475
- `acceptance.scripts`; keep that script in the ordinary project build.
476
- See the [editing contract](MCP.md#guarded-editing) for unit ownership,
477
- Git patches, bounded reads and preview review. Keep normal build gates enabled
478
- for edits made by other tools.
479
-
480
- `check` validates required shared names in `:root`, readily checkable value
481
- categories, undefined aliases, alias cycles, and individual theme/media
482
- overrides. Project-specific values and additional definitions within ADS's fixed
483
- naming contract are allowed. The contract's `naming` section lists the fixed
484
- shared families and names; projects cannot rename those shared semantics.
485
- All design values belong in the shared foundation. Components and patterns map
486
- shared roles into their runtime variables instead of defining independent values.
487
- See [shared Data and component mappings](ADS.md#shared-data-and-component-mappings).
488
- Foreign token namespaces remain rejected.
489
- `--ds-*`, `--ux-*`, and `--showcase-*` variables remain owned by their layers,
490
- including when a file is inside `tokens/`. Shared token assignments outside
491
- `tokens/` fail. Source styles also check shared references for undeclared names.
492
- It does not change values, import a theme, or synchronize definitions.
493
-
494
- Source checks enforce the fixed `@ds` public alias for app/showcase consumers,
495
- reject JSX inline styling except files declared in their owner's `styles.inline`
496
- contract, and check CSS and imported
497
- Linaria `css` and `styled` templates for raw visual values and namespace ownership. Private
498
- ADS implementation imports and showcase-local files are allowed. The checker
499
- recognizes imported aliases and shadowed bindings.
500
-
501
- These are static checks, not framework type checking or browser CSS evaluation.
502
- Arbitrary computed expressions, combined conditional cascade behavior, computed
503
- module specifiers, JSX spreads, other styling engines, and renderer-specific APIs
504
- need the project's existing checks and review. Continue to run its type checking,
505
- component tests, and browser comparisons. Register component-specific guards as
506
- explicit project scripts; include them in builds and `acceptance.scripts` when
507
- required. `ads check` does not invoke project linter plugins.
502
+ `init` takes the folder of the design package to create or complete. Other
503
+ commands inspect the given directory. All default to the current folder.
504
+ `--json` gives structured results for inspection and setup commands; `mcp` uses
505
+ stdout only for JSON-RPC. `--fresh` (check and validate) executes the batch
506
+ checks without task-cache reads ([caching](CACHING.md)).
507
+
508
+ Exit codes:
509
+
510
+ - 0: success.
511
+ - 1: error findings, or a gate that did not pass. `ads audit` also exits 1 when
512
+ it ran nothing (no registered or selected scenario): its result is
513
+ `not-available`, never `ok`.
514
+ - 2: invalid input or configuration, or an execution error. With `--json`, an
515
+ execution error prints `{ "ok": false, "error" }`.
516
+
517
+ Review and info items never change the exit code. A one-shot command exits as
518
+ soon as it has reported: it closes its native compiler clients and does not wait
519
+ for their idle timeout. `ads mcp`, `ads showcase` and the `--watch` modes run
520
+ until stopped.
521
+
522
+ These are static checks. They are not framework type checking of the
523
+ application, and they do not evaluate CSS in a browser. Continue to run the
524
+ project's type checking, tests and browser comparisons. Register
525
+ project-specific guards as explicit project scripts, and include them in builds
526
+ and in `acceptance.scripts` when required. `ads check` does not invoke project
527
+ linter plugins. Keep the normal build gates enabled for edits made by other
528
+ tools.
529
+
530
+ **Guarded editing.** Guarded MCP editing is opt-in. Its mandatory checks and the
531
+ optional project `acceptance.scripts` run in a temporary project copy with
532
+ installed dependencies. See the [editing contract](MCP.md#guarded-editing) for
533
+ unit ownership, Git patches, bounded reads and preview review.
534
+
535
+ - `acceptance.scripts` and `validation.scripts` default to empty; ADS infers no
536
+ names. `ads validate` runs `acceptance.scripts` and then `validation.scripts`,
537
+ so list each script once. After direct source edits, run
538
+ `ads validate --changed`
539
+ ([the two gates](../skills/ads-designer/references/validation.md)).
540
+ - Each project script has 60 seconds by default. For measured slower builds, set
541
+ `mcp.mutationCheckTimeoutMs` (100–300000 ms). Behavior profiles have a
542
+ separate whole-run budget.
543
+ - A preview waits up to 5 minutes for its build, including the first build after
544
+ the MCP server starts. `mcp.previewBuildTimeoutMs` (1000–3600000 ms) changes
545
+ this.
546
+ - When acceptance runs the owners' registered behavior checks, or a capture was
547
+ requested, ADS builds production previews and shares them with browser
548
+ verification. The render audit of acceptance renders the owners' UI scenarios
549
+ in the candidate on that host, or compiles only those scenarios when nothing
550
+ else needs previews. Core-only acceptance does not build the whole graph.
508
551
 
509
552
  ### Checks and guards
510
553
 
511
- Every finding has one of three kinds, and no setting changes a finding's kind:
554
+ Every finding has one of three kinds. No setting changes the kind of a finding,
555
+ and there is no warning level.
512
556
 
513
557
  - **Error**: fails `ads check`, `ads audit`, `ads validate` and MCP acceptance.
514
- - **Review**: shown, never blocks; it names something only a person can judge.
515
- - **Info**: notes an analysis limit, such as a color `token-contrast` cannot resolve
516
- statically.
517
-
518
- There is no warning level.
558
+ - **Review**: shown, never blocks. It names something only a person can judge.
559
+ - **Info**: notes an analysis limit, such as an owner that is not analysed until
560
+ another owner is fixed.
561
+
562
+ **Repair plan.** When a command fails, its text output ends with a repair plan:
563
+ the failed rules grouped by mistake, in the order to fix them, each with its
564
+ repair hint and the guides to read. An earlier group is often the cause of later
565
+ errors, so fix the first group and check again. After the steps, the plan names
566
+ the owners that are not analysed until those errors are fixed, one line each
567
+ (`Not analysed until fixed: <owner> (blocked by <owner>)`, capped, with the rest
568
+ in `--json`). `--json` output is the command's result unchanged. MCP replies
569
+ carry the plan as `repair`, with the owners in `repair.notAnalysed`.
570
+ [The rule reference](RULES.md) lists every rule under its group; agents read the
571
+ same catalogue as `ads://guides/errors`.
572
+
573
+ **Text output.** Text output prints errors and review items, but not individual
574
+ info notes. The summary line counts them and says where to read them, for
575
+ example
576
+ `ADS check failed: . (1 error, 4 review items, 38 info notes; --json lists them)`.
577
+ The info part is omitted when there are none. `ads validate` adds the same count
578
+ to its summary line. `ads audit` prints its info rows and counts them in its
579
+ summary.
519
580
 
520
581
  **Gates.**
521
582
 
522
583
  | Gate | What runs |
523
584
  |---|---|
524
- | `ads check` | Static token, theme, brand, accessibility, ownership, import and coverage rules; no browser |
525
- | `ads audit` | axe-core (WCAG A/AA rules), ADS's non-text contrast check, `layout-shift` and `layout-overflow` at 390, 768 and 1280 px in every component, pattern and composition scenario, once per brand and theme, and in a 240 px container for components and patterns |
585
+ | `ads check` | Design-system structure, the import closure, owner analysis, mock ownership, declared themes and brands, generated source and the emitted output folder; no browser |
586
+ | `ads audit` | `ads check`, then axe-core (WCAG A/AA rules), ADS's non-text contrast check, `layout-shift`, `layout-overflow` and `img-shape` in every registered scenario, once per declared brand and theme, and the text passes (`a11y-text-scale`, `a11y-text-spacing-override`, `a11y-reflow`) once per scenario |
526
587
  | MCP acceptance | `ads_accept` checks the draft's candidate and writes no source unless it passes (`dryRun:true` writes nothing): `ads check` rules, `acceptance.scripts`, the draft owners' own registered behavior tests (`acceptance.behavior`, default `true`) and the render audit of their own UI scenarios (`acceptance.audit`, default `true`) |
527
588
  | `ads validate` | The project gate, applying nothing: `ads check` rules, `acceptance.scripts` then `validation.scripts`, current previews, and every registered behavior test and render audit its change set reaches |
528
- | `ads validate --changed` | The same for what changed since the last successful full run (configuration, foundation or token changes widen it to everything); run it after direct edits or a series of accepted drafts |
529
-
530
- **Render audit.** `ads validate` always runs it over the scenarios its change set
531
- reaches; draft acceptance runs it over the draft owners' own scenarios.
532
- `mcp.auditPages` (1–16, default 4) sets how many pages render at once. Each `a11y-axe`,
533
- `a11y-non-text-contrast`, `layout-overflow` and `layout-shift` finding is an error that fails the gate, and an audit that cannot run fails it with a `render-audit` error
534
- naming what to install. Each `a11y-incomplete` finding is an info item that fails nothing: axe could
535
- not decide that rule on those elements, so check it by hand. It names the axe rule, scenario, themes,
536
- elements, and axe's reason, such as `bgGradient` for text over a gradient. The audit needs the
537
- project's Playwright and a browser:
589
+ | `ads validate --changed` | The same for what changed since the last successful full run. Configuration, foundation or token changes, and changes outside `dsDir` such as manifests, lockfiles or tooling, widen it to everything. Run it after direct edits or a series of accepted drafts |
538
590
 
539
- ```sh
540
- npm install -D @playwright/test # ads init declares it
541
- npx playwright install chromium # Bun: bunx playwright install chromium
542
- ```
543
-
544
- `mcp.capture` selects `browser` (`chromium`, `firefox`, `webkit`), an installed Chrome
545
- `channel` such as `"chrome"`, and `timeoutMs`. To turn the owners' behavior tests or
546
- render audit off for draft acceptance, set them in `ds.config.json`; `ads validate`
547
- always runs both:
591
+ To turn the owners' behavior tests or render audit off for draft acceptance, set
592
+ them in `ds.config.json`. `ads validate` always runs both:
548
593
 
549
594
  ```json
550
595
  {
@@ -553,924 +598,1897 @@ always runs both:
553
598
  }
554
599
  ```
555
600
 
556
- Declare `"sideEffects": ["**/*.css"]` in `package.json`, as the starters do, so a
557
- component change audits only the scenarios that import it.
558
-
559
- A render that fails because the preview dropped or was slow is retried on its own, up to 3
560
- attempts, with a new browser and preview; the others keep their results, and findings never
561
- cause a retry. The JSON result and the check list retried passes under `retries`, and `ads
562
- audit` prints them. A scenario that still fails is a `render-audit` error naming it and the
563
- last cause, beside any findings. A project that fails validation stops the audit.
564
-
565
- **Non-text contrast.** axe-core does not check WCAG 1.4.11, so the audit adds
566
- `a11y-non-text-contrast` for every visible, enabled `button`, `input`, `select`, `textarea`,
567
- `a[href]` and `switch`, `checkbox`, `radio`, `slider` and `tab` role in the rendered state:
568
-
569
- - A control whose background has less than 3:1 against the background around it and that
570
- has a visible border needs that border at 3:1 against the surrounding background. Use
571
- `--border-strong` (or a stronger step) for a field or control outline; `--border-default`
572
- is for dividers and card edges. A button, link or tab with text or an icon is exempt: that
573
- content identifies it.
574
- - An icon-only control (an `svg`, no text) needs the icon's stroke or fill at 3:1 against
575
- the control's background. Paint icons with a text or `-fg` token.
576
-
577
- Disabled and `aria-disabled="true"` controls, controls whose background has 3:1 against
578
- their surroundings, browser-drawn native checkboxes, radios and ranges, and controls over a
579
- background image are exempt. Each finding names the scenario, themes and brands, element
580
- selectors and the lowest ratio. Hover and focus states are not rendered by the audit.
581
-
582
- **Contrast.** `token-contrast` checks the role pairs that meet on screen in every theme and
583
- brand: text, link, accent and status text on their backgrounds need 4.5:1; focus indicators
584
- and control borders on canvas and surface need 3:1. It resolves every CSS color syntax,
585
- including `oklch()` and `color-mix()`, and composites translucent colors over their
586
- background and the canvas. A pair color it cannot resolve statically (`currentColor`,
587
- relative color syntax) is a `token-contrast-unresolved` info item. Fix a failing pair by
588
- choosing another ramp step.
589
-
590
- `component-contrast` checks the pairs components and patterns make themselves. Where one
591
- Linaria style block (the template's top level, a nested block such as `&:hover` or
592
- `&[aria-selected="true"]`, or an at-rule) declares both `color: var(--a)` and
593
- `background` or `background-color: var(--b)`, the pair needs 4.5:1 in every theme and brand,
594
- resolved and composited as `token-contrast` resolves it. Large text needs 3:1 (WCAG 1.4.3):
595
- where the block or an enclosing block declares `font-size` of at least 24px, or at least
596
- 18.66px with `font-weight` 700 or more, in `px`, `pt` or `rem` (a 16px root), literally or
597
- through a token resolved per theme and brand. Other sizes (`em`, `%`, `calc()`, keywords,
598
- the `font` shorthand) are not known to be large and keep 4.5:1; a size set by another
599
- composed class is not seen, so declare it in the block that pairs the colors. Each failing
600
- context reports its `minimum`. Local custom properties set in the
601
- block or an enclosing block resolve one level; an undeclared one reads its `var()` fallback.
602
- Fix it with the role contract: `--x-text` on
603
- `--x-bg`, `--x-fg` on `--x` (not `--success` as text on `--success-bg`). Disabled states
604
- (`:disabled`, `[disabled]`, `[aria-disabled="true"]`, `[data-disabled]`) are exempt;
605
- `currentColor`, `inherit`, `transparent`, fully transparent backgrounds, one token on both
606
- sides and native `<progress>`, `<meter>` and range parts are skipped. A side that names no
607
- declared color token is a `component-contrast-unresolved` info item; so is text matching the
608
- canvas (under 1.25:1) over a translucent background, which sits on another backdrop.
609
- Pairs `token-contrast` checks are not repeated.
610
-
611
- The same rule also follows source-resolvable owned JSX composition: imported component
612
- calls, wrappers forwarding `children`, fragments, returned style objects and separate
613
- Linaria classes. For actual text, it checks the resolved foreground against the element's
614
- background or an owned ancestor's background, across themes and brands. For example, a
615
- link using `--text-product` inside a panel using `--bg-menu` is checked automatically;
616
- there is no custom pair declaration to remember. Transparent wrappers preserve the
617
- backdrop; translucent token layers need a known opaque ancestor. Composed text can use a
618
- known inherited font size/weight. Hidden and disabled text is excluded; matching text and
619
- background tokens are still an error when the source proves that text is rendered.
620
- Text supplied through a `string` or `number` prop is checked too. Literal class hooks
621
- do not hide the backdrop when no captured paint selector targets them. Optional classes
622
- that only change layout preserve contrast evidence; every alternative must establish
623
- the same paint and visibility facts.
624
-
625
- This composition pass does not guess the browser cascade. Competing classes, differing
626
- paint/interpolation alternatives, unknown prop spreads or components, conditional or
627
- descendant paint selectors, gradients, opacity, filters, out-of-flow positioning and
628
- missing backdrops produce `component-contrast-unresolved` info where contrast evidence
629
- is incomplete. SVG text, native control value/placeholder text and dynamically generated
630
- DOM remain browser-audit concerns. An informational limit is not a contrast pass: run
631
- `ads audit` on the affected composed scenario and interaction states. Axe remains the
632
- rendered check, including actual cascade, visibility and backgrounds.
633
-
634
- **Static accessibility.** Errors: `a11y-target-size` (`--control-height-*` at least 24 px),
635
- `a11y-focus` (`--focus-w` at least 2 px and a `:focus-visible` indicator in `base.css`),
636
- `a11y-text-resize` (font sizes in `rem`), `a11y-reduced-motion` (every non-zero `--dur-*`
637
- set to 0 under `prefers-reduced-motion`), `a11y-text-spacing` (`--leading-normal` at least
638
- 1.5, `--content-max` under 80 characters), `a11y-image-alt` and `a11y-icon-label`.
639
- `a11y-keyboard` is a review item.
640
-
641
- **Layout.** Widths are fluid on the grid.
642
-
643
- `layout-fixed-width` (`ads check`) reads fixed minima in component, pattern and composition
644
- styles: widths, inline sizes, flex bases and grid tracks. Fixed sizing comes from the project's
645
- spatial scale, mini/fine units, standard control/icon sizes or explicit fixed-size roles.
646
- Aliases and calculations retain their underlying roles, and a fixed minimum must fit the
647
- spatial maximum. Projects without a spatial definition may use their shared spacing primitives.
648
-
649
- | Construction | Result |
650
- |---|---|
651
- | A fixed size from `spatial.ads.json`'s scale, including sizes above 96 px | Supported within the spatial bound |
652
- | Standard control/icon size, or an alias/calculation based on a supported size | Supported within the spatial bound |
653
- | A fixed minimum without a supported sizing role | `layout-fixed-width` error |
654
- | `min(100%, var(--side-pane-width))`, shrinking flex bases or `minmax(0, var(--side-pane-width))` tracks | Supported responsive sizing |
655
- | Percentages, fractional tracks, viewport/container units and intrinsic sizing | Supported |
656
- | A maximum size, or a fixed width capped by `max-width: 100%` in the same rule | Supported cap |
657
- | A token explicitly named by `layout.widthTokens` | Supported and listed for review |
658
- | Fixed/hybrid tracks emitted by `@ads-layout` | Checked by local track, cap, margin and gutter algebra |
601
+ A behavior, preview or audit stage with nothing to run (no registered checks or
602
+ scenarios, none that the change reaches, or turned off) is listed as
603
+ `skipped: true` with `status: "not-available"`, a `reason` code and a `message`.
604
+ In acceptance it does not block the draft; `ads audit` exits 1.
605
+
606
+ **Behavior.** A registered guarantee needs current passing execution evidence.
607
+ `ads verify` runs the registered checks against current source.
608
+
609
+ #### Render audit
610
+
611
+ The audit renders registered scenarios from the emitted preview tree, which
612
+ holds only a revision that passes `ads check`. With no registered scenario it
613
+ reports `not-available` (`no-scenarios`); with none selected, `none-selected`.
614
+
615
+ The audit mounts a scenario's specimens alone, without the page that ADS draws
616
+ around them in the showcase, so every finding is about the project's UI. A
617
+ capture shows the page as the showcase does.
618
+
619
+ - **Kinds.** Without `--scenario`, the audit renders component and pattern
620
+ scenarios. A mock gates nothing and is left out; `ads audit --scenario
621
+ mocks/<Name>` still audits one, as a look at how its owners combine.
622
+ - **States.** Every named state of a scenario is its own render, in every theme
623
+ and brand, with all passes. A finding lists the states it was found in
624
+ (`states`, and "States: Invalid, Long." at the end of its message); the same
625
+ finding in several states is one finding. A scenario has at most 12 states.
626
+
627
+ - Each `a11y-axe`, `a11y-non-text-contrast`, `a11y-text-scale`,
628
+ `a11y-text-spacing-override`, `a11y-reflow`, `layout-overflow`, `layout-shift`
629
+ and `img-shape` finding is an error that fails the gate.
630
+ - Each `a11y-incomplete` finding is an info item that fails nothing: axe could
631
+ not decide that rule on those elements, so check it by hand.
632
+ - An audit that cannot run fails the gate with a `render-audit-unavailable`
633
+ error. When the browser installation cannot run (offline, a blocked download),
634
+ the error names the command that installs the browser by hand (see
635
+ **Screenshots** above).
636
+ - The browser is Chromium by default. `mcp.capture` selects `browser`
637
+ (`chromium`, `firefox`, `webkit`), an installed Chrome `channel` such as
638
+ `"chrome"`, and `timeoutMs`.
639
+ - `mcp.auditPages` (1–16, default 4) sets how many pages render at once.
640
+ - A render that fails because the preview dropped or was slow is retried alone,
641
+ up to 3 attempts, with a new browser and preview. The other renders keep their
642
+ results, and findings never cause a retry. The JSON result and the check list
643
+ the retried passes under `retries`, and `ads audit` prints them. A scenario
644
+ that still fails is a `render-audit` error that names it and the last cause,
645
+ beside any findings.
646
+
647
+ What the audit measures in each render:
648
+
649
+ - **Non-text contrast** (WCAG 1.4.11, which axe-core does not check). A visible,
650
+ enabled control whose background does not stand out from its surroundings
651
+ needs a 3:1 border on its best-contrasting side (a soft field's one rule under
652
+ the text passes). An icon-only control needs a 3:1 icon. Disabled controls,
653
+ browser-drawn native controls and controls over a background image are exempt.
654
+ A text-entry control whose recipe declares an `accessibility` boundary
655
+ (identified by its visible label, or by a boundary that appears on
656
+ interaction) is not failed. It is listed on every run as the review item
657
+ `a11y-boundary-declared`, with a screenshot under `.ds/audit-evidence/`, for a
658
+ person to keep approving.
659
+ - **Overflow** at 390, 768 and 1280 px: horizontal document scrolling, elements
660
+ past the edge of the viewport, and text or a control cut off by
661
+ `overflow-x: hidden` or `clip` (`clipped`; the finding names what is cut).
662
+ - The audit measures what is cut, not the scroll width of the box. Images,
663
+ video, canvas, SVG artwork, iframes, `aria-hidden` and inert layers, and
664
+ pseudo-elements under a clip are not cut content, so a cropped hero image or
665
+ a decorative glow passes.
666
+ - Scrollers, ellipsis text, carousels, pannable widgets, native text fields,
667
+ fixed layers and visually hidden content are exempt.
668
+ - Components and patterns are also rendered in a 240 px container. What does
669
+ not fit a side pane is a `layout-overflow-narrow` review item.
670
+ - **Text scaling** (WCAG 1.4.4, 1.4.10, 1.4.12), once per scenario in the first
671
+ theme and brand, because text does not follow colour. The passes add about a
672
+ tenth to the audit's time.
673
+ - `a11y-text-scale`: at each overflow width the audit doubles the root font
674
+ size (200% text). It also renders the page zoomed to 200% (the 640 px
675
+ viewport that a 1280 px window leaves).
676
+ - `a11y-text-spacing-override`: at each overflow width the audit applies the
677
+ WCAG text-spacing values as the reader's stylesheet does (line height 1.5,
678
+ letter spacing 0.12em, word spacing 0.16em, 2em after paragraphs).
679
+ - `a11y-reflow`: the audit renders the page at 320 px (1280 px at 400%).
680
+ - Each pass reports what the scenario does not already show at rest:
681
+ horizontal overflow as above; text or controls cut off below by
682
+ `overflow: hidden` or `clip` (`block-clipped`); content that spills past a
683
+ box whose height or max-height does not grow (`spilled`); grid or flex items
684
+ that overlap past a reserved track (`overlap`); and a control or its focus
685
+ outline cut off by a clipping ancestor (`focus-clipped`).
686
+ - Each finding names the pass, the widths and the elements. Content that a
687
+ scroll axis hides is scrolled, not cut off. Ellipsis text, line clamps and
688
+ the exemptions of the overflow check stay exempt. Overflow that already
689
+ fails at 390 px is reported once, by `layout-overflow`.
690
+ - **Interaction states**: overlays opened from `aria-haspopup` controls, hovered
691
+ and focused controls, and busy controls, named in the finding's selector
692
+ (`open overlay "Edit": button`, `hover: button`). The result's `coverage`,
693
+ printed as a `Covered:` line, gives what was measured. What was skipped is a
694
+ `render-audit-skipped` info item. A render that measured none of its targets
695
+ is a `render-audit-nothing-measured` review item.
696
+ - **Settling**: the audit waits up to 5 s for the page to settle, and each
697
+ measurement waits for layout to stop moving. A page that never settles is
698
+ measured anyway and reported as `content-still-changing`.
699
+ - **Images and layout shift**: `img-shape` reports a visible image whose box
700
+ differs from its declared ratio. `layout-shift` reports a Cumulative Layout
701
+ Shift above 0.1 on first render, where the browser reports it (Chromium).
659
702
 
660
- A panel can use a responsive cap or a validated hybrid region. Repeated tiles can use
661
- `@ads-layout fixed`. There is no universal fixed-width pixel cutoff and no warning for a
662
- legitimate responsive cap around a small part.
703
+ ## Showcase
663
704
 
664
- `layout` in `ds.config.json` has two fields:
705
+ ADS ships a minimal HTTP browser shell with isolated previews. `ads mcp` serves
706
+ the website alongside its stdio connection, and `ads showcase` starts the same
707
+ runtime for browser-only use. `ads mcp --no-showcase` keeps a headless stdio
708
+ server. Run the commands from the project root. Open the printed URL, or use
709
+ `ads_status.showcaseUrl` from a connected runtime: the URL and port of the
710
+ showcase that the server runs. ADS selects an available loopback port by
711
+ default; `--port 4185` selects a fixed port.
712
+
713
+ The browser reads discovery and opens previews through scoped HTTP services,
714
+ backed by the same engine as MCP. The client uses no project catalogue pages and
715
+ no direct component imports.
716
+
717
+ - SSE events refresh the menus and the build state.
718
+ - The selected scenario updates inside its persistent iframe. Compatible edits
719
+ keep component state, typed values and focus. Changed hook signatures follow
720
+ the framework's refresh rules (React Refresh, or Prefresh for Preact). An edit
721
+ that changes hook signatures or module boundaries, or the restoration of a
722
+ rejected revision, can reset the preview.
723
+ - A failed check restores the verified output. Errors identify stale retained
724
+ output.
725
+ - “Checking changes…” is live feedback, not acceptance. The source gates and the
726
+ selected browser checks decide whether the revision passes. Application
727
+ production builds are unchanged.
728
+ - The theme and brand selectors list the themes and brands that
729
+ `foundation.ads.ts` declares, through the preview host context.
730
+
731
+ Previews compile from the design system's emitted preview tree with ADS's Bun
732
+ compiler: incremental modules for watched previews and complete bundles for
733
+ verification. The project supplies no mount file and no preview application.
734
+ There is one managed compiler per runtime, shared by stdio and HTTP clients. The
735
+ App loads only the selected scenario's dependencies. An accepted mutation of a
736
+ configuration unit replaces the managed compiler and keeps MCP connected. See
737
+ [the compiler contract](MCP.md#one-client-command-managed-preview-builds) for
738
+ revisions, diagnostics, invalidation and the shared resource graph.
665
739
 
666
740
  ```json
667
- { "layout": {
668
- "widthTokens": ["--side-pane-width", "--ux-panel-*"],
669
- "fixedWidthUnits": ["components/Overlays/*", "design-system/patterns/Menu/**"]
670
- } }
741
+ {
742
+ "framework": "react@19.2.7",
743
+ "mcp": { "showcaseTitle": "My Project Design System" }
744
+ }
671
745
  ```
672
746
 
673
- - `widthTokens`: token names or globs of widths that stay fixed.
674
- - `fixedWidthUnits`: unit ids or project-relative file globs (`*` within a path segment, `**`
675
- across them) whose widths are not checked. List overlays here: dialogs, menus, popovers and
676
- tooltips. There is no per-declaration exception.
747
+ `framework` can pin the exact installed version (`name@1.2.3`). ADS keys preview
748
+ freshness and compiled previews by the files it owns (`ds.config.json` and the
749
+ design-system folder) and by the emitted preview tree. The pin is how a
750
+ framework upgrade reaches previews, so update it with the upgrade. The optional
751
+ title defaults to the project package name followed by ` · Design System`.
752
+
753
+ **Scenarios.** The showcase lists the registered [scenarios](#scenarios) and
754
+ previews them from the emitted preview tree. A project without scenarios lists
755
+ none, and `ads_scenarios`, `ads://project/scenarios` and `ads_status` report
756
+ `not-available` (`no-scenarios`).
757
+
758
+ **Showcase boxes.** A scenario's subject (the owners it covers) is shown in a
759
+ box of the project's own canvas, 16px larger than the subject on each side, on
760
+ the showcase's neutral page; the scenario's own headings and notes stay on the
761
+ page. The ADS views do the same for their samples and drawings. Leave at least
762
+ 24px between a heading and the subject under it.
763
+
764
+ **Groups follow folders.** The left menu groups its entries by the design
765
+ system's folders: token folders and their role sheets, profile folders, asset
766
+ folders, the area folders that hold owners, and an owner that has more than
767
+ one scenario. Tokens, Profiles and Artwork each start with a **Summary** entry
768
+ generated from the same data: the folders with their counts. A view opened without the
769
+ showcase (an MCP App in another client) offers the same choices as buttons on
770
+ its page.
771
+
772
+ **ADS views.** Beside the scenarios, the showcase lists entries that ADS draws
773
+ itself from the revision it previews, in a frame of the project with its emitted
774
+ sheets and themes. They are not scenarios: the registry, `ads_scenarios` and
775
+ scenario coverage never list or count them, and no source file declares them.
776
+ They read the preview tree of the emitted revision, never live source, so an
777
+ edit appears after it is emitted.
778
+
779
+ - **Foundation** (id `foundation`, in the Tokens section) shows the grid of each
780
+ spatial profile: its breakpoints, outer margins and cell gutters in pixels,
781
+ the tokens that declare them, an example region per profile that steps through
782
+ the breakpoints as you resize the preview, and the mini unit. Each example is
783
+ the grid algebra's own expansion, carried in the preview tree's facts file
784
+ with its token references; the view derives no margins, bounds or tracks
785
+ itself. A changed margin or gutter token thus changes the example in the
786
+ frame's theme and brand. The guide overlay draws on the examples. It draws
787
+ each element's lattice in the mini unit of the spatial profile that the grids
788
+ of its owner follow, from the same facts.
789
+ `ads_show_scenario({ id: "foundation" })` opens the view like a scenario.
790
+ - **Profiles** (id `profiles`, the Profiles section) lists every profile,
791
+ whether or not an owner selects it. The left menu lists the folders under
792
+ `profiles/`; a folder's page shows its profiles in kind order. Each
793
+ profile is a section that names its kind, what it builds on (`with`), which profiles
794
+ build on it or select it in a slot, and where it is declared. Its table has
795
+ one row per field: the authored value, a sample when the field reads one
796
+ token, the role it reads (or `profile` for a composite's slot), and the
797
+ profile that states the value: "this profile", or the one it comes from. Each
798
+ choice has its own table with every option's fields. Each profile ends with
799
+ an **Applied** sample that shows it as a whole: text set in a text profile, a
800
+ surface painted with a surface profile, a box framed by a frame profile,
801
+ items spaced by a spacing profile, a control with a focus profile's
802
+ indicator, and a composite's profiles together. A motion profile also
803
+ plays: a square moves by the profile's timing on its own effect (a turn, a
804
+ scale or a distance), with a **Replay** button; it stays still when the
805
+ reader asks for reduced motion. Use it to find profiles
806
+ that repeat each other, and to see what a change to a base profile reaches.
807
+ `ads_show_scenario({ id: "profiles" })` opens the view like a scenario.
808
+ - **Artwork** (id `assets`, the Artwork section) lists every declared asset,
809
+ whether or not an owner draws it. The left menu lists the asset groups (the
810
+ folders under `assets/`). The Summary lists every glyph set with its
811
+ members: a set is a named list of glyphs that a component may choose from by
812
+ name at run time, declared beside the glyphs. A group's assets are sections by paint kind: foreground
813
+ (takes the text colour), slots (takes its paint slots' tokens) and intrinsic
814
+ (keeps its own colours). Each row draws the asset from its authored SVG, made
815
+ inert by ADS's sanitizer, and shows its title, aliases, glyph sets, what
816
+ differs between its drawings (themes, sizes, states), its optical centre
817
+ when that is not the middle of its box, and where it is declared. A themed asset shows the drawing of the preview's theme.
818
+ `ads_show_scenario({ id: "assets" })` opens the view like a scenario.
819
+ - **Tokens** (id `tokens`, also in the Tokens section) lists every token of the
820
+ token inventory (`ads tokens`), whether or not an owner uses it. No scenario
821
+ thus has to exercise a token. The left menu lists the token folders as groups
822
+ and each role sheet (`tokens/<Group>/<role>.ads.css`) as an entry; an entry's
823
+ page shows that role's tokens. Under
824
+ its name a section says what the role is for, the unit to write it in, the
825
+ profile fields that read it, and whether it may derive from a spacing token. A
826
+ **Problems** choice lists every token whose status is not valid. A group shows
827
+ its first 100 rows, and **Show more** adds the next 100. A token edit keeps
828
+ the selected group; an edit to an owner alone does not rebuild the view. The
829
+ explorer entry of the view is the token category, whose count is the number of
830
+ tokens. Each row shows:
831
+ - the name;
832
+ - a sample drawn from the token itself, in a box of the project's canvas: a
833
+ swatch for a paint, gradient, shadow or opacity; a bar for a length; a
834
+ corner for a radius; a line eight times as thick for a border width; a type
835
+ sample for a font family, size, weight or letter spacing; a bar for a
836
+ duration (1px per 5ms); the curve of an easing. Numbers are shown as text;
837
+ - its value here: what the frame computes in the theme and brand selected in
838
+ the showcase;
839
+ - the values that other contexts declare where they differ
840
+ (`dark: …; iris · dark: …; @media (…): …`);
841
+ - its value-shape status (valid, invalid, not following the text size, or not
842
+ statically checked, with the contexts and reason);
843
+ - where it is declared.
844
+
845
+ **Phone viewport.** The toggle in the showcase header constrains the real
846
+ preview iframe to 390 CSS pixels, or to the available width on a narrower
847
+ screen. It keeps the mounted example and its state, and does not change the
848
+ selected application host. `?viewport=phone` keeps the choice in a link; turn
849
+ the toggle off to follow the available browser width. On phone browsers the
850
+ catalogue starts collapsed, and the navigation button opens it again. Automated
851
+ captures keep their exact requested viewport.
852
+
853
+ **Approval view.** `?draft=<id>&view=approval&revision=<revision>`, the
854
+ `approvalUrl` that `ads_accept` returns, lists the accessibility declarations
855
+ that a draft revision adds or changes, and what ADS verifies of each. Its
856
+ "Approve and accept" is a person's step. It accepts that exact revision through
857
+ the gates of `ads_accept` and records no name; a changed draft asks for a new
858
+ link. First review the draft's split view in every theme and brand.
859
+
860
+ Run `ads check` and the registered project checks before preview compilation,
861
+ with the framework checks and meaningful tests. Review real entries at narrow
862
+ and wide sizes, in each declared theme and in the relevant states. Browser
863
+ verification establishes layout, keyboard and focus behavior, interactions and
864
+ motion; compiler success does not.
677
865
 
678
- `layout-declared-width` lists explicit fixed roles and owners for review. A configuration
679
- entry matching no token, unit or file is a `layout-config` error; an entry cannot name every
680
- token or unit.
866
+ ## Configuration and component rules
681
867
 
682
- ### Spatial layouts
868
+ `ds.config.json` uses schema version 1. Every field is optional except the
869
+ framework that init saves. Defaults apply to the other fields:
683
870
 
684
- `tokens/spatial.ads.json` defines the mini unit, sizing scale, ratios, breakpoints and gutter
685
- modes. Owned Linaria styles describe layout with `@ads-layout`; ADS validates it against that
686
- definition and compiles it to ordinary CSS, so placement is correct in the first render and no
687
- layout wrapper component is needed. An invalid construction is a `grid-construction` error at
688
- its source; an invalid definition is `grid-definition`.
871
+ ```json
872
+ {
873
+ "schemaVersion": 1,
874
+ "framework": "react",
875
+ "dsDir": "design-system",
876
+ "assets": { "generatedPaths": ["dist", "dist-showcase", ".vite", ".ds"], "fontBudgetKb": 150 },
877
+ "acceptance": { "scripts": [], "behavior": true, "audit": true },
878
+ "validation": { "scripts": [], "inputs": [] },
879
+ "resources": { "memoryLimitMb": null },
880
+ "cache": { "extractionMaxMiB": 64, "extractionMaxEntries": 8192 },
881
+ "compile": { "outDir": null, "emitOnAccept": true },
882
+ "mcp": { "showcaseTitle": null, "auditPages": 4, "behaviorProfiles": {}, "capture": {} }
883
+ }
884
+ ```
689
885
 
690
- | Layout | Use |
691
- |---|---|
692
- | `fluid` | Tracks that share the width: the breakpoint's column count, or `columns: N` |
693
- | `hybrid` | Fluid tracks plus a `fixed-start` and/or `fixed-end` track (a token or `0`); `@ads-at <breakpoint> { fixed-start: …; fixed-end: … }` changes them from that breakpoint on |
694
- | `fixed` | Tiles of `tile: <token>` that wrap |
695
- | `flow` | A column with `row-gap`, natural content height |
696
- | `inherited` | Inside a cell: continues the parent's tracks (CSS subgrid), optionally with its own `gutter` mode |
697
-
698
- Fluid and hybrid roots also take `gutter`, `row-gap`, `margin`, `bound`, `align`, `rows` and
699
- `context`. `align: start | center | end` places a capped region (`bound` other than `full`)
700
- inside the available width, keeping its outer margin; the default is `center`. `rows` lists
701
- 1–12 row sizes, each `auto` (content height) or `fill` (shares the remaining block size), for
702
- example `rows: auto fill` for a header above a body. Without `rows`, rows are implicit and
703
- content-sized; ADS never invents equal rows.
704
- `context: viewport` (the default) emits media queries; `context: container` applies the same
705
- breakpoints to the nearest region container instead, so a layout responds to the space its
706
- region has. Inherited layouts follow their parent's context.
707
-
708
- Cells are direct children named by class or data attribute: `@ads-cell .name { … }`.
709
-
710
- | Property | Values |
886
+ | Field | Purpose |
711
887
  |---|---|
712
- | `start` | A column line from 1, or `auto` to take the next free position (needs a numeric `span`). Default `1` |
713
- | `span` / `end` | Columns to cover (a number or `full`), or the line to end before. Use one; a breakpoint that sets one replaces the other |
714
- | `row`, `row-span` | Row line (default `auto`) and rows to cover (default 1). With `rows` declared, placement must stay within them |
715
- | `visible` | `true` (default) or `false`. A hidden range compiles to a bounded query, so the element's own `display` is never overridden where it is visible |
716
- | `padding`, `ratio` | A spacing token inside the cell; a supported ratio |
717
-
718
- Two region properties:
719
-
720
- - `container: region` makes the cell a region container for `context: container` layouts
721
- inside it. A cell either continues its parent's tracks or starts a region, not both.
722
- - `overlay: start | end` takes the cell out of the tracks at that breakpoint: it covers the
723
- region from that inline edge and the other cells keep their tracks. `overlay: none` returns
724
- it to its track. Overlays belong to root fluid or hybrid layouts.
725
-
726
- `@ads-at <breakpoint> { start; span; end; row; row-span; overlay; visible }` changes a cell from
727
- that breakpoint on. An overlay keeps its row band, so a panel placed in the body row covers the
728
- body, not the header.
729
- Placement is checked against the track count at every breakpoint. Outside any region
730
- container, a `context: container` layout uses its narrowest placement. The starter's `Shell`
731
- pattern combines hybrid tracks, overlays and a region container for its panels.
732
-
733
- `layout-overflow` (render audit) resizes each rendered scenario, in every theme and brand, to
734
- 390, 768 and 1280 px. Each finding names the scenario, widths, themes, brands and elements:
735
-
736
- - The document scrolls horizontally.
737
- - An element reaches past the viewport's edge; the outermost such element is named.
738
- - An element with `overflow-x: hidden` or `clip` cuts off content more than 4 px wider.
739
-
740
- Exempt: `overflow-x: auto` or `scroll` scrollers and their content, except the outermost one as tall as the window, which is the page or a preview frame; `text-overflow: ellipsis`,
741
- carousels (`aria-roledescription="carousel"`), pannable widgets (`role="application"`), native text fields, fixed-position layers and visually hidden content.
742
-
743
- Each measurement waits for layout to stop moving, so a component that refits after a resize is
744
- measured after it refits. Before measuring anything, the audit waits up to 5 s for the page to settle:
745
- no change in the scenario for 500 ms, no finite animation running, and nothing still loading. Content
746
- that arrives late, such as syntax colours, is then measured every run. A page that never settles is
747
- measured anyway and reported as `content-still-changing`.
748
-
749
- The audit also renders what a scenario shows after someone acts on it, in every theme and brand.
750
- Findings name the state in the selector, such as `open overlay "Edit": button` or `hover: button`.
751
- The result's `coverage`, also printed as a `Covered:` line, gives what was measured. What was skipped is
752
- a `render-audit-skipped` info item per reason, with up to 5 examples. A render that could measure none
753
- of its targets is a `render-audit-nothing-measured` review item.
754
-
755
- - **Overlays.** It clicks each distinct control with `aria-haspopup`, up to 3 per render, once per
756
- theme and brand across the audit. What opens
757
- (`dialog`, `alertdialog`, `menu`, `listbox` roles, an open `<dialog>` or popover) gets axe, non-text
758
- contrast, and must fit the 390 px viewport. Give a trigger `aria-haspopup`, or render the overlay
759
- open in its scenario. Tooltips are not opened.
760
- - **Hover and focus.** Up to 6 controls per render, in document order, each distinct control once per
761
- theme and brand on the same surface, measured by the first scenario in request order. Focus skips a
762
- control a keyboard cannot reach: `aria-hidden` on it or an ancestor, `inert`, or `tabindex="-1"`
763
- outside a `group`, `tablist`, `menu`, `menubar`, `radiogroup`, `toolbar`, `listbox`, `tree` or `grid` that
764
- holds a `tabindex="0"`. Under hover it runs axe
765
- `color-contrast` and the non-text check. A `:focus-visible` outline needs 3:1 against what is around
766
- it. A focus ring drawn with `box-shadow` is not read, and an outline beside one is left alone.
767
- - **Busy.** A control with `aria-busy="true"` is checked even when disabled, and its icon even when it
768
- has text. Render the busy state in the scenario: the audit does not press buttons to reach it.
769
-
770
- It also renders each component and pattern scenario with its container narrowed to 240 px, inside
771
- the 1280 px viewport, once per brand, to show what would not fit a side pane. These are
772
- `layout-overflow-narrow` review items: fix the part if it can sit in a pane, or change a scenario's
773
- demo frame to a maximum.
774
-
775
- - An element past the container's edge, or cut off inside it, is reported when it or something in it
776
- has a set width, `min-width` or unshrinking `flex-basis` above 96 px. A row or table held open only
777
- by its content, or by parts of 96 px or less, is not reported.
778
- - Not rendered this way: compositions, scenarios with a `main` landmark, which are pages, and owners
779
- in `layout.fixedWidthUnits`, which float above the layout.
780
- - A finding that clears at the 390 px viewport, still in the 240 px container, is left out: it folds
781
- on a viewport media query, such as a full-width site header.
782
-
783
- **Web performance.** MCP serves this as `ads://guides/performance`.
784
-
785
- | Rule | Gate | Fails |
786
- |---|---|---|
787
- | `img-attributes` | `ads check` | A raw `<img>` in components, patterns or compositions without `loading`, or without `width` and `height`, a visible `aspect-ratio`, a width and height in its style, or out-of-flow positioning. A `srcset` with width descriptors and no `sizes`, on `<img>` or the project's `Image`. A spread or a class from elsewhere is an `img-attributes-unresolved` info item |
788
- | `asset-image-budget` | `ads check` | An image in `assets/` over its limit: SVG 100 KB, WebP and AVIF 300 KB, JPEG 400 KB, PNG and GIF 500 KB. `assets.imageBudgetKb` is one limit for every format |
789
- | `img-shape` | `ads audit` | A visible image whose CSS sizing box differs from its explicit `aspect-ratio`, or, with none and `object-fit: fill`, whose content box differs from its `width` and `height`. Explicit CSS ratios respect `box-sizing`; attribute ratios exclude border and padding. A height attribute beats `aspect-ratio`: add `height: auto`. `object-fit: cover` in a box of its own with no `aspect-ratio` is a deliberate crop |
790
- | `layout-shift` | `ads audit` | A scenario with Cumulative Layout Shift above 0.1 on first render, where the browser reports it (Chromium) |
791
- | `themes-generated` | `ads check` | A stale `tokens/fonts.preload.generated.ts` |
792
- | `font-weight-missing` | `ads check` | CSS uses a weight of a family `tokens/fonts.css` declares and no face covers it. A range such as `100 900`, or a face with no `font-weight`, covers what it spans. A weight in a rule with no `font-family` counts against the body's family |
793
- | `asset-font-budget` | `ads check` | A font file in `assets/` above 150 KB. `assets.fontBudgetKb` changes the limit |
794
-
795
- Review items, which fail nothing: `font-file-unused` (a declared face no CSS uses; weights 400 and 700
796
- count as used, since browsers apply them by default), `font-display` (none, or `optional`, which decides
797
- per file and can leave some weights in the fallback on one page) and `font-format` (not WOFF2). A
798
- project with no `@font-face` gets none of these.
799
-
800
- The starters' `Image` lazily loads and reserves space; `priority` marks the view's main visible
801
- image. When body or heading text uses a font from `tokens/fonts.css`, `ads assets` writes
802
- `tokens/fonts.preload.generated.ts`, and the generated public barrel re-exports it: call
803
- `preloadFonts()` from the public entry in the app entry before the first render. It imports the files through the bundler, Vite or Bun, so the preload and the stylesheet share
804
- one URL. For a preload earlier than JavaScript, a build step or prerender can call `fontPreloadTags()`
805
- for `<link>` tags or `fontPreloadHeader()` for a `Link` header value; `fontPreloads` is the same list.
806
- A project that sets heading fonts per component names what to preload in `assets.preloadFonts`:
807
- `[{ "family": "Body", "weight": 400 }, { "family": "Heading", "weight": 700 }]`. That list replaces the
808
- reading of `base.css`, and an entry `tokens/fonts.css` cannot satisfy is a `font-preload-config` error.
809
- ADS does not cover page metadata, `noindex`, sitemaps or hosting; run Lighthouse on a production
810
- build with real URLs.
811
-
812
- **Themes and brands.** Themed tokens are per-theme halves (`--x-light`, `--x-dark`) on
813
- `:root`; brands set their own halves on `[data-brand]`. `ads assets` generates
814
- `themes.generated.css` and `.ts`. Missing or conflicting halves, empty themes or brands,
815
- stale generated files, `light-dark()` and `[data-theme]`/`[data-brand]` ancestor selectors
816
- in components are errors; see [Tokens, grid, icons and accessibility](#tokens-grid-icons-and-accessibility).
817
-
818
- **Tokens.** Ownership, naming, the 2 px spacing rhythm (`token-rhythm`), missing names and
819
- scenario references are errors; equal values in different roles are a
820
- `token-overlap-review` item.
821
-
822
- **Architecture.** Data, UX and Skin ownership, project structure, unit and paint contracts,
823
- and binding and variable ownership are errors; Linaria atomic composition risks are
824
- `atomic-composition-review` items. See [Generic architecture guards](#generic-architecture-guards).
825
-
826
- **Behavior.** A registered guarantee needs current passing execution evidence. `ads verify`
827
- runs the registered checks against current source (`--unit` and `--check` select);
828
- `ads validate` runs every one its change set reaches, draft acceptance the draft
829
- owners' own ones unless `acceptance.behavior` is `false`.
888
+ | `framework` | The UI framework that the design system is written for and that previews mount with (`react` or `preact`), optionally pinned as `react@<version>` |
889
+ | `dsDir` | The design-system folder |
890
+ | `assets.generatedPaths` | Project-relative folders that hold generated output, never source. They are not analysis inputs, and an import from one is a `source-unavailable` error |
891
+ | `assets.fontBudgetKb` | The largest font file that a `font()` declaration may list, in KiB rounded up (default 150). Above it: `font-budget` |
892
+ | `acceptance` | Draft acceptance: extra project scripts, and whether the owners' behavior tests and render audit run |
893
+ | `validation` | `ads validate`: scripts run after `acceptance.scripts`, and extra project files that count as validation inputs |
894
+ | `resources.memoryLimitMb` | An optional memory budget for ADS's managed processes |
895
+ | `cache` | Bounds of the persisted extraction cache ([Cache bounds](#cache-bounds)) |
896
+ | `compile` | The emitted output folder, and emit after acceptance ([Emitting the design system](#emitting-the-design-system)) |
897
+ | `mcp` | Showcase title, check and preview timeouts, audit concurrency, behavior profiles, capture browser and result retention |
898
+
899
+ An unknown field, at the top level or in a section, fails to load; ADS does not
900
+ silently weaken checks. Paths stay within the receiving project. A subfolder
901
+ with its own `ds.config.json` is a separate project: check, validation, audits,
902
+ previews and watches stop there and run in it on their own.
903
+
904
+ ADS reads only the design-system project: the `dsDir` tree, `ds.config.json`,
905
+ package manifests and lockfiles with their dependency-resolution configuration,
906
+ the TypeScript configuration chain, the entry files of configured package
907
+ scripts and their imports, notices and `validation.inputs`. ADS does not read or
908
+ check application source, public directories, the root `index.html` or tests
909
+ outside `dsDir`. An edit to them never makes validation, preview or acceptance
910
+ evidence stale. A policy about how the application uses the design system
911
+ belongs to the application's own tooling.
912
+
913
+ ### Cache bounds
914
+
915
+ `cache` bounds ADS's persisted extraction cache in `.ds/cache/extraction/`
916
+ (see [the caching guide](CACHING.md#persisted-extraction-cache)).
917
+ Both fields are optional:
830
918
 
831
- ## Showcase
919
+ ```json
920
+ { "cache": { "extractionMaxMiB": 64, "extractionMaxEntries": 8192 } }
921
+ ```
922
+
923
+ | Field | Default | Range | Bounds |
924
+ | --- | --- | --- | --- |
925
+ | `extractionMaxMiB` | 64 | integer 1–65536 | Disk space of all entries, in MiB |
926
+ | `extractionMaxEntries` | 8192 | integer 128–1000000 | Number of entries |
927
+
928
+ The bound limits disk space only. A lookup costs the same at any size, and
929
+ pruning runs when ADS is idle or about to exit, not during a check. A smaller
930
+ cap extracts more again after restarts. Values outside the ranges fail to load.
931
+ `ADS_CACHE=off` disables the disk layer whatever the bound.
932
+
933
+ ### Design system source
934
+
935
+ A design system authors recipe owners (`@reqvire-org/ads/recipe`), role token
936
+ sheets (`tokens/**/*.ads.css`), profiles (`profiles/**/*.ads.ts`), asset
937
+ declarations beside their drawings (`assets/<group>/*.ads.ts` and `*.svg`) and
938
+ `foundation.ads.ts`. The public barrel `index.ts` is written by hand and names
939
+ each public owner (`export *` is rejected). The installed `@reqvire-org/ads`
940
+ package types the macro imports. An `env.d.ts` at the design-system root is
941
+ included when present, but is not required. Source in any other form fails.
942
+
943
+ This section describes what `ads check` enforces, by area. `ads check`, MCP
944
+ checks, previews, emission and draft acceptance use the same findings.
945
+ [The contract](ADS.md#checks) lists the rules of each area,
946
+ [the rule reference](RULES.md) gives the statement and repair of every rule, and
947
+ [the authoring language](LANGUAGE.md) describes the constructs.
948
+
949
+ #### Structure, themes and brands
950
+
951
+ - `project-structure`: `dsDir`, `index.ts` and `foundation.ads.ts` are required.
952
+ - `import-leaves-design-system`: an import leaves the design-system folder.
953
+ - `source-unavailable`: an import names a file that is not an analysis input,
954
+ such as a folder in `assets.generatedPaths` or the emitted output.
955
+ - `source/framework-mismatch` (`owner-analysis`, at the import): a React package
956
+ (`react`, `react-dom`, their subpaths, type imports included) in a Preact
957
+ project, or a Preact package (`preact`, `@preact/*`) in a React project.
958
+
959
+ ADS reads the themes and brands from `foundation({ ..., themes, brands })`, in
960
+ declared order. The first theme and brand are the defaults: the `:root` values
961
+ of the token sheets. The render audit, capture, the showcase and `ads_status`
962
+ read the same declaration. Two optional fields are `true` or omitted:
963
+
964
+ - `followSystemTheme: true`: a root without `data-theme` follows the OS colour
965
+ scheme. It takes the first light-scheme theme for a light preference and the
966
+ first dark-scheme theme for a dark one, so the design system needs one of
967
+ each. An explicit `data-theme` always wins, and brands keep their own values.
968
+ Emission copies the token rules of each such theme for
969
+ `:root:not([data-theme])` under `@media (prefers-color-scheme: …)`, directly
970
+ after the original, so they cascade as the attribute does.
971
+ - `sections: true`: `data-theme` or `data-brand` on any element switches its
972
+ subtree ([Colours that depend on their surroundings](#colours-that-depend-on-their-surroundings)).
973
+ Without it, only the attributes of `<html>` select a context.
974
+
975
+ An invalid list or field is an `owner-analysis` finding at the field
976
+ (`contexts/list-invalid`). A theme or brand that a token sheet or asset variant
977
+ names without a declaration is one finding per reference
978
+ (`contexts/theme-undeclared`, `contexts/brand-undeclared`). A declared
979
+ non-default theme or brand that nothing defines is an error at its entry
980
+ (`theme-undefined`, `brand-undefined`).
981
+
982
+ #### Owner analysis
983
+
984
+ Owner analysis reads the design inputs and discovers every owner that the barrel
985
+ reaches. It type-checks the owners with the scenarios and the fixtures they
986
+ import. It then analyzes, lowers and compiles every reachable construction, and
987
+ resolves each owner's token CSS. Each failure is a blocking `owner-analysis`
988
+ finding with a `code` that names the exact error (`<domain>/<kind>`, for example
989
+ `spec/value-invalid` or `token-css/token-missing`), its `group`, a `repair` hint
990
+ and a position.
991
+
992
+ - ADS analyzes every owner. One check thus reports the first source failure of
993
+ each failing owner (in discovery order), every TypeScript diagnostic, each
994
+ failing helper module, the first compile failure of the analyzed owners and
995
+ every token CSS failure.
996
+ - Invalid design inputs, owner discovery failures (a cycle, `export *`) and
997
+ import-graph failures stop analysis of the revision.
998
+ - An owner whose grid aligns the rows of a failed owner (`alignRows`) cannot be
999
+ analyzed until that owner is fixed. ADS reports it as a nonblocking
1000
+ `owner-analysis-blocked` info advisory at the aligned component, with the
1001
+ failed owner in `blockedBy`, never as an error that repeats the cause. After
1002
+ the fix, the blocked owner reports its own problems.
1003
+ - What analysis cannot prove is a nonblocking `owner-analysis-review` item with
1004
+ a `review/<kind>` code: a scroll container that nothing focuses, a summary
1005
+ without its marker or artwork, truncated or clamped text without a `title`.
1006
+
1007
+ Three codes concern profile and recipe declarations:
1008
+
1009
+ - `foundation/profile-field-unknown`, at the field: a profile field that its
1010
+ kind does not have (a misspelt composite slot such as `frameProfle`, a text
1011
+ field on a spacing profile, an unknown field in a choice option or spatial
1012
+ clause). The vocabulary is the kind's token and policy fields and the
1013
+ composite slots.
1014
+ - `foundation/profile-argument-default`, at the selection: a slot reference
1015
+ selects the default option of the referenced profile.
1016
+ - `source/recipe-redundant`, at the declaration: a recipe restates what its
1017
+ selected profile supplies. This is a default choice selection, a binding equal
1018
+ to its composite slot (by name, an equivalent alias, `{ slot: "text" }` on a
1019
+ text part, a binding recipe's `visual`, a paint transition's `motion`), the
1020
+ default content gap, or a `when` state that selects the base surface. It is
1021
+ redundant only when it is redundant in every reachable choice. A state surface
1022
+ may overlay part of its base (a colour-only error state).
1023
+
1024
+ #### Tokens
1025
+
1026
+ Shared values obey three contracts: the value shape of each role, the roles that
1027
+ each profile field reads, and the permitted token derivations
1028
+ ([token roles](TOKEN-ROLES.md)). ADS checks the tokens in every context that the
1029
+ sheets declare: the base, each theme, each brand, each brand under each theme,
1030
+ and the overrides of each `@media`/`@supports` condition. It first resolves
1031
+ `var()` references through the values of that context. Each finding is at the
1032
+ declaration, unless stated.
1033
+
1034
+ - `token-role-duplicate` (error): a token has one role, the file name of its
1035
+ sheet. Its `:root` default and every theme or brand override are in that
1036
+ sheet.
1037
+ - `token-selector-invalid` (error): token rules are `:root`,
1038
+ `:root[data-theme="…"]`, `:root[data-brand="…"]` or both, directly or inside
1039
+ `@media`, `@supports` or `@layer`. Another selector (`.card`, a selector list,
1040
+ `[data-theme]` without `:root`) or at-rule (`@container`) forms no context. An
1041
+ override of a token with no `:root` default is allowed; each reference to such
1042
+ a token needs a `var()` fallback (`token-css/token-missing`).
1043
+ - `review/context-section-inactive` (review): without `sections: true`, a
1044
+ `data-theme` or `data-brand` attribute on design-system markup switches
1045
+ nothing.
1046
+ - `token-sheet-property` (error): a token sheet declares custom properties only.
1047
+ An ordinary property (`:root { color: red }`) is not read as a token.
1048
+ - `token-type` (error): every token is a value of the shape of its role
1049
+ (`paint` a colour, `spacing` a nonnegative length, `duration` a nonnegative
1050
+ time, `easing` a timing function). A `calc()` that mixes units is accepted
1051
+ where the role has no sign or range bound.
1052
+ - `token-type-unresolved` (review, never a silent pass): a mixed-unit `calc()`
1053
+ where the role has a bound, or a value ADS cannot read statically (an unknown
1054
+ function, `currentColor`, an undefined reference).
1055
+ - `token-provenance` (error): a forbidden authored edge or composite position,
1056
+ including in unused tokens and fallbacks. Repair the named reference with a
1057
+ permitted role or shared literal
1058
+ ([provenance](TOKEN-ROLES.md#provenance-and-permitted-derivation)).
1059
+ - `token-overlap-review` (review, at the second token): tokens of one role that
1060
+ are identical in every context are possibly one decision named twice. Pure
1061
+ aliases (`var(--space-lg)` in every context) are not compared.
1062
+ - `a11y-text-resize` (error): a `font-size` token, and a `line-height` token
1063
+ that is a length, resolves to `rem` or `em` (or a `calc()`, `min()`, `max()`
1064
+ or `clamp()` that contains them) in every context (WCAG 2.2 1.4.4). A px line
1065
+ height stays fixed while resized text grows, so lines overlap; a unitless
1066
+ multiplier already scales. See also
1067
+ [Text scaling in the application](#text-scaling-in-the-application).
1068
+
1069
+ **Spatial profiles.**
1070
+
1071
+ - `spatial-profile-invalid` (error, at the profile's declaration): every
1072
+ declared spatial profile, selected or not, reads through the grid algebra
1073
+ (units, scale, ratios, maximum width, breakpoints, margins and gutters), as
1074
+ grid lowering and the preview facts read it, in the base context and in every
1075
+ context that defines a reached token differently. Profiles that compose one
1076
+ definition (`with: ["page-grid"]`) and have the same failure give one finding,
1077
+ at the profile that declares the units. An owner that selects a broken profile
1078
+ also reports its own failure at the construction.
1079
+ - `spatial-context-unsupported` (error, at the profile's declaration): a
1080
+ breakpoint width, column count or named condition bound is compiled into media
1081
+ queries and track lists, so no context can give its token another value.
1082
+ Margins, gutters, the maximum width and fixed tracks are read live and can
1083
+ differ by context, if every grid still holds there
1084
+ (`construction/grid-context-invalid`, at the grid construction).
1085
+
1086
+ #### Contrast
1087
+
1088
+ Each text pair belongs to one of three checks. The minimum is 4.5:1 (WCAG 2.2
1089
+ 1.4.3), or 3:1 where the text is provably large: its text profile, own or
1090
+ inherited, resolves to at least 24px, or 18.66px at weight 700, in that context.
1091
+ Inactive elements and states (`:disabled`, `[aria-disabled="true"]`, not a state
1092
+ only excluded with `:not()`) have no minimum. The same is true for placeholder
1093
+ contrast.
1094
+
1095
+ **`surface-contrast`** (error, at the profile's declaration): a surface profile
1096
+ that sets both `color` and `background` reaches 4.5:1 in every context. Its
1097
+ `background-image` gradient stops count as backgrounds. A profile does not state
1098
+ whether its colour paints only non-text UI, so the text minimum applies to every
1099
+ pair.
1100
+
1101
+ - A translucent background, an `opacity` below 1 or an image that is not a
1102
+ gradient of known colours is a `surface-contrast-unresolved` review item.
1103
+ - A surface that paints a disabled control declares `state: "inactive"` among
1104
+ its fields and is not checked. A construction can select it only under an
1105
+ inactive owner state; anywhere else is `construction/inactive-surface-active`.
1106
+
1107
+ **State contrast** (owner analysis): an owner's `when` states pair the colour of
1108
+ one profile with the background of another, such as a colour-only error state
1109
+ over the base fill, or a hover fill under the base colour.
1110
+ `construction/state-contrast-insufficient` blocks the owner;
1111
+ `review/state-contrast-unresolved` is a review item.
1112
+
1113
+ **`component-contrast`** (error, at the surface that chose the colour of the
1114
+ text): text meets the minimum against the backdrop it is rendered on, across
1115
+ elements and owners, without declared pairs.
1116
+ [The contract](ADS.md#composed-text-contrast) defines the rule and its
1117
+ unresolved cases, and [the architecture](ARCHITECTURE.md#composed-contrast)
1118
+ explains the join.
1119
+
1120
+ - ADS follows each text position outward through the elements of its owner, into
1121
+ the slot of every component it is passed to and back out, and up through every
1122
+ placement of its owner. The colour is the nearest one that a surface sets. The
1123
+ backdrop is the nearest opaque background, with translucent backgrounds and
1124
+ gradients of known colours composited over it.
1125
+ - Text sizes inherit across owners: an owner without a text profile takes its
1126
+ renderer's, else the document's. A placement's literal props select the
1127
+ choices of the child that it renders. Hidden elements and absent text
1128
+ (`{null}`, an empty or missing prop) add nothing.
1129
+ - Applications also place a component that the public barrel exports, on the
1130
+ document surface that `foundation({ surface })` declares. ADS thus checks its
1131
+ text there also. An application's own coloured container is outside this
1132
+ check.
1133
+ - An element that renders `data-theme` or `data-brand` is painted with the
1134
+ document surface. With `sections: true`, its subtree is checked in the named
1135
+ context only; without sections, in the page's contexts.
1136
+ - The finding lists the pair's `tokens`, every failing context that differs from
1137
+ the one it extends (`contexts`: theme, brand, condition, ratio, minimum) and,
1138
+ in `related`, the backdrop, the placements and the slots between them.
1139
+ - What ADS cannot prove is a `component-contrast-unresolved` review item at the
1140
+ placement or element, never a pass. Examples are a wrapper component that ADS
1141
+ does not analyze, a same-file component that does not render its `children`, a
1142
+ component placed by a plain module, a user-agent colour, an out-of-flow
1143
+ element without its own backdrop, `opacity` below 1, an unknown image, with
1144
+ sections a `data-theme`/`data-brand` that ADS cannot name, an expression that
1145
+ may be text, and markup rendered outside the markup of its component.
1146
+
1147
+ #### Accessibility in owners
1148
+
1149
+ ADS checks owners and their constructions against WCAG 2.2 AA. Each finding is
1150
+ an owner-analysis finding with its fine-grained code, reported under its
1151
+ `a11y-*` rule.
1152
+
1153
+ - `a11y-focus` (error, at the focus profile; WCAG 2.4.7, 1.4.11): the `width` of
1154
+ every focus profile is at least 2 CSS px in every context, and the document's
1155
+ default indicator has 3:1 against the background of the document surface. What
1156
+ cannot be evaluated is `a11y-focus-unresolved` (review).
1157
+ - `a11y-target-size` (error): every control construction and every
1158
+ `frame: "control"` part is at least 24 × 24 CSS px in every context, its hit
1159
+ area included (`construction/target-size-below-minimum`, naming the element,
1160
+ its size, the context and the deficit).
1161
+ - ADS computes the size from the lowered box, with relative lengths at the
1162
+ 16px reference root: min block = max(`min-block-size`, content + 2 × (inset +
1163
+ border)); inline = max(the frame's `min-inline-size`, 2 × (`padding-inline` +
1164
+ border) + content).
1165
+ - Neighbouring hit areas in a stack or inline arrangement must not overlap
1166
+ across their gap (`construction/target-area-overlap`).
1167
+ - A value that ADS cannot evaluate, or an inline extent that reaches 24px only
1168
+ with the width of its label (text is data), is `a11y-target-size-unresolved`
1169
+ (review).
1170
+ - A frame's `min-target-inline-size` / `min-target-block-size` (role
1171
+ `target-min-size`) lower to a hit area that the element owns: a centred,
1172
+ absolutely positioned `::after` that takes no layout space. A top-layer root
1173
+ cannot have one.
1174
+ - `a11y-icon-label` (error, at the control's element): in every reachable choice
1175
+ where a control renders no text part, its root has a non-empty `aria-label`,
1176
+ `aria-labelledby` or `title` (`source/control-name-missing`). Conditions are
1177
+ evaluated in the choice. Application text (a label prop) counts as a name, as
1178
+ it counts as content in a text part.
1179
+ - `source/pressed-state-mismatch` (`owner-analysis` error, at the choice's
1180
+ binding recipe; WCAG 4.1.2): a toggle's `aria-pressed` agrees with its
1181
+ drawing. In every reachable choice where the root of a construction sets
1182
+ `aria-pressed` and its artwork declares a `selected` state, a pressed choice
1183
+ draws `selected` and an unpressed one another state. An `aria-pressed` whose
1184
+ type is not finite (`any`, for example) is a `review/pressed-state-unresolved`
1185
+ item.
1186
+ - `a11y-image-alt` (error, at the image): every `<img>` that an owner renders
1187
+ has `alt`: artwork (`source/intrinsic-alt-missing`), content media and any
1188
+ other image (`source/image-alt-missing`). `alt=""` marks a decorative one.
1189
+ - `a11y-keyboard` (review, at the element): `onClick` on a non-interactive
1190
+ element (div, span, li, img, …) without a role and `tabIndex`
1191
+ (`review/click-without-keyboard`). Composite-widget items (option, tab,
1192
+ menuitem, row, gridcell, …) and backdrops whose handler reads `currentTarget`
1193
+ are exempt.
1194
+ - `a11y-non-text-contrast` (error): the check applies where a construction knows
1195
+ the surface that a control part sits on (an enclosing element that paints an
1196
+ opaque background). A control part is a `frame: "control"` part, or
1197
+ `frame: { kind: "control", rules }` with one-sided rules such as a soft
1198
+ field's underline.
1199
+ - The border colour of the part (base and each owner state) reaches 3:1, when
1200
+ the part's own background does not bound it at 3:1.
1201
+ - The focus outline colour reaches 3:1, on the enclosing background outside
1202
+ the box and on the part's own background inside it.
1203
+ - The error is `construction/non-text-contrast-insufficient`. Unprovable pairs
1204
+ are `review/non-text-contrast-unresolved`.
1205
+ - A part can carry a human-approved `accessibility` declaration. It turns the
1206
+ border error into the review item `review/boundary-identified-otherwise` and
1207
+ needs a person's approval at acceptance (see the accessibility reference of
1208
+ the skill).
1209
+ - A control's artwork paints with its text colour, which `surface-contrast`
1210
+ already holds to 4.5:1. The surroundings of a control root are its parent's
1211
+ composition, which the render audit measures.
1212
+
1213
+ #### Assets, fonts and the application icon
1214
+
1215
+ **Assets** ([assets](ASSETS.md#icons-and-glyph-sets)).
1216
+
1217
+ - Asset names, asset aliases and glyph-set names are one namespace
1218
+ (`assets/name-duplicate`, at the repeated field). An alias resolves to its
1219
+ asset wherever an asset name is accepted.
1220
+ - The members of a glyph set are declared, distinct foreground assets on one
1221
+ grid, and its aliases name members (`assets/set-*`, at the member or alias).
1222
+ - An owner that takes an icon takes a glyph reference
1223
+ (`Glyph<"close" | "search">`, made with `glyph()`). An icon chosen from data
1224
+ is looked up in a declared glyph set by a name typed as the names of the set.
1225
+ The constructions do not depend on the glyph (`source/glyph-*` codes).
1226
+ - `asset-unused` (error, at the name in the declaration): an asset that no owner
1227
+ binds, no bound set lists and no `glyph()` references, or a glyph set that no
1228
+ owner binds. ADS reports it only after every owner is analyzed.
1229
+
1230
+ **Fonts.** Declare a font family once, with `font()`, in an `assets/**/*.ads.ts`
1231
+ file beside its files. Keep its licence there also:
1232
+
1233
+ ```ts
1234
+ import { font } from "@reqvire-org/ads/font" with { type: "macro" };
1235
+
1236
+ export default font({
1237
+ family: "Inter", // the CSS family name, unique in the design system
1238
+ title: "Inter",
1239
+ description: "UI text face",
1240
+ license: "SIL OFL 1.1 (assets/fonts/inter/OFL.txt)",
1241
+ display: "swap", // swap | fallback | optional | block
1242
+ faces: [
1243
+ { source: "./Inter-Variable.woff2", weight: [100, 900] },
1244
+ { source: "./Inter-Italic.woff2", weight: [100, 900], style: "italic" },
1245
+ ],
1246
+ preload: [{ weight: 600 }], // optional: faces to preload beyond the document text's
1247
+ });
1248
+ ```
832
1249
 
833
- ADS ships a minimal HTTP browser shell with isolated previews. `ads mcp` serves the
834
- website alongside its stdio connection; `ads showcase` starts the same runtime
835
- for browser-only use. Run commands from the project root. Open the printed URL,
836
- or use `ads_status.showcaseUrl` from an already connected runtime: it is the URL
837
- and port of the showcase that server is running. An available loopback port is
838
- selected by default; `--port 4185` selects a fixed port.
839
- `ads mcp --no-showcase` keeps a headless stdio server.
840
-
841
- The browser reads catalogues and opens previews through scoped HTTP services
842
- backed by the same engine as MCP. SSE events refresh menus and build state;
843
- the selected scenario updates inside its persistent iframe.
844
- Compatible React/Preact edits retain component state, typed values and focus.
845
- Edits that change hook signatures or module boundaries can reset state; failed
846
- checks restore verified output. Errors identify
847
- stale retained output. Its neutral header and left pane align and collapse
848
- together. Themes flow through the preview host context. No project catalogue pages
849
- or direct component imports are used by this client.
850
-
851
- The project owns implementations, colocated scenarios/fixtures, foundation
852
- CSS and a framework mount adapter. ADS runs its preview compiler on Bun, using
853
- incremental modules for watched previews and complete bundles for verification.
854
- The starter and init provide the mount under `design-system/showcase/mcp/`.
855
- Configure the framework; ADS compiles every scenario into one shared preview graph:
1250
+ A font is used where a font-family role token names it first
1251
+ (`--font-ui: "Inter", system-ui, sans-serif`), in any theme, brand or condition.
1252
+ The starter keeps system fonts. A face's file is a design input. A missing file,
1253
+ a source outside the declaration's folder, a file whose bytes are not its
1254
+ format, a repeated family (`fonts/family-duplicate`) or overlapping faces reject
1255
+ the declaration.
1256
+
1257
+ - `font-weight-missing` (error, at the profile): a text profile draws a declared
1258
+ font at a weight that no upright face covers. The weight is its font-weight
1259
+ token in some context; the document text profile without one draws at 400.
1260
+ - `font-budget` (error): a file is above `assets.fontBudgetKb`.
1261
+ - `font-unused` (review): a family that no font-family token names first, or a
1262
+ face of a used family that no profile selects. The 400, 700 and italic faces
1263
+ count as used, because browsers draw plain, bold and emphasized text with
1264
+ them.
1265
+ - `font-format` (review): a file is not WOFF2.
1266
+ - `font-display` (review): display `block` (invisible text while loading) or
1267
+ `optional` (one page can mix the face and the fallback).
1268
+
1269
+ **Application icon.** `foundation({ appIcon })` names a declared asset as the
1270
+ icon that browsers, launchers and app stores show
1271
+ ([the icon role](ASSETS.md#the-application-icon-a-role-not-a-kind)). `ads emit`
1272
+ renders it ([The output folder](#the-output-folder)). Its drawings count as used
1273
+ (no `asset-unused`).
1274
+
1275
+ ```ts
1276
+ export default foundation({
1277
+ // …tokens, profiles, themes…
1278
+ appIcon: {
1279
+ asset: "app-icon", // a declared asset() name or alias
1280
+ background: "--brand-surface", // optional: a paint-role token behind padded renders
1281
+ maskable: { padding: 0.1 }, // optional: or { asset: "app-icon-maskable" }
1282
+ exports: [ // optional: further images, inside the output folder
1283
+ { file: "icons/128x128.png", size: 128 },
1284
+ { file: "social/banner.png", asset: "banner", width: 1200, height: 630, background: "--brand-surface" },
1285
+ { file: "icons/icon.ico", sizes: [16, 32, 48, 256] },
1286
+ { file: "icons/icon.icns", sizes: [16, 32, 64, 128, 256, 512, 1024] },
1287
+ { file: "icons/app.svg" },
1288
+ ],
1289
+ },
1290
+ });
1291
+ ```
1292
+
1293
+ - `app-icon-asset` (error, at `appIcon.asset` or `appIcon.background`): the
1294
+ asset is undeclared, is not `paint: "intrinsic"` (a browser tab or launcher
1295
+ cannot read CSS variables), has optical-size variants, or has a viewBox that
1296
+ is not square. Or a background token is not a paint-role token, or does not
1297
+ resolve to an opaque colour in the default theme and brand. With variants, ADS
1298
+ renders the drawing of the default theme.
1299
+ - `app-icon-export` (error, at the entry): a file outside the output folder
1300
+ (`..`, absolute or hidden segments), or at a path that ADS or another export
1301
+ writes (the platform icons, `fonts/`); a format other than `.svg`, `.png`,
1302
+ `.ico` and `.icns`; a size outside 16–2048 px; an export asset that cannot be
1303
+ rendered; or a sizing that the format does not take. `.png` takes `size`, or
1304
+ `width` and `height`; `.ico` takes `sizes` up to 256; `.icns` takes `sizes`
1305
+ 16, 32, 64, 128, 256, 512 and 1024; an `.svg` copy takes none.
1306
+ - `app-icon-maskable` (error, at `appIcon.maskable`): a padded master (`padding`
1307
+ 0–0.4 of the width on each side) needs `background`, and its drawing stays
1308
+ inside the safe zone, the central circle of 80% of the width (W3C Web App
1309
+ Manifest). A separate maskable drawing is square and opaque to its edges. ADS
1310
+ reads both from the drawing rendered at 256 px.
1311
+
1312
+ #### Styling ownership
1313
+
1314
+ Styling exists only in owners, and owners style only through their recipes. Each
1315
+ finding is an `owner-analysis` error at its position.
1316
+
1317
+ - `source/css-in-js-import`: an import of a CSS-in-JS package in any
1318
+ design-system file, including owners, scenarios and fixtures. ADS keeps the
1319
+ known packages as one closed list, a backstop for libraries that hide a class
1320
+ name behind a component or a call.
1321
+ - A production module that authors no recipe renders only design-system owners.
1322
+ The errors are intrinsic markup (`source/plain-markup`); `className`, `class`,
1323
+ `style` or `css` on a rendered element (`source/plain-style-attribute`);
1324
+ styling written through the DOM (`source/plain-style-write`); and stylesheet
1325
+ imports (`source/plain-stylesheet-import`). To repair them, move the styling
1326
+ into a recipe in an owner. Then render that owner from the plain module, or
1327
+ make the module an owner by authoring the recipe of its markup.
1328
+ - A scenario styles nothing. It can render fixture markup around owners. Styling
1329
+ props (on owners too), DOM styling writes and stylesheet imports are the same
1330
+ errors, and a `<style>` element is `source/style-element`.
1331
+ - An owner imports no stylesheet (`source/owner-stylesheet-import`, at the
1332
+ import, whether or not the file exists).
1333
+ - An owner writes no styling through the DOM (`source/owner-style-write`).
1334
+ Geometry that it measures at runtime goes through the declared `measured`
1335
+ values of its recipe ([Runtime values](#runtime-values-and-interaction)).
1336
+ - A production module's import that points into a development location
1337
+ (mock media such as `../mocks/…/media/photo.svg`, a fixture) is
1338
+ `source/development-import`. `source/module-unresolved` stays for paths that
1339
+ are really unresolved.
1340
+ - A development file's import of an asset that the preview serves
1341
+ (`./media/mark.svg`, `?raw`, `?url`, `?worker`) needs no module declaration.
1342
+
1343
+ `source/framework-mismatch` is in
1344
+ [Structure, themes and brands](#structure-themes-and-brands).
1345
+
1346
+ **Mocks.** `mock-ownership` (codes `mock/<kind>`) applies
1347
+ to every script under `mocks/` and each helper it imports. A mock is held to
1348
+ what a source application is held to. The script renders only what it imports
1349
+ from `@ds` with explicit props: a pattern, and components only inside a
1350
+ pattern, as its child or in a slot prop (`component-outside-pattern`). It may import
1351
+ any framework hook and declared library. It reaches the design system only
1352
+ through `@ds`: a relative import leads to captured helpers inside `mocks/` or
1353
+ its own `media/` images. Native or local markup,
1354
+ `style`/`className`/`css`/`dangerouslySetInnerHTML`, spreads, re-exports,
1355
+ imperative styles, dynamic code and design hidden in strings are errors at their
1356
+ position.
1357
+
1358
+ ##### The same check for a source package
1359
+
1360
+ The part of the mock rule that concerns design use is released as its own npm
1361
+ package, `@reqvire-org/ads-guard`. An application installs it and confirms that
1362
+ its own source does no design and uses the design system only. It is optional.
1363
+ Its purpose is to close the loop for work in the application, where ADS does
1364
+ not look: without it, a person or an agent can add an element or a class in
1365
+ application code and nothing reports it.
1366
+
1367
+ It runs on Node or Bun and needs no ADS in the application.
1368
+
1369
+ ```sh
1370
+ npm install --save-dev @reqvire-org/ads-guard # or: bun add --dev @reqvire-org/ads-guard
1371
+ npx ads-guard # or: bunx ads-guard
1372
+ ```
1373
+
1374
+ Where to run it:
1375
+
1376
+ | Stage | How |
1377
+ | --- | --- |
1378
+ | Lint | `"lint": "eslint . && ads-guard"` in the application's `package.json` |
1379
+ | Test | `"pretest": "ads-guard"`, so tests do not start on source that does design |
1380
+ | Build | `"prebuild": "ads-guard"`, when a build must never ship such source |
1381
+ | CI | A step `npx ads-guard` (or `bunx ads-guard`); it exits 1 on findings |
1382
+ | An agent's own loop | Tell the agent to run `npx ads-guard` after it edits application code, and to fix findings by using or adding a pattern, never by excluding the file |
1383
+
1384
+ `npx ads-guard --json` prints the report for tools.
1385
+
1386
+ `ads-guard.config.json`, in the application's root:
856
1387
 
857
1388
  ```json
858
1389
  {
859
- "framework": "react",
860
- "mcp": {
861
- "showcaseTitle": "My Project Design System"
862
- }
1390
+ "designSystem": "@acme/design",
1391
+ "include": ["src"],
1392
+ "exclude": ["src/generated"],
1393
+ "allow": { "react": ["Suspense", "StrictMode"], "react-router": ["Outlet", "RouterProvider"] }
863
1394
  }
864
1395
  ```
865
1396
 
866
- Keep the saved `framework` (`react` or `preact`), JSX transform and mount adapter
867
- consistent. The optional title defaults to the project package name followed by
868
- ` · Design System`. The browser shell stays the same for both frameworks. There is
869
- one managed compiler per runtime, shared by stdio and HTTP clients. It builds
870
- a shared multi-entry graph on first demand and after source changes; the App
871
- loads only the selected scenario's dependencies. TSX/Linaria compilation still
872
- happens automatically. Accepted configuration-unit mutations replace the managed
873
- compiler while keeping MCP connected. Configuration or dependency
874
- changes may require restarting the runtime; ordinary owner/fixture/style/asset edits do not.
875
- See [the compiler contract](MCP.md#one-client-command-managed-preview-builds) for revisions,
876
- diagnostics, invalidation and the shared resource graph.
877
-
878
- Colocate `<Owner>.ads.scenario.tsx` and `<Owner>.ads.fixture.ts` beside tokens and
879
- each component/pattern. Larger entries
880
- live under `composition/<Name>/`. A default zero-input mountable view imports the
881
- real public UI and a local fixture, and exports literal metadata:
1397
+ - `designSystem` is the specifier the application imports the design system
1398
+ by. The guard reads its public entry to learn which exports are patterns.
1399
+ When the specifier is an alias that Node cannot resolve, `entry` names the
1400
+ entry file.
1401
+ - `include` lists the source folders. `exclude` lists folders and files under
1402
+ them that are not checked. Every run reports what was excluded, and an entry
1403
+ that does not exist is an error, so the list cannot hide anything.
1404
+ - `allow` lists components of other packages that carry no design, one by one:
1405
+ a router's outlet, providers, the framework's own markers.
1406
+ - Tests and the design system's own files are never checked; the report counts
1407
+ them. Document metadata (`<title>`, `<meta>`, `<script>`, a `<link>` that is
1408
+ not a stylesheet) is accepted anywhere.
1409
+ - Exit code 0: the source uses the design system only. 1: findings, each with
1410
+ a file, position, code (`design-usage/<kind>`), message and repair. 2: the
1411
+ configuration is wrong.
1412
+
1413
+ The configuration belongs to the application, not to the design system: ADS
1414
+ reads only the design-system project, and one design system can serve
1415
+ applications on different frameworks.
1416
+
1417
+ **Libraries in an application.** What a library gives decides how it is used.
1418
+
1419
+ | The library gives | Examples | Use |
1420
+ | --- | --- | --- |
1421
+ | Functions and hooks | Image URL builders, a router's hooks, date utilities | Freely. They are behavior. |
1422
+ | Components that render nothing | `Suspense`, `Outlet`, providers | Listed in the guard's `allow`. |
1423
+ | Hooks that return props for an element | `react-aria` | In the design system: the owner spreads them on its own element (`behaviorLibraries`). |
1424
+ | Components with their own design | A styled library, a framework's image component | Not rendered. Take the library's function; the design system owns the element. |
1425
+
1426
+ - **Images.** The application asks the library for the URLs and passes them to
1427
+ the design system's image owner: with Next.js, `getImageProps` from
1428
+ `next/image` gives `src`, `srcSet` and `sizes` as data; Cloudinary and imgix
1429
+ build the same from a source and a width. The starter's `Image` takes
1430
+ `source` and `responsive: { srcSet, sizes }`.
1431
+ - **Links.** The pattern renders `<a href>` and reports the click; the
1432
+ application navigates in the handler with its router.
1433
+
1434
+ #### Layout
1435
+
1436
+ **Grid containers.** A grid in container context (`context: "container"`)
1437
+ follows the nearest `ads-region` size container. An owned ancestor in the same
1438
+ owner must thus start one in every reachable choice: a region framed
1439
+ `frame: { container: "region" }`. Otherwise the tier rules of the grid never
1440
+ match, wherever the component is placed, and the grid is
1441
+ `source/grid-container-missing` at its construction. A container that a consumer
1442
+ renders around the component, or one inside a public component that the grid is
1443
+ passed to, is not evidence for this owner.
1444
+
1445
+ **Frames in grid cells.** A grid cell whose own construction declares a frame
1446
+ with a fixed inline size needs that width at the lower edge of every tier it is
1447
+ visible in. A fixed inline size is an `inline-size` that its `max-inline-size`
1448
+ does not cap to the region, or a `min-inline-size`.
1449
+
1450
+ - Where the grid algebra bounds the cell and the frame is wider, the cell is
1451
+ `source/frame-exceeds-region` at its construction. The finding names the tier,
1452
+ the condition and the context. The bound is the span of the cell less its
1453
+ gutter insets, in every context whose geometry differs.
1454
+ - Where the algebra cannot bound the cell (inherited tracks, or the placement
1455
+ outside a named condition at a tier that the condition can hold), or the size
1456
+ is not a length that ADS evaluates (an `em` of an unknown font size), it is
1457
+ the review item `review/frame-region-unresolved`, never a pass.
1458
+ - Frames deeper inside a cell are checked against the cell less the inline
1459
+ insets and fixed sizes of the owned elements between. A public component, or a
1460
+ list, figure, blockquote or fieldset in the way, is reviewed.
1461
+ - For the children of a fixed tiling grid, a size wider than the tile fails. Any
1462
+ other fixed size is reviewed, because a tile shrinks to a narrower region.
1463
+ - A public component placed as a cell or tile is reviewed, naming the narrowest
1464
+ region that the grid gives it. Its frame belongs to its own owner.
1465
+ - A nested grid inside a cell is checked against its own regions.
1466
+
1467
+ The overflow check of the render audit stays the rendered backstop.
1468
+
1469
+ **Row width.** An `inline` row is as wide as its content and never wider than
1470
+ its container. `extent: "container"` on its root makes it take the width
1471
+ available in any parent (a block, a column that aligns its children, the space
1472
+ left beside siblings). A part with `extent: "fill"` needs such a row, or one
1473
+ whose frame fixes its width: in a row that hugs, it has nothing to fill
1474
+ (`construction/extent-row-hugs`). `"container"` on a row whose frame fixes its
1475
+ width is `construction/extent-conflict`.
1476
+
1477
+ **Text layout.** Text layout is closed and resolved at compile time. A text
1478
+ part's `wrap` is one of anywhere (`true`/`"anywhere"`), `"never"`, `"balance"`
1479
+ (headings and short titles), `"pretty"` (body text) or `"truncate"`. Truncation
1480
+ is one line with an ellipsis, or a clamp to `lines: 2 | 3`. `reserveLines:
1481
+ 1 | 2 | 3` makes the part always take that many lines of the line height of its
1482
+ text profile. Control labels keep their own closed `wrap` (word breaks by
1483
+ default, `"anywhere"` or `"never"`). [The language](LANGUAGE.md#closed-layout-constructs)
1484
+ gives the lowering; the contract's platform inventory lists each lowered feature
1485
+ ([Browser targets](#browser-targets)).
1486
+
1487
+ - `spec/value-invalid`: `lines` other than `2 | 3`; `lines` without
1488
+ `wrap: "truncate"`; or a clamp that reserves more lines than it shows
1489
+ (`lines: 2` with `reserveLines: 3`, at `reserveLines`, naming both values).
1490
+ - `spec/value-invalid`, `construction/extent-conflict`: a clamp on a declared
1491
+ native `element`, or beside an arrangement's own display or a scroll
1492
+ container.
1493
+ - `source/clamp-on-control`: a clamp on a control or a form label (a button,
1494
+ label, legend, summary, select, option or text field), or on text inside one.
1495
+ It hides what the control does.
1496
+ - `review/truncated-text-unnamed`: truncated or clamped text without a `title`.
1497
+ Assistive technology reads all of the text. Sighted readers need the title, an
1498
+ expand control or the full content elsewhere, and analysis sees only the
1499
+ title.
1500
+ - `review/balance-on-paragraph`, at the part's `wrap`: `wrap: "balance"` on a
1501
+ text part rendered as a `<p>`. A paragraph is body text, which `"pretty"`
1502
+ suits. Render a heading as a heading element.
1503
+
1504
+ #### Runtime values and interaction
1505
+
1506
+ The authoring language owns these constructs. Each lowers to plain CSS and
1507
+ plain `style.setProperty`/`removeProperty` calls, with no ADS runtime.
1508
+
1509
+ **Measured geometry** ([language](LANGUAGE.md#measured-runtime-geometry),
1510
+ [cropped media](LANGUAGE.md#cropped-media)). A recipe declares what its owner
1511
+ measures at runtime with `measured: { name: { type, property, fallback? } }`.
1512
+ The owner writes the values with `recipe.measured.set` and `.clear`, or spreads
1513
+ `recipe.measured.props(…)` on the element for a value known at render. Codes:
1514
+ `construction/measured-property-unsupported`,
1515
+ `construction/measured-profile-conflict`,
1516
+ `construction/measured-placement-missing`, `source/measured-undeclared`,
1517
+ `review/measured-unused`, `construction/cover-box-missing` and
1518
+ `construction/cover-asset-unsupported`. A measured size on a `frame: "control"`
1519
+ part is checked for target size with its fallback and reviewed
1520
+ (`a11y-target-size-unresolved`). Measured values never take part in contrast.
1521
+ The starter's `Menu` is a worked example: it places its panel below its trigger,
1522
+ or above it when only that side has room, and clears the values when it closes.
1523
+
1524
+ **Interaction properties** ([language](LANGUAGE.md#interaction-properties)).
1525
+ Drag handles, splitters and carousels declare `cursor`, `touchAction` and
1526
+ `userSelect` in `normalize`, and scroll snap as `snap: { type, align }` on the
1527
+ arrangement that scrolls. Codes: `spec/value-invalid`,
1528
+ `construction/extent-conflict`, `construction/snap-without-scroll`,
1529
+ `review/user-select-text` and `review/touch-action-unhandled`. A splitter
1530
+ combines both constructs: the grip declares the interaction, the pane declares
1531
+ the measured width, and the pointer handlers of the owner write the width
1532
+ through the measured setter.
1533
+
1534
+ **Runtime paint from data** ([language](LANGUAGE.md#runtime-paint-from-data)). A
1535
+ recipe declares the paints that its owner selects by data (a chart series, a
1536
+ status) with `paints: { name: { property, values, fallback } }`. The owner
1537
+ writes `recipe.paints.set` and `.clear`. Codes:
1538
+ `construction/paint-property-unsupported`, `construction/paint-value-role`,
1539
+ `construction/paint-profile-conflict`,
1540
+ `construction/paint-contrast-insufficient`, `source/paint-undeclared`,
1541
+ `source/paint-value-untyped`, `review/paint-unused` and
1542
+ `review/paint-contrast-unresolved`. The starter's `BarChart` paints its bars
1543
+ from the `--chart-1`…`--chart-3` series tokens (`tokens/Charts/paint.ads.css`,
1544
+ with light, dark and high-contrast values).
1545
+
1546
+ **Press scale** ([language](LANGUAGE.md#state-focus-and-motion),
1547
+ [motion](MOTION.md)). A press effect is a `when` state that reads `scale` from
1548
+ the motion slot of the recipe: on the artwork part of a control, or on a region
1549
+ or control root that declares `transition: ["scale"]`. A scale factor is
1550
+ relative: 0.96 moves a 40px button in by less than 1px per side, and a 400px
1551
+ card by 8px. Select the factor per size class, through the motion profile that
1552
+ the motion slot of the composite selects. The starter names the classes
1553
+ (`tokens/Motion/motion-scale.ads.css`, `profiles/Motion/feedback.ads.ts`):
1554
+
1555
+ | Element size | Profile | Factor | Shrink |
1556
+ | --- | --- | --- | --- |
1557
+ | Artwork inside a control (~20px) | `press-glyph` | 0.98 in the starter; 0.9 gives a visible ~1px | ~0.2px per side at 0.98 |
1558
+ | A control (~120 × 40px) | `press-control` | 0.97 | ~1–2px |
1559
+ | A card or tile surface (~300px) | `press-surface` | 0.99 | ~1.5px |
1560
+ | A page-sized region | none | — | no press scale |
1561
+
1562
+ The starter's Button, IconButton and ToggleTile press their artwork
1563
+ (`action-feedback` composes `press-glyph`). A `frame: "container"` root whose
1564
+ press factor is below 0.98 in some token context, or cannot be read as a number,
1565
+ is the review item `review/press-scale-large-surface` at the `scale` endpoint
1566
+ (`owner-analysis-review`, never blocking, also in a draft's acceptance result).
1567
+ `frame: {}` roots and control roots do not count. Select a surface-class press
1568
+ profile (factor at least 0.98) or no press scale, or keep a deliberate stronger
1569
+ press. Only such roots read token values for this item, so every other owner
1570
+ keeps its analysis across token edits.
1571
+
1572
+ #### Generated source and the emitted output
1573
+
1574
+ - `palette-generated` (error): a declared `palette.generated.ts` is missing or
1575
+ out of date, or one is present without `palette: true`
1576
+ ([Regenerating generated source](#regenerating-generated-source)).
1577
+ - `generated-modified` (error) and `generated-stale` (info): see
1578
+ [Hand edits and out-of-date output](#hand-edits-and-out-of-date-output).
1579
+
1580
+ #### Scenarios
1581
+
1582
+ Every public owner needs a scenario. A public owner is a file that the barrel
1583
+ re-exports and that authors recipes; a public plain module needs none. A public
1584
+ owner that no scenario covers is a `scenario-coverage` error at the owner file,
1585
+ naming it and where its scenario goes.
1586
+
1587
+ A scenario is a `*.ads.scenario.tsx` under `components/`, `patterns/` or
1588
+ `mocks/`. It supplies data and subjects; ADS draws the page with its own
1589
+ showcase components, the same for every design system.
882
1590
 
883
1591
  ```tsx
884
1592
  import { Button } from "@ds";
885
- import { fixture } from "./Button.ads.fixture";
886
- export const scenario = { title: "Button states", covers: ["Button"] };
887
- export default function Scenario() { return <Button>{fixture.label}</Button>; }
1593
+ import type { Scenario } from "@reqvire-org/ads/showcase";
1594
+
1595
+ export const scenario = {
1596
+ title: "Button",
1597
+ description: "The primary action control.",
1598
+ covers: ["Button"],
1599
+ specimens: [
1600
+ { title: "Sizes", arrangement: "row",
1601
+ render: () => <><Button label="Continue" size="sm" /><Button label="Continue" size="lg" /></> },
1602
+ ],
1603
+ } satisfies Scenario;
888
1604
  ```
889
1605
 
890
- IDs derive from filenames; do not maintain another registry or hand-assigned IDs.
891
- Showcase groups come only from folders. A folder above an owner becomes a group
892
- when its non-hidden children are all real directories:
1606
+ - It exports a literal `scenario` and has no default export (`scenario-entry`).
1607
+ ADS draws the title, the description, each specimen's title and note, the box
1608
+ around a specimen, the gaps and the state switch.
1609
+ - `title` is a nonempty static string. `covers` lists the public UI that the
1610
+ specimens render. Optional fields are `description`, `id`, `exercises`,
1611
+ `frame`, `states` and `captureTargets` (up to 20 named, nonempty CSS selectors
1612
+ of at most 500 characters). Another field, a `frame` outside `inline`,
1613
+ `screen` and `phone`, or `states` that is not an object literal of named prop
1614
+ sets is a `scenario-field` error.
1615
+ - `specimens` is a nonempty array literal of object literals
1616
+ (`scenario-specimens`). A specimen has a `render` function and can have a
1617
+ static `title` and `note`, an `arrangement` (`stack`, `row`, `tiles`) and a
1618
+ `width` (`content`, `full`, `small`, `medium`).
1619
+ - `render` is a component of the project's framework. It can hold local state.
1620
+ Its argument is the chosen state's props.
1621
+ - A scenario file writes no markup of its own (`scenario-markup`): no HTML or
1622
+ SVG element, no `style` attribute, and no component that a fixture or helper
1623
+ file declares. It renders owners, text and the scenario kit.
1624
+
1625
+ **States.** `states` names sets of props. ADS draws one switch for the scenario
1626
+ and passes the chosen set to every `render`. A new choice starts each specimen
1627
+ again. Use local state for what a person changes by using the owner. The
1628
+ showcase address names the chosen state (`&state=<name>`), so a state can be
1629
+ linked, and `ads_capture` takes the same name to capture it.
1630
+
1631
+ **Frames.** `frame: "inline"` (the default) is a page of boxed specimens.
1632
+ `frame: "screen"` shows the first specimen as a whole screen, with the state
1633
+ switch in a bar above it; a mock uses it. `frame: "phone"` shows it in a
1634
+ 390 by 844px box.
1635
+
1636
+ **The scenario kit.** `@reqvire-org/ads/showcase` supplies what a subject
1637
+ sometimes needs around it. The kit renders only in an ADS preview.
1638
+
1639
+ | Kit | Purpose |
1640
+ | --- | --- |
1641
+ | `Container` | A parent of a named size and direction, for a subject that only makes sense inside one. `inline`: `fill`, `pane`, `column`, `page`. `block`: `content`, `short`, `medium`, `tall`. |
1642
+ | `Placeholder` | A labelled, tinted stand-in for a slot that the application fills. |
1643
+ | `Anchor` | The control an overlay opens from. Its child is a function that receives the control's element. |
1644
+ | `EventLog`, `useEvents` | Shows what the owner's callbacks received. |
1645
+
1646
+ **Roles.** The type of an export decides what it is, however it was made
1647
+ (aliases, re-exports, `memo`, any chain of factories).
1648
+
1649
+ - It is rendered UI when calling it returns the framework's element type, or
1650
+ constructing it gives a class component. The element types are React's
1651
+ `ReactNode`, `ReactElement` or `JSX.Element`, and Preact's `VNode`,
1652
+ `ComponentChildren` or `JSX.Element`, identified by the framework's own
1653
+ declarations.
1654
+ - It is a behavioral API when it is callable or constructible and returns
1655
+ anything else (a value, `void`, a controller instance, a hook's result), or is
1656
+ declared under `controllers/` (a context provider).
1657
+ - An export of a recipe owner, or one that aliases it, is UI unless its
1658
+ signatures show otherwise (a hook beside the component).
1659
+ - When its type, or what calling it returns, is `any`, `unknown` or generic, ADS
1660
+ does not guess. An `exercises` entry that names it is a
1661
+ `scenario-exercise-review` item that says why. A `covers` entry that names it
1662
+ is judged by whether the scenario renders it.
1663
+
1664
+ **`covers`.** ADS checks each entry on its own, at that entry
1665
+ (`entry: "covers[1]"`). A bad entry is left out of what the scenario registers,
1666
+ and the valid ones stand.
1667
+
1668
+ - `scenario-covers`: the entry is not a static name, or the barrel does not
1669
+ export it.
1670
+ - `scenario-covers-role`: the entry names a public behavioral API.
1671
+ - `scenario-render`, at the entry: nothing that a specimen's `render` reaches
1672
+ renders the covered export. ADS resolves every JSX tag that a `render` reaches,
1673
+ and every call of the framework's element factory (`createElement`, or
1674
+ Preact's `h`), to its declaration, through `const` aliases. It follows the
1675
+ design system's own components (scenario adapters, owners) into theirs, so a
1676
+ mock renders the owners that its patterns render. An import, or a
1677
+ reference outside the rendered tree, does not count.
1678
+
1679
+ **`exercises`** names the public behavioral APIs that the scenario uses, so that
1680
+ previews and `ads_scenarios` can find them. It is a demonstration, never passing
1681
+ behavior evidence. The scenario stays registered with its valid entries and its
1682
+ covers.
1683
+
1684
+ - `scenario-exercise-api`, at the entry: the entry is not a static name, is not
1685
+ exported by the barrel, names rendered UI, or names a value that is neither
1686
+ callable nor constructible.
1687
+ - `scenario-field`: `exercises` is not an array.
1688
+ - `scenario-exercise`: the mounted code never uses the API (it is only imported,
1689
+ or used in a function that nothing reaches). A use is a call, a construction
1690
+ or a render (a context provider), in a specimen's `render` or in a development
1691
+ adapter that it reaches: a component it renders, a function it calls, an event
1692
+ handler. A call of a method attached to the API (`api.success()`) counts,
1693
+ through aliases, namespace imports and re-exports.
1694
+ - `scenario-exercise-review` (review, never blocks): the mounted code only
1695
+ passes the API on or reads it, or ADS cannot tell the role of the entry.
1696
+
1697
+ **Other rules.** The location, entry, metadata and identity of a scenario are
1698
+ checked as `scenario-location`, `scenario-entry`, `scenario-metadata`,
1699
+ `scenario-field` and `scenario-identity`. After a field error (an unknown field,
1700
+ an empty `title`, an invalid `id` or `captureTargets`), the scenario stays
1701
+ registered and its coverage counts while `covers` reads. Unreadable metadata
1702
+ (`scenario-metadata`, marked `coverage: "not-established"`) leaves its coverage
1703
+ unknown, not missing.
1704
+
1705
+ #### Previews
1706
+
1707
+ A scenario previews the emitted owner: the bytes that `ads emit` writes, with
1708
+ the emitted `foundation.css` as the document CSS.
1709
+
1710
+ - While a preview compiler runs, ADS emits each settled edit of the design
1711
+ system into a preview-owned tree (`.ds/emitted/live`, never the output
1712
+ folder), and the open previews rebuild from it. Scenario and fixture edits
1713
+ rebuild without an emit.
1714
+ - A revision whose check fails is not emitted, and the previews keep the last
1715
+ good revision. `ads://project/build` reports `freshness`
1716
+ `{ kind: "stale", shown, reason: { kind: "emit-failed", failure } }` with the
1717
+ findings of the check until the edit is fixed, then
1718
+ `{ kind: "current", revision }`.
1719
+ - The showcase marks such a preview stale. The preview status in the toolbar
1720
+ becomes an error. Its details list the findings of the check (or of emission)
1721
+ and offer Retry preview, until the revision is current again.
1722
+ - Several MCP servers on one project share that tree. They write it one at a
1723
+ time under a lock in `.ds/locks/`, and an earlier revision never replaces the
1724
+ revision of the latest edit.
1725
+
1726
+ #### Touch density
1727
+
1728
+ Input modality is a token context, like a theme or a brand, so controls can grow
1729
+ on touch screens without a new construct. Override the size tokens in their own
1730
+ role sheets under `@media (pointer: coarse)`. Every owner that reads them
1731
+ follows:
893
1732
 
894
- ```text
895
- components/
896
- Forms/ # group: Forms
897
- Input/
898
- Input.ads.scenario.tsx
899
- Select/
900
- Select.ads.scenario.tsx
901
- Switch/ # ungrouped owner
902
- Switch.ads.scenario.tsx
903
- ```
904
-
905
- The folder name is the group name, with spelling and case unchanged:
906
- `form-controls/` displays as `form-controls`. The owner's own directory and the
907
- layer root are never groups. The same convention applies to `patterns/` and
908
- `composition/`. Nested containers appear as one label, such as
909
- `Forms / Selection`. A regular file (`index.ts`, `README.md`, etc.) or a symbolic
910
- link prevents that container from becoming a group. Hidden entries are ignored.
911
-
912
- There is no grouping metadata, tag list or grouping registry. Do not add `group`
913
- to the scenario export or owner contract. The optional `group` in MCP discovery
914
- results is computed from folders; it is not authoring input. Change a group by
915
- moving complete owner directories and updating imports, exports and any scenario,
916
- behavior or capture references whose path-derived IDs change.
917
-
918
- Ungrouped entries remain directly visible without a Default heading. Named groups
919
- are collapsible and sorted alphabetically within each layer. Existing flat
920
- projects continue to work without moving files. Token views follow the catalogue's groups.
921
-
922
- ADS renders the **Tokens** section itself from the token sheets and
923
- `<dsDir>/tokens/catalog.ads.json`. Token navigation follows the same model as folders: a
924
- catalogue group is a sidebar group, and each kind of token in it (color fills, text colors,
925
- font families, text sizes, line heights, shadows…) is one view, `tokens/<Group>/<section>`, so a page shows one kind at a
926
- time. A group with a single kind stays one view, `tokens/<Group>`; the `Layout` group stays one
927
- view with the spatial reference. The section follows from each token's sample property, so there
928
- is no section metadata. As on component pages, each sample sits on the project canvas in a box
929
- while names and values sit on the showcase surface. The catalogue lists groups and gives each token its sample binding:
1733
+ ```css
1734
+ /* tokens/Controls/control-min-size.ads.css */
1735
+ :root { --control-height-sm: 1.75rem; --control-height-md: 2.25rem; --control-height-lg: 2.75rem; }
1736
+ @media (pointer: coarse) {
1737
+ :root { --control-height-sm: 2.25rem; --control-height-md: 2.75rem; --control-height-lg: 3rem; }
1738
+ }
930
1739
 
931
- ```json
932
- {
933
- "schemaVersion": 1,
934
- "groups": [
935
- { "id": "Color", "title": "Color", "samples": [
936
- { "token": "--accent", "property": "background-color", "probe": "rgb(31, 97, 163)" }
937
- ] }
938
- ]
1740
+ /* tokens/Controls/frame-inset.ads.css: the insets that go with the taller frames */
1741
+ :root { --control-inset-inline: 0.75rem; }
1742
+ @media (pointer: coarse) {
1743
+ :root { --control-inset-inline: 1rem; }
939
1744
  }
940
1745
  ```
941
1746
 
942
- `property` is the CSS property the view demonstrates the token with, and `probe` a valid test
943
- value different from the token's own; the view checks in the browser that the property responds.
944
- Tokens without a catalogue entry appear in a **Values** group with a default binding for their
945
- type. The `Layout` group's view also shows the spatial definition's examples. An invalid
946
- catalogue is a `foundation-catalog` error. Projects author no token scenarios or token review
947
- renderers: a project scenario with a foundation view's ID fails. (An additional project scenario
948
- that claims tokens is still checked by `token-scenario-reference` and `token-scenario-render`.)
949
-
950
- Fixtures/adapters own development inputs, state, callbacks and simulated services.
951
- The entry requires no browser page, application router/store or prior setup.
952
- Several contextual parts may share a scenario with their real parent. Larger
953
- entries reuse public production screen patterns instead of reassembling screens.
954
-
955
- `scenario-contract`, `scenario-render` and `scenario-coverage` require addressable
956
- coverage for every public renderable component/pattern, including unused exports.
957
- Only reachable real render references count. Types/constants/utilities are
958
- excluded. Scenarios and fixture helpers are development-only; runtime code and
959
- the public barrel cannot import or re-export them. They define no CSS, custom
960
- classes or native widget replicas. Project-specific review helpers use marked `.ads.review.*` files; the outer browser shell is tooling UI. Full-app integration harnesses
961
- belong in application tests. See the [contract](ADS.md#showcase-contract).
962
-
963
- The showcase header's **Phone viewport** toggle constrains the real preview iframe to 390 CSS pixels (or the available width on a narrower screen). It is available for patterns and compositions as well as components, keeps the mounted example and its state, and does not change the selected application host. Use it to review a responsive web shell at phone width independently of a native mobile app shell. `?viewport=phone` preserves this preview choice in a link; toggle it off to follow the available browser width. On phone browsers the catalogue starts collapsed, leaving the available width to the preview; the navigation button can reopen it. Automated captures retain their exact requested viewport.
964
-
965
- For this checkout, `bun run dev:showcase` builds the tool and serves an initialized
966
- Preact starter under ignored `.ds/playground/`. `bun run dev:react` selects React.
967
- The design source is `starters/shared/`; restart after editing it to generate a new
968
- playground snapshot. `bun run build:showcase` compiles that starter’s scenarios.
969
- The playground and receiving projects use the same initializer and packaged source.
970
- The built-in browser reads discovery and checked assets over HTTP and receives
971
- build reports through SSE. MCP agents and embedded Apps retain their existing
972
- interfaces. No delivery flag or project migration is required. Existing custom showcases
973
- are preserved by init; replace their run command deliberately when migrating.
974
-
975
- Run core and registered project checks before preview compilation, alongside
976
- framework checks and meaningful tests. Review real entries at narrow/wide sizes,
977
- in both themes and relevant states. Browser verification still establishes
978
- layout, keyboard/focus, interactions and motion; compiler success does not.
979
-
980
- Public `*Props` declarations omit inherited DOM `style`; arbitrary visual strings
981
- also fail. Measured geometry uses explicit boundaries. HTML mount styles may
982
- only establish full root height and body overflow. Project presentation belongs
983
- in owned component/pattern styles, with tokens supplying visual values.
984
-
985
- ## Branding
986
-
987
- ADS has fixed token names and ownership namespaces. Change values in the existing
988
- token files; `--accent`, `--font-sans`, `--radius-md`, and the other shared roles
989
- keep their meanings across projects. Foreign shared prefixes such as `--nuv-*` or
990
- `--brand-*` fail. There are no independent owner-local token namespaces. Components own `--ds-*`, patterns own `--ux-*`, and the showcase
991
- reserves `--showcase-*` for showcase boundaries. Fixture files still define no
992
- custom styling; the frame pattern uses `--ux-*`. Branding never assigns
993
- component state variables.
994
-
995
- Keep original artwork (SVG masters, finished PNG/JPEG/WebP images, delivered
996
- `.ico`/`.icns` files, in any mix) and a usage/credits/license README in
997
- `design-system/assets/brand/`, and font files in `assets/fonts/`. `ads check` fails
998
- when artwork is undescribed in that README (`brand-readme`), the README states no
999
- license (`brand-license`), and lists artwork nothing uses for review (`brand-unused`). Name a dark-theme variant
1000
- `<name>.dark.svg`; the component showing it renders both and shows each with a display switch
1001
- (`display: var(--display-dark, block)`). ADS renders the showcase's first
1002
- section, **Brand** (`brand/Assets`), from the artwork in `assets/brand/` and its subfolders: artwork in the
1003
- current theme and the app icon at its actual sizes. Projects author no brand preview scenarios. A finished image renders only at or below its own
1004
- pixel size; ADS never enlarges it. The [branding guide](../skills/ads-designer/references/branding.md)
1005
- (`ads://guides/branding`) covers the whole flow. Font declarations
1006
- belong in optional `tokens/fonts.css`. ADS generates the import-only foundation entry
1007
- (`styles.css`) from the sheets present, in this order: fonts, colors, typography, spacing,
1008
- elevation, base, themes.generated.css. Never edit it by hand.
1009
- Fixed artwork colors and geometry are permitted inside SVG assets; they do not
1010
- permit raw visual values in component or pattern styles.
1011
-
1012
- Foundation sheets are checked source. Keep root token definitions in value sheets,
1013
- font faces in `fonts.css`, and closed-role defaults in `base.css` (document
1014
- typography/canvas/theme, limited native resets, global focus/reduced motion).
1015
- Owner hooks, contextual UI selectors, keyframes, extra CSS imports, raw visual
1016
- values and missing token references fail checks there too. Move component-specific
1017
- repairs into their Linaria owner; see the [foundation contract](ADS.md#shared-token-contract).
1018
-
1019
-
1020
- Select one square master, an SVG or a PNG/JPEG/WebP of at least 512 px, with an
1021
- ADS-relative path:
1747
+ - The token checks evaluate the overrides of each `@media` condition as a
1748
+ context of its own, crossed with every theme and brand. Thus
1749
+ `a11y-target-size`, contrast and `token-type` all check the touch values. A
1750
+ coarse value that makes a control smaller than 24 px fails in that context,
1751
+ and the finding names it (for example `:root under @media (pointer: coarse)`).
1752
+ - `ads emit` writes the overrides into the emitted sheets unchanged. Nothing
1753
+ runs at runtime.
1754
+ - ADS checks WCAG 2.2 AA (2.5.8): 24 px, whatever the pointer. Larger touch
1755
+ targets (44 px is a common platform guideline) are a design choice that the
1756
+ tokens express, not a rule that ADS enforces. An owned hit area
1757
+ (`minTargetBlockSize`, `minTargetInlineSize` on a frame profile) can enlarge
1758
+ the target without a change to the layout.
1759
+ - The starter does this ([starter touch density](STARTER.md#touch-density)). To
1760
+ see it, open a scenario in a touch context: Chromium DevTools device
1761
+ emulation, or Playwright's `hasTouch: true`, which makes Chromium report a
1762
+ coarse primary pointer.
1763
+ - Prefer `(pointer: coarse)` for the primary input. `(any-pointer: coarse)` also
1764
+ matches a laptop with a touch screen, which then gets touch density with a
1765
+ mouse also.
1766
+
1767
+ ### Colours that depend on their surroundings
1768
+
1769
+ Some UI must change its colours with what it sits on. Examples are a dark footer
1770
+ or dark card on a light page, a button over a photo or a strongly coloured
1771
+ banner, the cells and icons of a selected table row, and the links inside a
1772
+ warning banner. ADS has two checked patterns for this.
1773
+
1774
+ #### Nested theme and brand sections
1775
+
1776
+ A design system opts in with `sections: true` in its foundation declaration:
1022
1777
 
1023
- ```json
1024
- { "assets": { "iconSource": "assets/brand/app-icon.svg" } }
1778
+ ```ts
1779
+ // foundation.ads.ts
1780
+ export default foundation({
1781
+ // …
1782
+ themes: [
1783
+ { name: "light", scheme: "light" },
1784
+ { name: "dark", scheme: "dark" },
1785
+ ],
1786
+ sections: true,
1787
+ });
1025
1788
  ```
1026
1789
 
1027
- Merge this into `ds.config.json`; the source must be inside `assets/brand/`.
1028
- `favicon.svg` is written only for an SVG master. `ads assets` generates these files in ignored `.ds/assets/`:
1790
+ Then `data-theme="<name>"` or `data-brand="<name>"` on any element switches
1791
+ every token in the subtree of that element, exactly as the same attribute on
1792
+ `<html>` switches the page.
1029
1793
 
1030
- | Output | Size |
1031
- |--------|------|
1032
- | `favicon.svg` | Copy of the original SVG |
1033
- | `favicon.ico` | 16, 32, 48 px entries |
1034
- | `apple-touch-icon.png` | 180 × 180 |
1035
- | `icon-192.png` | 192 × 192 |
1036
- | `icon-512.png` | 512 × 512 |
1794
+ **Cost.** Sections are opt-in because they cost CSS. Every owner sheet carries
1795
+ toggle rules and a section rule for its context-dependent tokens. Without `sections: true`, ADS emits
1796
+ no section rule, and `data-theme` or `data-brand` below `<html>` changes
1797
+ nothing: the subtree keeps the page's values.
1037
1798
 
1038
- Rendering preserves colors, aspect ratio, and transparent padding. Include a
1039
- background in the original if needed for a platform. Every invocation rebuilds
1040
- the small output set; there is no rendering cache, asset registry, or theme
1041
- resolver. With no `iconSource`, it succeeds without writing. All images render
1042
- before generated files are replaced, so invalid artwork leaves prior outputs
1043
- intact. Sources, duplicate output mounts, and symlinked write paths are checked.
1799
+ **Authoring.** Token sheets continue to declare their contexts on the root only
1800
+ (`:root`, `:root[data-theme="dark"]`, `:root[data-brand="iris"]`,
1801
+ `:root[data-brand="iris"][data-theme="dark"]`). Emission applies each context to
1802
+ sections also ([The output folder](#the-output-folder)).
1044
1803
 
1045
- ### Committed targets and glyph sets
1804
+ **Selection.** The nearest `data-theme` and the nearest `data-brand` select the
1805
+ context independently, at any depth. The nearest attribute is the element's own
1806
+ or an ancestor's, `<html>` included.
1046
1807
 
1047
- Native launchers, tray icons and upload exports must exist without running ADS, so
1048
- they are committed. `assets.targets` lists them; each renders one master from
1049
- `assets/brand/` to a project path, the extension choosing the format:
1808
+ - A `data-brand="iris"` section inside a dark page gets iris's dark values.
1809
+ - A `data-theme="light"` section inside a dark page resets to the values of the
1810
+ default theme.
1811
+ - The `color-scheme` of the section follows its theme, so native controls and
1812
+ `light-dark()` match.
1813
+ - `foundation.css` repaints its document surface.
1050
1814
 
1051
- ```json
1052
- { "assets": { "targets": [
1053
- { "from": "assets/brand/app-icon.svg", "to": "app/icons/icon.svg" },
1054
- { "from": "assets/brand/app-icon.svg", "to": "app/icons/128x128.png", "size": 128 },
1055
- { "from": "assets/brand/banner.svg", "to": "exports/banner.png", "width": 1200, "height": 630 },
1056
- { "from": "assets/brand/app-icon.svg", "to": "exports/upload.png", "size": 1024, "background": "#FFFFFF" },
1057
- { "from": "assets/brand/app-icon.svg", "to": "app/icons/icon.ico", "sizes": [16, 32, 48, 256] },
1058
- { "from": "assets/brand/app-icon.svg", "to": "app/icons/icon.icns", "sizes": [16, 32, 64, 128, 256, 512, 1024] }
1059
- ] } }
1815
+ The checks already evaluate every theme, brand and brand × theme context. The
1816
+ same findings thus prove contrast inside a section and on the page.
1817
+
1818
+ A dark footer on a light page:
1819
+
1820
+ ```tsx
1821
+ // Application code: the footer and everything in it take the dark theme's values.
1822
+ <footer data-theme="dark">
1823
+ <p>Northstar · Terms · Privacy</p>
1824
+ <Button onClick={subscribe}>Subscribe</Button>
1825
+ </footer>
1060
1826
  ```
1061
1827
 
1062
- `.svg` copies the master; `.png` renders one `size` or a `width` × `height`
1063
- (other shapes are centred); `.ico` and `.icns` bundle `sizes`; `background` fills
1064
- transparency. `ads assets` re-renders only targets whose master or settings changed
1065
- and records every output's master hash, settings and output hash in the committed
1066
- `assets/generated.json`. `ads check` fails (`brand-output-stale`) when an output is
1067
- missing, edited by hand, or out of date, by comparing those hashes; it renders
1068
- nothing. Commit outputs and the manifest together.
1069
-
1070
- `assets.glyphs` turns a folder of UI icon SVGs into one typed module:
1071
- `{ "source": "assets/glyphs", "output": "components/Content/Icon/glyphs.ts",
1072
- "attributes": { "fill": "none", "stroke": "currentColor" } }`. Each SVG becomes
1073
- `glyphs[name]` with missing root attributes added; `aliases.json` beside them
1074
- becomes `glyphAliases`. `ads assets` writes it and `ads check` fails when it is stale.
1075
- Other products' logos are not brand artwork or glyphs: keep them, in their own
1076
- colors and under their owners' trademark and usage terms, in `assets/logos/` and
1077
- show them as images; ADS generates and checks nothing there. Never mute, tint or recolor
1078
- another product's logo. Use a one-color version only where its owner's published rules allow
1079
- it and in the colors they name; a CSS mask over a color token then keeps the shape and
1080
- follows the theme. A quieter version needs the owner's rule or written permission. Record each
1081
- file's source and rule in `assets/logos/README.md`.
1082
-
1083
- ### Tokens, grid, icons and accessibility
1084
-
1085
- `ads init` starts a design system from a token foundation in six groups (Color, Type, Space &
1086
- sizing, Shape & elevation, Motion, Layout) whose roles meet WCAG 2.2 AA in both themes,
1087
- a spatial definition with `@ads-layout` constructions (see [Spatial layouts](#spatial-layouts)), and an icon set with `Icon` and
1088
- `IconButton`. Keep the token names and change values to brand a project.
1089
-
1090
- `ads check` reports two kinds of finding. **Errors** fail `ads check`, validation and
1091
- acceptance: contrast per theme and brand (`token-contrast`), the 2 px spacing rhythm
1092
- (`token-rhythm`), accessibility from tokens and source (`a11y-target-size`, `a11y-focus`,
1093
- `a11y-text-resize`, `a11y-reduced-motion`, `a11y-text-spacing`, `a11y-image-alt`,
1094
- `a11y-icon-label`), glyph sets (`glyph-viewbox`, `glyph-color`), control padding
1095
- (`control-padding`: a control sized with `--control-height-<size>` pads its sides with
1096
- `--control-padding-<size>`, or `--control-inset` inside a track), declared artwork/text
1097
- relationships (`lockup-construction`), and the theme, brand and
1098
- brand-artwork rules below. **Review items** never block; each names something only a person
1099
- can judge: `atomic-composition-review`, `token-overlap-review`, `pointer-capture-review`,
1100
- `scenario-exercise-review`, `a11y-keyboard`, `brand-unused` and `render-color-probe`.
1101
- **Info** items (`atomic-composition-limit`) note an analysis limit. There is no setting that
1102
- changes a finding's kind. The showcase's layout-grid button inspects actual rendered grid
1103
- containers. Its **Icons** tab shows the glyph set: every glyph at the size used beside
1104
- text, each one on its grid at every `--icon-*` size with its aliases and glyph errors, and
1105
- each file in `assets/logos/` as it is, on a white and a black tile.
1106
-
1107
- Use `@ads-lockup` in an owned Linaria style to declare the artwork hook, text-group
1108
- hook and size token for a logo/icon beside text. It centers the artwork and aligns
1109
- the text runs, preserving intrinsic artwork proportions. The blocking check rejects
1110
- conflicting styles and unresolved hooks; it does not restrict standalone artwork
1111
- or prove optical balance. See the [worked branding example](../skills/ads-designer/references/branding.md#aligning-artwork-with-text)
1112
- for markup, font trimming, browser support and review boundaries.
1113
-
1114
- `ads audit` runs `ads check` first. A policy error such as `layout-fixed-width` or `img-attributes`
1115
- does not stop it: it renders every scenario and reports those errors with its own, and exits 1. Only
1116
- an error that stops rendering blocks it (`source-syntax`, `css-syntax`, `project-structure`,
1117
- `styles-entry`, `scenario-contract`); a broken import fails the scenarios that reach it. `ads check`,
1118
- `ads compile` and `ads validate` stop on every error, as before.
1119
-
1120
- It adds a rendered check: axe-core (WCAG A/AA rules) in every component, pattern
1121
- and composition scenario, once per declared brand and theme (`--scenario`, `--theme` and
1122
- `--brand` narrow it). Each violation is an `a11y-axe` error naming the axe rule, WCAG
1123
- criterion, themes and brands, failing elements and help link, and `ads audit` exits 1. It
1124
- needs the project's Playwright and browser, as captures do. `ads validate` runs it too,
1125
- over every scenario its change set reaches; MCP draft acceptance audits the draft
1126
- owners' own scenarios before writing source unless `acceptance.audit` is `false`, and an
1127
- `a11y-axe`, `a11y-non-text-contrast` or `layout-overflow` error rejects the change.
1128
- `ads tokens --format dtcg` exports the tokens as W3C Design Tokens JSON for design tools
1129
- (`--theme <name>` and `--brand <name>` select one context). MCP clients read the same export
1130
- from `ads://project/tokens/dtcg` (`?theme=` and `?brand=`).
1131
-
1132
- `themes` in `ds.config.json` declares the themes (a name and the color scheme for native
1133
- controls; the first is the default), and the optional `brands` the brands (the first is the
1134
- default). `data-theme="<name>"` and `data-brand="<name>"` on `<html>` theme the page, on any
1135
- element one section; each element follows its nearest theme and its nearest brand, at any
1136
- nesting depth, in every browser with CSS variables.
1137
-
1138
- Write a token that differs per theme as one plain value per theme, named with the theme as
1139
- suffix, on `:root`:
1828
+ **Guarantees.**
1829
+
1830
+ - Any element below a section resolves the context of the nearest `data-theme`
1831
+ and the nearest `data-brand` above it, at any depth and in any order of the
1832
+ two attributes.
1833
+ - A token whose value reads another token (`var(--action-fill)`) resolves with
1834
+ the values of the section.
1835
+ - A token that a context leaves undefined is undefined in such a section also.
1836
+ Its readers take their `var()` fallback.
1837
+ - Only declared names switch. An undeclared `data-theme` value leaves the
1838
+ section on the context of its parent.
1839
+
1840
+ **Limits.**
1841
+
1842
+ - A section switches whole themes and brands, never a subset of tokens.
1843
+ - A recipe's own declaration of a token on the section element wins over the
1844
+ value of the section. Sections apply at zero specificity, as the root values
1845
+ of the page are overridable.
1846
+ - Conditional overrides (`@media`, `@supports`) follow each condition as the
1847
+ checks evaluate it, one condition at a time. When two conditions hold at once
1848
+ and override the same token in different contexts, a section takes the value
1849
+ of the later condition, where the page root cascades them by specificity.
1850
+ - `@layer` is read as the checks read it. The contexts of a token in one layer
1851
+ behave exactly. A layered and an unlayered override of the same token are not
1852
+ ranked by layer.
1853
+
1854
+ #### Explicit choices
1855
+
1856
+ Sometimes a child must look different on one particular background that is not a
1857
+ whole theme, such as a photo or a brand-coloured banner. The child then exposes
1858
+ a closed choice that the caller sets, as Spectrum's `staticColor` prop does. The
1859
+ choice is typed and checked like any other choice. The caller must pass it.
1860
+
1861
+ ```tsx
1862
+ // IconButton.tsx (sketch): tone selects a precompiled surface; the default adds nothing.
1863
+ export interface IconButtonProps {
1864
+ // …
1865
+ /** "on-dark" over a photo or dark fill the theme does not know about. */
1866
+ tone?: "default" | "on-dark";
1867
+ }
1868
+ const toneChoices = {
1869
+ default: undefined,
1870
+ "on-dark": recipe({ surface: "control-on-dark-surface" }).root,
1871
+ };
1872
+ // … className={`ds-icon-button ${anatomy} ${toneChoices[tone] ?? ""} …`}
1873
+ ```
1140
1874
 
1141
1875
  ```css
1876
+ /* tokens/Surfaces/paint.ads.css: static paints, the same in every context. */
1142
1877
  :root {
1143
- --color-accent-9-light: oklch(55% .2 280);
1144
- --color-accent-9-dark: oklch(70% .16 280);
1145
- --bg-canvas-light: var(--slate-1-light); /* a half refers to halves */
1146
- --bg-canvas-dark: var(--slate-2-dark);
1147
- --accent: var(--color-accent-9); /* single values stay single */
1148
- }
1149
- [data-brand="acme"] { /* a brand sets its own halves */
1150
- --color-accent-9-light: oklch(55% .2 25);
1151
- --color-accent-9-dark: oklch(70% .16 25);
1878
+ --static-dark-fill: #101c19;
1879
+ --static-light-text: #ffffff;
1152
1880
  }
1153
1881
  ```
1154
1882
 
1155
- ADS generates `tokens/themes.generated.css` from these halves and the declared themes and
1156
- brands: theme switches and one resolver per themed token. It is the last foundation import;
1157
- commit it and never edit it. `ads assets`, the showcase and the MCP server write it, the
1158
- showcase and MCP server again whenever tokens or `ds.config.json` change; `ads check` fails
1159
- when it is missing or out of date (`themes-generated`).
1160
-
1161
- The generated file also defines display switches: `--display-<theme>` and, with brands,
1162
- `--display-brand-<brand>`, each `none` outside its nearest theme or brand. Show
1163
- theme- or brand-specific content with `display: var(--display-dark, block)`.
1164
- `"followSystemTheme": true` makes a page without `data-theme` take the first declared theme
1165
- whose scheme matches the OS `prefers-color-scheme`; an explicit `data-theme` wins.
1166
-
1167
- Beside it ADS generates `tokens/themes.generated.ts`, written, checked and kept current
1168
- together with the CSS: every color token resolved for every theme and brand as `{ css, rgba }`
1169
- for Canvas, WebGL and SVG renderers. The starter's `controllers/Palette` reads it:
1170
- `paletteFor(element)` (the nearest theme and brand's palette), `observePalette(element,
1171
- callback)` (once per theme or brand change) and `resolveColor(element, value)` (a non-token
1172
- color, cached, without inserting elements). `render-color-probe` (review) flags color reads
1173
- from the page inside per-item render callbacks. The same module exports `themed({ light,
1174
- dark, … })` and `themedByScheme({ light, dark })` for per-theme values that come from data at
1175
- runtime; `light-dark()` is an error in token sheets, component CSS and component string
1176
- literals (`theme-light-dark`).
1177
-
1178
- Errors: a token value set under `[data-theme]`, `prefers-color-scheme` or a combined brand
1179
- selector (`theme-old-form`); a component or pattern styled by a `[data-theme]` or
1180
- `[data-brand]` ancestor selector (`theme-selector`); a themed token without a half for every theme
1181
- (`theme-coverage`); a token set both as one value and as halves (`theme-half-conflict`); a
1182
- half that refers to a theme-following token instead of its half (`theme-half-reference`); a
1183
- lone half (`theme-new-token`); themes without any halves (`theme-empty`); an undeclared
1184
- brand name (`brand-undeclared`); a brand that gives a theme-following token one value
1185
- (`brand-theme-value`) or only some of its halves or ramp steps (`brand-coverage`); a token
1186
- only a brand defines (`brand-new-token`); a declared brand without values (`brand-empty`).
1187
- See the [token guide](../skills/ads-designer/references/design-data.md) and the
1188
- [accessibility guide](../skills/ads-designer/references/accessibility.md).
1189
-
1190
- Initialized builds run:
1883
+ ```ts
1884
+ // profiles/Surfaces/controls.ads.ts: the treatment.
1885
+ export const controlOnDarkSurface = profile({
1886
+ name: "control-on-dark-surface",
1887
+ kind: "surface",
1888
+ with: ["control-surface"],
1889
+ fields: { background: "--static-dark-fill", color: "--static-light-text" },
1890
+ });
1891
+ ```
1191
1892
 
1192
- ```text
1193
- ads check → ads assets → existing prebuild → existing build
1893
+ ```tsx
1894
+ // Application code: the caller knows what is behind the button.
1895
+ <figure>
1896
+ <img src={photo} alt="" />
1897
+ <IconButton icon={closeGlyph} label="Close" tone="on-dark" />
1898
+ </figure>
1194
1899
  ```
1195
1900
 
1196
- `lint:ds` runs the native, read-only ADS gates. `assets:ds`
1197
- runs `ads assets`; checks do not require outputs on a clean checkout. A failed
1198
- check or generation stops the build. Re-running init preserves token values,
1199
- artwork, existing configuration, and unrelated scripts.
1200
-
1201
- Mount `.ds/assets/` using the application's existing bundler. Init does not change
1202
- framework configuration. For a Vite app with no other public directory, a project
1203
- can set `publicDir: path.resolve(import.meta.dirname, ".ds/assets")`; when it
1204
- already has public assets, use its existing asset merge/copy step and reject
1205
- duplicate output paths. Use the same assets in development and production.
1206
- Application manifest metadata and other platform exports remain project-owned.
1207
-
1208
- ### Generic architecture guards
1209
-
1210
- `ads check` enforces reusable architecture policies alongside token checks:
1211
-
1212
- | Guard | Shared enforcement |
1213
- |----------------|------------------------------|
1214
- | Public APIs | Inherited/explicit style props and open-ended visual color/fill/stroke strings |
1215
- | Renderer boundaries | JSX inline styles, React/Preact CSS types, imperative `.style` writes, bulk style writes, and style-object escapes |
1216
- | Asset ownership | ADS/public mount collisions, configured generated assets in source, and tracked generated output |
1217
- | Product patterns | CSS/JSX namespace ownership; ADS implementations and showcase cannot import app source |
1218
- | Primitive state | State-variable overrides outside components; undocumented non-state component variables |
1219
- | Literal visual values | Absolute/font-relative lengths (including `ch` and root font units), durations and color/effect formulas require tokens; geometry angles and responsive viewport/container relationships remain available |
1220
- | Fixed token ownership | Foreign token names, shared token overrides, misplaced component/pattern/showcase variables, and noncanonical foundation imports |
1221
- | Showcase ownership | Fixture CSS/Linaria definitions, custom JSX classes, native controls/widget roles, state styling, private CSS/aliased imports, catalogue dependencies of a project's own showcase pages and source ownership, and runtime imports of fixtures/test helpers |
1222
- | Scenario coverage | All public renderable UI has path-discovered entries, colocated fixtures, literal metadata and reachable public render references; runtime imports of scenarios/fixtures are rejected |
1223
- | Data access | Direct global fetch/XHR/WebSocket/EventSource in ADS source is rejected; injected services, workers and lazy imports remain allowed |
1224
- | Showcase coverage | Public ADS UI referenced by production JSX/React `createElement` has showcase render references; imports and tests alone do not count |
1225
-
1226
- ES module imports, re-exports, and dynamic imports with literal specifiers use
1227
- TypeScript's project configuration, including aliases and bundler resource
1228
- queries. ADS implementations and showcase fixtures cannot import app code.
1229
- Private imports within ADS implementations remain allowed, including when the ADS
1230
- is nested inside `src/`. Application integration harnesses belong in test support.
1231
-
1232
- Unknown configuration fields fail rather than silently weakening checks.
1233
-
1234
- Notification usage can be enforced directly by ADS, without a project lint
1235
- plugin or another parse/lint pass:
1901
+ Surface contrast proves the pair of the profile in every context, and these
1902
+ static paints do not change between contexts. The on-dark treatment is thus
1903
+ readable whatever theme the page uses. Whether the photo needs the treatment is
1904
+ the caller's decision, which the type makes explicit.
1236
1905
 
1237
- ```json
1238
- {
1239
- "usage": {
1240
- "notifications": [{
1241
- "api": "toast",
1242
- "host": "Toaster",
1243
- "rootFiles": ["src/App.tsx", "design-system/components/Toast.ads.scenario.tsx"]
1244
- }],
1245
- "restrictedImports": ["sonner"]
1246
- }
1247
- }
1248
- ```
1906
+ #### What neither pattern covers
1249
1907
 
1250
- `api` and `host` name exports imported from `@ds`. ADS
1251
- recognizes named aliases and namespace imports, respecting shadowed bindings.
1252
- It rejects direct module/render calls and calls in `use server` modules, requires
1253
- a stable `id` for directly effect-created notifications with inspectable options,
1254
- and restricts the host to the exact declared roots. Direct conditional hosts and
1255
- duplicate static host IDs in one file fail. `restrictedImports` rejects runtime
1256
- package and subpath imports, re-exports, literal dynamic imports and unshadowed
1257
- `require` calls; type-only imports are exempt. Both policies are empty by default.
1258
-
1259
- These native guards run in `ads check`, acceptance and validation. They inspect
1260
- source and ADS runtime/scenario files, excluding tests and declaration contracts.
1261
- They do not prove cross-module host uniqueness or trace helper calls, dynamic
1262
- IDs/options, aliases assigned to local variables or framework render callbacks.
1263
- Keep route persistence and lifecycle browser tests. ADS does not assume a toast
1264
- implementation exists or install one.
1265
-
1266
- Component interaction variables such as `--ds-button-hover-bg` cannot be
1267
- assigned by app code, patterns, or showcase code. This includes static JSX style
1268
- objects in files with inline-style exceptions. Reading a variable is allowed;
1269
- the component owns its state definitions. Documented non-state customizations
1270
- are registered explicitly. State variables cannot be allowlisted.
1271
-
1272
- Keep renderer-, framework-, and component-specific project guards too. The
1273
- shared tool does not validate a third-party graph renderer's own APIs, arbitrary
1274
- runtime spreads, or the semantic meaning of a
1275
- measured value. Register project-specific guard scripts in the existing build
1276
- and configured acceptance/validation scripts. The project's own linter remains
1277
- an independent build tool.
1278
-
1279
- ### Project boundaries and assets
1280
-
1281
- Style permissions belong to their owner, in its `<Owner>.ads.contract.ts`, with paths
1282
- relative to the contract:
1908
+ Two cases are not covered:
1283
1909
 
1284
- ```ts
1285
- export default {
1286
- schemaVersion: 1,
1287
- styles: { writes: { "./geometry.ts": ["--ds-panel-height"] }, inline: [] },
1288
- customization: ["--ds-panel-gap"],
1289
- } satisfies UnitContract;
1290
- ```
1910
+ - state that cascades to children: a selected table row whose cells, icons and
1911
+ checkbox switch to "on selected" colours;
1912
+ - tinted containers: a success or warning banner whose links and icons must stay
1913
+ readable on its tint.
1291
1914
 
1292
- `styles.writes` permits only the listed CSS properties in that exact file. Use
1293
- kebab-case (`user-select`) or an exact custom property. Static assignments,
1294
- `setProperty`, and `removeProperty` can use that permission; `cssText`, computed
1295
- property names, escaped style objects, and bulk writes remain forbidden. Plain
1296
- property reads are allowed. `styles.inline` is a separate file-level JSX/type
1297
- exception and never permits imperative writes by itself. `customization` lists a
1298
- component's non-state `--ds-*` variables that patterns, the showcase and the
1299
- application may set.
1915
+ These cases need a prop passed through each child (an explicit choice at every
1916
+ level), or a construct that lets a surface set the context that its descendants
1917
+ read. ADS has no such surface-context construct. Do not emulate one with a theme
1918
+ per state: a theme is a whole colour mode, and the checks would prove every
1919
+ token of it.
1300
1920
 
1301
- Optional asset configuration adds only the paths that the project actually uses:
1921
+ ### Emitting the design system
1302
1922
 
1303
- ```json
1304
- {
1305
- "assets": {
1306
- "iconSource": "assets/brand/app-icon.svg",
1307
- "publicDirs": ["public/assets"],
1308
- "generatedPaths": ["dist", "dist-showcase", ".vite", ".ds"],
1309
- "generatedFiles": ["icon-generated.png"]
1310
- }
1311
- }
1312
- ```
1923
+ `ads emit [directory] [--json] [--force] [--watch]` compiles the design system
1924
+ into plain modules that an application can install without ADS. It captures the
1925
+ current revision of the design system once, runs `ads check` on it, and writes
1926
+ output only when that check passes. A failing check returns its findings and
1927
+ writes nothing.
1313
1928
 
1314
- Merge this section into `ds.config.json`.
1929
+ Exit codes:
1315
1930
 
1316
- Asset checks compare `design-system/assets/` with each configured public mount
1317
- and `design-system/showcase/public/assets/`, adjusting for `dsDir`. A relative
1318
- asset path may have one source owner per mount, even if duplicate contents
1319
- match. `generatedFiles` names asset-relative paths forbidden in those source
1320
- directories; nothing is inferred from filenames such as `favicon.ico`.
1931
+ - `0`: emitted, including "nothing changed".
1932
+ - `1`: a failing check or emission, or an output folder with hand edits.
1933
+ - `2`: an invalid invocation, an unusable output folder, a concurrent emit,
1934
+ cancellation, a source change during the emit, or a write failure.
1321
1935
 
1322
- `generatedPaths` names project-relative files or directories that must not be
1323
- tracked. A project's own `dist-showcase/` build output is also treated as generated;
1324
- the built-in client uses project preview artifacts under `.ds/`.
1325
- Git inspects tracked files, including nested workspaces. Outside a Git repo,
1326
- there are no tracked outputs to check; other asset checks still run. Real Git
1327
- inspection errors fail the check. These guards read files and never delete them.
1936
+ `--json` prints `{ "ok": true, "revision", "outDir", "written", "unchanged",
1937
+ "removed", "contract", "owners", "forced" }` or
1938
+ `{ "ok": false, "failure": { "kind", … } }`.
1328
1939
 
1329
- ## Configuration and component rules
1940
+ #### The output folder
1330
1941
 
1331
- `ds.config.json` uses schema version 1. A subfolder with its own `ds.config.json` is a separate
1332
- project: check, validation, audits, previews and watches stop there and run in it on their own.
1333
- Paths stay within the receiving project:
1942
+ By default ADS writes the design package's `dist/`, which the package's
1943
+ `exports` publish. The one-application layout emits into the application's
1944
+ source ([Set up a design package](#set-up-a-design-package)):
1334
1945
 
1335
1946
  ```json
1336
- {
1337
- "schemaVersion": 1,
1338
- "sourceDir": "src",
1339
- "dsDir": "design-system",
1340
- "themes": [{ "name": "light", "scheme": "light" }, { "name": "dark", "scheme": "dark" }],
1341
- "layout": { "widthTokens": [], "fixedWidthUnits": [] }
1947
+ { "compile": { "outDir": "../src/ui", "emitOnAccept": true } }
1948
+ ```
1949
+
1950
+ - `compile.outDir` is relative to the design package, or `null` for the default.
1951
+ It can be outside the package (an application's source). It is never the
1952
+ package's root, the design-system folder or an ancestor of either, and never
1953
+ inside `node_modules`, `.git` or `.ds`, judged from the package root. Any
1954
+ other value fails to load.
1955
+ - `compile.emitOnAccept` (`true` or `false`, default `true`) emits after
1956
+ `ads_accept` publishes a draft ([Emit after acceptance](#emit-after-acceptance)).
1957
+ - ADS owns the output folder entirely: after every emit it holds exactly the
1958
+ emitted files. Emission refuses to replace a folder that holds files it did
1959
+ not write, so an `outDir` that points at existing application code cannot
1960
+ erase that code.
1961
+ - The folder is never an input. ADS does not capture, watch or analyze it, so an
1962
+ emit never changes the revision that a check or a preview sees.
1963
+ - The repository owner decides whether the folder is committed. ADS never edits
1964
+ `.gitignore`, and emission, checks and the contract behave the same in both
1965
+ cases.
1966
+
1967
+ The folder holds:
1968
+
1969
+ - **Owner modules and sheets**, at the owner's path inside the design system.
1970
+ The module is the authored source with class expressions replaced by compiled
1971
+ classes. `<Owner>.css` holds the token CSS that the owner uses and its
1972
+ compiled atomic rules. With `sections: true` it also holds the section rules
1973
+ that apply the contexts of those tokens to nested `data-theme`/`data-brand`
1974
+ sections.
1975
+ - **`foundation.css`**, the document CSS that `foundation.ads.ts` declares, once
1976
+ for the design system
1977
+ ([contents](ARCHITECTURE.md#the-foundation-has-a-narrow-styling-role)): one
1978
+ `@font-face` per declared font face (`font-family`,
1979
+ `src: url("./fonts/…") format(…)`, `font-weight` value or range, `font-style`
1980
+ and `font-display`); the document reset (box sizing, body margin, inherited
1981
+ control fonts, and `display: none` for every `[hidden]` element except
1982
+ `hidden="until-found"`); the `text` and `surface` profile fields on `body`;
1983
+ the default focus indicator from the `focus` profile
1984
+ (`foundation({ focus: "keyboard-focus" })`) on every `:focus-visible` element,
1985
+ at zero specificity so that the indicator of a construction wins;
1986
+ `color-scheme` for each declared theme; the page scroll lock behind a modal
1987
+ dialog, when an owner needs it; and the tokens that these use.
1988
+ - **`index.ts`**, the public barrel: the authored `<dsDir>/index.ts` with the
1989
+ same exports, which resolve to the emitted modules (public `@ds` imports, if
1990
+ any, made relative). It imports `foundation.css` first. It is the import entry
1991
+ of the output: an application imports the emitted design system, with its
1992
+ document CSS, through it, as it imports `@ds` while authoring. With declared
1993
+ fonts it also re-exports `fonts.ts`, and with an application icon
1994
+ `app-icons.ts`.
1995
+ - **Fonts**, with declared fonts: each face's file at
1996
+ `fonts/<family-slug>/<source>`, and `fonts.ts`, the preload list. Previews use
1997
+ the emitted tree, so they draw the faces also. `fonts.ts` exports:
1998
+ - `fontPreloads` (`{ href, type }[]`): the face that the document `text`
1999
+ profile draws first, in the default context, then the `preload` faces of
2000
+ each declaration, once each;
2001
+ - `preloadFonts(doc = document)`, which adds one
2002
+ `<link rel="preload" as="font" crossorigin>` per face, once;
2003
+ - `fontPreloadTags()` and `fontPreloadHeader()`, for a build step, a server
2004
+ render or a `Link` header.
2005
+
2006
+ Each href is a standard asset import of the file
2007
+ (`import font0 from "./fonts/…"`), which the application's bundler resolves to
2008
+ its public URL: the same in the client and server builds, and the same as the
2009
+ `url()` of the stylesheet, so a preloaded font downloads once. Call
2010
+ `preloadFonts()` in the app entry before the first render, or render
2011
+ `fontPreloadTags()` into the server's `<head>` (`preloadFonts()` then adds
2012
+ nothing).
2013
+ - **Application icon**, with `foundation({ appIcon })`: each export at its
2014
+ `file`, and the platform set under `icons/`: `favicon.svg` (the drawing),
2015
+ `favicon.ico` (16, 32 and 48 px), `apple-touch-icon.png` (180 px),
2016
+ `icon-192.png` and `icon-512.png`, and with a maskable icon
2017
+ `icon-maskable-192.png` and `icon-maskable-512.png`. `app-icons.ts` exports:
2018
+ - `appIconLinks` (`{ rel, href, sizes?, type }[]`): the ICO, the SVG and the
2019
+ touch icon;
2020
+ - `appIconTags()`: the same as `<link>` tags for the head of the page, from a
2021
+ build step, prerender or server render;
2022
+ - `webManifestIcons` (`{ src, sizes, type, purpose }[]`) for the `icons` of a
2023
+ web app manifest, the maskable ones with `purpose: "maskable"`.
2024
+
2025
+ Each URL is an asset import of the file (`import icon0 from "./icons/…"`). ADS
2026
+ does not write into the application's `public/` folder: copy the files, or
2027
+ import them from the output. ADS caches renders by the bytes of the drawing
2028
+ and the settings, so an emit with an unchanged icon renders nothing. Committed
2029
+ launcher or installer icons are committed with the folder.
2030
+ - **Helper modules** that the owners or the barrel import, with public `@ds`
2031
+ imports made relative. A public helper that no owner imports is emitted also.
2032
+ A module's `glyph("close")` becomes the reference literal `{ asset, source }`
2033
+ (the SVG text of its drawing), and the declaration of a glyph set under
2034
+ `assets/` becomes its name list. The application's bundler thus drops a glyph
2035
+ that is not imported.
2036
+ - **`ads-glyph.ts`**, the types-only `Glyph`/`GlyphSet` module, when an emitted
2037
+ module uses glyph references. Their `@reqvire-org/ads/asset` type imports are
2038
+ rewritten to it.
2039
+ - **`ads-dependencies.json`**, the packages that the emitted modules require.
2040
+ - **`package.json`**, `{ "sideEffects": ["*.css"] }`: an emitted module does
2041
+ nothing when it loads except import its stylesheet. The file has no `type`
2042
+ field, because the output is source for bundlers, not a package that Node
2043
+ runs.
2044
+ - **`ads-contract.json`**, the record of the emission: `format`
2045
+ (`"ads-contract"`), `version` (2), the source `revision`, `files` with the
2046
+ `sha256` of each emitted file, and `platform`
2047
+ ([Browser targets](#browser-targets)). The contract does not list itself. ADS
2048
+ also reads a version 1 contract, which has no `platform`, and verifies its
2049
+ folder in the same way; the next emit replaces it.
2050
+
2051
+ #### Consuming the output
2052
+
2053
+ The output ships source only: `.ts`/`.tsx` modules, `.css` sheets and the JSON
2054
+ records, plus the files of the declared fonts and the images of the application
2055
+ icon. An application consumes it through a bundler (Vite, Bun, Next.js, or a
2056
+ library build such as tsup or Vite library mode). Applications import the
2057
+ emitted barrel, never authoring source, which holds build-time macros. With the
2058
+ default output folder, for example:
2059
+
2060
+ ```jsonc
2061
+ // tsconfig.json
2062
+ { "compilerOptions": { "paths": { "@ds": ["./design-system/dist/index.ts"] } } }
2063
+ ```
2064
+
2065
+ ```ts
2066
+ // vite.config.ts
2067
+ export default defineConfig({ resolve: { alias: { "@ds": "/design-system/dist/index.ts" } } });
2068
+ ```
2069
+
2070
+ **JSX.** The output carries no JSX pragma: compile it with the JSX runtime of
2071
+ the project's framework. For Preact, set `"jsx": "react-jsx"` and
2072
+ `"jsxImportSource": "preact"` in the application's `tsconfig.json` (Vite and Bun
2073
+ read them from there).
2074
+
2075
+ **Stylesheets.** Each owner module begins with a side-effect import of its own
2076
+ sheet (`import "./Button.css";`). There is no separate stylesheet to include: a
2077
+ bundle that imports an owner gets its CSS. The JavaScript of unused owners is
2078
+ tree-shaken with every bundler.
2079
+
2080
+ - Vite, webpack and Next.js read the nearest `package.json` of each file. A
2081
+ bundler that honours the output's `sideEffects` bundles, through `index.ts`,
2082
+ only the sheets of the owners that the application uses: an owner imported
2083
+ through the barrel bundles the same CSS as a direct import of its module.
2084
+ - Bun.build ignores `sideEffects` for CSS and bundles every public owner's sheet
2085
+ that the barrel reaches. With Bun.build, import the owners you use directly from the
2086
+ output (`<outDir>/components/Actions/Button/Button`, with
2087
+ `<outDir>/foundation.css`).
2088
+ - Other bundlers that honour `sideEffects` for CSS imports should behave as Vite
2089
+ does. ADS tests Vite and Bun.build
2090
+ (`tests/integration/packed-emitted-app.test.ts`).
2091
+
2092
+ **Asset imports.** `fonts.ts` and `app-icons.ts` import their files (`.woff2`,
2093
+ `.woff`, `.ttf`, `.otf`, `.ico`, `.svg`, `.png`) as standard asset imports, each
2094
+ marked `// @ts-ignore`. A bundler's own types (`vite/client`) declare those
2095
+ modules, and a second wildcard declaration would conflict with them.
2096
+
2097
+ - Vite resolves the `url()` of the stylesheet and those imports to one hashed
2098
+ file, in client and SSR builds. It inlines files under
2099
+ `build.assetsInlineLimit` (4 KiB by default) as data URLs in both; set `0` to
2100
+ keep every icon a file.
2101
+ - Bun.build reads the `paths` alias itself and copies each imported file under a
2102
+ hashed name. Set `publicPath` (for example `"/"`) so that the imported URLs
2103
+ are absolute, not relative to the page.
2104
+ - Bun.build inlines a `url()` file of a stylesheet smaller than 128 KiB as a
2105
+ data URL. A small font thus arrives with the CSS, and a preload of its file is
2106
+ a second download. With Bun.build, preload only faces of 128 KiB or more.
2107
+
2108
+ **Server rendering.** The generated modules (`fonts.ts`, `app-icons.ts`, the
2109
+ palette) touch no `window` or `document` when they load. The starter's owners
2110
+ use the DOM only in effects, ref callbacks and handlers, so the emitted starter
2111
+ renders with `react-dom/server` or `preact-render-to-string` and hydrates
2112
+ without mismatch. For other owners, their own module-level code decides this.
2113
+
2114
+ - Values spread with `recipe.measured.props(…)` are in the server's markup.
2115
+ Values set with `recipe.measured.set` or `recipe.paints.set` are written by
2116
+ the client after hydration.
2117
+ - The server render can put `fontPreloadTags()` and `appIconTags()` in the head
2118
+ of the page. A Vite SSR build gives each file the URL that the client build
2119
+ gives it, so the server's tags are the client's and the client's
2120
+ `preloadFonts()` adds nothing
2121
+ (`tests/browser/emitted-ssr-hydration-browser.test.ts`).
2122
+
2123
+ #### Browser targets
2124
+
2125
+ ADS does not certify browser versions. The `platform` section of the contract
2126
+ states, as facts read from the emitted sheets, what the emitted CSS uses beyond
2127
+ the CSS core. The core is CSS 2.1 and the long-established CSS3 modules:
2128
+ selectors level 3, media queries, flexbox, grid layout, custom properties,
2129
+ `calc()` and the comparison functions, transforms, transitions, animations and
2130
+ web fonts.
2131
+
2132
+ ```jsonc
2133
+ "platform": {
2134
+ "features": {
2135
+ "popover": { "css": [":popover-open"], "owners": ["components/Overlays/Menu/Menu.tsx"],
2136
+ "degrades": "Required by popovers and menus: …" },
2137
+ "lh-unit": { "css": ["lh"], "owners": ["components/Actions/Button/Button.tsx", "…"],
2138
+ "degrades": "Declarations measured in lines are dropped: control boxes sized by 1lh fall back to their content height, …" },
2139
+ "user-select": { "css": ["user-select"], "prefixed": ["-webkit-user-select"], "owners": ["…"], "degrades": "Text stays selectable; …" },
2140
+ "text-wrap-balance": { "css": ["text-wrap: balance"], "owners": ["…"], "degrades": "Normal wrapping: line lengths are not balanced." }
2141
+ },
2142
+ "unrecognized": {},
2143
+ "assumptions": ["foundation.css loads before every owner sheet: …", "…"]
1342
2144
  }
1343
2145
  ```
1344
2146
 
1345
- `layout` declares allowed width tokens and owners with fixed widths; see
1346
- [Checks and guards](#checks-and-guards). Inside `dsDir` the layout is fixed:
1347
- ADS generates the public barrel `index.ts`, the review entry `review/index.ads.review.ts`
1348
- and the styles entry `styles.css`, and token sheets live in `tokens/`. ADS writes
1349
- the barrels from the owners' `<Owner>.ads.exports.ts` files and the styles entry
1350
- from the token sheets (`ads assets`, the showcase and the MCP server); `ads check`
1351
- reports one that is stale or edited by hand. The app imports the design system as
1352
- `@ds` and its development layer as `@ds/review`.
1353
-
1354
- These source-layout defaults apply when the file is absent; the example omits
1355
- the required init-time framework choice. Run `ads init --framework react` (or
1356
- `preact`) to save it. To use other folders, write this configuration before init. Configure TypeScript and the app bundler to resolve
1357
- `@ds` to `<dsDir>/index.ts`; this file does not rewrite their configuration.
1358
-
1359
- Colocate component-specific guards with their owner and register their command
1360
- in the project build or in `acceptance.scripts`. Core tooling imports no particular component.
1361
- Registered project configuration and build helpers may import one another;
1362
- native ADS import guards enforce this boundary. It does not
1363
- allow application code to import private ADS modules or build helpers to import
1364
- private UI implementation.
1365
-
1366
- Unused `styles.inline` entries and `styles.writes` properties fail the core
1367
- `stale-style-boundary` check, reported on the contract. Inline permissions recognize
1368
- JSX, imported UI factories and UI `CSSProperties` use; property permissions require
1369
- an exact write or removal, not a read. Change an owner's source and its contract
1370
- permissions together in its draft.
1371
-
1372
- `styles.inline` should name only documented geometry/renderer boundaries,
1373
- not broad styling exceptions. Ignore `.ds/`; generated paths refer to the project
1374
- and its locally installed tool.
1375
-
1376
- For native ADS gates outside package-manager hooks, run the installed tool directly:
2147
+ - `features`, by feature id:
2148
+ - `css`: the constructs found (properties, value keywords such as
2149
+ `display: -webkit-box`, at-rules, media features, pseudo-classes, units,
2150
+ functions);
2151
+ - `prefixed`: the vendor-prefixed forms that ADS writes beside or for the
2152
+ standard one (the clamp's `-webkit-box` form, `-webkit-user-select`);
2153
+ - `owners`: the owners whose sheets use it (`foundation.css` for the document
2154
+ sheet);
2155
+ - `degrades`: what happens in a browser without it. Required features
2156
+ (popover, modal dialogs, logical properties, `:focus-visible`) say so.
2157
+ Progressive enhancements (balanced and pretty wrapping, `@starting-style`,
2158
+ text-box trim) describe the plainer result.
2159
+ - `unrecognized`: constructs that the inventory has no entry for, with their
2160
+ owners. Typically this is a function in the project's own token values. Check
2161
+ them yourself.
2162
+ - `assumptions`: what the output needs of the document. `foundation.css` loads
2163
+ first (or, for a namespaced emission, the host page's own document styles).
2164
+ Themes and brands are selected with `data-theme`/`data-brand` on the root or a
2165
+ section. The root font size is the 16px that ADS's pixel-equivalent checks
2166
+ assume. Operating-system text scaling is not audited.
2167
+
2168
+ Check the listed features against your own browser targets, for example with
2169
+ Baseline data, before you rely on a degradation that you cannot accept. ADS has
2170
+ no declared targets with generated fallbacks.
2171
+
2172
+ #### Text scaling in the application
2173
+
2174
+ ADS owns the design system, not the application's `index.html`, and never writes
2175
+ document metadata (no `<meta name="text-scale">`). A design system is safe for
2176
+ the reader's text size, including the text scaling of the operating system where
2177
+ the browser passes it on, under three conditions.
2178
+
2179
+ ADS checks the two that belong to the design system. Every font size and length
2180
+ line height is in `rem` or `em` (`a11y-text-resize`). Every scenario keeps its
2181
+ content with 200% text, 200% zoom, WCAG text spacing and at 320 px (the text
2182
+ passes of the [render audit](#render-audit)). `foundation.css` sets no root font
2183
+ size, so `rem` starts from the browser's default (`medium`), which is where the
2184
+ reader's setting arrives.
2185
+
2186
+ The third is the application's document, which ADS does not check:
2187
+
2188
+ - Leave the root font size to the reader: no `px` `font-size` on `html` or
2189
+ `:root`. A percentage or `rem` scales with the setting; a `px` value replaces
2190
+ it.
2191
+ - Let the reader zoom: no `user-scalable=no`, and no `maximum-scale` below 2, in
2192
+ the viewport `<meta>` (WCAG 1.4.4).
2193
+ - To receive the operating system's text scale on browsers that support it, opt
2194
+ in with `<meta name="text-scale" content="scale">` in the head of the
2195
+ document. The tag tells the browser that the page scales its own text. The
2196
+ browser then sets the default font size from the system setting, and does not
2197
+ zoom or enlarge text on its own. Without the tag, those browsers keep their
2198
+ own adjustment, which the zoom pass covers. Add the tag when the application's
2199
+ own CSS also sizes text in `rem` or `em`: ADS checks the owners of the design
2200
+ system for this, not the pages of the application.
2201
+
2202
+ #### How an emit writes
2203
+
2204
+ - **Incremental.** An emit writes only the files whose bytes changed, and
2205
+ removes the files that are no longer emitted. An emit with no source change
2206
+ writes nothing. Owners whose analysis is unchanged keep their emitted module
2207
+ and are not analyzed or serialized again. This applies within one running ADS
2208
+ process, such as the MCP server or `ads emit --watch`; a one-off CLI run
2209
+ reuses only the persisted extraction cache.
2210
+ - **Whole-folder swap.** ADS stages the new tree beside the output folder and
2211
+ swaps it in with two renames, so a reader never sees a mix of old and new
2212
+ files. Between the renames the folder is briefly absent, because Bun offers no
2213
+ atomic directory exchange. A tool that reads it at that instant can see it
2214
+ missing and must retry. A failure or cancellation leaves the old tree
2215
+ untouched.
2216
+ - **One writer.** One emit writes a given output folder at a time, under a lock
2217
+ in `.ds/locks/`. An emit from another process is refused as `output-busy`. ADS
2218
+ removes a lock that a stopped process left. Within one process
2219
+ (`ads emit --watch`, or the MCP server's `ads_emit` and emit after
2220
+ acceptance), an emit requested while another runs is queued: at most one
2221
+ follow-up per output folder, which emits the source as it is when it starts.
2222
+
2223
+ **Watch mode.** `ads emit --watch` emits once, then again whenever the inputs of
2224
+ the design system change (the files that `ads check` captures, never the output
2225
+ folder).
2226
+
2227
+ - Changes that arrive within 150 ms of the first one share one emit. An event
2228
+ that leaves the bytes of every input as they were emitted (a touched file, a
2229
+ restored edit) emits nothing.
2230
+ - Each emit prints one line with the revision, the written, unchanged and
2231
+ removed counts and its duration, or its failure (findings on stderr). The
2232
+ watch continues after a failure. With `--json`, each emit is one JSON object
2233
+ per line: the `--json` result plus `event: "emit"` and `elapsedMs`.
2234
+ - The analysis stays warm, so after a one-owner edit only that owner is analyzed
2235
+ and serialized again.
2236
+ - SIGINT, SIGTERM or the end of stdin stops the watch. Run it with an open
2237
+ stdin; `< /dev/null` stops it immediately. A running emit is cancelled without
2238
+ a partial folder, and the lock, the watchers and the analysis process are
2239
+ released (exit 0).
2240
+
2241
+ #### Emit after acceptance
2242
+
2243
+ When `ads_accept` publishes a draft, the MCP server writes the published
2244
+ revision into the output folder, unless `compile.emitOnAccept` is `false`. It
2245
+ does not emit on a dry run, a rejection, a cancellation before publication or a
2246
+ stale revision. [Emitting from MCP](MCP.md#emitting-from-mcp) gives the `emit`
2247
+ result, including its `from` (`candidate-tree` or `published-source`).
2248
+
2249
+ - The source is published first, then the output folder. Acceptance never
2250
+ depends on the emit, and no owner is analyzed again for it.
2251
+ - A failed write (a hand edit, a busy folder, a cancellation, a write error) is
2252
+ reported as a failed emit with its `repair`, never as a success. The folder
2253
+ keeps its previous emission whole, `ads check` reports it `generated-stale`
2254
+ until `ads emit` runs, and nothing retries the emit.
2255
+ - The emit is never forced. Hand edits are reported as `output-modified`.
2256
+ - The MCP tool `ads_emit` (mutation-enabled servers) runs the same emit on
2257
+ demand. `ads_delete` publishes and emits in the same way.
2258
+
2259
+ #### Hand edits and out-of-date output
2260
+
2261
+ **Hand edits.** Before it writes, ADS verifies the folder against its
2262
+ `ads-contract.json`. A file edited after emission, a missing file, a file that
2263
+ ADS did not emit, or a non-empty folder without a contract refuses the emit
2264
+ (`output-modified`, exit 1), and nothing is written. Make the change in the
2265
+ design-system source, or run `ads emit --force` to overwrite the folder.
2266
+ `ads check` reports the same differences as blocking `generated-modified`
2267
+ findings, each hand-edited, missing or foreign file on its own. It reports
2268
+ nothing while the folder does not exist. The contract reports a hand-edited icon
2269
+ like any emitted file.
2270
+
2271
+ **Out-of-date output.** The contract records the source revision that the output
2272
+ was emitted from: the digest of the inputs that `ads check` captures for the
2273
+ same bytes. When the design system has changed since then, `ads check` (in the
2274
+ CLI, MCP and validation) lists a `generated-stale` info item at the contract,
2275
+ naming both revisions and `ads emit`. The item never blocks a check or an
2276
+ acceptance. After an accept with `compile.emitOnAccept: false`, it is expected
2277
+ until the next emit. `ads check --json` lists it, and the text report counts it
2278
+ among the info notes. A folder without a readable contract is
2279
+ `generated-modified`.
2280
+
2281
+ #### Renderer palette
2282
+
2283
+ Code that draws on a canvas or with WebGL needs theme colours as JavaScript
2284
+ values. A design system that declares `palette: true` in `foundation()` (the
2285
+ starter does) keeps `<dsDir>/palette.generated.ts`: every paint-role token,
2286
+ resolved in every declared context (each theme of the default brand, then
2287
+ `<brand>/<theme>`). A design system that does not declare it gets none.
2288
+
2289
+ - The module exports `palette`, `themes`, `brands`, `contexts`,
2290
+ `defaultContext`, `systemThemes`, `themeSchemes` and `unresolved`, and the
2291
+ types `ColorToken`, `Palette`, `PaletteColor`, `PaletteContext` and `Theme`.
2292
+ - Themes, brands and the default come from `foundation.ads.ts`, in declared
2293
+ order. A value is what the `:root` rules of the token sheets cascade to on a
2294
+ root with that `data-theme`/`data-brand`. `@media`/`@supports` variants are
2295
+ not contexts.
2296
+ - `systemThemes` names the theme that each OS colour scheme selects when the
2297
+ foundation declares `followSystemTheme: true`. Otherwise it is `null`.
2298
+ - The module is generated source. Owners and controllers import it relatively
2299
+ and typecheck against its exact token union, and emission copies it as a plain
2300
+ module. The starter's `controllers/Palette/Palette.ts` reads it (`paletteFor`,
2301
+ `observePalette`, `resolveColor`, `paletteContext`, exported from the barrel).
2302
+ - `ads emit` never writes source, so it refuses while `ads check` reports
2303
+ `palette-generated`
2304
+ ([Regenerating generated source](#regenerating-generated-source)).
2305
+
2306
+ ### Deleting declared targets
2307
+
2308
+ Through MCP (`--mutations`), `ads_delete` removes declared targets (tokens,
2309
+ profiles, components, patterns, assets, glyph sets, fonts) without a draft.
2310
+ [Guarded deletion](MCP.md#guarded-deletion) gives the inputs, what each target
2311
+ kind removes, the refusals and the result.
2312
+
2313
+ - Name each target by identity: a token's custom property (`--radius-spare`); a
2314
+ profile, asset, glyph-set or font family name; or a component or pattern owner
2315
+ path (`Actions/Button`). Pass the `ads_status.sourceRevision` at which you
2316
+ inspected them, and try `dryRun: true` first.
2317
+ - ADS refuses the deletion while anything that survives still refers to a
2318
+ target, while an open draft holds a changed file, and at another source
2319
+ revision. Change a dependent first, or name it in the same request. ADS never
2320
+ deletes dependents on its own.
2321
+ - The candidate runs the same checks as `ads_accept`. On success ADS writes the
2322
+ source, then the output folder.
2323
+ - The protection covers the design system that ADS checks. ADS cannot see
2324
+ applications maintained elsewhere, or consumers of a published package, that
2325
+ still import a removed export.
2326
+
2327
+ ### Inspecting tokens and the public API
2328
+
2329
+ `ads tokens [directory]` lists every token that the role sheets
2330
+ (`tokens/**/<role>.ads.css`) declare, by group (the folder of the sheet below
2331
+ `tokens/`), role (the name of the sheet) and name. Each token has one line with
2332
+ its role, its `:root` value (the default theme and brand), its value-shape
2333
+ status when it is not valid, and its first declaration. Below it is each theme,
2334
+ brand or condition whose value differs:
2335
+
2336
+ ```text
2337
+ ADS tokens: 1 of 1
2338
+ --action-fill Surfaces/paint #145e50 design-system/tokens/Surfaces/paint.ads.css:8
2339
+ :root[data-theme="dark"]: #a6e8cf
2340
+ :root[data-brand="iris"]: #51429a
2341
+ ```
2342
+
2343
+ - `--query text` keeps tokens whose name, role or group contains the text. Token
2344
+ names are accepted as written (`--query --action-fill`). `--role` and
2345
+ `--group` select exactly, and `--limit n` bounds the listing.
2346
+ - `--json` prints the page `{ total, tokens, nextOffset?, groups, contexts,
2347
+ reach }`. [The token inventory](MCP.md#the-token-inventory) describes the
2348
+ fields of each token: `role`, `group`, `shape`, `value`, `values`,
2349
+ `declarations`, `profiles`, `owners` and `type`. `reach.complete` is false
2350
+ while an owner was not analyzed.
2351
+ - `--format dtcg` prints every token as one
2352
+ [W3C Design Tokens (DTCG)](https://www.designtokens.org/tr/2025.10/format/)
2353
+ document. The selection options do not apply to the export.
2354
+ - The structure is `group → role → name` (without `--`), with `$type` from
2355
+ the value shape of the role.
2356
+ - `$value` is the `:root` value: an exact `var(--token)` as a
2357
+ `{group.role.name}` reference; a colour, dimension, duration, font family
2358
+ or cubic Bézier as its DTCG object; other values as CSS text marked
2359
+ `css: true`.
2360
+ - `$extensions["org.reqvire.ads"]` has the token's `name`, `role`, `group` and
2361
+ `modes`: the value of every theme, brand and condition that differs, keyed
2362
+ `dark`, `iris`, `iris/dark` or `dark @media (…)`. The document's own
2363
+ extension lists the context of each mode.
2364
+ - The output is deterministic (keys sorted), so you can commit and diff it.
2365
+
2366
+ Both forms read the sources as `ads check` does, never a generated file. The
2367
+ inventory reports value-shape problems but never fails (exit 0); `ads check`
2368
+ fails for them. Tokens that do not read (for example, a sheet names an
2369
+ undeclared theme) are an execution error (exit 2) that names the first finding
2370
+ of `ads check`.
2371
+
2372
+ MCP serves the same inventory (`ads_tokens`, `ads://project/tokens`,
2373
+ `ads://project/tokens/dtcg`) and the public catalogue: `ads_catalog` lists every
2374
+ public export with its API role, source, scenarios and props and, for an owner,
2375
+ the profiles it selects ([MCP inspection](MCP.md#inspect-the-design-system)).
2376
+
2377
+ ### Regenerating generated source
2378
+
2379
+ `ads sync [directory] [--json]` creates and refreshes the generated source files
2380
+ that `foundation.ads.ts` declares. The only such file is
2381
+ `<dsDir>/palette.generated.ts` (`palette: true`), generated from the token
2382
+ sheets and `foundation.ads.ts`.
2383
+
2384
+ - If you edit source directly, run `ads sync` after you declare the palette, or
2385
+ change colour tokens or the declared themes and brands. Until then,
2386
+ `ads check` reports a blocking `palette-generated` finding. It reports the
2387
+ same finding for a module that is present without the declaration.
2388
+ - Drafts need no sync: acceptance creates or regenerates the file in the
2389
+ candidate before its check, so the published change includes it.
2390
+ - The command prints each file that it created or wrote, or that every generated
2391
+ file is current. It never creates an undeclared file, and leaves a file that
2392
+ is present without its declaration unchanged (declare it or delete it).
2393
+ - Exit codes: 0 created, written or current; 1 the inputs of a generated file do
2394
+ not read, or the file is present without its declaration (run `ads check` for
2395
+ the located finding); 2 a usage error.
2396
+ - With `--json` it prints `{ ok, root, files: [{ source, file, outcome }] }`.
2397
+ `outcome` is `absent` (neither declared nor present), `undeclared`, `current`,
2398
+ `created`, `written` or `inputs-unreadable`.
2399
+
2400
+ **Project guards.** Put a component-specific guard beside its owner, and
2401
+ register its command in the project build or in `acceptance.scripts`. Core
2402
+ tooling imports no particular component. For native ADS gates outside
2403
+ package-manager scripts, run the installed tool directly:
1377
2404
 
1378
2405
  ```sh
1379
2406
  ads check .
1380
- ads compile .
2407
+ ads emit .
1381
2408
  ```
1382
2409
 
1383
- Retain unrelated lint, type checking, and framework build commands.
2410
+ Keep unrelated lint, type checking and framework build commands. Ignore `.ds/`.
2411
+ Generated paths refer to the project and its locally installed tool.
1384
2412
 
1385
2413
  ## External content
1386
2414
 
1387
- Use the repository's `ads-import` skill for selected external ADS source or theme
1388
- values, and `ads-port` for a native implementation inspired by an upstream
1389
- library. These agent workflows handle dependency closure, token mapping, motion
1390
- comparisons, source credits, applicable notices, and local documentation.
1391
- Ports reuse the project's visual language and consolidate equivalent design roles
1392
- introduced by upstream dependencies. Verify required behavior and project
1393
- consistency; exact visual replication is an explicit requirement, not the default.
1394
- They are agent workflows, rather than CLI import/design subcommands. Install
1395
- them through `npx skills`, or read the packaged skills through the
1396
- [stdio MCP server](MCP.md#skills). MCP serving does not install or automatically
1397
- activate a skill, and the tool still bundles no UI component/example library.
1398
-
2415
+ Use the repository's `ads-import` skill for selected external ADS source or
2416
+ theme values, and `ads-port` for a native implementation inspired by an upstream
2417
+ library. These are agent workflows, not CLI import or design subcommands.
2418
+
2419
+ - The workflows handle dependency closure, token mapping, motion comparisons,
2420
+ source credits, applicable notices and local documentation.
2421
+ - A port reuses the project's visual language and consolidates equivalent design
2422
+ roles that upstream dependencies introduce. Verify the required behavior and
2423
+ the consistency with the project. Exact visual replication is an explicit
2424
+ requirement, not the default.
2425
+ - Install the skills through `npx skills`, or read the packaged skills through
2426
+ the [stdio MCP server](MCP.md#skills). MCP serving does not install or
2427
+ automatically activate a skill.
2428
+ - The tool bundles no UI component or example library other than the starter.
1399
2429
 
1400
2430
  ## Release maintenance
1401
2431
 
1402
- Choose a version that is not already in `npm view @reqvire-org/ads versions`.
1403
- Published npm versions cannot be replaced, even by moving or recreating a Git
2432
+ Select a version that is not already in `npm view @reqvire-org/ads versions`.
2433
+ Published npm versions cannot be replaced, even if you move or recreate a Git
1404
2434
  tag; see [npm publishing rules](https://docs.npmjs.com/cli/v11/commands/npm-publish/).
1405
2435
 
1406
- Update `package.json` and its lockfile with
1407
- `npm version <new-version> --no-git-tag-version --ignore-scripts`. Follow the
1408
- [local verification and changelog stamp workflow](#releasing-the-ads-tool), then
1409
- push the matching `v<new-version>` tag. `release.yml` checks version availability
1410
- and the committed local proof, packs, publishes and creates the GitHub release. Stable tags publish as `latest`; prerelease tags
1411
- publish as `next`. Check the workflow result and npm version before updating
1412
- consumer dependencies. The manual workflow moves a label to an existing
1413
- published version; it does not publish new source.
1414
-
1415
- ## Owner contracts and migration
1416
-
1417
- New colocated development source uses `<Name>.ads.<role>.ts[x]`: contract,
1418
- scenario, fixture, helpers, test, spec or behavior.spec. Optional
1419
- `<Owner>.ads.contract.ts` consolidates token/behavior declarations with typed
1420
- paint and declarative-consumer contracts. Production APIs/types stay in runtime
1421
- files. ADS reads contract data statically; no project import runs during discovery.
1422
- See [CONTRACTS.md](CONTRACTS.md) for exact fields, supported producer forms and
1423
- source/browser limits. Only `.ads.`-marked filenames are development roles.
1424
-
1425
- Project scale policies remain explicit. A registered check can call
1426
- `inspectTokenOrigins(await inspectTokens(root), target, {stopAt: allowedSharedTokens})`
1427
- from the tooling package. Check `aliasOnly` for strict alias-only policies across
1428
- all themes; inspect `literals`/`diagnostics` for raw values, cycles and limits.
1429
- Choose exact targets/origins and documented geometry exceptions in project code;
1430
- register the command in `acceptance.scripts` and the normal build. ADS owns no
1431
- universal spacing scale and infers no design meaning from token names.
2436
+ 1. Update `package.json` and its lockfile with
2437
+ `npm version <new-version> --no-git-tag-version --ignore-scripts`.
2438
+ 2. Follow the [local verification and changelog stamp workflow](#releasing-the-ads-tool).
2439
+ 3. Push the matching `v<new-version>` tag. `release.yml` checks version
2440
+ availability and the committed local proof, builds, packs and publishes the
2441
+ tagged version, and creates the GitHub release with the changelog entry as
2442
+ the release notes. It does not repeat the local browser and package suite.
2443
+ Stable tags publish as `latest`; prerelease tags publish as `next`.
2444
+ 4. Check the workflow result and the npm version before you update consumer
2445
+ dependencies.
2446
+
2447
+ The manual workflow moves a label to an existing published version. It does not
2448
+ publish new source.
1432
2449
 
1433
2450
  ## Releasing the ADS tool
1434
2451
 
1435
- Run the complete tool, browser and packed npm/Bun suite locally before tagging.
1436
- Commit the implementation, documentation and package version first, then run
1437
- `bun run release:verify` with Bun, Chrome, and npm and Node available (the packed
1438
- tests install ADS into an npm project and check the Node-facing exports). The suite
1439
- runs the same grouped command as `bun run test`: one shared build, then unit,
1440
- integration and browser groups. Defaults are 4 unit file workers with up to 4
1441
- concurrent cases per file, 2 integration workers and 4 browser workers. All three
1442
- groups overlap after the build. All per-group overrides also
1443
- apply to release verification; see [test configuration](../tests/README.md).
1444
- Bun's optional `[test] smol = true` in
1445
- `bunfig.toml` reduces heap growth through more frequent garbage collection; it
1446
- can slow tests and is not a hard limit for the runner or its compiler/browser
1447
- children. Use an OS/container limit when a hard memory cap is needed.
1448
- The runner rejects failed or skipped tests, and
1449
- refuses uncommitted inputs or source changes during the run.
1450
-
1451
- `make test` runs the same full suite; `make test-grid` uses serial compact dots
1452
- and `make test-analysis` runs the focused analysis tests. `make release-verify`
1453
- records release evidence and `make release-proof` verifies it. These targets
1454
- enable terminal colors. Direct `bun run release:verify` also preserves colors
1455
- while saving its output. To disable them, use `make test FORCE_COLOR=0` or
1456
- `FORCE_COLOR=0 bun run release:verify`.
1457
-
1458
- A successful run writes a generated verification stamp under the matching
1459
- version in `docs/CHANGELOG.md`. It records the tested implementation commit,
1460
- command, counts, runtimes, completion time, duration, source SHA-256 and log
1461
- SHA-256, per-group counts/report hashes and explicit test-setting overrides.
1462
- All three fresh JUnit reports must pass without skips. The full log remains in
1463
- `output/local-tests.log`; group reports are in `output/local-tests.junit/`. Commit that stamp
1464
- and tag the resulting commit. Do not hand-author a passing stamp.
1465
-
1466
- `bun run release:proof` verifies that the tested commit is an ancestor and its
1467
- source digest matches both the release tree and working inputs. Only generated
1468
- proof blocks and the machine-specific, unpackaged `.mcp.json` launcher are
1469
- excluded from the digest; other tracked changes require another local run.
1470
- Untracked release source must be committed before testing. This is a record of
1471
- trusted local verification, not a signed attestation or a substitute for review.
1472
-
1473
- Release CI checks the committed proof, builds and packs the tool, and publishes
1474
- the tagged version with its changelog entry as the release notes. It does not repeat the local browser/package suite.
1475
-
1476
- To add illustrative SVG artwork, use `design-system/assets/pictograms/catalog.ads.json` and the separate **Pictograms** showcase section. The starter includes a Journey example and a project-owned Pictogram component. Read the [pictogram guide](../skills/ads-designer/references/pictograms.md) for full-color artwork, theme selection, accessibility and checks. Brand identity and UI icons keep their own sections.
2452
+ Run the complete tool, browser and packed npm/Bun suite locally before you tag.
2453
+
2454
+ 1. Commit the implementation, the documentation and the package version. The
2455
+ runner refuses uncommitted inputs, untracked release source and source
2456
+ changes during the run.
2457
+ 2. Run `bun run release:verify` with Bun, Chrome, npm and Node available. The
2458
+ packed tests install ADS into an npm project and check the Node-facing
2459
+ exports. The runner rejects failed or skipped tests.
2460
+ 3. Commit the generated stamp and tag the resulting commit. Do not write a
2461
+ passing stamp by hand.
2462
+ 4. Run `bun run release:proof` to verify the stamp.
2463
+
2464
+ **The suite.** It runs the same grouped command as `bun run test`: one shared
2465
+ build, then the unit, integration and browser groups. The worker defaults and
2466
+ per-group overrides of [test configuration](../tests/README.md) also apply to
2467
+ release verification.
2468
+
2469
+ Bun's optional `[test] smol = true` in `bunfig.toml` reduces heap growth through
2470
+ more frequent garbage collection. It can slow tests, and it is not a hard limit
2471
+ for the runner or its compiler and browser children. For a hard memory cap, use
2472
+ an OS or container limit.
2473
+
2474
+ **Make targets.** `make test` runs the same full suite, `make test-grid` uses
2475
+ serial compact dots, and `make test-analysis` runs the focused analysis tests.
2476
+ `make release-verify` records release evidence and `make release-proof` verifies
2477
+ it. These targets enable terminal colors. Direct `bun run release:verify` also
2478
+ preserves colors while it saves its output. To disable colors, use
2479
+ `make test FORCE_COLOR=0` or `FORCE_COLOR=0 bun run release:verify`.
2480
+
2481
+ **The stamp.** A successful run writes a generated verification stamp under the
2482
+ matching version in `docs/CHANGELOG.md`. It records the tested implementation
2483
+ commit, command, counts, runtimes, completion time, duration, source SHA-256 and
2484
+ log SHA-256, per-group counts and report hashes, and explicit test-setting
2485
+ overrides. All three fresh JUnit reports must pass without skips. The full log
2486
+ is in `output/local-tests.log`, and the group reports are in
2487
+ `output/local-tests.junit/`.
2488
+
2489
+ **The proof.** `bun run release:proof` verifies that the tested commit is an
2490
+ ancestor, and that its source digest matches both the release tree and the
2491
+ working inputs. Only generated proof blocks and the machine-specific, unpackaged
2492
+ `.mcp.json` launcher are excluded from the digest. Other tracked changes require
2493
+ another local run. The proof is a record of trusted local verification. It is
2494
+ not a signed attestation or a substitute for review.