@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
package/SKILL.md ADDED
@@ -0,0 +1,698 @@
1
+ ---
2
+ name: ztothez-design-engineering
3
+ description: Design, implement, audit, or refactor production UI/UX systems with architecture evaluation, semantic tokens, accessible components, workspaces, dashboards, brand systems, Figma libraries, assets, icons, and presentations. Use when user asks to "design a new dashboard", "generate frontend UI", "build a design system", "create a brand identity", "generate visual assets", "design an icon system", "create presentation slides", "review UI architecture", or "improve UX". Apply to Claude Code, Cursor, Windsurf, Antigravity, GitHub Copilot, Kiro, Codex, Qoder, and Lovable workflows.
4
+ ---
5
+
6
+ # ZtotheZ Design Engineering System
7
+
8
+ Use ZtotheZ Design Engineering to create task-centered interfaces whose visual system, component boundaries, runtime behavior, and evidence are explicit enough to implement and evaluate. Preserve the user's stack, product constraints, and existing design language unless the user requests a redesign.
9
+
10
+ ## Operating Rules
11
+
12
+ 1. Inspect the repository, current UI, framework, routes, shared components, tokens, tests, and build commands before proposing changes.
13
+ 2. Identify the requested mode: new interface, focused feature, redesign, design-system work, AI workspace, operational dashboard, architecture review, or UX audit.
14
+ 3. Determine the primary user, their highest-frequency task, data sensitivity, deployment context, supported devices, and consequential actions. Infer only low-risk details; surface assumptions that affect architecture or behavior.
15
+ 4. Put the working task surface before promotional content. Optimize for clear action, state visibility, recovery, and evidence before decoration.
16
+ 5. Reuse established project conventions where they are coherent. Introduce a new abstraction only when it removes demonstrated duplication, isolates a likely change, or creates a required variation point.
17
+ 6. Work iteratively. Implement the smallest coherent slice, verify behavior, and refactor without changing observable behavior before expanding the surface.
18
+ 7. Never present a mock interaction as implemented. Distinguish verified behavior, proposed behavior, and untested assumptions.
19
+
20
+ ## Knowledge Retrieval Workflow
21
+
22
+ ### Step 1: Search The Approved Scope
23
+
24
+ Use `search_design_knowledge` when the task needs guidance beyond this skill. Write a specific query containing the design problem, relevant quality attribute, and product context. Restrict `categories` when the task clearly belongs to architecture, design intelligence, Figma and design systems, UX patterns, or usability evaluation.
25
+
26
+ The search result must include ranked repository-relative source paths, section excerpts, confidence, and matched terms. Treat `SKILL.md` results as authoritative and other indexed files as approved supporting guidance.
27
+
28
+ ### Step 2: Inspect Exact Sources
29
+
30
+ Read the highest-value result through its category-specific MCP tool before applying detailed rules. Load only the files needed to resolve the task. Do not treat a search excerpt as a complete specification when the surrounding section contains constraints, exceptions, or validation requirements.
31
+
32
+ ### Step 3: Handle No-Match Results
33
+
34
+ When retrieval returns `no-match`, refine the query or broaden only the approved categories. If no approved source matches, state the knowledge gap and proceed from current product requirements, repository evidence, public standards, or official platform documentation as appropriate. Never fill the gap from legacy archives, ignored local research, or a third-party design product.
35
+
36
+ Do not let supporting retrieval override current repository behavior, product contracts, user requirements, or this root skill. Cite the repository-relative paths that materially affected a recommendation or implementation.
37
+
38
+ ## Portfolio Benchmark Safety
39
+
40
+ Use the portfolio workflow only when the user asks to benchmark, inventory, or evaluate multiple local products. The local registry is authorization metadata, not design guidance and not permission to modify a project.
41
+
42
+ 1. Validate the local registry before inspecting a registered project. Reject unknown ownership, disabled projects, duplicate or nested canonical roots, path escapes, and unsafe publication policy.
43
+ 2. Use inventory only to discover manifest-bearing candidates. Discovery does not authorize execution, publication, retrieval indexing, or source reuse.
44
+ 3. Treat every registered source as read-only. Never install, build, test, format, migrate, serve, or clean from the original project directory.
45
+ 4. Create a disposable portfolio snapshot before any operation that can write. Exclude secrets, user data, dependency trees, generated output, models, backups, and escaping symlinks.
46
+ 5. Run project processes only through the isolated snapshot process boundary. Deny network access unless the registry explicitly permits dependency installation, pass only allowlisted environment values, and keep package lifecycle scripts disabled unless reviewed.
47
+ 6. Compare the original source manifest and scoped Git status after copying, after each executable stage, and before cleanup. Treat any difference as a failed run and never repair or revert the original automatically.
48
+ 7. Store local snapshots and evidence only under ignored benchmark directories. Do not add project source, private screenshots, absolute paths, client content, or local reports to knowledge retrieval, MCP exact reads, Git, package output, or offline releases.
49
+ 8. Produce advisory findings only. Apply remediation to an original project only after a separate explicit user request.
50
+
51
+ Use `zz-design portfolio validate-registry`, `zz-design portfolio inventory`, and `zz-design portfolio snapshot --project ID`. Read `knowledge-base/benchmarks/portfolio-corpus/registry.template.yaml` only when creating or revising registry policy.
52
+
53
+ ## V2 Interface Generation Workflow
54
+
55
+ Use this bounded workflow for a new interface or consequential redesign. First validate a version 1.0 product design brief. Then load `interface-trust.md`, `information-design.md`, and `visual-polish.md` only when their routing conditions apply, and record the nine downstream stages in a version `2.1` design-deliverable manifest.
56
+
57
+ 1. **Product task:** validate the version 1.1 product contract, archetype, activated quality dimensions, primary user, observable start and success states, recovery path, and consequential actions. For browser products, bind the task to an existing journey, route, and viewport no wider than 768 CSS pixels. Keep missing evidence `unverified`, executed failure `failed`, and unsupported capability a `limitation`.
58
+ 2. **Truth and data-source contract:** declare demo, live, fallback, stale, and disconnected behavior. Run the trust validator before implementation.
59
+ 3. **Information architecture:** bind every metric, finding, chart, and hierarchy level to a decision. Run the information validator before implementation.
60
+ 4. **Interaction and state model:** define loading, empty, success, warning, error, partial, disabled, selected, and focus behavior.
61
+ 5. **Visual direction:** define domain fit, typography, composition, density, motion, chart treatment, and prohibited ornament.
62
+ 6. **Token architecture:** bind implementation values through primitive, semantic, and component tokens.
63
+ 7. **Implementation:** build the smallest coherent task path using the declared contracts.
64
+ 8. **Automated verification:** run contract, architecture, browser, retrieval, and package checks that match the changed surface.
65
+ 9. **Human visual review:** request attributable review of rendered hierarchy, balance, scanability, density, and domain fit.
66
+
67
+ Do not advance a stage from `declared`, `required`, or `review-required` without the evidence that stage specifies. A passing declaration is not rendered proof. Automated or AI-assisted evidence can never complete the human-review stage or establish representative-user validation.
68
+
69
+ ## Product Design Brief Workflow
70
+
71
+ Use this workflow before generating a new product, dashboard, workspace, consequential redesign, or
72
+ primary task path. Read `knowledge-base/design-intelligence/product-design-brief.md` and start from
73
+ `product-design-brief.template.yaml`.
74
+
75
+ 1. Record user-provided, stakeholder, research, analytics, existing-product, technical, standards,
76
+ and agent-assumption evidence as distinct source classes.
77
+ 2. Ground the product problem and every primary audience in evidence other than an agent assumption.
78
+ Do not invent personas, market demand, expertise, accessibility needs, or operating context.
79
+ 3. Define included and excluded scope, measurable outcomes, primary tasks, success signals, failure
80
+ impact, and recovery. Resolve contradictory scope before planning.
81
+ 4. Classify data as live, demo, hybrid, imported, cached, user input, or local static. Declare
82
+ latency, sensitivity, freshness, fallback, limitations, and origin-preserving disclosure.
83
+ 5. Derive applicable loading, empty, success, error, partial, stale, disconnected, unauthorized,
84
+ blocked, or offline states from the actual task and data model.
85
+ 6. Declare platforms, maintained viewports, input modes, constraints, and prioritized requirements.
86
+ Keep unresolved high-risk assumptions blocking and medium-risk assumptions visible.
87
+ 7. Bind every must-have requirement and every task to an observable acceptance criterion. A human
88
+ verification method is a requirement for future evidence, not an attestation.
89
+ 8. Run `validate_product_design_brief` or `npm run validate-brief -- --brief PATH`. Proceed to design
90
+ planning only when `generationReady` is true. Continue to require downstream architecture,
91
+ trust, information, design, implementation, browser, and release evidence.
92
+
93
+ ## Design Plan Compilation Workflow
94
+
95
+ Use this workflow after brief validation and before generating production UI. Read
96
+ `knowledge-base/design-intelligence/design-plan.md`.
97
+
98
+ 1. Run `compile_design_plan` or `zz-design compile-plan --brief PATH --project-root ROOT --json`.
99
+ 2. Inspect every decision, route, boundary, state owner, contract result, token role, responsive
100
+ rule, asset requirement, stage, verification obligation, and trace reference.
101
+ 3. Treat `blocked` as a stop. Treat `provisional` as permission to author or confirm the named
102
+ downstream contracts, not as permission to invent them. Target-route mapping remains an adapter
103
+ responsibility in the implementation stage.
104
+ 4. Require declared existing product-task, interface-trust, information-design, and
105
+ design-deliverable contracts to pass their maintained validators inside the allowed root.
106
+ 5. Recompile after evidence changes. The same brief and compiler version must produce the same
107
+ artifact. Do not edit generated decisions to hide blockers; change the source evidence instead.
108
+ 6. Begin implementation only when `implementationReady` is true. Planning readiness and a valid
109
+ schema do not prove rendered, runtime, usability, human-review, or release readiness.
110
+
111
+ ## Contained React Generation Workflow
112
+
113
+ Use this workflow only for a new independent React and TypeScript fixture after design-plan
114
+ compilation. Read `knowledge-base/design-intelligence/generation-adapter.md`.
115
+
116
+ 1. Require a plan with `status: ready` and `implementationReady: true`. Never change readiness
117
+ fields manually or generate from a blocked or provisional plan.
118
+ 2. Use only `zz-design generate-react`. Provide a pre-existing generation root, an absent child
119
+ output path, and the local portfolio registry. Do not invoke the adapter through MCP; MCP
120
+ portfolio operations remain read-only.
121
+ 3. Stop when the output exists, its parent is symlinked, its resolved path escapes the generation
122
+ root, the registry is invalid, or either generation path overlaps a portfolio root. Do not retry
123
+ by weakening the policy or by writing directly to an original product repository.
124
+ 4. Preserve the generated manifest and file checksums. The same plan and adapter version must
125
+ produce the same file records.
126
+ 5. Keep reducer-owned domain state separate from rendering. Use the generated semantic token layer
127
+ and preserve the complete primary task, success state, failure context, and bounded recovery.
128
+ 6. Keep demo, imported, cached, and live source modes distinct in state and rendered disclosure.
129
+ Missing sources stay unavailable. Never let demo values appear as imported, cached, or live.
130
+ 7. Treat the initial adapter as a new-fixture generator only. Existing-repository adaptation needs a
131
+ separate convention-aware adapter and its own regression evidence.
132
+ 8. Run generated build, typecheck, unit, architecture, browser, accessibility, and product-contract
133
+ checks before integration. Generation and static audit do not authorize release or satisfy human
134
+ review.
135
+
136
+ ## Bounded Repair Workflow
137
+
138
+ Use this workflow only for a manifest-owned file in an independent fixture created by the React
139
+ adapter. Read `knowledge-base/design-intelligence/closed-loop-repair.md` and author a request that
140
+ validates against `repair-request.schema.yaml`.
141
+
142
+ 1. Run the complete product-profile quality gate before proposing a repair. Bind every repair to
143
+ one fresh architecture or runtime finding, one acceptance criterion in the selected profile,
144
+ the complete expected evidence set, and an explicit stopping condition.
145
+ 2. Use only `zz-design repair-react`. Provide the original generation root, generated target,
146
+ portfolio registry, contract, loopback URL, profile, and an absent evidence output outside the
147
+ target. Never expose repair through MCP or run it against an original portfolio project.
148
+ 3. Declare one to three attempts in advance. Each operation must identify one generation-manifest
149
+ file, its complete current SHA-256 digest, exact source text, exact replacement text, and exact
150
+ occurrence count. Do not use search-and-rewrite, generated patches, or undeclared files.
151
+ 4. Require fresh evidence to resolve every referenced finding uniquely before writing. Stop on a
152
+ stale or ambiguous finding, digest mismatch, traversal, symlink, portfolio overlap, remote URL,
153
+ or evidence output that resolves inside the target.
154
+ 5. After each attempt, rerun the same contract, route, profile, journeys, viewports, browser, tool
155
+ versions, static audit, acceptance evaluation, and screenshots. Preserve report and screenshot
156
+ checksums for both sides.
157
+ 6. Succeed only when all referenced findings are absent, evidence identity remains comparable,
158
+ unrelated files retain their digests, and the complete gate passes at the declared threshold.
159
+ 7. Stop immediately when a targeted fingerprint repeats or verification fails. Restore every
160
+ operation file to its original bytes and emit an unresolved report instead of rewriting again.
161
+ 8. Never create, copy, update, or infer a human attestation. Automated repair evidence does not
162
+ satisfy expert or representative-user obligations and does not authorize release.
163
+
164
+ ## Interaction And Recovery Verification Workflow
165
+
166
+ Use this workflow after an executable browser task and its data behavior are declared. Read
167
+ `knowledge-base/design-intelligence/interaction-recovery-verification.md` before adding lifecycle
168
+ journeys or changing verification evidence.
169
+
170
+ 1. Keep existing version `1.0` journey suites as historical compatibility artifacts. Use version
171
+ `1.1` only for newly qualified interaction coverage, and bind it to a version `1.2` product
172
+ contract when task-level enforcement is required.
173
+ 2. Declare the task identifier, primary or recovery phases, and only the states that the current
174
+ task and data model make applicable. A primary phase needs observed start and success; required
175
+ recovery needs observed failure and preserved state.
176
+ 3. Place each checkpoint directly after its browser observation. A checkpoint records evidence; it
177
+ cannot create a state transition or upgrade an unsupported claim into a pass.
178
+ 4. Use real keyboard input before keyboard checks, retained download evidence before export checks,
179
+ and explicit offline emulation before offline checks. Keep disconnected UI state distinct from
180
+ a demonstrated offline browser condition.
181
+ 5. Record unsupported automation as a verifier limitation and leave the corresponding product
182
+ evidence unverified. Runtime evidence never replaces human or representative-user evidence.
183
+
184
+ ## Interface Trust Workflow
185
+
186
+ Use this workflow before implementing any interface that shows external data, operational status, generated analysis, cached or imported results, environment labels, history, or exports. Read `knowledge-base/design-intelligence/interface-trust.md` and start from `interface-trust.template.yaml` when a formal contract is needed.
187
+
188
+ 1. Identify each source as runtime evidence, user input, import record, cache record, demonstration fixture, local simulation, or configuration. Do not treat configuration as proof of availability.
189
+ 2. Model separate `dataMode`, `connection`, `resultOrigin`, and freshness values. Include concrete demo, live, fallback, stale, and disconnected states; use `unknown` while a fact is not established.
190
+ 3. Bind every operational claim to the source that establishes that exact fact, or classify it explicitly as demonstration or unknown. Labels such as `operational`, `online`, `connected`, `production`, and `live` require verified evidence.
191
+ 4. Keep data mode visible in the shell. Before consequential actions, show data mode and processing boundary next to the action.
192
+ 5. Preserve fallback origin and limitations during loading, in results, history, and exports. Preserve stale timestamps with timezone and scope.
193
+ 6. Keep interface availability, backend availability, connection, and result provenance as separate claims. A rendered page or successful simulation does not prove an external integration works.
194
+ 7. Preserve data mode, connection, result origin, freshness, environment, scope, and limitations in history and exports.
195
+ 8. Never place credentials or realistic secret placeholders in contracts, source, UI, or screenshots. Declare only approved credential sourcing.
196
+ 9. Run `validate_interface_trust` or `npm run validate-trust -- --contract PATH`. Treat a passing declaration as prerequisite evidence, then verify rendered placement and runtime behavior separately.
197
+
198
+ ## Operational Information Design Workflow
199
+
200
+ Use this workflow for dashboards, workspaces, reports, findings queues, monitoring surfaces, and interfaces that use metrics or charts to support decisions. Read `knowledge-base/design-intelligence/information-design.md` and start from `information-design.template.yaml`.
201
+
202
+ 1. Declare environment, scope, data description, sources, freshness, timezone, and limitations before presenting outcomes.
203
+ 2. Give each metric a definition, formula, sources, context, scope, period, freshness, baseline or explicit baseline exception, drill-down, limitations, and supported decision.
204
+ 3. Reject decorative metrics and charts. Keep only information that answers a task question or supports a concrete action.
205
+ 4. Give each finding severity, affected entities, observation, evidence, impact, confidence basis, remediation, owner or action destination, and validation method.
206
+ 5. Define distinct loading, available, missing, partial, stale, and error behavior. Never display missing as zero, partial as complete, or stale as current.
207
+ 6. Pair color with text, icons, values, shape, pattern, or position. Make long labels revealable without pointer hover and large collections searchable with scalable rendering.
208
+ 7. Order operational content as context and provenance, primary outcome and action, critical exceptions, health and impact metrics, prioritized findings, telemetry, evidence, then history and exports.
209
+ 8. Declare tasks for identifying context, priority, impact, evidence, next action, and success verification. Do not present agent-authored task declarations as human evidence.
210
+ 9. Run `validate_information_design` or `npm run validate-information -- --contract PATH`. Then verify rendered hierarchy, responsive behavior, chart alternatives, and comprehension separately.
211
+
212
+ ## Design & Architecture Workflow
213
+
214
+ ### Step 1: Frame The System
215
+
216
+ Write a compact design brief before implementation:
217
+
218
+ - Primary user and job to be done.
219
+ - Critical path and success condition.
220
+ - Core entities, data ownership, and processing boundary.
221
+ - Functional requirements and quality attributes.
222
+ - Constraints from the current stack, platform, organization, security model, and delivery scope.
223
+ - Expected variation points, integrations, and product-family reuse.
224
+
225
+ Prioritize quality attributes such as usability, accessibility, modifiability, performance, reliability, availability, security, portability, and variability. Make each important attribute measurable rather than using labels such as `fast`, `simple`, or `secure` without criteria.
226
+
227
+ ### Step 2: Select And Document Architecture
228
+
229
+ Choose architecture from the task shape, not fashion. Multiple styles may coexist when their boundaries are explicit.
230
+
231
+ - Use layered architecture to separate presentation, application policy, domain behavior, and infrastructure. Lower layers provide services upward; use callbacks or abstractions when a lower layer must signal upward without depending on presentation.
232
+ - Use MVC or an equivalent unidirectional state pattern for interactive systems that need multiple views, synchronized state, or replaceable presentation.
233
+ - Use pipes and filters for independent, preferably stateless transformation stages such as document or media processing. Define pipe data formats, buffering, cancellation, and error propagation.
234
+ - Use client-server when a server owns shared resources, policy, transactions, or security. Account for latency, service failure, and recovery.
235
+ - Use message passing when participants are dynamic or independently deployed. Specify message schema, event or command semantics, delivery guarantees, ordering, retries, idempotency, and observability.
236
+ - Use microservices only when independent deployment, scaling, ownership, or technology boundaries justify network and operational complexity.
237
+ - For reusable product platforms, define shared scope, common requirements, and explicit variation points. Prefer configuration and plugin interfaces over inheritance-heavy white-box frameworks.
238
+
239
+ Record each consequential decision with context, chosen option, alternatives, rationale, affected quality attributes, constraints, and reversal cost. Describe the architecture through the views needed by stakeholders: logical structure, development/package structure, runtime processes, deployment, and representative scenarios.
240
+
241
+ ### Step 3: Evaluate Architecture With ATAM
242
+
243
+ Use a lightweight Architecture Tradeoff Analysis Method pass for new systems, shared components, consequential redesigns, or disputed architecture choices.
244
+
245
+ 1. State business drivers, constraints, stakeholders, and the proposed architecture.
246
+ 2. Build a utility tree from prioritized quality attributes.
247
+ 3. Express each important scenario as `stimulus -> environment -> response -> measurable result`.
248
+ 4. Include normal-use, anticipated-change, and stress or exploratory scenarios.
249
+ 5. Rank scenarios by importance and implementation difficulty using `high`, `medium`, or `low`.
250
+ 6. Link high-priority scenarios to the decisions that enable them.
251
+ 7. Record risks, non-risks, sensitivity points, and trade-off points. State assumptions behind every non-risk.
252
+ 8. Group related risks into risk themes and convert material risks into acceptance criteria or follow-up work.
253
+
254
+ Do not claim architectural completeness when a quality attribute cannot be evaluated from the documented decisions. Add the missing view, contract, or scenario.
255
+
256
+ ### Step 4: Establish Component Boundaries
257
+
258
+ Treat a component as an independently understandable unit that exposes services through a well-defined interface and declares its context dependencies.
259
+
260
+ - Give each component one cohesive responsibility and one primary reason to change.
261
+ - Keep domain policy independent of UI frameworks, storage, network clients, analytics, and model providers.
262
+ - Define provided and required interfaces, data ownership, input and output types, preconditions, postconditions, errors, async behavior, and accessibility responsibilities.
263
+ - Make dependencies visible through parameters, props, context providers, or dependency injection. Avoid hidden globals and imports that bypass ownership boundaries.
264
+ - Design client-specific interfaces. Split broad interfaces when consumers depend on methods they do not use.
265
+ - Depend on abstractions at volatile boundaries. The policy-owning layer owns the abstraction; implementation details satisfy it.
266
+ - Ensure substitutions preserve client expectations. A variant must demand no more and guarantee no less than its contract.
267
+ - Keep component APIs stable while permitting internal implementation changes.
268
+
269
+ Apply package-level cohesion and coupling rules:
270
+
271
+ - Group code that is reused together, released together, and changed for the same reason.
272
+ - Keep package dependencies acyclic. Break cycles with dependency inversion or a new cohesive package.
273
+ - Depend toward stability; stable packages should expose abstractions, while volatile leaf packages may remain concrete.
274
+ - Treat the dependency graph as a buildability and change-impact map, not merely a feature map.
275
+
276
+ ### Step 5: Detect Design Smells And Choose Patterns
277
+
278
+ Check every significant design for:
279
+
280
+ - `Rigidity`: a small change forces many changes.
281
+ - `Fragility`: changes break unrelated behavior.
282
+ - `Immobility`: useful code cannot be extracted from its context.
283
+ - `Viscosity`: shortcuts are easier than the intended extension path.
284
+ - `Needless complexity`: abstractions exist for hypothetical needs.
285
+ - `Needless repetition`: behavior or token values are copied instead of shared.
286
+ - `Opacity`: intent and ownership are hard to understand.
287
+
288
+ Refactor the smallest boundary that removes the cause. Select a pattern only when its problem and trade-off are present:
289
+
290
+ - Strategy or Template Method for a real algorithm variation point.
291
+ - Command for queued, logged, delayed, or undoable actions.
292
+ - Observer for multiple state views or event consumers; document implicit dependencies.
293
+ - State for behavior that changes across an explicit state machine.
294
+ - Adapter for an incompatible existing or third-party interface.
295
+ - Bridge for independently varying abstraction and implementation.
296
+ - Decorator for optional runtime responsibilities without expanding a core interface.
297
+ - Composite for uniform treatment of items and nested groups.
298
+ - Proxy for remote, persistent, permissioned, or otherwise mediated access.
299
+ - Factory when construction of volatile implementations must be isolated.
300
+ - Visitor only for stable hierarchies that need new operations; use an acyclic variant only when hierarchy growth justifies its complexity.
301
+
302
+ Do not add factories, services, microservices, or pattern layers preemptively. Favor the simplest design that preserves identified variation points and quality requirements.
303
+
304
+ ### Step 6: Standardize Design Tokens
305
+
306
+ Create a three-level token architecture and use it throughout the UI:
307
+
308
+ 1. Primitive tokens hold raw values for color, spacing, type, radius, elevation, motion, and breakpoints.
309
+ 2. Semantic tokens express intent: `background`, `surface`, `surface-elevated`, `foreground`, `muted-foreground`, `border`, `accent`, `success`, `warning`, `info`, `danger`, and `focus`.
310
+ 3. Component tokens map semantic roles to local parts and states, such as `button-primary-background`, `input-border-error`, or `table-row-selected`.
311
+
312
+ Requirements:
313
+
314
+ - Use semantic names in components; never encode personal color names or raw palette values in component code.
315
+ - Define default, hover, active, disabled, focus, loading, success, warning, and error states where relevant.
316
+ - Use typography by function: body, label, heading, metadata, metric, and monospace for code, IDs, logs, paths, formulas, or model traces.
317
+ - Keep focus visible. Pair every status, severity, score, or confidence color with text, an icon, a value, or another non-color cue.
318
+ - Keep component dimensions stable across states so loading text, validation, hover, and dynamic values do not shift the layout.
319
+ - Map tokens into the project's native mechanism, such as CSS custom properties, theme objects, JSON tokens, or framework configuration. Keep one source of truth.
320
+
321
+ When no brand palette exists, choose accessible primitives only after semantic roles are defined. When a brand system exists, preserve it and repair contrast or state gaps at the semantic layer.
322
+
323
+ ### Step 7: Design Interaction, State, And Responsiveness
324
+
325
+ For every task surface, design these states where applicable: empty, loading, success, partial, low-confidence, blocked, error, rate-limited, offline, and permission denied.
326
+
327
+ - Name primary actions by outcome, such as `Analyze`, `Generate`, `Review`, `Approve`, `Convert`, or `Export`.
328
+ - Give inputs visible labels, constraints, inline validation, and a recovery action. Preserve user-entered data across errors, retries, rate limits, and navigation.
329
+ - Show immediate feedback within 100 ms after submission. After 300 ms, use a skeleton or staged status for work that remains in progress.
330
+ - Keep destructive actions separate from positive primary actions. Confirm consequential or bulk changes and show the affected count.
331
+ - Use controls that match the choice: toggles for binary settings, segmented controls for small mode sets, menus for option sets, and sliders only for understandable ranges.
332
+ - Make target sizes at least 44 by 44 CSS pixels where practical. Provide visible keyboard focus and respect reduced motion.
333
+ - Test at 375, 768, 1024, and 1440 CSS pixels. Avoid competing scroll regions on mobile; use tabs, drawers, or stacked sections.
334
+
335
+ ## AI Workspace Workflow
336
+
337
+ ### Step 1: Choose The Workspace Pattern
338
+
339
+ - Choose `Structured Analysis` when users provide input, configure scope, inspect findings, compare evidence, or export a report.
340
+ - Choose `Conversational Agent` for iterative requests, context updates, tool calls, and approvals.
341
+ - Choose `Trust Entry` only when an entry screen is required to explain purpose, processing boundaries, evidence policy, and the route into the real workspace.
342
+ - Combine structured controls with chat when the task benefits from both. Do not force forms, evidence, filters, or approvals into chat messages.
343
+
344
+ ### Step 2: Build The Information Architecture
345
+
346
+ Use this baseline and omit routes the product does not need:
347
+
348
+ ```text
349
+ / entry or direct workspace redirect
350
+ /analyze structured input and result review
351
+ /agent conversational work with context and tool visibility
352
+ /history runs, versions, exports, and approvals
353
+ /settings model, privacy, permission, and retention controls
354
+ ```
355
+
356
+ For a structured analysis workspace:
357
+
358
+ 1. Place input or context and configuration before one outcome-named primary action.
359
+ 2. On desktop, use a 50/50 or 45/55 split when users compare input and output; make the divider resizable when comparison is frequent.
360
+ 3. On tablet, stack panels and keep the primary action reachable.
361
+ 4. On mobile, switch between `Input` and `Results` with tabs or a drawer.
362
+ 5. Order results as summary, findings, recommendation, evidence, then action.
363
+ 6. Give each finding a severity label, title, category, explanation, evidence, source jump, confidence or limitation, and suggested action.
364
+
365
+ For a conversational agent workspace:
366
+
367
+ 1. Show relevant context beside chat on desktop and in a drawer, accordion, or tab on mobile.
368
+ 2. Distinguish user, AI, tool, system, and approval messages.
369
+ 3. Make tool calls collapsible with tool name, state, and result summary.
370
+ 4. Provide send, stop or cancel, retry, copy, regenerate, report, and clear controls where relevant.
371
+ 5. Let users edit drafts or context during long work unless the submitted context must be immutable.
372
+
373
+ ### Step 3: Make AI Work Inspectable
374
+
375
+ - Show phases such as `Validating`, `Retrieving context`, `Analyzing`, `Generating`, and `Saving` for long operations.
376
+ - Expose sources, citations, retrieved context, or evidence for factual claims.
377
+ - Mark uncertain, partial, unsupported, and low-confidence output explicitly.
378
+ - Separate generated suggestions from human-approved decisions.
379
+ - Require confirmation before destructive or consequential AI actions.
380
+ - Explain local, private-cloud, and third-party model or data-processing boundaries next to the input surface.
381
+ - Use `aria-live="polite"` for async result updates and move focus to the result summary after completion when that improves keyboard flow.
382
+ - Provide a tabular alternative for charts and show every score as a numeric or textual value.
383
+
384
+ ## Operational Dashboard Workflow
385
+
386
+ ### Step 1: Establish The Dashboard Shell
387
+
388
+ Use a restrained, information-dense shell in this order:
389
+
390
+ 1. Header with current context, scope, and primary metric.
391
+ 2. Cross-tool navigation only when the dashboard belongs to a suite.
392
+ 3. Summary metrics with labels and time or scope context.
393
+ 4. Primary workspace: table, queue, tracker, upload surface, or split view.
394
+ 5. Lifecycle actions such as export, import, backup, migration, reset, or delete when the product owns user data.
395
+
396
+ Growing datasets require search, filtering, sorting, useful empty states, and pagination or virtualization when warranted. Bulk actions show selection counts and require confirmation when destructive.
397
+
398
+ ### Step 2: Apply The Closest Task Pattern
399
+
400
+ | Pattern | Required task sequence |
401
+ |---|---|
402
+ | Document conversion | Processing boundary; drop zone and picker; category or destination; conversion action; preview; copy/download/open; saved destination and overwrite/retention details; recent conversions |
403
+ | Media processing | URL or file input; metadata fetch; category and quality preset; preview; active jobs with labeled progress; recent jobs; destination and third-party disclosure |
404
+ | Period records | Active period and date; period selector; inflow, outflow, net, completion, and balance metrics; inflow and outflow tables; lifecycle actions |
405
+ | Pipeline tracker | Active count and scope; totals by waiting, active, blocked, and completed state; response or conversion rate; tabs, search, and sortable records table; lifecycle actions |
406
+ | Repayment tracker | Active period; total, paid, outstanding, and progress metrics; open/completed/all filters; obligations with labeled row progress; lifecycle actions |
407
+
408
+ Use semantic status treatment consistently: `warning` for waiting or due soon, `info` for active processing or assessment, `success` for completed or resolved, and `danger` for failed, blocked, rejected, or overdue. Text labels are mandatory; tint is supplemental.
409
+
410
+ ### Step 3: Design Data Safety And Recovery
411
+
412
+ - Explain where data is processed, stored, exported, and retained.
413
+ - Show destination and overwrite behavior before conversion or export.
414
+ - Preserve filters, edits, selections, and in-progress input after recoverable failures.
415
+ - Provide recovery actions for failed, overdue, partial, and interrupted jobs.
416
+ - Never imply local-only processing when data leaves the device.
417
+
418
+ ## Heuristic Evaluation Workflow
419
+
420
+ Use this workflow when the user asks for a UX audit, heuristic analysis, usability review, redesign diagnosis, or release evaluation. Read `knowledge-base/usability-evaluation/HEURISTIC_EVALUATION.md` when method detail or a formal finding record is needed. Use `get_usability_evaluation` to retrieve this category when MCP is available.
421
+
422
+ 1. Define the intended users, critical tasks, context, supported viewports, and states before judging the interface.
423
+ 2. Run automated checks for facts that code and browser evidence can establish: overflow, clipping, collisions, occlusion, accessible names, focus, runtime failures, network behavior, and journey outcomes.
424
+ 3. Execute representative tasks and inspect the relevant states against Nielsen's heuristics and domain-specific rules. Record one concrete problem per finding with location, trigger, observation, evidence, user impact, severity, confidence, correction, and validation method.
425
+ 4. Distinguish evidence levels. Automated checks establish rendered or behavioral facts; expert inspection identifies likely usability risks; representative-user testing validates whether intended users can complete intended tasks. Never claim one evidence type proves another.
426
+ 5. Prioritize by task consequence, affected users, frequency or reach, and recoverability. Visual prominence alone does not determine severity.
427
+ 6. Convert major and blocker findings into acceptance criteria and regression journeys. Retest after correction.
428
+ 7. Escalate unresolved mental-model, terminology, comprehension, or workflow assumptions to representative-user testing. Prefer iterative formative rounds over one final large test.
429
+ 8. For a formal review, start from `knowledge-base/usability-evaluation/heuristic-review.template.yaml` and preserve the versioned schema. Classify every evidence item as `automated`, `ai-assisted-expert`, `human-expert`, or `representative-user`; human and user evidence must include attributable reviewer-provided metadata.
430
+ 9. Validate the artifact with `evaluate_heuristic_review` or `npm run review-heuristics -- --review PATH`. Review and merge generated severity 3-4 acceptance candidates into the applicable product contract; the evaluator must not edit contracts automatically.
431
+ 10. Never treat an AI-assisted review as a human-expert record, representative-user result, risk-acceptance decision, or manual-review attestation. An agent may format evidence supplied by a person but must not invent identity, timestamps, sessions, decisions, or approval.
432
+
433
+ ## Anonymous Comparison Workflow
434
+
435
+ Use this workflow when the user asks whether one implementation improves truthful disclosure, information design, visual polish, comprehension, confidence, or task efficiency relative to another implementation.
436
+
437
+ 1. Define the method before inspecting candidate identities. Use comparison methodology version `1.1` when a release decision depends on complete reviewer matrices or target-versus-comparator results.
438
+ 2. Keep candidate identity mapping in a coordinator-only directory. Reviewer-facing filenames, prompts, screenshots, and session templates must use anonymous candidate labels only.
439
+ 3. Give every candidate the same tasks, common-state captures, viewport set, rubric anchors, and opportunity to expose missing behavior. Never repair a candidate during the review.
440
+ 4. Configure explicit minimum human-expert and representative-user session counts, complete task and rating matrices, and sufficient counterbalanced orders. A single incomplete form cannot satisfy the review stage.
441
+ 5. Separate human-expert visual assessment from representative-user task observation. Record task completion, duration, navigation errors, recovery attempts, comprehension, confidence, and concrete rationale at the declared evidence level.
442
+ 6. Keep session templates at `status: draft`. Only the actual reviewer or facilitator may replace observations and change a session to `complete`. An agent may validate and compile supplied records but must not author, sign, infer, or upgrade human evidence.
443
+ 7. Run `compile-comparison` to hash completed source sessions and produce the combined review, then run `validate-comparison`. Read `passed`, `humanReview.requirementsMet`, `benchmarkDecision.passed`, and `releaseReady` as separate decisions.
444
+ 8. Preserve missing behavior, failed tasks, dissenting ratings, and target regressions. Do not remove an inconvenient session or average evidence levels together to obtain a preferred winner.
445
+
446
+ For the Azure V2 benchmark, use `knowledge-base/benchmarks/azure-optimizer/v2-human-review-methodology.yaml` and the retained packet under `evidence/interface-quality/azure-v2-review/`. The external anonymous human visual comparison is complete for readability, information findability, visual preference, and observable screenshot problems. It does not claim interactive representative-user task validation.
447
+
448
+ ## Enterprise Readiness
449
+
450
+ For production or enterprise-facing tools, include these requirements in architecture and UX acceptance criteria:
451
+
452
+ - Environment-driven configuration with startup validation.
453
+ - Authentication for every non-health endpoint outside local development.
454
+ - Explicit allowed hosts, security headers, sensitive-response `no-store` caching, and request body limits before expensive processing.
455
+ - Request IDs on responses, unauthenticated liveness checks, and metrics where operational visibility is required.
456
+ - Visible authentication and workspace or organization context.
457
+ - Health, rate-limit, and request-ID information where users need it for recovery or support.
458
+ - Documented processing, retention, import, export, backup, migration, and deletion behavior.
459
+ - Secrets, certificates, generated histories, exports, caches, seed data, and local state excluded from source control unless intentionally versioned.
460
+ - Production startup failure when identity configuration, sufficiently protected secrets, explicit hosts, or documented retention and export locations are missing.
461
+
462
+ ## Design Intelligence Workflow
463
+
464
+ ### Step 1: Declare Deliverables
465
+
466
+ Use this workflow when the request includes a brand system, Figma library, generated or sourced assets, iconography, or presentation design. Read `knowledge-base/design-intelligence/MASTER.md`, then load only the modules matching the requested deliverables.
467
+
468
+ Create a design-deliverable manifest from `knowledge-base/design-intelligence/design-deliverable.template.yaml`. Use version `2.1` and declare `interface-system` when visual polish, responsive composition, charts, rendered evidence, or human visual review is in scope. Keep versions `1.0` and `2.0` compatible for existing manifests. Do not declare work that is outside the request.
469
+
470
+ ### Step 2: Build One Canonical System
471
+
472
+ 1. Define brand promise, attributes, prohibited traits, voice, and mark constraints before visual exploration.
473
+ 2. Define primitive, semantic, and component tokens before applying values in Figma, code, slides, icons, or generated media.
474
+ 3. Map Figma collections and modes to canonical tokens. Give components explicit properties, states, resizing behavior, and usage documentation.
475
+ 4. Give every asset a stable identifier, concrete task purpose, source, creator, rights status,
476
+ rights basis, evidence, restrictions, alternative-content classification, and explicit failure
477
+ behavior.
478
+ 5. For generated assets, record provider, model, prompt artifact, human contributions, and every reference asset with approved rights.
479
+ 6. Give every icon one meaning and one approved asset. Require an accessible name for semantic icons unless equivalent visible text provides it; hide decorative icons from assistive technology.
480
+ 7. Build presentations from declared masters. Give every slide a literal title, one purpose, explicit reading order, and approved asset references.
481
+
482
+ Do not treat visual novelty, generation metadata, a provider subscription, or asset possession as evidence of task fit, accessibility, ownership, permission, or legal clearance.
483
+
484
+ ### Step 3: Gate Visual Polish
485
+
486
+ When `interface-system` is declared, read `knowledge-base/design-intelligence/visual-polish.md` and complete these actions:
487
+
488
+ 1. Define a domain-specific direction and explicitly prohibit decorative agent diagrams, excessive glow, meaningless gradients, and ornamental status elements.
489
+ 2. Bind typography, layout, density, interaction states, motion, and charts to semantic or component tokens rather than primitives or raw values.
490
+ 3. Declare all typography roles, all nine interaction states, reduced-motion equivalents, and responsive composition at 375, 768, 1024, and 1440 CSS pixels.
491
+ 4. Map each viewport's visible priorities to canonical roles. Keep context, the primary outcome, critical exceptions, and the next action ahead of telemetry, evidence detail, and history. At 375 CSS pixels, expose no more than four decision-critical priorities before expandable detail.
492
+ 5. Validate every typography foreground, focus treatment, state foreground and surface, and chart
493
+ series and background in the default theme and every declared color mode. Do not assume that a
494
+ passing light theme proves dark-theme readability, or the reverse.
495
+ 6. Give every chart a decision purpose, readable labels and values, comparison context, accessible alternative, exceptional states, and non-color cues.
496
+ 7. For automated composition checks, mark exactly one visible context, primary outcome, and next
497
+ action in semantic order. Declare density limits, status purpose, visual-claim evidence, state
498
+ cues, chart visuals, and rendered asset metadata. These semantics must not dictate one style.
499
+ 8. Keep viewport evidence `planned` until captured. Mark it `verified` only with screenshot path, runtime report path, and checksum.
500
+ 9. Keep human visual review `required` until a reviewer supplies attributable evidence for hierarchy, balance, scanability, density, and domain fit. Never generate the reviewer record.
501
+
502
+ ### Step 4: Validate Declarations
503
+
504
+ Run `validate_design_deliverable` against the manifest. Resolve every error before shipping. Review warnings against product context and document the decision.
505
+
506
+ CLI fallback:
507
+
508
+ ```bash
509
+ npm run validate-design -- --manifest PATH
510
+ ```
511
+
512
+ The validator checks structure, cross-contract references, generation order, token chains, semantic visual bindings, composition, states, motion, charts, evidence declarations, contrast math, provenance records, icon semantics, and presentation masters. Read `integration.releaseReady` and `visualPolish.releaseReady` separately from `passed`; declarations, planned captures, automated checks, and required human review are distinct gates. Complete remaining checks with source inspection, browser verification, export inspection, and qualified human review.
513
+
514
+ ## Corpus Benchmark Workflow
515
+
516
+ Use the maintained corpus after changing retrieval, architecture rules, product-contract validation, anti-slop rules, or the approved knowledge scope. The corpus is a regression gate for the design-engineering system itself, not a substitute for evaluating the target product.
517
+
518
+ ### Step 1: Preserve Case Provenance
519
+
520
+ Add a case only when its source is user-owned or appropriately licensed. Record the owner, license, evidence path, redistribution boundary, and an original derivation statement. Never use a reference archive or third-party design product as a corpus authority. Keep positive and negative cases behaviorally minimal so one case tests one declared capability.
521
+
522
+ ### Step 2: Declare Expected Behavior
523
+
524
+ Use `knowledge-base/benchmarks/corpus/corpus.yaml` and its versioned schema. Classify each case as retrieval, audit, or contract evidence and assign exactly one dimension:
525
+
526
+ - `recommendation-relevance`: the expected approved source appears within the maximum rank.
527
+ - `abstention`: an out-of-scope query returns `no-match` without archive fallback.
528
+ - `architectural-integrity`: a clean repository is accepted or declared architecture defects are detected.
529
+ - `task-completeness`: a coherent product contract passes or broken task references are rejected.
530
+ - `anti-slop-rejection`: a functional surface passes or known mock and placeholder behavior is rejected.
531
+
532
+ Declare required and forbidden rule IDs or issue codes. Do not change an expected result merely to make a regression pass; correct the implementation or document and review an intentional contract change.
533
+
534
+ ### Step 3: Evaluate And Interpret
535
+
536
+ Run `evaluate_corpus_benchmark` or the CLI fallback:
537
+
538
+ ```bash
539
+ npm run evaluate-corpus
540
+ ```
541
+
542
+ Require every dimension threshold, the overall score, and recommendation mean reciprocal rank to pass. Preserve the per-case observation, rank, rule IDs, issue codes, polarity, and provenance source. A passing corpus proves only the included deterministic behaviors; it does not prove general design quality, universal retrieval relevance, product usability, accessibility, or legal clearance.
543
+
544
+ ## Supply Independence Workflow
545
+
546
+ Use this workflow when changing the skill, approved knowledge, retrieval, dependencies, packaging, release automation, or compatibility behavior.
547
+
548
+ ### Step 1: Preserve The Authority Boundary
549
+
550
+ 1. Keep `SKILL.md` authoritative and retrieve supporting guidance only from `knowledge-base/retrieval-scope.yaml`.
551
+ 2. Build maintained guidance from original project rules, user-owned evidence, public standards, official platform documentation, or material with recorded reuse rights.
552
+ 3. Treat historical research and comparative products as removable review inputs. Never import, execute, package, call, or silently search them from production workflows.
553
+ 4. Reimplement behavior from independent input, output, state, and error contracts. Do not copy private implementation structure, proprietary wording, unverified assets, or vendor-specific internal identifiers.
554
+ 5. Preserve explicit `no-match` behavior when the approved corpus lacks evidence.
555
+
556
+ ### Step 2: Maintain Provenance And Dependency Records
557
+
558
+ 1. Add every distributable knowledge or design artifact to `knowledge-base/provenance.yaml` with source, ownership, license status, review attribution, review date, and transformation history.
559
+ 2. Keep direct packages in `knowledge-base/dependencies.yaml`. Classify them as replaceable infrastructure, record their exact lockfile version and license, define their narrow boundary, and provide a fallback plus replacement trigger.
560
+ 3. Keep strategic product behavior, schemas, rule identities, quality thresholds, and design guidance project-owned. A dependency may implement transport, parsing, browser control, or validation mechanics, but it must not become the authority for product decisions.
561
+ 4. Reject license ambiguity, missing provenance, unapproved status, path traversal, symlink escapes, archive imports, and package files outside the explicit distribution allowlist.
562
+
563
+ ### Step 3: Certify A Release
564
+
565
+ Run these checks after changing a distributable artifact or dependency:
566
+
567
+ ```bash
568
+ npm run independence:check
569
+ npm run evaluate-corpus
570
+ npm test
571
+ npm run package:smoke
572
+ npm run release:pack
573
+ npm run release:check
574
+ npm run independence:archive-smoke
575
+ ```
576
+
577
+ The archive-removal check must build an isolated workspace containing only active project-owned inputs and approved dependencies, then pass build, typecheck, MCP and retrieval regression tests, corpus evaluation, and the browser fixture quality gate. The offline release must contain the compiled CLI and MCP runtime, authoritative skill, approved knowledge and schemas, serialized retrieval index, production dependencies, manifest, and checksums. Do not claim independence if any supported operation needs a vendor account, hosted design service, reference repository, or non-distributable local file.
578
+
579
+ ## Compatibility & Output Rules
580
+
581
+ Generate artifacts that parse consistently in Claude Code, Cursor, Windsurf, Antigravity, GitHub Copilot, Kiro, Codex, Qoder, and Lovable.
582
+
583
+ 1. Use UTF-8 Markdown with one YAML frontmatter block at the top of skill files. Keep `name` lowercase kebab-case and keep `description` a single-line scalar without XML angle brackets.
584
+ 2. Use standard Markdown headings, lists, tables, and fenced code blocks. Always add a language identifier such as `tsx`, `css`, `json`, `yaml`, `bash`, or `text`.
585
+ 3. Do not embed platform-specific tool-call syntax, hidden instructions, XML wrappers, editor macros, citations, or chat transcripts in generated source files.
586
+ 4. When returning multiple files in chat, introduce each with `### relative/path.ext`, then provide exactly one fenced block containing the complete file. Do not place commentary inside code fences.
587
+ 5. Use repository-relative paths in generated documentation and examples. Never emit machine-specific absolute paths, private product names, secrets, or environment values.
588
+ 6. Produce complete imports, exports, types, event handlers, states, and accessible labels. Do not use ellipses, pseudo-code, placeholder callbacks, or omitted sections in implementation-ready output.
589
+ 7. Preserve the repository's framework, package manager, formatter, linter, module system, naming conventions, and supported language level unless migration is requested.
590
+ 8. Keep domain logic, design tokens, and contracts framework-neutral where practical. Place framework adapters at explicit boundaries.
591
+ 9. Use stable token identifiers that are valid in CSS custom properties, JSON, JavaScript, TypeScript, and common design-token tools. Provide one canonical token source and generated adapters when multiple formats are required.
592
+ 10. Make commands non-interactive and portable where practical. Put commands in `bash` fences and state any platform-specific prerequisite outside the command.
593
+ 11. Keep generated code deterministic and locally runnable. Include or update focused tests and validation commands in proportion to the change.
594
+ 12. If operating with file-editing tools, edit the repository directly and summarize changed paths and verification. If limited to chat output, use the complete-file convention above.
595
+
596
+ Do not create separate versions of the product for different AI IDEs. The source artifact is canonical; only invocation or installation instructions may vary by environment.
597
+
598
+ ## Validation And Handoff
599
+
600
+ Before declaring completion:
601
+
602
+ 1. Trace the primary task from entry through success and recovery.
603
+ 2. Verify empty, loading, success, partial, error, rate-limit, and permission states that can occur.
604
+ 3. Verify keyboard navigation, natural focus order, visible and unobscured focus, labels, async announcements, non-color status cues, reduced motion, and text alternatives.
605
+ 4. Check responsive layouts at 375, 768, 1024, and 1440 CSS pixels. Verify 200% zoom reflow at effective widths down to 320 CSS pixels and 200% text-only resizing, including long labels, dense data, code, and tables.
606
+ 5. Check minimum text contrast, 24 CSS-pixel target size, and the 44 CSS-pixel touch recommendation. Check that hover, loading, validation, and dynamic content do not shift fixed-format controls, overlap adjacent content, or hide focused controls behind sticky UI.
607
+ 6. Confirm tokens are semantic, centralized, and consumed by components without stray raw values.
608
+ 7. When design-intelligence deliverables are in scope, validate their manifest and inspect final assets, Figma source, presentation exports, provenance evidence, and alternative content. A passing declaration is not rendered or legal proof.
609
+ 8. Inspect dependency direction, package cycles, component contracts, and ownership of state and side effects.
610
+ 9. Run the repository's formatter, lint, typecheck, focused tests, and build when available. Report what ran and any residual risk; never imply unrun checks passed.
611
+ 10. When a matching benchmark product contract exists, validate it with `validate_product_contract` before implementation and use its archetype, activated quality dimensions, primary tasks, actors, modes, states, sources of truth, acceptance criteria, recovery paths, and journey profiles as the task model. Compare implementations only when the task-contract ID, archetype, primary intent, and observable success match. Current product requirements and working behavior override archived examples. CLI fallback: `npm run validate-contract -- --contract PATH` from the ZtotheZ Design Engineering project.
612
+ 11. When `audit_repository_architecture` is available, run it before handoff. Treat error findings as blockers and review every warning against product context. The static audit does not replace browser, interaction, accessibility, or responsive verification. If MCP is unavailable in this repository, use `npm run audit -- --repo PATH` from the ZtotheZ Design Engineering project.
613
+ 12. When the application can run, use `verify_ui_runtime` against the local URL with representative product journeys. Inspect its screenshots and evidence for contrast, target size, focus, keyboard flow, reflow, text resizing, motion, collision, media, console, network, interface-trust, composition, asset, and chart-contract findings. Verify both `light` and `dark` when both are implemented. For V2 surfaces, opt in with `data-ztothez-design-interface-trust`; declare required stages and states on the marked root, expose visible data-mode and provenance attributes, and mark charts with names, values, alternatives, and legends where required. Opt in to composition checks with `data-ztothez-design-composition="1.0"` and the maintained decision, claim, state, chart, and asset markers. Treat runtime errors as blockers and resolve or explicitly justify warnings.
614
+ 13. Use screenshot baselines only to detect rendered change. Mask dynamic regions with the narrowest selectors, retain their declared selector list with each checksum, and require attributable human review for intentional baseline changes. If MCP is unavailable, run `npm run verify-ui -- --url URL` from the ZtotheZ Design Engineering project. Runtime automation supplements, but does not replace, human review of content hierarchy, task fit, and visual quality.
615
+ 14. When `run_design_quality_gate` is available, prefer it for final handoff because it consolidates contract, architecture, runtime, and profile-scoped acceptance evidence under one failure policy. Every blocker criterion must pass; `UNVERIFIED` is not success. The target application must already be running. CLI fallback: `npm run quality-gate -- --contract PATH --repo PATH --url URL --profile ID`. Never report a skipped runtime stage as a passing gate, and never invent or self-author a manual-review attestation.
616
+ 15. Run every profile required by the contract in its declared service environment, preserving a separate evidence directory for each. Controlled offline profiles may declare expected network failures only with narrow method, URL, status, and occurrence bounds; an unobserved expectation is a failure, not permission to suppress errors. Aggregate profile reports with `aggregate_design_quality_gates` or `npm run aggregate-gates -- --contract PATH --reports DIR,DIR`. Release only when the aggregate report is complete and passing.
617
+ 16. After changing this skill, approved knowledge, retrieval, audit rules, product-contract validation, or anti-slop enforcement, run `evaluate_corpus_benchmark` or `npm run evaluate-corpus`. Treat a missed dimension threshold or MRR floor as a release blocker unless the corpus contract is intentionally revised with provenance and review.
618
+ 17. When changing this design-engineering system itself, validate provenance and dependencies, test the packed installation, verify the offline release, and run the archive-removal certification. A normal product UI implementation does not need to run these system-maintainer checks.
619
+
620
+ ## Examples
621
+
622
+ ### Example 1: Design A New Dashboard
623
+
624
+ User trigger: `Design a new pipeline dashboard for reviewing applications.`
625
+
626
+ Action sequence:
627
+
628
+ 1. Inspect the stack and existing shell, then identify reviewer tasks, record states, privacy constraints, and common lookup behavior.
629
+ 2. Frame measurable usability, accessibility, modifiability, and performance scenarios.
630
+ 3. Select the operational pipeline pattern and document state ownership plus client-server boundaries.
631
+ 4. Define primitive, semantic, and component tokens; map waiting, active, blocked, and completed statuses to text plus icon treatments.
632
+ 5. Build the header, metrics, filters, search, sortable records table, row actions, and export/import/backup controls.
633
+ 6. Implement empty, loading, partial, error, permission, and destructive-confirmation states.
634
+ 7. Validate dependency direction, keyboard table use, responsive behavior at four target widths, tests, and build.
635
+
636
+ ### Example 2: Generate An AI Analysis Workspace
637
+
638
+ User trigger: `Generate frontend UI for an AI document analysis workspace with evidence.`
639
+
640
+ Action sequence:
641
+
642
+ 1. Identify practitioner and reviewer flows, processing boundary, evidence source, retention policy, and consequential actions.
643
+ 2. Choose the structured analysis pattern with a 45/55 desktop split and `Input` and `Results` mobile tabs.
644
+ 3. Define contracts between input, job orchestration, result state, findings, evidence, and export modules.
645
+ 4. Implement input validation, configuration, one `Analyze` action, immediate feedback, staged progress, and preserved input.
646
+ 5. Render summary, filterable findings, recommendations, evidence, confidence or limitations, and next actions.
647
+ 6. Add async announcements, focus transfer, source jumps, retry, copy, export, and human approval where required.
648
+ 7. Exercise ATAM scenarios for rate limits, partial retrieval, provider failure, large input, and a change of model provider; then run project checks.
649
+
650
+ ### Example 3: Refactor A Design System
651
+
652
+ User trigger: `Standardize design tokens and fix tightly coupled components in this UI.`
653
+
654
+ Action sequence:
655
+
656
+ 1. Inventory raw values, duplicate styles, component variants, cross-package imports, state ownership, and change hotspots.
657
+ 2. Classify smells such as needless repetition, rigidity, fragility, and opacity; identify the smallest boundaries that cause them.
658
+ 3. Introduce primitive, semantic, and component tokens, then migrate shared components before feature surfaces.
659
+ 4. Split mixed responsibilities, replace hidden dependencies with explicit contracts, and break cycles with dependency inversion or a cohesive package.
660
+ 5. Preserve public behavior and visual intent while adding missing focus, disabled, loading, validation, and status states.
661
+ 6. Verify no unresolved raw values remain outside the canonical token source, run visual and interaction checks, then run lint, tests, and build.
662
+
663
+ ### Example 4: Build A Brand And Asset System
664
+
665
+ User trigger: `Create a brand identity, icon system, and presentation deck for this product.`
666
+
667
+ Action sequence:
668
+
669
+ 1. Inspect the product task, users, existing marks, assets, tokens, competitors, and delivery channels.
670
+ 2. Load the brand, asset, icon, presentation, licensing, and visual-accessibility design-intelligence modules.
671
+ 3. Create the design-deliverable manifest and define brand promise, attributes, avoid-list, voice, token layers, and required mark variants.
672
+ 4. Create or source only the assets required by the product brief; record rights and generation evidence before use.
673
+ 5. Define icon meanings and geometry, then build presentation masters and slide purposes from the product narrative.
674
+ 6. Validate the manifest, inspect final assets and exports, verify actual contrast and alternatives, and report remaining rights or human-review obligations.
675
+
676
+ ## Troubleshooting
677
+
678
+ | Problem | Diagnosis | Resolution |
679
+ |---|---|---|
680
+ | Missing or inconsistent tokens | Components contain raw colors, spacing, radii, or one-off status styles | Create primitive, semantic, and component layers; migrate shared components first; search for remaining raw values and document intentional exceptions |
681
+ | Bad component coupling | A visual component imports storage, networking, model clients, or unrelated feature state | Move policy and effects behind a client-owned interface; inject data and actions; keep the visual component responsible for rendering and local interaction |
682
+ | Circular package dependencies | Features import each other or a shared package imports a consumer | Map the dependency graph; move the stable contract to the policy owner or a new cohesive package; invert the volatile implementation dependency |
683
+ | Fat component API | Consumers receive many props or methods they never use | Split by client role and reason for change; expose focused interfaces and compose behavior at a higher boundary |
684
+ | Fragile variants | A subtype disables inherited behavior, throws unexpectedly, or requires stricter inputs | Restore substitutability, extract a valid common contract, or replace inheritance with composition and explicit strategies |
685
+ | Premature abstraction | Factories, services, or framework layers exist for a single stable implementation | Remove the unused indirection; reintroduce an abstraction only at a demonstrated variation or testing boundary |
686
+ | Unclear architecture choice | The team prefers a style but cannot connect it to requirements | Create measurable scenarios, compare options by quality attributes, and record risks, sensitivity points, trade-offs, and reversal cost |
687
+ | Opaque AI output | Results lack evidence, confidence, source context, or a clear next action | Reorder as summary, findings, recommendation, evidence, action; mark limitations and require review for consequential use |
688
+ | Frozen long-running UI | Submit gives no immediate response or blocks unrelated work | Show feedback within 100 ms, staged status after 300 ms, cancellation and retry, and keep editable work available unless immutability is required |
689
+ | Lost user input | Validation, rate limits, navigation, or service errors clear the form | Store drafts separately from request state; preserve input and configuration; explain cause, recovery, and preservation status |
690
+ | Color-only status | Severity, confidence, or progress is understandable only from hue | Add readable labels, icons or patterns, numeric values, and assistive-technology text; keep color supplemental |
691
+ | Dashboard cannot scale | A growing table lacks search, filters, sorting, empty states, or bulk feedback | Add controls based on lookup behavior, selection counts, pagination or virtualization, and explicit loading and empty states |
692
+ | Mobile scroll conflict | Split panes or nested tables create competing scroll regions | Replace simultaneous panes with tabs, drawers, or stacking; keep the primary action reachable and retest at 375 CSS pixels |
693
+ | Unsafe destructive action | Delete, reset, approval, or bulk mutation resembles a primary action | Separate it visually and structurally, show impact and selection count, require confirmation, and provide recovery copy where possible |
694
+ | Production trust gap | Users cannot tell auth context, processing location, retention, health, or failure identity | Surface workspace and auth context, processing boundaries, retention, status, rate-limit details, and request ID near the relevant workflow |
695
+ | Untraceable design asset | A logo, image, font, icon, or generated asset has no source, rights basis, or evidence | Remove it from shipping output until an approved asset record identifies origin, creator, rights basis, evidence, restrictions, and attribution |
696
+ | Inconsistent icon family | Icons mix grids, stroke weights, fill strategies, or meanings | Select one approved source strategy; normalize geometry and semantics; replace Unicode or one-off glyphs through the icon component boundary |
697
+ | Figma implementation drift | Variables, components, and code tokens evolve independently | Declare one canonical token source, map collections and modes to it, compare exports, and document synchronization direction and conflict policy |
698
+ | Presentation is decorative but unclear | Slides use inconsistent layouts, vague titles, tiny screenshots, or unlicensed imagery | Rebuild from a decision narrative and master layouts; give every slide one purpose, explicit reading order, and approved evidence-bearing assets |