@ztothez/design-engineering 2.0.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 (513) hide show
  1. package/LICENSE +15 -0
  2. package/README.md +448 -0
  3. package/ROADMAP.md +127 -0
  4. package/SKILL.md +698 -0
  5. package/V2-ROADMAP.md +431 -0
  6. package/V3-ROADMAP.md +605 -0
  7. package/V4-ROADMAP.md +283 -0
  8. package/clean-room-ux-design-spec.md +1431 -0
  9. package/dist/cli/aggregate-gates.d.ts +2 -0
  10. package/dist/cli/aggregate-gates.js +86 -0
  11. package/dist/cli/aggregate-gates.js.map +1 -0
  12. package/dist/cli/assess-maintainer-review.d.ts +2 -0
  13. package/dist/cli/assess-maintainer-review.js +72 -0
  14. package/dist/cli/assess-maintainer-review.js.map +1 -0
  15. package/dist/cli/audit.d.ts +2 -0
  16. package/dist/cli/audit.js +71 -0
  17. package/dist/cli/audit.js.map +1 -0
  18. package/dist/cli/compile-comparison-review.d.ts +2 -0
  19. package/dist/cli/compile-comparison-review.js +154 -0
  20. package/dist/cli/compile-comparison-review.js.map +1 -0
  21. package/dist/cli/compile-plan.d.ts +2 -0
  22. package/dist/cli/compile-plan.js +66 -0
  23. package/dist/cli/compile-plan.js.map +1 -0
  24. package/dist/cli/evaluate-corpus.d.ts +2 -0
  25. package/dist/cli/evaluate-corpus.js +65 -0
  26. package/dist/cli/evaluate-corpus.js.map +1 -0
  27. package/dist/cli/generate-react.d.ts +2 -0
  28. package/dist/cli/generate-react.js +83 -0
  29. package/dist/cli/generate-react.js.map +1 -0
  30. package/dist/cli/index.d.ts +2 -0
  31. package/dist/cli/index.js +58 -0
  32. package/dist/cli/index.js.map +1 -0
  33. package/dist/cli/portfolio.d.ts +2 -0
  34. package/dist/cli/portfolio.js +316 -0
  35. package/dist/cli/portfolio.js.map +1 -0
  36. package/dist/cli/quality-gate.d.ts +2 -0
  37. package/dist/cli/quality-gate.js +131 -0
  38. package/dist/cli/quality-gate.js.map +1 -0
  39. package/dist/cli/repair-react.d.ts +2 -0
  40. package/dist/cli/repair-react.js +163 -0
  41. package/dist/cli/repair-react.js.map +1 -0
  42. package/dist/cli/review-heuristics.d.ts +2 -0
  43. package/dist/cli/review-heuristics.js +68 -0
  44. package/dist/cli/review-heuristics.js.map +1 -0
  45. package/dist/cli/validate-brief.d.ts +2 -0
  46. package/dist/cli/validate-brief.js +58 -0
  47. package/dist/cli/validate-brief.js.map +1 -0
  48. package/dist/cli/validate-comparison.d.ts +2 -0
  49. package/dist/cli/validate-comparison.js +68 -0
  50. package/dist/cli/validate-comparison.js.map +1 -0
  51. package/dist/cli/validate-contract.d.ts +2 -0
  52. package/dist/cli/validate-contract.js +54 -0
  53. package/dist/cli/validate-contract.js.map +1 -0
  54. package/dist/cli/validate-design.d.ts +2 -0
  55. package/dist/cli/validate-design.js +53 -0
  56. package/dist/cli/validate-design.js.map +1 -0
  57. package/dist/cli/validate-information.d.ts +2 -0
  58. package/dist/cli/validate-information.js +53 -0
  59. package/dist/cli/validate-information.js.map +1 -0
  60. package/dist/cli/validate-trust.d.ts +2 -0
  61. package/dist/cli/validate-trust.js +53 -0
  62. package/dist/cli/validate-trust.js.map +1 -0
  63. package/dist/cli/verify-ui.d.ts +2 -0
  64. package/dist/cli/verify-ui.js +181 -0
  65. package/dist/cli/verify-ui.js.map +1 -0
  66. package/dist/src/acceptance/evaluator.d.ts +13 -0
  67. package/dist/src/acceptance/evaluator.js +201 -0
  68. package/dist/src/acceptance/evaluator.js.map +1 -0
  69. package/dist/src/acceptance/loader.d.ts +2 -0
  70. package/dist/src/acceptance/loader.js +18 -0
  71. package/dist/src/acceptance/loader.js.map +1 -0
  72. package/dist/src/acceptance/report.d.ts +2 -0
  73. package/dist/src/acceptance/report.js +18 -0
  74. package/dist/src/acceptance/report.js.map +1 -0
  75. package/dist/src/acceptance/schema.d.ts +64 -0
  76. package/dist/src/acceptance/schema.js +57 -0
  77. package/dist/src/acceptance/schema.js.map +1 -0
  78. package/dist/src/acceptance/types.d.ts +47 -0
  79. package/dist/src/acceptance/types.js +2 -0
  80. package/dist/src/acceptance/types.js.map +1 -0
  81. package/dist/src/aggregate/report.d.ts +2 -0
  82. package/dist/src/aggregate/report.js +33 -0
  83. package/dist/src/aggregate/report.js.map +1 -0
  84. package/dist/src/aggregate/runner.d.ts +2 -0
  85. package/dist/src/aggregate/runner.js +165 -0
  86. package/dist/src/aggregate/runner.js.map +1 -0
  87. package/dist/src/aggregate/schema.d.ts +182 -0
  88. package/dist/src/aggregate/schema.js +54 -0
  89. package/dist/src/aggregate/schema.js.map +1 -0
  90. package/dist/src/aggregate/types.d.ts +57 -0
  91. package/dist/src/aggregate/types.js +2 -0
  92. package/dist/src/aggregate/types.js.map +1 -0
  93. package/dist/src/audit/policy.d.ts +3 -0
  94. package/dist/src/audit/policy.js +45 -0
  95. package/dist/src/audit/policy.js.map +1 -0
  96. package/dist/src/audit/report.d.ts +2 -0
  97. package/dist/src/audit/report.js +32 -0
  98. package/dist/src/audit/report.js.map +1 -0
  99. package/dist/src/audit/rules/accessibility-name.d.ts +2 -0
  100. package/dist/src/audit/rules/accessibility-name.js +64 -0
  101. package/dist/src/audit/rules/accessibility-name.js.map +1 -0
  102. package/dist/src/audit/rules/component-size.d.ts +2 -0
  103. package/dist/src/audit/rules/component-size.js +27 -0
  104. package/dist/src/audit/rules/component-size.js.map +1 -0
  105. package/dist/src/audit/rules/credential-placeholder.d.ts +2 -0
  106. package/dist/src/audit/rules/credential-placeholder.js +83 -0
  107. package/dist/src/audit/rules/credential-placeholder.js.map +1 -0
  108. package/dist/src/audit/rules/helpers.d.ts +16 -0
  109. package/dist/src/audit/rules/helpers.js +64 -0
  110. package/dist/src/audit/rules/helpers.js.map +1 -0
  111. package/dist/src/audit/rules/index.d.ts +2 -0
  112. package/dist/src/audit/rules/index.js +23 -0
  113. package/dist/src/audit/rules/index.js.map +1 -0
  114. package/dist/src/audit/rules/interactive-integrity.d.ts +2 -0
  115. package/dist/src/audit/rules/interactive-integrity.js +111 -0
  116. package/dist/src/audit/rules/interactive-integrity.js.map +1 -0
  117. package/dist/src/audit/rules/mixed-responsibilities.d.ts +2 -0
  118. package/dist/src/audit/rules/mixed-responsibilities.js +39 -0
  119. package/dist/src/audit/rules/mixed-responsibilities.js.map +1 -0
  120. package/dist/src/audit/rules/mock-production-path.d.ts +2 -0
  121. package/dist/src/audit/rules/mock-production-path.js +39 -0
  122. package/dist/src/audit/rules/mock-production-path.js.map +1 -0
  123. package/dist/src/audit/rules/network-state.d.ts +2 -0
  124. package/dist/src/audit/rules/network-state.js +39 -0
  125. package/dist/src/audit/rules/network-state.js.map +1 -0
  126. package/dist/src/audit/rules/operational-claim.d.ts +2 -0
  127. package/dist/src/audit/rules/operational-claim.js +94 -0
  128. package/dist/src/audit/rules/operational-claim.js.map +1 -0
  129. package/dist/src/audit/rules/placeholder-interaction.d.ts +2 -0
  130. package/dist/src/audit/rules/placeholder-interaction.js +46 -0
  131. package/dist/src/audit/rules/placeholder-interaction.js.map +1 -0
  132. package/dist/src/audit/rules/raw-design-values.d.ts +2 -0
  133. package/dist/src/audit/rules/raw-design-values.js +97 -0
  134. package/dist/src/audit/rules/raw-design-values.js.map +1 -0
  135. package/dist/src/audit/scanner.d.ts +2 -0
  136. package/dist/src/audit/scanner.js +215 -0
  137. package/dist/src/audit/scanner.js.map +1 -0
  138. package/dist/src/audit/types.d.ts +62 -0
  139. package/dist/src/audit/types.js +2 -0
  140. package/dist/src/audit/types.js.map +1 -0
  141. package/dist/src/comparison/evaluator.d.ts +2 -0
  142. package/dist/src/comparison/evaluator.js +478 -0
  143. package/dist/src/comparison/evaluator.js.map +1 -0
  144. package/dist/src/comparison/loader.d.ts +3 -0
  145. package/dist/src/comparison/loader.js +26 -0
  146. package/dist/src/comparison/loader.js.map +1 -0
  147. package/dist/src/comparison/maintainer.d.ts +47 -0
  148. package/dist/src/comparison/maintainer.js +218 -0
  149. package/dist/src/comparison/maintainer.js.map +1 -0
  150. package/dist/src/comparison/report.d.ts +2 -0
  151. package/dist/src/comparison/report.js +48 -0
  152. package/dist/src/comparison/report.js.map +1 -0
  153. package/dist/src/comparison/schema.d.ts +464 -0
  154. package/dist/src/comparison/schema.js +502 -0
  155. package/dist/src/comparison/schema.js.map +1 -0
  156. package/dist/src/contracts/archetypes.d.ts +21 -0
  157. package/dist/src/contracts/archetypes.js +102 -0
  158. package/dist/src/contracts/archetypes.js.map +1 -0
  159. package/dist/src/contracts/journeys.d.ts +7 -0
  160. package/dist/src/contracts/journeys.js +32 -0
  161. package/dist/src/contracts/journeys.js.map +1 -0
  162. package/dist/src/contracts/report.d.ts +2 -0
  163. package/dist/src/contracts/report.js +33 -0
  164. package/dist/src/contracts/report.js.map +1 -0
  165. package/dist/src/contracts/schema.d.ts +1038 -0
  166. package/dist/src/contracts/schema.js +385 -0
  167. package/dist/src/contracts/schema.js.map +1 -0
  168. package/dist/src/contracts/validator.d.ts +12 -0
  169. package/dist/src/contracts/validator.js +303 -0
  170. package/dist/src/contracts/validator.js.map +1 -0
  171. package/dist/src/corpus/evaluator.d.ts +2 -0
  172. package/dist/src/corpus/evaluator.js +203 -0
  173. package/dist/src/corpus/evaluator.js.map +1 -0
  174. package/dist/src/corpus/loader.d.ts +2 -0
  175. package/dist/src/corpus/loader.js +20 -0
  176. package/dist/src/corpus/loader.js.map +1 -0
  177. package/dist/src/corpus/report.d.ts +2 -0
  178. package/dist/src/corpus/report.js +33 -0
  179. package/dist/src/corpus/report.js.map +1 -0
  180. package/dist/src/corpus/schema.d.ts +316 -0
  181. package/dist/src/corpus/schema.js +269 -0
  182. package/dist/src/corpus/schema.js.map +1 -0
  183. package/dist/src/design-intelligence/loader.d.ts +2 -0
  184. package/dist/src/design-intelligence/loader.js +21 -0
  185. package/dist/src/design-intelligence/loader.js.map +1 -0
  186. package/dist/src/design-intelligence/report.d.ts +2 -0
  187. package/dist/src/design-intelligence/report.js +36 -0
  188. package/dist/src/design-intelligence/report.js.map +1 -0
  189. package/dist/src/design-intelligence/schema.d.ts +838 -0
  190. package/dist/src/design-intelligence/schema.js +854 -0
  191. package/dist/src/design-intelligence/schema.js.map +1 -0
  192. package/dist/src/design-intelligence/validator.d.ts +2 -0
  193. package/dist/src/design-intelligence/validator.js +1371 -0
  194. package/dist/src/design-intelligence/validator.js.map +1 -0
  195. package/dist/src/design-plan/compiler.d.ts +8 -0
  196. package/dist/src/design-plan/compiler.js +288 -0
  197. package/dist/src/design-plan/compiler.js.map +1 -0
  198. package/dist/src/design-plan/report.d.ts +2 -0
  199. package/dist/src/design-plan/report.js +28 -0
  200. package/dist/src/design-plan/report.js.map +1 -0
  201. package/dist/src/design-plan/schema.d.ts +202 -0
  202. package/dist/src/design-plan/schema.js +76 -0
  203. package/dist/src/design-plan/schema.js.map +1 -0
  204. package/dist/src/generation/loader.d.ts +2 -0
  205. package/dist/src/generation/loader.js +21 -0
  206. package/dist/src/generation/loader.js.map +1 -0
  207. package/dist/src/generation/policy.d.ts +12 -0
  208. package/dist/src/generation/policy.js +62 -0
  209. package/dist/src/generation/policy.js.map +1 -0
  210. package/dist/src/generation/react-typescript.d.ts +6 -0
  211. package/dist/src/generation/react-typescript.js +538 -0
  212. package/dist/src/generation/react-typescript.js.map +1 -0
  213. package/dist/src/generation/report.d.ts +2 -0
  214. package/dist/src/generation/report.js +21 -0
  215. package/dist/src/generation/report.js.map +1 -0
  216. package/dist/src/generation/schema.d.ts +44 -0
  217. package/dist/src/generation/schema.js +50 -0
  218. package/dist/src/generation/schema.js.map +1 -0
  219. package/dist/src/generation/templates/tokens.d.ts +1 -0
  220. package/dist/src/generation/templates/tokens.js +59 -0
  221. package/dist/src/generation/templates/tokens.js.map +1 -0
  222. package/dist/src/heuristics/evaluator.d.ts +2 -0
  223. package/dist/src/heuristics/evaluator.js +65 -0
  224. package/dist/src/heuristics/evaluator.js.map +1 -0
  225. package/dist/src/heuristics/loader.d.ts +2 -0
  226. package/dist/src/heuristics/loader.js +21 -0
  227. package/dist/src/heuristics/loader.js.map +1 -0
  228. package/dist/src/heuristics/report.d.ts +3 -0
  229. package/dist/src/heuristics/report.js +31 -0
  230. package/dist/src/heuristics/report.js.map +1 -0
  231. package/dist/src/heuristics/schema.d.ts +198 -0
  232. package/dist/src/heuristics/schema.js +197 -0
  233. package/dist/src/heuristics/schema.js.map +1 -0
  234. package/dist/src/information-design/loader.d.ts +2 -0
  235. package/dist/src/information-design/loader.js +21 -0
  236. package/dist/src/information-design/loader.js.map +1 -0
  237. package/dist/src/information-design/report.d.ts +2 -0
  238. package/dist/src/information-design/report.js +27 -0
  239. package/dist/src/information-design/report.js.map +1 -0
  240. package/dist/src/information-design/schema.d.ts +370 -0
  241. package/dist/src/information-design/schema.js +329 -0
  242. package/dist/src/information-design/schema.js.map +1 -0
  243. package/dist/src/information-design/validator.d.ts +2 -0
  244. package/dist/src/information-design/validator.js +242 -0
  245. package/dist/src/information-design/validator.js.map +1 -0
  246. package/dist/src/interface-trust/loader.d.ts +2 -0
  247. package/dist/src/interface-trust/loader.js +21 -0
  248. package/dist/src/interface-trust/loader.js.map +1 -0
  249. package/dist/src/interface-trust/report.d.ts +2 -0
  250. package/dist/src/interface-trust/report.js +26 -0
  251. package/dist/src/interface-trust/report.js.map +1 -0
  252. package/dist/src/interface-trust/schema.d.ts +299 -0
  253. package/dist/src/interface-trust/schema.js +238 -0
  254. package/dist/src/interface-trust/schema.js.map +1 -0
  255. package/dist/src/interface-trust/validator.d.ts +2 -0
  256. package/dist/src/interface-trust/validator.js +283 -0
  257. package/dist/src/interface-trust/validator.js.map +1 -0
  258. package/dist/src/portfolio/adapter-report.d.ts +3 -0
  259. package/dist/src/portfolio/adapter-report.js +38 -0
  260. package/dist/src/portfolio/adapter-report.js.map +1 -0
  261. package/dist/src/portfolio/adapters.d.ts +37 -0
  262. package/dist/src/portfolio/adapters.js +325 -0
  263. package/dist/src/portfolio/adapters.js.map +1 -0
  264. package/dist/src/portfolio/evidence.d.ts +9 -0
  265. package/dist/src/portfolio/evidence.js +233 -0
  266. package/dist/src/portfolio/evidence.js.map +1 -0
  267. package/dist/src/portfolio/files.d.ts +8 -0
  268. package/dist/src/portfolio/files.js +77 -0
  269. package/dist/src/portfolio/files.js.map +1 -0
  270. package/dist/src/portfolio/fixture-server.d.ts +11 -0
  271. package/dist/src/portfolio/fixture-server.js +131 -0
  272. package/dist/src/portfolio/fixture-server.js.map +1 -0
  273. package/dist/src/portfolio/loader.d.ts +2 -0
  274. package/dist/src/portfolio/loader.js +21 -0
  275. package/dist/src/portfolio/loader.js.map +1 -0
  276. package/dist/src/portfolio/mcp.d.ts +186 -0
  277. package/dist/src/portfolio/mcp.js +117 -0
  278. package/dist/src/portfolio/mcp.js.map +1 -0
  279. package/dist/src/portfolio/promotion-schema.d.ts +220 -0
  280. package/dist/src/portfolio/promotion-schema.js +148 -0
  281. package/dist/src/portfolio/promotion-schema.js.map +1 -0
  282. package/dist/src/portfolio/promotion.d.ts +4 -0
  283. package/dist/src/portfolio/promotion.js +160 -0
  284. package/dist/src/portfolio/promotion.js.map +1 -0
  285. package/dist/src/portfolio/qualification-schema.d.ts +268 -0
  286. package/dist/src/portfolio/qualification-schema.js +112 -0
  287. package/dist/src/portfolio/qualification-schema.js.map +1 -0
  288. package/dist/src/portfolio/qualification.d.ts +4 -0
  289. package/dist/src/portfolio/qualification.js +157 -0
  290. package/dist/src/portfolio/qualification.js.map +1 -0
  291. package/dist/src/portfolio/registry.d.ts +34 -0
  292. package/dist/src/portfolio/registry.js +240 -0
  293. package/dist/src/portfolio/registry.js.map +1 -0
  294. package/dist/src/portfolio/report.d.ts +4 -0
  295. package/dist/src/portfolio/report.js +47 -0
  296. package/dist/src/portfolio/report.js.map +1 -0
  297. package/dist/src/portfolio/run-schema.d.ts +135 -0
  298. package/dist/src/portfolio/run-schema.js +81 -0
  299. package/dist/src/portfolio/run-schema.js.map +1 -0
  300. package/dist/src/portfolio/runner.d.ts +118 -0
  301. package/dist/src/portfolio/runner.js +423 -0
  302. package/dist/src/portfolio/runner.js.map +1 -0
  303. package/dist/src/portfolio/schema.d.ts +251 -0
  304. package/dist/src/portfolio/schema.js +317 -0
  305. package/dist/src/portfolio/schema.js.map +1 -0
  306. package/dist/src/portfolio/snapshot.d.ts +89 -0
  307. package/dist/src/portfolio/snapshot.js +548 -0
  308. package/dist/src/portfolio/snapshot.js.map +1 -0
  309. package/dist/src/portfolio/taxonomy-schema.d.ts +215 -0
  310. package/dist/src/portfolio/taxonomy-schema.js +74 -0
  311. package/dist/src/portfolio/taxonomy-schema.js.map +1 -0
  312. package/dist/src/portfolio/taxonomy.d.ts +5 -0
  313. package/dist/src/portfolio/taxonomy.js +236 -0
  314. package/dist/src/portfolio/taxonomy.js.map +1 -0
  315. package/dist/src/portfolio/vault.d.ts +53 -0
  316. package/dist/src/portfolio/vault.js +176 -0
  317. package/dist/src/portfolio/vault.js.map +1 -0
  318. package/dist/src/product-brief/loader.d.ts +2 -0
  319. package/dist/src/product-brief/loader.js +21 -0
  320. package/dist/src/product-brief/loader.js.map +1 -0
  321. package/dist/src/product-brief/report.d.ts +2 -0
  322. package/dist/src/product-brief/report.js +22 -0
  323. package/dist/src/product-brief/report.js.map +1 -0
  324. package/dist/src/product-brief/schema.d.ts +367 -0
  325. package/dist/src/product-brief/schema.js +272 -0
  326. package/dist/src/product-brief/schema.js.map +1 -0
  327. package/dist/src/product-brief/validator.d.ts +2 -0
  328. package/dist/src/product-brief/validator.js +251 -0
  329. package/dist/src/product-brief/validator.js.map +1 -0
  330. package/dist/src/product.d.ts +7 -0
  331. package/dist/src/product.js +28 -0
  332. package/dist/src/product.js.map +1 -0
  333. package/dist/src/quality-gate/report.d.ts +2 -0
  334. package/dist/src/quality-gate/report.js +46 -0
  335. package/dist/src/quality-gate/report.js.map +1 -0
  336. package/dist/src/quality-gate/runner.d.ts +2 -0
  337. package/dist/src/quality-gate/runner.js +175 -0
  338. package/dist/src/quality-gate/runner.js.map +1 -0
  339. package/dist/src/quality-gate/schema.d.ts +75 -0
  340. package/dist/src/quality-gate/schema.js +37 -0
  341. package/dist/src/quality-gate/schema.js.map +1 -0
  342. package/dist/src/quality-gate/types.d.ts +49 -0
  343. package/dist/src/quality-gate/types.js +2 -0
  344. package/dist/src/quality-gate/types.js.map +1 -0
  345. package/dist/src/repair/loader.d.ts +2 -0
  346. package/dist/src/repair/loader.js +11 -0
  347. package/dist/src/repair/loader.js.map +1 -0
  348. package/dist/src/repair/policy.d.ts +16 -0
  349. package/dist/src/repair/policy.js +65 -0
  350. package/dist/src/repair/policy.js.map +1 -0
  351. package/dist/src/repair/report.d.ts +2 -0
  352. package/dist/src/repair/report.js +32 -0
  353. package/dist/src/repair/report.js.map +1 -0
  354. package/dist/src/repair/runner.d.ts +17 -0
  355. package/dist/src/repair/runner.js +511 -0
  356. package/dist/src/repair/runner.js.map +1 -0
  357. package/dist/src/repair/schema.d.ts +264 -0
  358. package/dist/src/repair/schema.js +202 -0
  359. package/dist/src/repair/schema.js.map +1 -0
  360. package/dist/src/retrieval/report.d.ts +2 -0
  361. package/dist/src/retrieval/report.js +21 -0
  362. package/dist/src/retrieval/report.js.map +1 -0
  363. package/dist/src/retrieval/schema.d.ts +123 -0
  364. package/dist/src/retrieval/schema.js +77 -0
  365. package/dist/src/retrieval/schema.js.map +1 -0
  366. package/dist/src/retrieval/search.d.ts +26 -0
  367. package/dist/src/retrieval/search.js +415 -0
  368. package/dist/src/retrieval/search.js.map +1 -0
  369. package/dist/src/runtime/advanced-checks.d.ts +6 -0
  370. package/dist/src/runtime/advanced-checks.js +487 -0
  371. package/dist/src/runtime/advanced-checks.js.map +1 -0
  372. package/dist/src/runtime/composition-checks.d.ts +5 -0
  373. package/dist/src/runtime/composition-checks.js +307 -0
  374. package/dist/src/runtime/composition-checks.js.map +1 -0
  375. package/dist/src/runtime/interface-checks.d.ts +12 -0
  376. package/dist/src/runtime/interface-checks.js +224 -0
  377. package/dist/src/runtime/interface-checks.js.map +1 -0
  378. package/dist/src/runtime/policy.d.ts +13 -0
  379. package/dist/src/runtime/policy.js +97 -0
  380. package/dist/src/runtime/policy.js.map +1 -0
  381. package/dist/src/runtime/report.d.ts +2 -0
  382. package/dist/src/runtime/report.js +48 -0
  383. package/dist/src/runtime/report.js.map +1 -0
  384. package/dist/src/runtime/schema.d.ts +406 -0
  385. package/dist/src/runtime/schema.js +308 -0
  386. package/dist/src/runtime/schema.js.map +1 -0
  387. package/dist/src/runtime/types.d.ts +177 -0
  388. package/dist/src/runtime/types.js +2 -0
  389. package/dist/src/runtime/types.js.map +1 -0
  390. package/dist/src/runtime/verifier.d.ts +2 -0
  391. package/dist/src/runtime/verifier.js +1201 -0
  392. package/dist/src/runtime/verifier.js.map +1 -0
  393. package/dist/src/server.d.ts +2 -0
  394. package/dist/src/server.js +1352 -0
  395. package/dist/src/server.js.map +1 -0
  396. package/docs/installation.md +337 -0
  397. package/knowledge-base/INDEX.md +285 -0
  398. package/knowledge-base/benchmarks/aegisops/CALIBRATION.md +52 -0
  399. package/knowledge-base/benchmarks/aegisops/MANIFEST.md +56 -0
  400. package/knowledge-base/benchmarks/aegisops/SOURCE-EVIDENCE.md +45 -0
  401. package/knowledge-base/benchmarks/aegisops/acceptance-criteria.md +42 -0
  402. package/knowledge-base/benchmarks/aegisops/anti-patterns.md +19 -0
  403. package/knowledge-base/benchmarks/aegisops/attestations.template.yaml +3 -0
  404. package/knowledge-base/benchmarks/aegisops/attestations.yaml +115 -0
  405. package/knowledge-base/benchmarks/aegisops/journeys.json +91 -0
  406. package/knowledge-base/benchmarks/aegisops/product-contract.yaml +328 -0
  407. package/knowledge-base/benchmarks/azure-optimizer/SOURCE-EVIDENCE.md +26 -0
  408. package/knowledge-base/benchmarks/azure-optimizer/V2-IMPLEMENTATION.md +39 -0
  409. package/knowledge-base/benchmarks/azure-optimizer/acceptance-criteria.md +23 -0
  410. package/knowledge-base/benchmarks/azure-optimizer/anti-patterns.md +13 -0
  411. package/knowledge-base/benchmarks/azure-optimizer/journeys.json +88 -0
  412. package/knowledge-base/benchmarks/azure-optimizer/product-contract.yaml +216 -0
  413. package/knowledge-base/benchmarks/azure-optimizer/v2-human-review-methodology.yaml +171 -0
  414. package/knowledge-base/benchmarks/azure-optimizer/v2-journeys.json +139 -0
  415. package/knowledge-base/benchmarks/corpus/PROVENANCE.md +21 -0
  416. package/knowledge-base/benchmarks/corpus/README.md +30 -0
  417. package/knowledge-base/benchmarks/corpus/cases/anti-slop-negative/package.json +9 -0
  418. package/knowledge-base/benchmarks/corpus/cases/anti-slop-negative/src/FakeDashboard.tsx +10 -0
  419. package/knowledge-base/benchmarks/corpus/cases/anti-slop-positive/package.json +9 -0
  420. package/knowledge-base/benchmarks/corpus/cases/anti-slop-positive/src/Progress.tsx +15 -0
  421. package/knowledge-base/benchmarks/corpus/cases/architecture-negative/package.json +9 -0
  422. package/knowledge-base/benchmarks/corpus/cases/architecture-negative/src/OperationsPanel.tsx +40 -0
  423. package/knowledge-base/benchmarks/corpus/cases/architecture-positive/package.json +9 -0
  424. package/knowledge-base/benchmarks/corpus/cases/architecture-positive/src/Dashboard.tsx +17 -0
  425. package/knowledge-base/benchmarks/corpus/cases/architecture-positive/src/theme.css +15 -0
  426. package/knowledge-base/benchmarks/corpus/cases/task-incomplete/SOURCE-EVIDENCE.md +3 -0
  427. package/knowledge-base/benchmarks/corpus/cases/task-incomplete/journeys.json +20 -0
  428. package/knowledge-base/benchmarks/corpus/cases/task-incomplete/product-contract.yaml +78 -0
  429. package/knowledge-base/benchmarks/corpus/corpus.schema.yaml +159 -0
  430. package/knowledge-base/benchmarks/corpus/corpus.yaml +209 -0
  431. package/knowledge-base/benchmarks/interface-quality/README.md +26 -0
  432. package/knowledge-base/benchmarks/interface-quality/SOLO-MAINTAINER-TRACK.md +35 -0
  433. package/knowledge-base/benchmarks/interface-quality/comparison-methodology-v1.1.schema.yaml +288 -0
  434. package/knowledge-base/benchmarks/interface-quality/comparison-methodology.schema.yaml +235 -0
  435. package/knowledge-base/benchmarks/interface-quality/comparison-methodology.template.yaml +181 -0
  436. package/knowledge-base/benchmarks/interface-quality/evidence/example-runtime-report.json +11 -0
  437. package/knowledge-base/benchmarks/interface-quality/review-session.schema.yaml +14 -0
  438. package/knowledge-base/benchmarks/interface-quality/review.schema.yaml +296 -0
  439. package/knowledge-base/benchmarks/interface-quality/review.template.yaml +43 -0
  440. package/knowledge-base/benchmarks/portfolio-corpus/ADAPTERS.md +68 -0
  441. package/knowledge-base/benchmarks/portfolio-corpus/PORTFOLIO-RUNNER.md +131 -0
  442. package/knowledge-base/benchmarks/portfolio-corpus/PRODUCT-TASK-CONTRACTS.md +29 -0
  443. package/knowledge-base/benchmarks/portfolio-corpus/PROMOTED-RULES.md +31 -0
  444. package/knowledge-base/benchmarks/portfolio-corpus/archetype-profiles.yaml +26 -0
  445. package/knowledge-base/benchmarks/portfolio-corpus/product-task-profile.schema.yaml +105 -0
  446. package/knowledge-base/benchmarks/portfolio-corpus/registry.schema.yaml +188 -0
  447. package/knowledge-base/benchmarks/portfolio-corpus/registry.template.yaml +63 -0
  448. package/knowledge-base/benchmarks/portfolio-corpus/rule-fixtures/component-size-abstention.json +10 -0
  449. package/knowledge-base/benchmarks/portfolio-corpus/rule-fixtures/component-size-negative.json +10 -0
  450. package/knowledge-base/benchmarks/portfolio-corpus/rule-fixtures/component-size-positive.json +10 -0
  451. package/knowledge-base/benchmarks/portfolio-corpus/rule-fixtures/interactive-integrity-abstention.json +10 -0
  452. package/knowledge-base/benchmarks/portfolio-corpus/rule-fixtures/interactive-integrity-negative.json +10 -0
  453. package/knowledge-base/benchmarks/portfolio-corpus/rule-fixtures/interactive-integrity-positive.json +10 -0
  454. package/knowledge-base/benchmarks/portfolio-corpus/rule-fixtures/raw-design-values-abstention.json +10 -0
  455. package/knowledge-base/benchmarks/portfolio-corpus/rule-fixtures/raw-design-values-negative.json +10 -0
  456. package/knowledge-base/benchmarks/portfolio-corpus/rule-fixtures/raw-design-values-positive.json +10 -0
  457. package/knowledge-base/benchmarks/portfolio-corpus/rule-holdout-evaluation.template.json +14 -0
  458. package/knowledge-base/benchmarks/portfolio-corpus/rule-promotion-evidence.template.json +24 -0
  459. package/knowledge-base/benchmarks/portfolio-corpus/v3-command-evidence.template.json +17 -0
  460. package/knowledge-base/benchmarks/portfolio-corpus/v3-qualification-evidence.template.json +29 -0
  461. package/knowledge-base/benchmarks/scenestart/CALIBRATION.md +95 -0
  462. package/knowledge-base/benchmarks/scenestart/MANIFEST.md +53 -0
  463. package/knowledge-base/benchmarks/scenestart/SOURCE-EVIDENCE.md +43 -0
  464. package/knowledge-base/benchmarks/scenestart/acceptance-criteria.md +59 -0
  465. package/knowledge-base/benchmarks/scenestart/anti-patterns.md +26 -0
  466. package/knowledge-base/benchmarks/scenestart/attestations.template.yaml +3 -0
  467. package/knowledge-base/benchmarks/scenestart/attestations.yaml +21 -0
  468. package/knowledge-base/benchmarks/scenestart/human-review.md +99 -0
  469. package/knowledge-base/benchmarks/scenestart/human-review.template.md +105 -0
  470. package/knowledge-base/benchmarks/scenestart/journeys.json +141 -0
  471. package/knowledge-base/benchmarks/scenestart/product-contract.yaml +427 -0
  472. package/knowledge-base/dependencies.yaml +69 -0
  473. package/knowledge-base/design-intelligence/MASTER.md +87 -0
  474. package/knowledge-base/design-intelligence/asset-generation.md +66 -0
  475. package/knowledge-base/design-intelligence/brand-systems.md +69 -0
  476. package/knowledge-base/design-intelligence/closed-loop-repair.md +95 -0
  477. package/knowledge-base/design-intelligence/design-deliverable.schema.yaml +1194 -0
  478. package/knowledge-base/design-intelligence/design-deliverable.template.yaml +591 -0
  479. package/knowledge-base/design-intelligence/design-plan.md +78 -0
  480. package/knowledge-base/design-intelligence/design-plan.schema.yaml +621 -0
  481. package/knowledge-base/design-intelligence/figma-production.md +63 -0
  482. package/knowledge-base/design-intelligence/generation-adapter.md +72 -0
  483. package/knowledge-base/design-intelligence/generation-adapter.schema.yaml +47 -0
  484. package/knowledge-base/design-intelligence/iconography.md +46 -0
  485. package/knowledge-base/design-intelligence/information-design.md +104 -0
  486. package/knowledge-base/design-intelligence/information-design.schema.yaml +390 -0
  487. package/knowledge-base/design-intelligence/information-design.template.yaml +281 -0
  488. package/knowledge-base/design-intelligence/interaction-recovery-verification.md +72 -0
  489. package/knowledge-base/design-intelligence/interface-trust.md +103 -0
  490. package/knowledge-base/design-intelligence/interface-trust.schema.yaml +263 -0
  491. package/knowledge-base/design-intelligence/interface-trust.template.yaml +173 -0
  492. package/knowledge-base/design-intelligence/licensing-and-provenance.md +59 -0
  493. package/knowledge-base/design-intelligence/presentation-design.md +56 -0
  494. package/knowledge-base/design-intelligence/product-design-brief.md +67 -0
  495. package/knowledge-base/design-intelligence/product-design-brief.schema.yaml +279 -0
  496. package/knowledge-base/design-intelligence/product-design-brief.template.yaml +225 -0
  497. package/knowledge-base/design-intelligence/repair-request.schema.yaml +95 -0
  498. package/knowledge-base/design-intelligence/repair-request.template.yaml +39 -0
  499. package/knowledge-base/design-intelligence/visual-accessibility.md +56 -0
  500. package/knowledge-base/design-intelligence/visual-polish.md +172 -0
  501. package/knowledge-base/maintained/architecture/MASTER.md +22 -0
  502. package/knowledge-base/maintained/architecture/component-boundaries.md +30 -0
  503. package/knowledge-base/maintained/architecture/product-platforms.md +25 -0
  504. package/knowledge-base/maintained/architecture/quality-attributes-and-evaluation.md +35 -0
  505. package/knowledge-base/maintained/product-patterns/MASTER.md +10 -0
  506. package/knowledge-base/maintained/product-patterns/ai-workspaces.md +26 -0
  507. package/knowledge-base/maintained/product-patterns/operational-dashboards.md +22 -0
  508. package/knowledge-base/provenance.yaml +196 -0
  509. package/knowledge-base/retrieval-scope.yaml +43 -0
  510. package/knowledge-base/usability-evaluation/HEURISTIC_EVALUATION.md +115 -0
  511. package/knowledge-base/usability-evaluation/heuristic-review.schema.yaml +210 -0
  512. package/knowledge-base/usability-evaluation/heuristic-review.template.yaml +37 -0
  513. package/package.json +133 -0
@@ -0,0 +1,1431 @@
1
+ # Clean-Room Design Specification: UX Design Intelligence, Audit, Preview, and Agent Integration Platform
2
+
3
+ **Status:** Clean-room engineering specification
4
+ **Reference inputs:** `ux-pilot-main.zip` and `ui-ux-pro-max-skill-2.15.0-source-code.zip`
5
+ **Purpose:** Define an implementation-independent system that can reproduce the externally meaningful UX-design, design-intelligence, audit, preview, persistence, and agent-integration behaviors evidenced by the two reference projects without reconstructing their source code.
6
+
7
+ ## Classification Legend
8
+
9
+ - **Observed** — directly evidenced by documentation, manifests, command help, generated-output behavior, or behavioral tests in the reference material.
10
+ - **Required** — necessary for compatibility with an externally observable behavior identified in the references.
11
+ - **Inferred** — a requirement reasonably necessary to make the observed behavior reliable, secure, or operable, but not uniquely dictated by the references.
12
+ - **Implementation Choice** — one of multiple valid ways to satisfy the requirement; an independent team is free to choose another method.
13
+
14
+ ---
15
+
16
+ # 1. Executive Summary
17
+
18
+ The reference material describes two complementary product concepts.
19
+
20
+ **Reference A** is an end-to-end UX workflow assistant. It conducts structured product discovery, stores a persistent UX brief, audits an existing interface, optionally supplements static analysis with browser screenshots, presents a scored report, runs a local live-preview environment, supports iterative screen approval, and exports a UX specification and framework-oriented components.
21
+
22
+ **Reference B** is a design-intelligence and agent-integration platform. It maintains local searchable design knowledge covering product categories, visual styles, color systems, typography, charts, UX guidance, animation guidance, icon guidance, and implementation stacks. It can synthesize a project-level design system, persist a global design direction plus page overrides, expose targeted search through a command-line interface, and install assistant-specific skill material for multiple coding agents.
23
+
24
+ The clean-room target system specified here combines those externally meaningful capabilities into one modular platform with six principal responsibilities:
25
+
26
+ 1. **Project understanding and discovery** — determine product type, audience, workflows, design goals, implementation stack, and operational constraints.
27
+ 2. **Design intelligence** — query a versioned local knowledge catalog and synthesize coherent design-system recommendations.
28
+ 3. **UX auditing** — inspect static project artifacts and, when available, rendered interfaces; produce traceable findings and a score.
29
+ 4. **Interactive preview and validation** — present candidate screens or design directions locally, support live reload, and record user decisions.
30
+ 5. **Persistence and export** — maintain a durable project brief/design-system source of truth and export implementation-independent specifications plus optional framework adapters.
31
+ 6. **Agent and CLI integration** — expose stable commands, machine-readable output, and assistant-specific installation adapters.
32
+
33
+ The target architecture deliberately does **not** require the original search algorithm, original file layout, internal module names, original wording of design rules, or source-code transformations. Compatibility is defined by observable contracts, not internal replication.
34
+
35
+ ---
36
+
37
+ # 2. System Purpose
38
+
39
+ The system shall help an AI coding assistant, designer, or developer move from an ambiguous UI/UX request to a validated and documented interface direction.
40
+
41
+ ### Core purpose
42
+
43
+ **Required:** The system must be able to answer four classes of user intent:
44
+
45
+ - **Design:** create or recommend a coherent visual/interaction direction for a new page, product, component, or flow.
46
+ - **Review:** inspect an existing project or rendered interface for usability, accessibility, responsive-design, SEO/UI, and consistency problems.
47
+ - **Iterate:** present alternatives, collect approval/rejection/commentary, and maintain decisions across sessions.
48
+ - **Implement/Export:** provide implementation guidance appropriate to the detected or selected technology stack and emit a durable specification.
49
+
50
+ ### Secondary purpose
51
+
52
+ **Observed:** The larger reference also supports installation into multiple AI coding assistants and provides broader design-related capabilities such as design systems, brand-oriented assets, slides, banners, icons, and visual-identity workflows.
53
+
54
+ **Implementation Choice:** These broader capabilities should be implemented as optional extension modules rather than coupled to the core UX engine. Core compatibility does not require every asset-generation capability unless those skills are intentionally exposed as public product features.
55
+
56
+ ---
57
+
58
+ # 3. Scope
59
+
60
+ ## 3.1 In scope
61
+
62
+ - Natural-language requirement interpretation for UI/UX work.
63
+ - Structured discovery dialogue.
64
+ - Persistent project UX brief.
65
+ - Local design-knowledge search.
66
+ - Design-system synthesis.
67
+ - Domain-specific guidance queries.
68
+ - Stack-specific implementation guidance.
69
+ - Static interface/code audit.
70
+ - Optional rendered/browser-based visual audit.
71
+ - Scoring and severity classification.
72
+ - Human-readable HTML and Markdown reports.
73
+ - Local preview server with live reload.
74
+ - Multiple named design alternatives.
75
+ - User validation state for screens/design decisions.
76
+ - Design-system persistence with global and page-level scopes.
77
+ - Machine-readable output for automation.
78
+ - Framework-aware export adapters.
79
+ - Multi-assistant installation adapters.
80
+ - Catalog versioning, validation, provenance, and freshness management.
81
+ - Security controls around local project data, tokens, preview serving, and persistence.
82
+
83
+ ## 3.2 Out of scope
84
+
85
+ - Reproducing the original source code or internal algorithms.
86
+ - Recreating original wording of proprietary or copyrighted rule text.
87
+ - Treating internal class/function/file organization as architectural requirements.
88
+ - Automatically installing operating-system software on behalf of an AI agent.
89
+ - Executing arbitrary project code as part of a static scan.
90
+ - Guaranteeing legal compatibility or licensing equivalence with the reference repositories.
91
+ - Full application business logic generation unrelated to UI/UX.
92
+
93
+ ---
94
+
95
+ # 4. Functional Requirements
96
+
97
+ ## FR-1: Intent Classification
98
+
99
+ **Required:** Given a user request, the system shall classify it into one or more of:
100
+
101
+ - new design/system direction;
102
+ - focused UX/design question;
103
+ - project audit;
104
+ - preview/iteration;
105
+ - export;
106
+ - stack-specific implementation guidance;
107
+ - installation/update/removal of assistant integration.
108
+
109
+ **Inferred:** Intent classification should be deterministic enough that equivalent requests produce the same operational mode unless additional context changes the result.
110
+
111
+ ## FR-2: Project and Stack Detection
112
+
113
+ **Observed:** The references detect common web frameworks and provide guidance across web, native mobile, and desktop stacks.
114
+
115
+ **Required:** The system shall inspect recognizable project metadata and classify the implementation stack when evidence exists.
116
+
117
+ **Required:** If stack detection is inconclusive and stack-specific guidance materially affects the answer, the system shall report uncertainty rather than silently selecting a stack.
118
+
119
+ **Implementation Choice:** Detection may be signature-based, manifest-based, AST-based, or delegated to an adapter framework.
120
+
121
+ ## FR-3: Structured Discovery
122
+
123
+ **Observed:** Reference A conducts one-question-at-a-time discovery, offers fixed choices plus free text, skips irrelevant questions, and attempts to reach a useful brief with minimal questioning.
124
+
125
+ **Required:** Discovery shall cover at minimum:
126
+
127
+ - product purpose;
128
+ - user/audience;
129
+ - principal tasks and flows;
130
+ - business or conversion goals where relevant;
131
+ - content/data characteristics;
132
+ - accessibility constraints;
133
+ - responsive/device context;
134
+ - design/style preferences;
135
+ - SEO/discoverability needs where relevant;
136
+ - technical stack and deployment constraints.
137
+
138
+ **Required:** Questions may be skipped when prior answers make them irrelevant or redundant.
139
+
140
+ **Required:** The resulting brief must clearly distinguish user-provided facts from inferred assumptions.
141
+
142
+ ## FR-4: UX Brief Persistence
143
+
144
+ **Observed:** Reference A persists a project-level Markdown brief and updates design-decision and validated-screen sections over time.
145
+
146
+ **Required:** The system shall maintain a durable project brief as a source of truth for later design, audit, preview, and export phases.
147
+
148
+ **Required:** Updates shall preserve unrelated sections.
149
+
150
+ **Inferred:** Writes should be atomic and recoverable from interruption.
151
+
152
+ ## FR-5: Design-Knowledge Search
153
+
154
+ **Observed:** Reference B exposes local search over design domains and stack-specific guidance. Search can return human-readable or JSON output, and an empty result is explicitly distinguishable from a match.
155
+
156
+ **Required:** The system shall support focused search across conceptual domains including at least:
157
+
158
+ - visual style;
159
+ - color/palette;
160
+ - typography;
161
+ - product/category patterns;
162
+ - landing/flow patterns;
163
+ - UX/accessibility guidance;
164
+ - chart/data-visualization guidance;
165
+ - icon guidance;
166
+ - animation/motion guidance;
167
+ - framework/stack-specific implementation guidance.
168
+
169
+ **Required:** Search results shall include stable identities or provenance metadata sufficient to trace why a recommendation was returned.
170
+
171
+ **Required:** A zero-match query shall be reported as zero results and must not be silently converted into fabricated catalog evidence.
172
+
173
+ ## FR-6: Design-System Generation
174
+
175
+ **Observed:** Reference B synthesizes a coherent design direction from multiple knowledge domains and returns pattern, style, colors, typography, effects, constraints, anti-patterns, and checklist-like guidance.
176
+
177
+ **Required:** For new projects/pages or system-wide visual direction, the system shall be able to produce a design-system recommendation containing:
178
+
179
+ - project/category interpretation;
180
+ - structural/pattern recommendation;
181
+ - visual-style direction;
182
+ - semantic color roles;
183
+ - typography direction;
184
+ - spacing/density guidance;
185
+ - interaction/motion guidance;
186
+ - accessibility constraints;
187
+ - component/state guidance;
188
+ - anti-patterns/avoidances;
189
+ - source/provenance information;
190
+ - assumptions and unresolved choices.
191
+
192
+ **Required:** Recommendations must be internally coherent; e.g., dark-theme intent must not be paired with a contradictory light-only palette without an explicit rationale.
193
+
194
+ ## FR-7: Adjustable Design Dials
195
+
196
+ **Observed:** Reference B exposes three user-tunable axes roughly corresponding to visual variance, motion intensity, and density.
197
+
198
+ **Required for compatibility mode:** The system shall accept bounded numeric controls for:
199
+
200
+ - design variance / conventionality;
201
+ - motion intensity;
202
+ - interface density.
203
+
204
+ **Implementation Choice:** Internally these may influence ranking, generation constraints, token values, or post-processing.
205
+
206
+ ## FR-8: Design-System Persistence
207
+
208
+ **Observed:** Reference B persists a global design-system master plus page-specific overrides. Existing global state is preserved unless explicit overwrite is requested.
209
+
210
+ **Required:** The persistence model shall support:
211
+
212
+ - one project-wide canonical design-system document;
213
+ - zero or more page/screen override documents;
214
+ - override precedence where page-specific values supersede global defaults only for that page;
215
+ - non-destructive default behavior;
216
+ - explicit authorization for overwrite/force operations.
217
+
218
+ ## FR-9: Static UX Audit
219
+
220
+ **Observed:** Reference A scans markup/project artifacts for issues such as heading hierarchy, missing alternative text, missing form labels, missing metadata, viewport issues, responsive-table problems, fixed widths, small touch targets, small text, navigation wrapping, and horizontal overflow.
221
+
222
+ **Required:** Static audit shall evaluate at minimum:
223
+
224
+ - accessibility semantics;
225
+ - form labeling and feedback;
226
+ - document structure;
227
+ - responsive-layout hazards;
228
+ - touch-target usability;
229
+ - typography legibility;
230
+ - image/media semantics;
231
+ - navigation resilience;
232
+ - basic SEO/document metadata relevant to front-end UX;
233
+ - obvious overflow and fixed-dimension hazards.
234
+
235
+ **Required:** Every finding shall include:
236
+
237
+ - severity;
238
+ - category;
239
+ - human-readable explanation;
240
+ - affected artifact/location when known;
241
+ - violated requirement or rule identity;
242
+ - suggested remediation expressed as behavior or outcome;
243
+ - confidence/evidence type.
244
+
245
+ ## FR-10: Rendered Visual Audit
246
+
247
+ **Observed:** Reference A optionally uses browser automation to capture multiple viewport sizes and identify visual problems that static analysis cannot reliably establish.
248
+
249
+ **Required:** When browser-rendered inspection is available, the system shall support visual checks for:
250
+
251
+ - viewport overflow;
252
+ - clipping;
253
+ - overlap;
254
+ - unreadable text;
255
+ - dense or undersized touch targets;
256
+ - navigation fit;
257
+ - responsive failures;
258
+ - horizontal scrolling;
259
+ - state/interaction issues observable in the rendered page.
260
+
261
+ **Required:** When browser automation is unavailable, the audit shall degrade gracefully to static analysis and explicitly state that rendered visual validation was not performed.
262
+
263
+ ## FR-11: Audit Scoring and Reports
264
+
265
+ **Observed:** Reference A produces a score out of 100, severity grouping, category breakdown, a self-contained HTML report, and natural-language fix prompts. Mobile/responsive issues receive elevated penalty weight in the tested behavior.
266
+
267
+ **Required:** The system shall produce:
268
+
269
+ - normalized overall score;
270
+ - findings grouped by severity;
271
+ - category-level summary;
272
+ - count of actionable findings;
273
+ - remediation guidance;
274
+ - evidence references and optional screenshots;
275
+ - both machine-readable and human-readable output.
276
+
277
+ **Required for Reference-A compatibility:** A self-contained HTML report shall be available and shall not depend on remote assets to render its core content.
278
+
279
+ **Implementation Choice:** The exact scoring formula may differ if the output scale and severity meaning remain documented and consistent. If strict score compatibility is required, a separate compatibility profile should freeze weights and penalties.
280
+
281
+ ## FR-12: Preview and Iteration
282
+
283
+ **Observed:** Reference A runs a local preview server, serves screen HTML and shared styling, supports server-sent live reload, and presents multiple named design variants.
284
+
285
+ **Required:** The preview subsystem shall:
286
+
287
+ - bind to a local-safe interface by default;
288
+ - select an available port without disrupting common project development ports;
289
+ - serve generated preview artifacts;
290
+ - provide a live-update mechanism;
291
+ - return explicit not-found responses for missing preview resources;
292
+ - support 2–3 meaningful variants for a screen when alternatives are requested;
293
+ - use descriptive variant names rather than numeric-only labels;
294
+ - associate each variant with rationale and applicable UX rules/constraints.
295
+
296
+ ## FR-13: Validation State
297
+
298
+ **Observed:** Screen approvals and design decisions are written back into persistent project documentation.
299
+
300
+ **Required:** A user shall be able to mark a design alternative as approved, rejected, or requiring revision.
301
+
302
+ **Required:** Approved decisions shall be durable and discoverable by later export/build steps.
303
+
304
+ ## FR-14: Export
305
+
306
+ **Observed:** Reference A exports a UX specification and can convert approved screens into multiple front-end framework formats.
307
+
308
+ **Required:** The system shall always be able to export an implementation-independent UX specification containing:
309
+
310
+ - brief;
311
+ - flows;
312
+ - validated screens;
313
+ - design-system decisions;
314
+ - accessibility requirements;
315
+ - rules/constraints applied;
316
+ - unresolved assumptions.
317
+
318
+ **Optional compatibility adapter:** It may also generate framework-specific components for supported targets. Such generation must preserve behavior and semantics rather than reproduce source code from the references.
319
+
320
+ ## FR-15: Assistant Integration Installer
321
+
322
+ **Observed:** Reference B exposes an installer capable of targeting multiple AI coding assistants, project-local or global installation, forced overwrite, update, version listing, and uninstall workflows.
323
+
324
+ **Required:** The system shall use an adapter abstraction so assistant-specific file layout and activation instructions are isolated from the core design engine.
325
+
326
+ **Required:** Installation must be idempotent where possible and must not overwrite existing user files without explicit force/overwrite authorization.
327
+
328
+ ---
329
+
330
+ # 5. Non-Functional Requirements
331
+
332
+ ## 5.1 Reliability
333
+
334
+ - **Required:** Catalog query failure must not be presented as a successful result.
335
+ - **Required:** Persistence operations must avoid partial/corrupt canonical documents.
336
+ - **Required:** Preview-server shutdown must release resources cleanly.
337
+ - **Required:** Unknown frameworks or missing optional tools must result in degraded capability, not catastrophic failure.
338
+
339
+ ## 5.2 Performance
340
+
341
+ - **Inferred target:** Typical local focused-search operations should complete interactively, ideally well under one second on a developer workstation for catalog sizes comparable to the references.
342
+ - **Inferred target:** Design-system synthesis should normally complete within a few seconds excluding external model latency.
343
+ - **Inferred target:** Static audit should scale approximately linearly with project files scanned.
344
+ - **Inferred:** Rule/catalog loading should be demand-driven rather than eagerly loading the entire knowledge base into an AI model context.
345
+
346
+ ## 5.3 Portability
347
+
348
+ - **Observed:** Reference behavior spans common desktop operating systems and many front-end/native stacks.
349
+ - **Required:** Core local search and persistence should avoid platform-specific dependencies where practical.
350
+ - **Required:** OS-specific behaviors such as opening reports or storing global integrations must be abstracted behind platform adapters.
351
+
352
+ ## 5.4 Accessibility
353
+
354
+ - **Required:** Generated design recommendations and audits must treat accessibility as a first-class constraint, including keyboard operation, focus visibility, contrast, reduced motion, touch target sizing, semantic labeling, and non-color-only meaning.
355
+
356
+ ## 5.5 Determinism and Explainability
357
+
358
+ - **Required:** Given the same catalog version, query, explicit mode, and settings, the system should provide stable result identities unless nondeterminism is explicitly documented.
359
+ - **Required:** Recommendations must be traceable to catalog entries, rules, user constraints, or clearly labeled fallback reasoning.
360
+
361
+ ## 5.6 Extensibility
362
+
363
+ - **Required:** New design domains, technology stacks, assistant adapters, audit rules, and export adapters must be addable without redesigning the entire platform.
364
+
365
+ ---
366
+
367
+ # 6. Observable Behavior
368
+
369
+ ## 6.1 Reference A observations
370
+
371
+ The following are externally meaningful behaviors evidenced by its README, skill instructions, manifests, and tests:
372
+
373
+ - A primary UX workflow has four phases: discovery, audit, preview, export.
374
+ - Discovery is adaptive and persists a Markdown brief.
375
+ - Static framework detection recognizes common web stacks and falls back to a generic/vanilla classification.
376
+ - Audit findings contain severity, rule information, source location, and natural-language remediation.
377
+ - A self-contained HTML audit report includes a score, severity groups, category summaries, finding numbering, and optional screenshot references.
378
+ - Rendered visual audit is optional and has a static-only fallback.
379
+ - Preview uses a local HTTP server with a live-reload stream and missing-resource handling.
380
+ - Screen alternatives use descriptive names.
381
+ - Export can produce Markdown specification material and framework-specific output.
382
+
383
+ ## 6.2 Reference B observations
384
+
385
+ - A local command-line search accepts a free-text query and can select a design domain or implementation stack.
386
+ - The search command provides text and JSON output modes.
387
+ - Design-system mode aggregates multiple design dimensions.
388
+ - Optional bounded dials affect variance, motion, and density.
389
+ - Persistence can create a project-level master design document and page-level override.
390
+ - Existing persisted master state is preserved by default; explicit force is required to replace it.
391
+ - Zero results are explicitly reported as zero results, with guidance to retry rather than fabricate.
392
+ - Multiple assistant environments can receive installed skill/instruction files through a CLI installer.
393
+ - The repository includes data-quality, provenance, relevance, freshness, and regression tests for catalogs.
394
+
395
+ ## 6.3 Metadata drift observation
396
+
397
+ **Observed:** Version numbers and catalog counts are not perfectly consistent across archive names, README text, manifests, and subpackages. Therefore:
398
+
399
+ - exact catalog counts are **not** treated as stable compatibility requirements;
400
+ - version metadata should be generated from one canonical release source in the clean-room design;
401
+ - capability compatibility should be defined by schema and behavior, not by hard-coded marketing counts.
402
+
403
+ ---
404
+
405
+ # 7. High-Level Architecture
406
+
407
+ ```mermaid
408
+ flowchart LR
409
+ U[User / AI Coding Assistant] --> ORCH[UX Orchestrator]
410
+ ORCH --> DISC[Discovery & Brief Service]
411
+ ORCH --> INTEL[Design Intelligence Service]
412
+ ORCH --> AUDIT[Audit Service]
413
+ ORCH --> PREV[Preview & Validation Service]
414
+ ORCH --> EXP[Specification & Export Service]
415
+
416
+ INTEL --> CAT[(Versioned Design Catalog)]
417
+ INTEL --> RULES[(UX / Accessibility Rules)]
418
+ INTEL --> STACK[Stack Guidance Adapters]
419
+
420
+ AUDIT --> STATIC[Static Inspectors]
421
+ AUDIT --> BROWSER[Optional Browser Inspection Adapter]
422
+ AUDIT --> REPORT[Report Generator]
423
+
424
+ PREV --> LOCAL[Local Preview Server]
425
+ PREV --> STATE[(Validation State)]
426
+
427
+ DISC --> PROJECT[(Project State Store)]
428
+ INTEL --> PROJECT
429
+ PREV --> PROJECT
430
+ EXP --> PROJECT
431
+
432
+ CLI[CLI / Assistant Installer] --> ORCH
433
+ CLI --> ADAPTERS[Assistant Integration Adapters]
434
+ ```
435
+
436
+ ### Architectural principle
437
+
438
+ **Required:** The AI-facing orchestration layer must consume clean contracts from deterministic local services. The model should not need to load or reason over the entire catalog at once.
439
+
440
+ ### Suggested deployment model
441
+
442
+ **Implementation Choice:** A single local CLI package may host all services in-process, or the system may split preview/browser functions into subprocesses. No network service is required for core catalog search.
443
+
444
+ ---
445
+
446
+ # 8. Component Responsibilities
447
+
448
+ ## 8.1 UX Orchestrator
449
+
450
+ - classify intent;
451
+ - inspect project context;
452
+ - choose discovery/search/audit/preview/export workflow;
453
+ - maintain phase state;
454
+ - enforce user authorization boundaries;
455
+ - combine deterministic tool output into an AI-facing context package.
456
+
457
+ ## 8.2 Discovery & Brief Service
458
+
459
+ - maintain question definitions independent of presentation;
460
+ - choose the next relevant question;
461
+ - record explicit answers and assumptions;
462
+ - render/update durable brief artifacts;
463
+ - expose current project facts to later phases.
464
+
465
+ ## 8.3 Design Intelligence Service
466
+
467
+ - normalize queries;
468
+ - route them to the appropriate domain or stack;
469
+ - rank catalog entries;
470
+ - synthesize design-system output;
471
+ - explain provenance and confidence;
472
+ - abstain on unsupported or empty matches;
473
+ - apply user-specified design dials.
474
+
475
+ **Implementation Choice:** Ranking may use lexical ranking, embeddings, rules, hybrid retrieval, or deterministic expert systems. The exact algorithm is not externally required.
476
+
477
+ ## 8.4 Catalog Manager
478
+
479
+ - load validated catalog snapshots;
480
+ - provide stable entry IDs and aliases;
481
+ - distinguish active, supplemental, deprecated, and legacy entries;
482
+ - validate referential integrity;
483
+ - record source/provenance/freshness metadata;
484
+ - support deterministic release builds.
485
+
486
+ ## 8.5 Audit Service
487
+
488
+ - discover scannable artifacts;
489
+ - run static rules;
490
+ - optionally invoke rendered/browser checks;
491
+ - normalize findings to a common schema;
492
+ - score results;
493
+ - generate HTML/Markdown/JSON reports.
494
+
495
+ ## 8.6 Preview & Validation Service
496
+
497
+ - allocate a safe local port;
498
+ - serve generated screens/assets;
499
+ - provide live reload;
500
+ - handle approval/rejection/commentary events;
501
+ - write validated decisions back to project state.
502
+
503
+ ## 8.7 Export Service
504
+
505
+ - render canonical UX specification;
506
+ - expose adapter interface for framework-specific component generation;
507
+ - preserve design tokens, semantic roles, accessibility requirements, and validated behavior.
508
+
509
+ ## 8.8 Assistant Integration Manager
510
+
511
+ - identify target assistant;
512
+ - map generic skill material to target-specific file layout;
513
+ - install project-local or global integration;
514
+ - list versions/update/uninstall;
515
+ - preserve existing files unless overwrite is explicit.
516
+
517
+ ---
518
+
519
+ # 9. Interfaces and Contracts
520
+
521
+ ## 9.1 Design Search CLI Compatibility Surface
522
+
523
+ A clean-room implementation seeking behavioral compatibility with Reference B should accept an interface equivalent to:
524
+
525
+ ```text
526
+ search <query>
527
+ [--domain <domain>]
528
+ [--stack <stack>]
529
+ [--max-results <1..20>]
530
+ [--json]
531
+ [--full]
532
+ [--design-system]
533
+ [--project-name <name>]
534
+ [--format <ascii|markdown>]
535
+ [--persist]
536
+ [--page <name>]
537
+ [--output-dir <path>]
538
+ [--force]
539
+ [--variance <1..10>]
540
+ [--motion <1..10>]
541
+ [--density <1..10>]
542
+ ```
543
+
544
+ ### Domain values observed
545
+
546
+ - style
547
+ - color
548
+ - chart
549
+ - landing
550
+ - product
551
+ - ux
552
+ - typography
553
+ - icons
554
+ - gsap/motion
555
+ - react/performance guidance
556
+ - web/native interface guidance
557
+ - google-fonts/font catalog
558
+
559
+ ### Stack values observed
560
+
561
+ - React
562
+ - Next.js
563
+ - Vue
564
+ - Svelte
565
+ - Astro
566
+ - SwiftUI
567
+ - React Native
568
+ - Flutter
569
+ - Nuxt
570
+ - Nuxt UI
571
+ - HTML + Tailwind
572
+ - shadcn/ui
573
+ - Jetpack Compose
574
+ - Three.js
575
+ - Angular
576
+ - Laravel
577
+ - JavaFX
578
+ - WPF
579
+ - WinUI
580
+ - Avalonia
581
+ - Uno Platform
582
+ - UWP
583
+
584
+ ### Validation rules
585
+
586
+ - query is required;
587
+ - maximum result count must be bounded;
588
+ - dial values must be integers in the configured range;
589
+ - unsupported domain/stack must fail with a validation error rather than silently reroute;
590
+ - `--format` is relevant to human-readable design-system output and should not corrupt JSON mode;
591
+ - persistence requires a writable destination;
592
+ - force may overwrite only the artifact explicitly governed by that flag.
593
+
594
+ ## 9.2 Search JSON Result Contract
595
+
596
+ A machine-readable design-system result should expose conceptual fields equivalent to:
597
+
598
+ ```json
599
+ {
600
+ "design_system": {
601
+ "project_name": "...",
602
+ "category": "...",
603
+ "pattern": { "...": "..." },
604
+ "style": { "...": "..." },
605
+ "colors": { "...": "..." },
606
+ "typography": { "...": "..." },
607
+ "spacing": { "...": "..." },
608
+ "effects": [],
609
+ "anti_patterns": [],
610
+ "constraints": [],
611
+ "activated_rules": [],
612
+ "source_identities": {},
613
+ "dials": {}
614
+ },
615
+ "persistence": {
616
+ "status": "not_requested|written|skipped|overwritten|error",
617
+ "paths": []
618
+ }
619
+ }
620
+ ```
621
+
622
+ **Implementation Choice:** Field names may differ in a new API, but a compatibility adapter should map them.
623
+
624
+ ## 9.3 Zero-Result Contract
625
+
626
+ **Required:** A focused search with no verified match shall produce:
627
+
628
+ - zero-result status;
629
+ - searched domain/stack;
630
+ - original query;
631
+ - no fabricated primary result;
632
+ - optional suggestions or retry guidance.
633
+
634
+ ## 9.4 UX Workflow Command Surface
635
+
636
+ Reference A exposes a main UX workflow with modes equivalent to:
637
+
638
+ ```text
639
+ ux-pilot
640
+ ux-pilot audit
641
+ ux-pilot preview
642
+ ux-pilot export
643
+ ```
644
+
645
+ A clean-room implementation may use different command names internally, but compatibility wrappers should preserve these observable modes if drop-in compatibility is a goal.
646
+
647
+ ## 9.5 Audit Finding Contract
648
+
649
+ ```text
650
+ Finding
651
+ - id: stable within report
652
+ - category
653
+ - severity: critical | high | medium | low
654
+ - message
655
+ - evidence_type: static | rendered | both
656
+ - source_location: optional file/path/route/selector
657
+ - viewport: optional
658
+ - rule_id / requirement_id
659
+ - remediation
660
+ - screenshot_reference: optional
661
+ - confidence: optional
662
+ ```
663
+
664
+ ## 9.6 Preview HTTP Contract
665
+
666
+ At minimum:
667
+
668
+ - GET screen/static resource → content or explicit 404;
669
+ - GET shared preview styling → content;
670
+ - live-update channel → push reload/change notification;
671
+ - shutdown → closes listener and watchers.
672
+
673
+ **Implementation Choice:** Live updates may use SSE, WebSocket, or another local mechanism; SSE is required only for strict Reference-A behavioral compatibility.
674
+
675
+ ## 9.7 Installer CLI Surface
676
+
677
+ Observed operations include:
678
+
679
+ - initialize/install integration for one assistant or all supported assistants;
680
+ - project-local vs global installation;
681
+ - offline/bundled asset use;
682
+ - forced overwrite;
683
+ - version listing;
684
+ - CLI/asset update;
685
+ - uninstall;
686
+ - optional GitHub token for release metadata/download access.
687
+
688
+ ---
689
+
690
+ # 10. Data Model
691
+
692
+ ## 10.1 Project
693
+
694
+ Fields/concepts:
695
+
696
+ - project identity and root;
697
+ - detected stack(s);
698
+ - user-specified product category;
699
+ - audience/context;
700
+ - brief status;
701
+ - current design system;
702
+ - validated screens;
703
+ - audit history;
704
+ - export history.
705
+
706
+ ## 10.2 UX Brief
707
+
708
+ Conceptual sections:
709
+
710
+ - goals;
711
+ - user groups;
712
+ - product/feature scope;
713
+ - primary flows;
714
+ - business/conversion context;
715
+ - content/data context;
716
+ - design preferences;
717
+ - accessibility requirements;
718
+ - responsive/device context;
719
+ - SEO/discoverability requirements;
720
+ - design decisions;
721
+ - validated screens;
722
+ - assumptions/unknowns.
723
+
724
+ ## 10.3 Catalog Entry
725
+
726
+ Common fields:
727
+
728
+ - stable ID;
729
+ - display name;
730
+ - domain;
731
+ - status;
732
+ - aliases;
733
+ - searchable terms;
734
+ - applicability constraints;
735
+ - recommendation content;
736
+ - anti-patterns;
737
+ - platform/stack applicability;
738
+ - provenance metadata;
739
+ - freshness/version metadata;
740
+ - deprecation/replacement relationship.
741
+
742
+ ## 10.4 Design System
743
+
744
+ - project/category identity;
745
+ - structural pattern;
746
+ - style family;
747
+ - semantic color tokens;
748
+ - typography roles;
749
+ - spacing/density scale;
750
+ - radius/elevation where relevant;
751
+ - interaction/motion rules;
752
+ - responsive rules;
753
+ - accessibility rules;
754
+ - component-state guidance;
755
+ - anti-patterns;
756
+ - provenance/source identities;
757
+ - page-level overrides.
758
+
759
+ ## 10.5 Screen Decision
760
+
761
+ - screen/page identifier;
762
+ - candidate variant identifier/name;
763
+ - status: proposed/approved/rejected/revise;
764
+ - rationale;
765
+ - user comments;
766
+ - applicable design-system version;
767
+ - applied rules;
768
+ - timestamp/revision.
769
+
770
+ ## 10.6 Audit Report
771
+
772
+ - project snapshot;
773
+ - framework/stack classification;
774
+ - scan mode;
775
+ - files/routes scanned;
776
+ - browser/viewport coverage;
777
+ - score;
778
+ - category scores;
779
+ - findings;
780
+ - report version;
781
+ - generated artifacts.
782
+
783
+ ---
784
+
785
+ # 11. State and Data Flows
786
+
787
+ ## 11.1 End-to-end design flow
788
+
789
+ ```mermaid
790
+ flowchart TD
791
+ A[User request] --> B{Existing brief?}
792
+ B -- no --> C[Adaptive discovery]
793
+ C --> D[Persist brief]
794
+ B -- yes --> E[Load brief]
795
+ D --> F[Detect project stack]
796
+ E --> F
797
+ F --> G[Generate or retrieve design system]
798
+ G --> H[Propose screen direction / alternatives]
799
+ H --> I[Local preview]
800
+ I --> J{User decision}
801
+ J -- revise --> H
802
+ J -- approve --> K[Persist validated screen]
803
+ K --> L[Export UX spec / implementation adapter]
804
+ ```
805
+
806
+ ## 11.2 Audit flow
807
+
808
+ ```mermaid
809
+ flowchart TD
810
+ A[Audit request] --> B[Detect project/route]
811
+ B --> C[Run static inspectors]
812
+ C --> D{Browser inspection available?}
813
+ D -- yes --> E[Render selected routes at viewports]
814
+ E --> F[Collect visual findings/screenshots]
815
+ D -- no --> G[Record visual-audit unavailable]
816
+ F --> H[Normalize findings]
817
+ G --> H
818
+ H --> I[Score and categorize]
819
+ I --> J[Generate JSON/Markdown/HTML report]
820
+ ```
821
+
822
+ ## 11.3 Persisted design-system state
823
+
824
+ ```mermaid
825
+ stateDiagram-v2
826
+ [*] --> Absent
827
+ Absent --> MasterCreated: persist
828
+ MasterCreated --> MasterUnchanged: persist without force
829
+ MasterCreated --> MasterReplaced: force overwrite
830
+ MasterCreated --> PageOverrideCreated: persist with page
831
+ PageOverrideCreated --> PageOverrideUnchanged: page exists, no force
832
+ PageOverrideCreated --> PageOverrideReplaced: authorized overwrite
833
+ ```
834
+
835
+ ---
836
+
837
+ # 12. Error Handling
838
+
839
+ ## 12.1 Search errors
840
+
841
+ - Empty or invalid query → validation error.
842
+ - Unsupported domain/stack → validation error naming allowed values.
843
+ - No catalog match → successful query with zero-match status, not an exception.
844
+ - Catalog read/parse failure → error; do not return partial data as if verified.
845
+ - Stale/deprecated-only match → either abstain or return with explicit legacy/deprecation status depending on query intent.
846
+
847
+ ## 12.2 Persistence errors
848
+
849
+ - Destination not writable → non-destructive failure.
850
+ - Existing master without force → skipped, not overwritten.
851
+ - Concurrent writers → one writer succeeds; others receive conflict/skip status.
852
+ - Interrupted write → prior complete artifact remains intact.
853
+ - Path escaping requested output root → reject.
854
+
855
+ ## 12.3 Audit errors
856
+
857
+ - Unsupported project framework → generic scan mode.
858
+ - Browser automation unavailable → static-only mode plus report note.
859
+ - Route fails to render → finding/report warning for that route; continue other routes where safe.
860
+ - Unparseable source artifact → skip with diagnostic; do not execute it.
861
+
862
+ ## 12.4 Preview errors
863
+
864
+ - Preferred port in use → select another allowed local port.
865
+ - Missing preview file → HTTP 404.
866
+ - Watcher failure → preview remains readable; live reload degrades with warning.
867
+ - Bind to non-local interface requires explicit opt-in.
868
+
869
+ ## 12.5 Installer errors
870
+
871
+ - Target assistant unknown → list supported targets.
872
+ - Destination already populated → preserve unless force specified.
873
+ - Remote rate limit → explain token/offline options without exposing secrets.
874
+ - Update fails → keep prior installed integration intact.
875
+
876
+ ---
877
+
878
+ # 13. Security Model
879
+
880
+ ## 13.1 Trust boundaries
881
+
882
+ Trust zones:
883
+
884
+ 1. user/agent request;
885
+ 2. local project files, treated as untrusted input;
886
+ 3. validated local design catalog;
887
+ 4. optional browser runtime;
888
+ 5. local preview server;
889
+ 6. optional network updater/release source.
890
+
891
+ ## 13.2 Project-data protection
892
+
893
+ **Required:** Core catalog search should operate locally and should not require sending project source or private identifiers to external services.
894
+
895
+ **Required:** If an AI model or external generation service is used, the integration must define exactly what project data is transmitted and obtain appropriate user authorization.
896
+
897
+ ## 13.3 Static-scan safety
898
+
899
+ - Parse project files as data.
900
+ - Do not execute discovered scripts during static scanning.
901
+ - If a dev server must be launched for rendered audit, do so only through an explicit project command or user-approved adapter.
902
+
903
+ ## 13.4 Preview-server safety
904
+
905
+ - Bind to loopback by default.
906
+ - Prevent directory traversal.
907
+ - Serve only configured preview roots.
908
+ - Escape user/project-derived text in generated HTML reports.
909
+ - Do not expose secrets or arbitrary project files.
910
+
911
+ ## 13.5 Token management
912
+
913
+ For optional remote release/update access:
914
+
915
+ - accept tokens through environment variables or ephemeral CLI input;
916
+ - never write them into generated skill files;
917
+ - redact tokens from logs/errors;
918
+ - prefer narrowly scoped or no-scope tokens for public-release access.
919
+
920
+ ## 13.6 Persistence integrity
921
+
922
+ - canonicalize output paths;
923
+ - reject writes outside allowed project/global integration roots;
924
+ - use atomic replace for canonical files;
925
+ - require explicit overwrite authorization;
926
+ - optionally maintain checksums/revision metadata.
927
+
928
+ ## 13.7 Catalog supply-chain security
929
+
930
+ - validate schema before release;
931
+ - track provenance and source version;
932
+ - prevent malformed aliases/duplicate stable IDs;
933
+ - distinguish active vs deprecated entries;
934
+ - verify bundled CLI assets match source catalog release.
935
+
936
+ ---
937
+
938
+ # 14. Configuration
939
+
940
+ Configuration should be layered:
941
+
942
+ 1. command-line arguments;
943
+ 2. project-local configuration;
944
+ 3. user/global configuration;
945
+ 4. safe defaults.
946
+
947
+ Configurable areas:
948
+
949
+ - design-search domain;
950
+ - result count;
951
+ - stack override;
952
+ - design dials;
953
+ - persistence root;
954
+ - report output location;
955
+ - browser-audit enablement;
956
+ - audit viewport set;
957
+ - preview preferred port/range;
958
+ - catalog version;
959
+ - assistant installation target;
960
+ - project-local/global integration mode;
961
+ - update source/token variable names.
962
+
963
+ **Required:** Configuration must never silently override explicit user instructions.
964
+
965
+ ---
966
+
967
+ # 15. External Dependencies and Integrations
968
+
969
+ ## 15.1 Core local runtime
970
+
971
+ **Observed:** One reference uses TypeScript with a JavaScript runtime; another uses Python standard-library tooling for local search and TypeScript for CLI installation.
972
+
973
+ **Implementation Choice:** A clean-room implementation may use one runtime or multiple runtimes. Runtime selection is not a compatibility requirement as long as command behavior and file outputs are preserved.
974
+
975
+ ## 15.2 Browser automation
976
+
977
+ Optional integration with a browser automation provider is required for rendered visual auditing. It must support:
978
+
979
+ - navigation/open local file;
980
+ - viewport resizing;
981
+ - screenshot capture;
982
+ - optional DOM/console inspection.
983
+
984
+ ## 15.3 AI coding assistants
985
+
986
+ Assistant adapters may target environments such as Claude Code, Cursor, Windsurf, GitHub Copilot, Kiro, Gemini CLI, Codex-style agents, Roo-like agents, Continue-like tools, and a generic/universal agent-skill layout.
987
+
988
+ **Required:** The core design engine must not depend on any one assistant’s file layout.
989
+
990
+ ## 15.4 Network release/update sources
991
+
992
+ Optional updater functionality may interact with a public source-control release API and/or package registry. This is separate from the local design-search runtime.
993
+
994
+ ---
995
+
996
+ # 16. Performance and Scalability
997
+
998
+ ## 16.1 Catalog search
999
+
1000
+ - Index catalog data once per version where practical.
1001
+ - Rebuild cache/index when catalog content changes.
1002
+ - Avoid reloading large datasets into an LLM context.
1003
+ - Support hundreds to thousands of catalog entries without noticeable interactive delay.
1004
+
1005
+ ## 16.2 Auditing
1006
+
1007
+ - Parallelize independent static inspections when safe.
1008
+ - Bound browser concurrency to avoid resource exhaustion.
1009
+ - Allow route sampling for large applications.
1010
+ - Cache unchanged-file scan results for incremental audits as an optional enhancement.
1011
+
1012
+ ## 16.3 Preview
1013
+
1014
+ - Initial preview should become available without requiring a production build.
1015
+ - Live-reload notification should be lightweight.
1016
+ - Preview rendering should remain independent of the main application’s production server where possible.
1017
+
1018
+ ## 16.4 Persistence
1019
+
1020
+ - Project state is small and human-readable; prioritize reliability and mergeability over database complexity.
1021
+ - For team/enterprise scale, a structured store may be added behind the same logical model.
1022
+
1023
+ ---
1024
+
1025
+ # 17. Testing Strategy
1026
+
1027
+ ## 17.1 Unit-level behavior
1028
+
1029
+ Test:
1030
+
1031
+ - query validation and routing;
1032
+ - zero-result semantics;
1033
+ - alias resolution;
1034
+ - active/deprecated catalog behavior;
1035
+ - design-dial bounds;
1036
+ - project stack detection;
1037
+ - discovery skip rules;
1038
+ - brief update preservation;
1039
+ - finding normalization;
1040
+ - score calculation;
1041
+ - port selection;
1042
+ - path canonicalization;
1043
+ - persistence non-overwrite semantics.
1044
+
1045
+ ## 17.2 Catalog contract tests
1046
+
1047
+ Validate:
1048
+
1049
+ - unique stable IDs;
1050
+ - deterministic alias ownership;
1051
+ - referential integrity between product, style, palette, pattern, and stack records;
1052
+ - known enum values;
1053
+ - freshness/provenance shape;
1054
+ - no duplicate or malformed semantic roles;
1055
+ - current vs legacy guidance separation;
1056
+ - font/icon source consistency where applicable.
1057
+
1058
+ ## 17.3 Search relevance tests
1059
+
1060
+ Maintain a locked evaluation set with:
1061
+
1062
+ - positive queries;
1063
+ - hard-negative queries that should abstain;
1064
+ - ambiguous queries;
1065
+ - typo queries;
1066
+ - legacy-version queries;
1067
+ - product-category exact matches;
1068
+ - accessibility-outcome queries.
1069
+
1070
+ Measure precision at K, reciprocal rank, and graded ranking quality or equivalent metrics.
1071
+
1072
+ ## 17.4 Discovery tests
1073
+
1074
+ - starts with a valid first question;
1075
+ - advances after an answer;
1076
+ - skips irrelevant questions;
1077
+ - terminates when complete;
1078
+ - preserves all collected answers;
1079
+ - produces a brief containing required conceptual sections.
1080
+
1081
+ ## 17.5 Audit contract tests
1082
+
1083
+ - missing alternative text detected;
1084
+ - missing labels detected;
1085
+ - document hierarchy issue detected;
1086
+ - responsive overflow hazards detected;
1087
+ - small touch targets detected;
1088
+ - small text detected;
1089
+ - clean fixture returns no false critical findings;
1090
+ - each finding contains remediation;
1091
+ - HTML report escapes untrusted strings;
1092
+ - screenshots render only when references exist;
1093
+ - browser-unavailable mode produces explicit fallback note.
1094
+
1095
+ ## 17.6 Preview tests
1096
+
1097
+ - binds a local port;
1098
+ - chooses an alternate port on collision;
1099
+ - serves screen resource;
1100
+ - serves shared styling;
1101
+ - live-update channel connects;
1102
+ - missing resource returns 404;
1103
+ - stop releases port;
1104
+ - generated preview opens without console errors in supported browser baseline.
1105
+
1106
+ ## 17.7 Persistence concurrency tests
1107
+
1108
+ - first writer creates canonical master;
1109
+ - second non-force writer does not overwrite;
1110
+ - explicit force replaces only target artifact;
1111
+ - simultaneous writes do not corrupt content;
1112
+ - page override does not mutate master unless explicitly intended.
1113
+
1114
+ ## 17.8 Installer tests
1115
+
1116
+ For each assistant adapter:
1117
+
1118
+ - correct project-local destination;
1119
+ - correct global destination;
1120
+ - activation guidance is accurate;
1121
+ - install is idempotent;
1122
+ - force behavior is explicit;
1123
+ - uninstall removes only managed files;
1124
+ - update preserves unrelated user files;
1125
+ - bundled asset version matches reported release version.
1126
+
1127
+ ## 17.9 Security tests
1128
+
1129
+ - path traversal attempts rejected;
1130
+ - HTML injection in finding text escaped;
1131
+ - secret token redaction;
1132
+ - preview server not externally bound by default;
1133
+ - static audit does not execute project scripts;
1134
+ - malformed catalog fails closed.
1135
+
1136
+ ---
1137
+
1138
+ # 18. Deployment and Operations
1139
+
1140
+ ## 18.1 Packaging
1141
+
1142
+ The platform may be distributed as:
1143
+
1144
+ - a CLI package;
1145
+ - a plugin/skill bundle;
1146
+ - a standalone local application;
1147
+ - or a combination of these with shared catalog assets.
1148
+
1149
+ ## 18.2 Versioning
1150
+
1151
+ **Required:** Use one canonical release version source and generate all manifests from it.
1152
+
1153
+ Catalog schema version and catalog content version should be independently identifiable from CLI version.
1154
+
1155
+ ## 18.3 Upgrades
1156
+
1157
+ - Upgrades must not silently overwrite user-maintained project design state.
1158
+ - Assistant integration templates may be regenerated only with documented overwrite behavior.
1159
+ - Catalog migrations must validate schema before activation.
1160
+ - Deprecated entries should preserve stable replacement mapping when possible.
1161
+
1162
+ ## 18.4 Observability
1163
+
1164
+ Local logs should include:
1165
+
1166
+ - selected workflow mode;
1167
+ - catalog version;
1168
+ - detected stack/confidence;
1169
+ - files/routes scanned count;
1170
+ - browser audit availability;
1171
+ - persistence result;
1172
+ - installer target/result.
1173
+
1174
+ Logs must not include secrets or unnecessary private project content.
1175
+
1176
+ ---
1177
+
1178
+ # 19. Architectural Constraints
1179
+
1180
+ 1. **Behavior over implementation:** Compatibility is defined by output and interaction contracts, not original algorithms.
1181
+ 2. **Local-first intelligence:** Core design search should work offline from bundled/installed data.
1182
+ 3. **Demand-driven context:** Only relevant rules/catalog material should be surfaced to the model for a given task.
1183
+ 4. **Non-destructive persistence:** Existing user decisions are preserved by default.
1184
+ 5. **Optional visual enhancement:** Rendered audit improves quality but cannot be a hard dependency for static audit.
1185
+ 6. **Adapter boundaries:** Assistant integrations and framework-specific exports must remain modular.
1186
+ 7. **Explicit abstention:** The system must distinguish “no verified match” from “fallback recommendation.”
1187
+ 8. **Human-readable source of truth:** Project brief and design-system state should remain inspectable without specialized tooling.
1188
+
1189
+ ---
1190
+
1191
+ # 20. Assumptions and Unknowns
1192
+
1193
+ ## 20.1 Exact catalog counts
1194
+
1195
+ **Observed conflict:** Catalog counts vary across README text, manifests, and archive snapshots. Exact counts are therefore not reliable external invariants.
1196
+
1197
+ **Decision:** Treat counts as release metadata, not API requirements.
1198
+
1199
+ ## 20.2 Version identifiers
1200
+
1201
+ **Observed conflict:** Archive naming, plugin manifests, skill manifests, package versions, and “what’s new” text are not perfectly synchronized.
1202
+
1203
+ **Decision:** The clean-room implementation must centralize release versioning.
1204
+
1205
+ ## 20.3 Licensing metadata
1206
+
1207
+ **Observed:** Top-level repository metadata in the larger reference indicates one license, while at least one CLI-facing document states a different license.
1208
+
1209
+ **Unknown:** Which license governs every bundled subartifact.
1210
+
1211
+ **Decision:** No licensing conclusion is incorporated into the technical design. Independent legal/license review is required before reusing any reference assets or text. The clean-room implementation should create its own original catalog content or use appropriately licensed sources.
1212
+
1213
+ ## 20.4 Exact audit-score formula
1214
+
1215
+ The score is externally visible, but the exact internal weighting is only partly inferable from tests and documentation.
1216
+
1217
+ **Decision:** Define a documented scoring model. Provide a compatibility profile only if exact numerical matching becomes a formal requirement.
1218
+
1219
+ ## 20.5 Exact search-ranking algorithm
1220
+
1221
+ A lexical ranking approach is referenced, but it is not necessary to reproduce it.
1222
+
1223
+ **Decision:** Preserve deterministic ranking quality, traceability, and abstention semantics; algorithm is an implementation choice.
1224
+
1225
+ ## 20.6 Optional broad design skills
1226
+
1227
+ The larger archive contains skills beyond core UI/UX intelligence.
1228
+
1229
+ **Unknown:** Whether these are intended as public baseline features for the same product tier.
1230
+
1231
+ **Decision:** Treat them as extension modules unless explicitly required.
1232
+
1233
+ ---
1234
+
1235
+ # 21. Alternative Implementation Strategies
1236
+
1237
+ ## Strategy A: Single-runtime monolith
1238
+
1239
+ A TypeScript or Python CLI contains discovery, search, audit, preview, persistence, and installer adapters.
1240
+
1241
+ **Advantages:** Simple packaging, one process model, easier cross-platform distribution.
1242
+ **Trade-offs:** Browser tooling and data-science/search libraries may complicate dependency management.
1243
+
1244
+ ## Strategy B: Deterministic core + thin agent adapters
1245
+
1246
+ A standalone local core exposes JSON commands or a local RPC interface. Each AI assistant receives only a small instruction/adapter layer.
1247
+
1248
+ **Advantages:** Strong separation, easy multi-agent support, consistent behavior.
1249
+ **Trade-offs:** More packaging/version coordination.
1250
+
1251
+ ## Strategy C: Library-first architecture
1252
+
1253
+ Core services are libraries with separate CLIs for search, UX workflow, audit, and installer.
1254
+
1255
+ **Advantages:** Highly testable and composable.
1256
+ **Trade-offs:** More public interfaces to version.
1257
+
1258
+ ## Strategy D: Hybrid retrieval engine
1259
+
1260
+ Use lexical ranking for deterministic identity matching plus embeddings/rules for semantic expansion.
1261
+
1262
+ **Advantages:** Better natural-language retrieval.
1263
+ **Trade-offs:** More complexity; must preserve reproducibility and zero-result semantics.
1264
+
1265
+ ## Strategy E: Rule engine for design-system synthesis
1266
+
1267
+ Represent applicability and constraints in declarative data rather than procedural code.
1268
+
1269
+ **Advantages:** Auditable, data-driven, easy catalog maintenance.
1270
+ **Trade-offs:** Requires strict schema governance and conflict resolution.
1271
+
1272
+ ---
1273
+
1274
+ # 22. Clean-Room Implementation Guidance
1275
+
1276
+ ## 22.1 Build from contracts, not source structure
1277
+
1278
+ An independent team should begin with the public behaviors defined in Sections 4, 6, 9, and 23. Do not copy internal filenames, class names, function names, source layout, or exact rule phrasing from the references unless a name is itself an external protocol/command that compatibility requires.
1279
+
1280
+ ## 22.2 Recreate design knowledge independently
1281
+
1282
+ The catalog should be authored from independent sources such as:
1283
+
1284
+ - public accessibility standards;
1285
+ - official framework/platform documentation;
1286
+ - independently authored UX heuristics;
1287
+ - public typography/color metadata with appropriate licensing;
1288
+ - original product-category reasoning rules.
1289
+
1290
+ Avoid copying large descriptive passages from the reference datasets.
1291
+
1292
+ ## 22.3 Treat compatibility surfaces explicitly
1293
+
1294
+ Create a compatibility layer for:
1295
+
1296
+ - command names and flags;
1297
+ - output JSON mapping;
1298
+ - persisted artifact layout where necessary;
1299
+ - assistant-specific installation locations;
1300
+ - preview/report behavior.
1301
+
1302
+ Keep the core implementation free to evolve behind those adapters.
1303
+
1304
+ ## 22.4 Prefer semantic output
1305
+
1306
+ Recommendations should say what the UI must accomplish:
1307
+
1308
+ - “interactive targets must remain comfortably operable on touch devices”;
1309
+ - “focus must remain visible”;
1310
+ - “page-specific decisions override global defaults only for that page”;
1311
+
1312
+ rather than prescribing the original repository’s exact code patterns.
1313
+
1314
+ ## 22.5 Make abstention a feature
1315
+
1316
+ If a design query has no verified catalog match, return no match and give a labeled fallback. This is materially safer than forcing a superficially relevant result.
1317
+
1318
+ ## 22.6 Preserve user decisions
1319
+
1320
+ The project brief and design system are user-owned state. Regeneration must never silently erase them.
1321
+
1322
+ ---
1323
+
1324
+ # 23. Acceptance Criteria
1325
+
1326
+ An independent implementation satisfies this specification when the following are true.
1327
+
1328
+ ## A. Discovery and state
1329
+
1330
+ - [ ] A new UX request can enter adaptive discovery.
1331
+ - [ ] Discovery asks one focused question at a time in compatibility mode.
1332
+ - [ ] Irrelevant questions can be skipped based on known answers.
1333
+ - [ ] A persistent project brief is generated.
1334
+ - [ ] Later design decisions can update the brief without deleting unrelated content.
1335
+
1336
+ ## B. Design intelligence
1337
+
1338
+ - [ ] Focused local queries can target design domains.
1339
+ - [ ] Stack-specific implementation guidance can be requested separately.
1340
+ - [ ] A new-project/page request can generate one coherent design-system object.
1341
+ - [ ] Design-system output includes pattern, style, semantic colors, typography, spacing/density, motion, accessibility constraints, anti-patterns, and provenance.
1342
+ - [ ] Variance, motion, and density inputs are validated in a bounded range.
1343
+ - [ ] Zero-result queries return explicit zero-match status and do not fabricate evidence.
1344
+
1345
+ ## C. Persistence
1346
+
1347
+ - [ ] A project-wide design master can be persisted.
1348
+ - [ ] Page-specific overrides can be persisted separately.
1349
+ - [ ] Existing master state is not replaced by default.
1350
+ - [ ] Explicit overwrite is required for destructive replacement.
1351
+ - [ ] Concurrent persistence does not corrupt artifacts.
1352
+
1353
+ ## D. Audit
1354
+
1355
+ - [ ] Static audit identifies representative accessibility, form, metadata, responsive-layout, touch-target, typography, and overflow problems.
1356
+ - [ ] Each finding contains severity, location/evidence, rule identity, and remediation.
1357
+ - [ ] Browser-rendered audit can add viewport-specific findings when available.
1358
+ - [ ] Missing browser tooling results in a clear static-only fallback notice.
1359
+ - [ ] A normalized score and category breakdown are produced.
1360
+ - [ ] A self-contained HTML report can be generated.
1361
+
1362
+ ## E. Preview and validation
1363
+
1364
+ - [ ] A local preview can start on an available safe port.
1365
+ - [ ] Missing preview resources return 404.
1366
+ - [ ] Preview updates can propagate without manual restart.
1367
+ - [ ] Multiple meaningful named variants can be shown.
1368
+ - [ ] Approval/rejection/revision state is persisted.
1369
+
1370
+ ## F. Export
1371
+
1372
+ - [ ] A complete implementation-independent UX specification can be exported.
1373
+ - [ ] Validated screens and design decisions appear in the export.
1374
+ - [ ] At least one framework adapter can demonstrate implementation-specific export without depending on the original source code.
1375
+
1376
+ ## G. Agent integration
1377
+
1378
+ - [ ] The installer can target at least one project-local and one global assistant integration path.
1379
+ - [ ] Adapter architecture supports adding further assistant targets.
1380
+ - [ ] Existing user files are preserved unless force is explicit.
1381
+ - [ ] Update/uninstall operates only on managed integration artifacts.
1382
+
1383
+ ## H. Security and governance
1384
+
1385
+ - [ ] Core catalog search works without transmitting project data externally.
1386
+ - [ ] Preview binds to localhost by default.
1387
+ - [ ] Path traversal is rejected.
1388
+ - [ ] Secrets are redacted from logs.
1389
+ - [ ] Catalog schema/provenance validation runs before release.
1390
+ - [ ] Release version metadata is generated from one canonical version source.
1391
+
1392
+ ---
1393
+
1394
+ # Appendix A. Compatibility-Oriented Traceability Matrix
1395
+
1396
+ | Observable capability | Clean-room requirement |
1397
+ |---|---|
1398
+ | Four-phase UX workflow | Discovery, Audit, Preview, Export orchestration |
1399
+ | Persistent UX brief | Project state + non-destructive brief updater |
1400
+ | Framework detection | Stack detector with generic fallback |
1401
+ | Static UX checks | Rule-based static audit service |
1402
+ | Optional screenshots | Browser audit adapter with graceful fallback |
1403
+ | Scored HTML report | Report normalizer + self-contained HTML renderer |
1404
+ | Multiple named variants | Preview candidate model with descriptive names |
1405
+ | Live reload | Local update channel |
1406
+ | UX spec export | Canonical implementation-independent exporter |
1407
+ | Local design search | Domain-aware catalog search service |
1408
+ | Design-system generation | Multi-domain synthesis service |
1409
+ | Master + page overrides | Hierarchical design-state persistence |
1410
+ | Zero-result abstention | Explicit no-match contract |
1411
+ | Stack-specific guidance | Stack adapter/catalog layer |
1412
+ | Multi-agent installation | Assistant integration adapter layer |
1413
+ | Catalog relevance/freshness tests | Data governance and evaluation suite |
1414
+
1415
+ ---
1416
+
1417
+ # Appendix B. Clean-Room Review Checklist
1418
+
1419
+ Before implementation or release, verify:
1420
+
1421
+ - [ ] No original source code has been copied or translated.
1422
+ - [ ] Internal names are used only when they are externally visible compatibility surfaces.
1423
+ - [ ] Rule prose is independently authored.
1424
+ - [ ] Search/reasoning algorithms are independently designed.
1425
+ - [ ] Catalog data has independent provenance and license review.
1426
+ - [ ] Exact marketing counts are not hard-coded as protocol requirements.
1427
+ - [ ] Version metadata comes from one canonical source.
1428
+ - [ ] Behavioral compatibility tests verify outputs, states, and errors rather than internal structure.
1429
+ - [ ] User-owned persisted state is non-destructive by default.
1430
+ - [ ] Zero-result and fallback behavior remain explicit.
1431
+ - [ ] Accessibility, security, and local-data protections are regression-tested.