@qijenchen/design-system 0.1.0-beta.92 → 0.1.0-beta.95

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 (493) hide show
  1. package/AGENTS.md +6 -208
  2. package/CLAUDE.md +2 -23
  3. package/dist/components/DataTable/data-table-filter-value-picker.js +4 -0
  4. package/dist/components/DataTable/data-table-filter-value-picker.js.map +1 -1
  5. package/dist/components/DataTable/filter-tree.js +6 -0
  6. package/dist/components/DataTable/filter-tree.js.map +1 -1
  7. package/dist/patterns/element-anatomy/item-anatomy.js +1 -1
  8. package/ds-canonical/adapters/claude/agents/README.md +58 -0
  9. package/ds-canonical/adapters/claude/agents/canonical-reviewer.md +14 -0
  10. package/ds-canonical/adapters/claude-root-instructions.md +24 -0
  11. package/ds-canonical/adapters/claude-settings-base.json +172 -0
  12. package/ds-canonical/commands/README.md +8 -13
  13. package/ds-canonical/commands/gov-status.md +5 -75
  14. package/ds-canonical/fork/AGENTS.md +116 -213
  15. package/ds-canonical/fork/CLAUDE.md +54 -0
  16. package/ds-canonical/fork/codex/agents/skills/bug-fix-rhythm/SKILL.md +207 -0
  17. package/ds-canonical/fork/codex/agents/skills/code-quality-audit/SKILL.md +71 -0
  18. package/ds-canonical/fork/codex/agents/skills/delivery-handoff/SKILL.md +244 -0
  19. package/ds-canonical/fork/codex/agents/skills/delivery-handoff/references/flow-diagram.md +180 -0
  20. package/ds-canonical/fork/codex/agents/skills/delivery-handoff/references/handoff-template.md +177 -0
  21. package/ds-canonical/fork/codex/agents/skills/delivery-handoff/references/inventory-checklist.md +196 -0
  22. package/ds-canonical/fork/codex/agents/skills/independent-review/SKILL.md +29 -19
  23. package/ds-canonical/fork/codex/agents/skills/independent-review/agents/openai.yaml +4 -0
  24. package/ds-canonical/fork/codex/agents/skills/independent-review/references/evidence-contract.md +24 -0
  25. package/ds-canonical/fork/codex/agents/skills/performance-audit/SKILL.md +114 -0
  26. package/ds-canonical/fork/codex/agents/skills/product-ui-audit/SKILL.md +244 -0
  27. package/ds-canonical/fork/codex/agents/skills/product-ui-audit/references/audit-checks.md +250 -0
  28. package/ds-canonical/fork/codex/agents/skills/product-ui-audit/references/common-misuses.md +329 -0
  29. package/ds-canonical/fork/codex/agents/skills/product-ui-audit/references/report-template.md +163 -0
  30. package/ds-canonical/fork/codex/agents/skills/propose-options/SKILL.md +190 -0
  31. package/ds-canonical/fork/codex/agents/skills/prototype/SKILL.md +246 -0
  32. package/ds-canonical/fork/codex/agents/skills/prototype/references/audit-checks.md +39 -0
  33. package/ds-canonical/fork/codex/agents/skills/prototype/references/benchmark-sources.md +94 -0
  34. package/ds-canonical/fork/codex/agents/skills/prototype/references/checkpoints.md +200 -0
  35. package/ds-canonical/fork/codex/agents/skills/prototype/references/evaluation-matrix.md +142 -0
  36. package/ds-canonical/fork/codex/agents/skills/prototype/references/ooux-template.md +198 -0
  37. package/ds-canonical/fork/codex/agents/skills/prototype/references/proposal-template.md +230 -0
  38. package/ds-canonical/fork/codex/agents/skills/scan-similar-bugs/SKILL.md +212 -0
  39. package/ds-canonical/fork/codex/agents/skills/ux-audit/SKILL.md +135 -0
  40. package/ds-canonical/fork/codex/agents/skills/visual-audit/SKILL.md +259 -0
  41. package/ds-canonical/fork/codex/agents/skills/visual-audit/output/.gitkeep +0 -0
  42. package/ds-canonical/fork/codex/agents/skills/visual-audit/references/audit-architecture.md +101 -0
  43. package/ds-canonical/fork/codex/agents/skills/visual-audit/references/visual-checklist.md +297 -0
  44. package/ds-canonical/fork/codex/agents/skills/visual-audit/references/world-class-benchmarks.md +198 -0
  45. package/ds-canonical/fork/codex/hooks.json +44 -3
  46. package/ds-canonical/fork/common/closed-tool-execution.mjs +1001 -0
  47. package/ds-canonical/fork/common/instruction.md +116 -0
  48. package/ds-canonical/fork/consumer/governance-check.mjs +3059 -0
  49. package/ds-canonical/fork/consumer/lib/closed-tool-execution.mjs +1001 -0
  50. package/ds-canonical/fork/consumer/lock.json +189 -0
  51. package/ds-canonical/fork/consumer/lock.schema.json +338 -0
  52. package/ds-canonical/fork/consumer/managed-files/0235cf6b3fd402a3717881dc205b5bf77aed7632e7d7d6f1811a40e3033bd816.blob +145 -0
  53. package/ds-canonical/fork/consumer/managed-files/145aab4b4fc470fc9ba7679b4a1d87d4f6a6d604940bd40f8d675c8af696498f.blob +47 -0
  54. package/ds-canonical/fork/consumer/managed-files/189e551431181e4a88783c02130d2787b801ef731c86e35bcde89a7313aa020e.blob +149 -0
  55. package/ds-canonical/fork/consumer/managed-files/24ad71c8613ddcf6fd23818cb3bb477a1fb6d83af4550b0bad43099813088686.blob +28 -0
  56. package/ds-canonical/fork/consumer/managed-files/2d1ef5617a5ce3c39ad9aae1c42af7d199f9270c0a0ccb490b63d62dbc6913db.blob +1001 -0
  57. package/ds-canonical/fork/consumer/managed-files/3625e02235cf166a50649a4d704cfb68fead69d0e168c481df013ebae9f6be25.blob +1412 -0
  58. package/ds-canonical/fork/consumer/managed-files/3ddedc67b464bdfe3dde9803a2d917920c96d633678b802eee638a44cd47366a.blob +8 -0
  59. package/ds-canonical/fork/consumer/managed-files/423729840acdd43c812f17c245b871716c6b60f76e4d3e94864d0e34a815bf8d.blob +348 -0
  60. package/ds-canonical/fork/consumer/managed-files/46f10bc55cdfdf834d0749eebff42ea0bb8576f361b36d2b6ba1851354c50150.blob +464 -0
  61. package/ds-canonical/fork/consumer/managed-files/475fba657eaeb8abd88f60635f3eadab27a9d0d3114ba4fffc65f43a2a0fe6e2.blob +124 -0
  62. package/ds-canonical/fork/consumer/managed-files/61c6aca6d7f04bedbf556eaa9d3043681fe48cbe0e93a8ccb1d69a7c5e23fdcf.blob +113 -0
  63. package/ds-canonical/fork/consumer/managed-files/63061e05969667005020166ea2ae7df3c96663f7a928e7dd3eebc1471022df56.blob +2398 -0
  64. package/ds-canonical/fork/consumer/managed-files/65410b66e8799a560e07b71779c186fed2a0ef50575ac44745df7a0938a9c2b4.blob +317 -0
  65. package/ds-canonical/fork/consumer/managed-files/6929a3c8bb4d69c507720b4754aeb339c6cbb8ff655e0a381d76606d64695e38.blob +393 -0
  66. package/ds-canonical/fork/consumer/managed-files/6b746628ac11fcccbe277ef6fea94cc2a7b90ea2822e83536eae80d5ee4b3fa5.blob +167 -0
  67. package/ds-canonical/fork/consumer/managed-files/76d485470d30ff014afacf7ce643763de9f4f956d9fc8128dbc1814774cf2e63.blob +671 -0
  68. package/ds-canonical/fork/consumer/managed-files/77e06f62670dfee01e9b5e8b0f8dad085ce711d75538c1fb0679d9818acaca82.blob +424 -0
  69. package/ds-canonical/fork/consumer/managed-files/7937321877e5c34c27dae36c0d507d21cd42fa3f46a8f11a284b8b4a52b6faa4.blob +84 -0
  70. package/ds-canonical/fork/consumer/managed-files/794bb911ba8ebef58ab0d44a55b9968a19d2c62bcfb310b1ee3a84166f087f21.blob +880 -0
  71. package/ds-canonical/fork/consumer/managed-files/7b17835d0ceb17cdcdcaf930540a3e5d0943a34a747ac43c12ca8cd485c11581.blob +44 -0
  72. package/ds-canonical/fork/consumer/managed-files/7eb6cc60abfdabaf6617c336058fad1454ccde08889295767bfd9b7fd153cc6e.blob +778 -0
  73. package/ds-canonical/fork/consumer/managed-files/81037efa5b3b9f4a875704005fb268acdc9233bb901f44902e4e37e1da92b8e3.blob +46 -0
  74. package/ds-canonical/fork/consumer/managed-files/884721550b56308812b20917adac7a12f36fdb4ecda6b02460a7f5a219c0c966.blob +78 -0
  75. package/ds-canonical/fork/consumer/managed-files/91f414b9462ddc1e4be1d4c6ca4ac7a7340a6eec9e98ee109cbc049d3b354b6a.blob +36 -0
  76. package/ds-canonical/fork/consumer/managed-files/92e4828cdcb96ff0d01daa16f6885f24045a8e72820665650f2a1890dc3a446c.blob +121 -0
  77. package/ds-canonical/fork/consumer/managed-files/93a89f16f6717d1e4e4e27ec20ef916e3355c7aa890ca74cd9b12db30d8a899f.blob +43 -0
  78. package/ds-canonical/fork/consumer/managed-files/974521d6b8fe796ea4c58b3c78b0c2b8a1be262b97100d77aaf4cc9c7724bcab.blob +45 -0
  79. package/ds-canonical/fork/consumer/managed-files/9791c85388d2e2e2bd564e2550fadc3351c4c960a47ce838098afcba7544eb90.blob +959 -0
  80. package/ds-canonical/fork/consumer/managed-files/a448d2222133335c30e6fda5116e26a40db3283a19d62ccc0663c30d272262a7.blob +174 -0
  81. package/ds-canonical/fork/consumer/managed-files/ab072e7f2eca51f0e18a5e18c4b333260ee5d219a12cc6df5bb2d683f0b2734d.blob +2636 -0
  82. package/ds-canonical/fork/consumer/managed-files/bc44cabad181f766611dab6a8f52d81100afadd50ac59799015e8ba7bf46d9eb.blob +596 -0
  83. package/ds-canonical/fork/consumer/managed-files/c4aa767f11714467de0038a2149cf78074baddc17fc6a9e074b6aed7544c6f3c.blob +80 -0
  84. package/ds-canonical/fork/consumer/managed-files/c893e9b734b162f4c631fef871128c16a9ab565f796a0e76d7f320f821f220f5.blob +41 -0
  85. package/ds-canonical/fork/consumer/managed-files/cd9c61f8ff24fb9bcc3663e346e2cfa419cfb84e02aae18d3dc66dd192681696.blob +9 -0
  86. package/ds-canonical/fork/consumer/managed-files/da2ad2737315d25a5300905ddefd62f1695056a8a1af155c5b34170ad9923bce.blob +38 -0
  87. package/ds-canonical/fork/consumer/managed-files/e1b11160d6c4043002d2cbff6d9a4ae551698a96137773c4244dadfac152fcb0.blob +222 -0
  88. package/ds-canonical/fork/consumer/managed-files/e26057408661597aac4a57cdf7e30e2f9d0afb1b9a2dbbb692c3805cd9028ca5.blob +250 -0
  89. package/ds-canonical/fork/consumer/managed-files/e68ae1915965d8e17d4b2441c00c2b97fe062ea308ae8535c9eebb2fc16fa245.blob +20 -0
  90. package/ds-canonical/fork/consumer/managed-files/e71c65f45c6af7ce12b6b3c0d8028f185da5b719e2050c9b2a6b243d41ae4878.blob +182 -0
  91. package/ds-canonical/fork/consumer/managed-files/e813096d69c49812e40e00be9ac8fa14d77f0ec1f97ab4c45cb096b3bedd35de.blob +3 -0
  92. package/ds-canonical/fork/consumer/managed-files/e930ebca6fd8eeb30802aac0930efae7bcc44cc0996f24de07c11ca6a081fedf.blob +277 -0
  93. package/ds-canonical/fork/consumer/managed-files/ea94e914d5c8acb84ad7660e5bda0f01b6ccc8cf96b0f6b1ce048f8938d0f5b5.blob +47 -0
  94. package/ds-canonical/fork/consumer/managed-files/f4db6e616d5229aa7e700c6a3ace022cb9d90baae74e38ca65fce617f18e0d9b.blob +110 -0
  95. package/ds-canonical/fork/consumer/managed-files/faa128c26102415dc5345e68698efbbd28a395c35ee278dceae044cf430692b2.blob +11 -0
  96. package/ds-canonical/fork/governance.lock +1552 -103
  97. package/ds-canonical/fork/hooks/_log-fire.sh +109 -12
  98. package/ds-canonical/fork/hooks/block_prototype_imports.py +148 -29
  99. package/ds-canonical/fork/hooks/check_chrome_header_avatar_canonical.sh +23 -12
  100. package/ds-canonical/fork/hooks/check_consumer_app_invariants.sh +116 -65
  101. package/ds-canonical/fork/hooks/check_consumer_code_quality.sh +140 -0
  102. package/ds-canonical/fork/hooks/check_ds_anchor_preflight.sh +84 -30
  103. package/ds-canonical/fork/hooks/check_dynamic_tailwind_class.sh +16 -6
  104. package/ds-canonical/fork/hooks/check_escape_marker_abuse.sh +65 -21
  105. package/ds-canonical/fork/hooks/check_field_family_invariants.sh +90 -24
  106. package/ds-canonical/fork/hooks/check_fork_product_quality.sh +8 -6
  107. package/ds-canonical/fork/hooks/check_item_list_gap.sh +4 -2
  108. package/ds-canonical/fork/hooks/check_layout_space_magic_numbers.sh +31 -13
  109. package/ds-canonical/fork/hooks/check_opacity_token_usage.sh +220 -95
  110. package/ds-canonical/fork/hooks/check_pattern_invariants.sh +73 -14
  111. package/ds-canonical/fork/hooks/check_sidebar_menu_button_implicit_wrap.sh +23 -12
  112. package/ds-canonical/fork/hooks/check_story_determinism.sh +1 -1
  113. package/ds-canonical/fork/hooks/check_story_invariants.sh +342 -61
  114. package/ds-canonical/fork/hooks/check_tabs_content_chrome_body_double_gap.sh +52 -23
  115. package/ds-canonical/fork/hooks/check_tailwind_wildcard_in_docs.sh +20 -13
  116. package/ds-canonical/fork/hooks/inject_deploy_url_after_push.sh +105 -22
  117. package/ds-canonical/fork/hooks/lib/_hook_integrity.sh +158 -0
  118. package/ds-canonical/fork/hooks/lib/_provider_paths.sh +162 -0
  119. package/ds-canonical/fork/launchers/approval-evidence.mjs +1131 -0
  120. package/ds-canonical/fork/launchers/authority-decision-evidence.mjs +413 -0
  121. package/ds-canonical/fork/launchers/canonical-order.mjs +8 -0
  122. package/ds-canonical/fork/launchers/fork-governance-dispatcher.sh +139 -29
  123. package/ds-canonical/fork/launchers/format-provider-hook-output.mjs +25 -0
  124. package/ds-canonical/fork/launchers/independent-review.mjs +490 -0
  125. package/ds-canonical/fork/launchers/inject_fork_governance_preamble.sh +88 -43
  126. package/ds-canonical/fork/launchers/normalize-provider-event.mjs +355 -0
  127. package/ds-canonical/fork/launchers/product-hook-dispatch-runtime.mjs +1067 -0
  128. package/ds-canonical/fork/launchers/provider-hook-normalization.mjs +1646 -0
  129. package/ds-canonical/fork/launchers/provider-hook-output-transport.mjs +525 -0
  130. package/ds-canonical/fork/launchers/settings-hooks.json +30 -53
  131. package/ds-canonical/fork/manifest.json +1881 -23
  132. package/ds-canonical/fork/providers/claude/hook-config.json +333 -0
  133. package/ds-canonical/fork/providers/claude/instruction.md +54 -0
  134. package/ds-canonical/fork/providers/claude/skills/bug-fix-rhythm/SKILL.md +207 -0
  135. package/ds-canonical/fork/providers/claude/skills/code-quality-audit/SKILL.md +71 -0
  136. package/ds-canonical/fork/providers/claude/skills/delivery-handoff/SKILL.md +244 -0
  137. package/ds-canonical/fork/providers/claude/skills/delivery-handoff/references/flow-diagram.md +180 -0
  138. package/ds-canonical/fork/providers/claude/skills/delivery-handoff/references/handoff-template.md +177 -0
  139. package/ds-canonical/fork/providers/claude/skills/delivery-handoff/references/inventory-checklist.md +196 -0
  140. package/ds-canonical/fork/providers/claude/skills/independent-review/SKILL.md +43 -0
  141. package/ds-canonical/fork/providers/claude/skills/independent-review/agents/openai.yaml +4 -0
  142. package/ds-canonical/fork/providers/claude/skills/independent-review/references/evidence-contract.md +24 -0
  143. package/ds-canonical/fork/providers/claude/skills/performance-audit/SKILL.md +114 -0
  144. package/ds-canonical/fork/providers/claude/skills/product-ui-audit/SKILL.md +244 -0
  145. package/ds-canonical/fork/providers/claude/skills/product-ui-audit/references/audit-checks.md +250 -0
  146. package/ds-canonical/fork/providers/claude/skills/product-ui-audit/references/common-misuses.md +329 -0
  147. package/ds-canonical/fork/providers/claude/skills/product-ui-audit/references/report-template.md +163 -0
  148. package/ds-canonical/fork/providers/claude/skills/propose-options/SKILL.md +190 -0
  149. package/ds-canonical/fork/providers/claude/skills/prototype/SKILL.md +246 -0
  150. package/ds-canonical/fork/providers/claude/skills/prototype/references/audit-checks.md +39 -0
  151. package/ds-canonical/fork/providers/claude/skills/prototype/references/benchmark-sources.md +94 -0
  152. package/ds-canonical/fork/providers/claude/skills/prototype/references/checkpoints.md +200 -0
  153. package/ds-canonical/fork/providers/claude/skills/prototype/references/evaluation-matrix.md +142 -0
  154. package/ds-canonical/fork/providers/claude/skills/prototype/references/ooux-template.md +198 -0
  155. package/ds-canonical/fork/providers/claude/skills/prototype/references/proposal-template.md +230 -0
  156. package/ds-canonical/fork/providers/claude/skills/scan-similar-bugs/SKILL.md +212 -0
  157. package/ds-canonical/fork/providers/claude/skills/ux-audit/SKILL.md +135 -0
  158. package/ds-canonical/fork/providers/claude/skills/visual-audit/SKILL.md +259 -0
  159. package/ds-canonical/fork/providers/claude/skills/visual-audit/output/.gitkeep +0 -0
  160. package/ds-canonical/fork/providers/claude/skills/visual-audit/references/audit-architecture.md +101 -0
  161. package/ds-canonical/fork/providers/claude/skills/visual-audit/references/visual-checklist.md +297 -0
  162. package/ds-canonical/fork/providers/claude/skills/visual-audit/references/world-class-benchmarks.md +198 -0
  163. package/ds-canonical/fork/providers/codex/hook-config.json +57 -0
  164. package/ds-canonical/fork/providers/codex/skills/bug-fix-rhythm/SKILL.md +207 -0
  165. package/ds-canonical/fork/providers/codex/skills/code-quality-audit/SKILL.md +71 -0
  166. package/ds-canonical/fork/providers/codex/skills/delivery-handoff/SKILL.md +244 -0
  167. package/ds-canonical/fork/providers/codex/skills/delivery-handoff/references/flow-diagram.md +180 -0
  168. package/ds-canonical/fork/providers/codex/skills/delivery-handoff/references/handoff-template.md +177 -0
  169. package/ds-canonical/fork/providers/codex/skills/delivery-handoff/references/inventory-checklist.md +196 -0
  170. package/ds-canonical/fork/providers/codex/skills/independent-review/SKILL.md +43 -0
  171. package/ds-canonical/fork/providers/codex/skills/independent-review/agents/openai.yaml +4 -0
  172. package/ds-canonical/fork/providers/codex/skills/independent-review/references/evidence-contract.md +24 -0
  173. package/ds-canonical/fork/providers/codex/skills/performance-audit/SKILL.md +114 -0
  174. package/ds-canonical/fork/providers/codex/skills/product-ui-audit/SKILL.md +244 -0
  175. package/ds-canonical/fork/providers/codex/skills/product-ui-audit/references/audit-checks.md +250 -0
  176. package/ds-canonical/fork/providers/codex/skills/product-ui-audit/references/common-misuses.md +329 -0
  177. package/ds-canonical/fork/providers/codex/skills/product-ui-audit/references/report-template.md +163 -0
  178. package/ds-canonical/fork/providers/codex/skills/propose-options/SKILL.md +190 -0
  179. package/ds-canonical/fork/providers/codex/skills/prototype/SKILL.md +246 -0
  180. package/ds-canonical/fork/providers/codex/skills/prototype/references/audit-checks.md +39 -0
  181. package/ds-canonical/fork/providers/codex/skills/prototype/references/benchmark-sources.md +94 -0
  182. package/ds-canonical/fork/providers/codex/skills/prototype/references/checkpoints.md +200 -0
  183. package/ds-canonical/fork/providers/codex/skills/prototype/references/evaluation-matrix.md +142 -0
  184. package/ds-canonical/fork/providers/codex/skills/prototype/references/ooux-template.md +198 -0
  185. package/ds-canonical/fork/providers/codex/skills/prototype/references/proposal-template.md +230 -0
  186. package/ds-canonical/fork/providers/codex/skills/scan-similar-bugs/SKILL.md +212 -0
  187. package/ds-canonical/fork/providers/codex/skills/ux-audit/SKILL.md +135 -0
  188. package/ds-canonical/fork/providers/codex/skills/visual-audit/SKILL.md +259 -0
  189. package/ds-canonical/fork/providers/codex/skills/visual-audit/output/.gitkeep +0 -0
  190. package/ds-canonical/fork/providers/codex/skills/visual-audit/references/audit-architecture.md +101 -0
  191. package/ds-canonical/fork/providers/codex/skills/visual-audit/references/visual-checklist.md +297 -0
  192. package/ds-canonical/fork/providers/codex/skills/visual-audit/references/world-class-benchmarks.md +198 -0
  193. package/ds-canonical/fork/references/story-baseline-registry.json +117 -0
  194. package/ds-canonical/fork/references/story-baseline-registry.schema.json +145 -0
  195. package/ds-canonical/fork/references/utility-registry.json +377 -0
  196. package/ds-canonical/fork/references/utility-registry.schema.json +373 -0
  197. package/ds-canonical/fork/review/canonical-order.mjs +8 -0
  198. package/ds-canonical/fork/review/provider-review-binding.mjs +2377 -0
  199. package/ds-canonical/fork/skills/bug-fix-rhythm/SKILL.md +19 -12
  200. package/ds-canonical/fork/skills/code-quality-audit/SKILL.md +19 -15
  201. package/ds-canonical/fork/skills/delivery-handoff/SKILL.md +17 -11
  202. package/ds-canonical/fork/skills/independent-review/SKILL.md +37 -0
  203. package/ds-canonical/fork/skills/independent-review/agents/openai.yaml +4 -0
  204. package/ds-canonical/fork/skills/independent-review/references/evidence-contract.md +24 -0
  205. package/ds-canonical/fork/skills/performance-audit/SKILL.md +11 -8
  206. package/ds-canonical/fork/skills/product-ui-audit/SKILL.md +31 -21
  207. package/ds-canonical/fork/skills/product-ui-audit/references/audit-checks.md +9 -5
  208. package/ds-canonical/fork/skills/product-ui-audit/references/report-template.md +30 -26
  209. package/ds-canonical/fork/skills/propose-options/SKILL.md +6 -4
  210. package/ds-canonical/fork/skills/prototype/SKILL.md +21 -21
  211. package/ds-canonical/fork/skills/prototype/references/audit-checks.md +7 -6
  212. package/ds-canonical/fork/skills/prototype/references/checkpoints.md +26 -17
  213. package/ds-canonical/fork/skills/prototype/references/evaluation-matrix.md +2 -1
  214. package/ds-canonical/fork/skills/prototype/references/ooux-template.md +1 -1
  215. package/ds-canonical/fork/skills/prototype/references/proposal-template.md +6 -5
  216. package/ds-canonical/fork/skills/scan-similar-bugs/SKILL.md +28 -27
  217. package/ds-canonical/fork/skills/ux-audit/SKILL.md +8 -5
  218. package/ds-canonical/fork/skills/visual-audit/SKILL.md +37 -43
  219. package/ds-canonical/fork/skills/visual-audit/references/audit-architecture.md +15 -15
  220. package/ds-canonical/fork/skills/visual-audit/references/visual-checklist.md +6 -6
  221. package/ds-canonical/fork/skills/visual-audit/references/world-class-benchmarks.md +2 -2
  222. package/ds-canonical/hooks/README.md +37 -23
  223. package/ds-canonical/hooks/_log-fire.sh +109 -12
  224. package/ds-canonical/hooks/auto_regen_ds_barrel.sh +52 -20
  225. package/ds-canonical/hooks/block_prototype_imports.py +148 -29
  226. package/ds-canonical/hooks/check_audit_post_report_validator.sh +76 -66
  227. package/ds-canonical/hooks/check_audit_sample_escape.sh +4 -4
  228. package/ds-canonical/hooks/check_benchmark_citation.sh +3 -3
  229. package/ds-canonical/hooks/check_canonical_propagation.sh +81 -22
  230. package/ds-canonical/hooks/check_chrome_header_avatar_canonical.sh +22 -11
  231. package/ds-canonical/hooks/check_codex_brief_invariants.sh +100 -56
  232. package/ds-canonical/hooks/check_codex_collab_5step.sh +31 -25
  233. package/ds-canonical/hooks/check_consumer_app_invariants.sh +116 -65
  234. package/ds-canonical/hooks/check_consumer_code_quality.sh +140 -0
  235. package/ds-canonical/hooks/check_datatable_invariants.sh +103 -25
  236. package/ds-canonical/hooks/check_dim_count_drift.sh +5 -4
  237. package/ds-canonical/hooks/check_ds_anchor_preflight.sh +83 -29
  238. package/ds-canonical/hooks/check_dynamic_tailwind_class.sh +16 -6
  239. package/ds-canonical/hooks/check_escape_marker_abuse.sh +65 -21
  240. package/ds-canonical/hooks/check_field_controls_contracts.sh +10 -8
  241. package/ds-canonical/hooks/check_field_family_invariants.sh +90 -24
  242. package/ds-canonical/hooks/check_file_size_budget.sh +32 -14
  243. package/ds-canonical/hooks/check_full_story_visual_interaction_sweep.sh +60 -21
  244. package/ds-canonical/hooks/check_item_list_gap.sh +4 -2
  245. package/ds-canonical/hooks/check_layout_space_magic_numbers.sh +31 -13
  246. package/ds-canonical/hooks/check_main_branch_workbench.sh +27 -68
  247. package/ds-canonical/hooks/check_naming_and_abstraction.sh +20 -9
  248. package/ds-canonical/hooks/check_opacity_token_usage.sh +220 -95
  249. package/ds-canonical/hooks/check_orphan_ds_css.sh +48 -18
  250. package/ds-canonical/hooks/check_overlay_open_focus_escape_probe.sh +29 -11
  251. package/ds-canonical/hooks/check_pattern_invariants.sh +73 -14
  252. package/ds-canonical/hooks/check_peoplepicker_ssot_drift.sh +4 -4
  253. package/ds-canonical/hooks/check_pixel_quantified_audit.sh +3 -2
  254. package/ds-canonical/hooks/check_plugin_fork_health.sh +151 -41
  255. package/ds-canonical/hooks/check_post_main_ssot_propagate.sh +5 -109
  256. package/ds-canonical/hooks/check_propose_discipline.sh +116 -29
  257. package/ds-canonical/hooks/check_propose_pre_grep_verify.sh +6 -4
  258. package/ds-canonical/hooks/check_propose_without_benchmark.sh +10 -6
  259. package/ds-canonical/hooks/check_select_all_canonical.sh +1 -1
  260. package/ds-canonical/hooks/check_sidebar_menu_button_implicit_wrap.sh +22 -11
  261. package/ds-canonical/hooks/check_solo_workflow.sh +117 -186
  262. package/ds-canonical/hooks/check_spec_class_drift.sh +33 -19
  263. package/ds-canonical/hooks/check_ssot_header_declaration.sh +6 -5
  264. package/ds-canonical/hooks/check_story_determinism.sh +1 -1
  265. package/ds-canonical/hooks/check_story_invariants.sh +526 -213
  266. package/ds-canonical/hooks/check_storybook_addon_packaging.sh +65 -15
  267. package/ds-canonical/hooks/check_substantive_edit_approval_preflight.sh +137 -67
  268. package/ds-canonical/hooks/check_tabs_content_chrome_body_double_gap.sh +52 -23
  269. package/ds-canonical/hooks/check_tailwind_wildcard_in_docs.sh +20 -13
  270. package/ds-canonical/hooks/check_wrapper_primitive_schema_drift.sh +15 -12
  271. package/ds-canonical/hooks/chrome_header_dispatcher.sh +75 -26
  272. package/ds-canonical/hooks/enforce_home_charter.sh +29 -8
  273. package/ds-canonical/hooks/governance_control_plane.sh +15 -0
  274. package/ds-canonical/hooks/inject_deploy_url_after_push.sh +105 -22
  275. package/ds-canonical/hooks/inject_pending_self_audit.sh +27 -24
  276. package/ds-canonical/hooks/lib/_app_shell_primary_header_consistency.sh +77 -29
  277. package/ds-canonical/hooks/lib/_approval_re.sh +5 -6
  278. package/ds-canonical/hooks/lib/_chrome_header_handcraft.sh +66 -20
  279. package/ds-canonical/hooks/lib/_code_quality.sh +9 -9
  280. package/ds-canonical/hooks/lib/_cva_default_sync.sh +11 -13
  281. package/ds-canonical/hooks/lib/_governance_coverage_check.sh +48 -21
  282. package/ds-canonical/hooks/lib/_hardcoded_strings.sh +13 -10
  283. package/ds-canonical/hooks/lib/_header_with_tabs_border.sh +68 -48
  284. package/ds-canonical/hooks/lib/_hook_integrity.sh +158 -0
  285. package/ds-canonical/hooks/lib/_layout_space_canonical.sh +5 -5
  286. package/ds-canonical/hooks/lib/_overlay_handcraft.sh +21 -23
  287. package/ds-canonical/hooks/lib/_person_data_richness.sh +5 -5
  288. package/ds-canonical/hooks/lib/_provider_paths.sh +162 -0
  289. package/ds-canonical/hooks/lib/_story_compile_drift.sh +5 -5
  290. package/ds-canonical/hooks/lib/_tab_lg_chrome_header_equal.sh +247 -27
  291. package/ds-canonical/hooks/lib/_token_hygiene.sh +39 -22
  292. package/ds-canonical/hooks/lib/approval-evidence.mjs +1131 -0
  293. package/ds-canonical/hooks/lib/audit-report-validator.mjs +118 -0
  294. package/ds-canonical/hooks/lib/provider-marker-regex.mjs +23 -0
  295. package/ds-canonical/hooks/lib/tsx-governance-analysis.mjs +410 -0
  296. package/ds-canonical/hooks/log_governance_fires.sh +45 -13
  297. package/ds-canonical/hooks/log_skill_invokes.sh +8 -7
  298. package/ds-canonical/hooks/post_edit_dispatcher.sh +106 -28
  299. package/ds-canonical/hooks/registrations.json +488 -0
  300. package/ds-canonical/hooks/registrations.schema.json +58 -0
  301. package/ds-canonical/hooks/retired/2026-06-11-prune-merge/check_propose_plain_chinese.sh +1 -1
  302. package/ds-canonical/hooks/retired/check_governance_compliance.sh +1 -1
  303. package/ds-canonical/hooks/session_start_governance_check.sh +109 -78
  304. package/ds-canonical/hooks/stop_audit_content_quality.sh +20 -0
  305. package/ds-canonical/hooks/stop_extract_canonical_rules.sh +20 -0
  306. package/ds-canonical/hooks/stop_passive_logging.sh +133 -59
  307. package/ds-canonical/hooks/stop_self_audit.sh +349 -210
  308. package/ds-canonical/hooks/tests/fixtures/transcripts/claude-transcript-jsonl-v1.jsonl +3 -0
  309. package/ds-canonical/hooks/tests/fixtures/transcripts/claude-transcript-jsonl-v2.jsonl +3 -0
  310. package/ds-canonical/hooks/tests/registration-output-contracts.mjs +151 -0
  311. package/ds-canonical/hooks/tests/run-all.sh +35 -5
  312. package/ds-canonical/hooks/tests/test_auto_regen_ds_barrel.sh +48 -4
  313. package/ds-canonical/hooks/tests/test_block_prototype_imports.sh +157 -9
  314. package/ds-canonical/hooks/tests/test_check_app_shell_primary_header_consistency.sh +265 -127
  315. package/ds-canonical/hooks/tests/test_check_audit_post_report_validator.sh +119 -12
  316. package/ds-canonical/hooks/tests/test_check_audit_sample_escape.sh +0 -0
  317. package/ds-canonical/hooks/tests/test_check_benchmark_citation.sh +0 -0
  318. package/ds-canonical/hooks/tests/test_check_canonical_propagation.sh +56 -5
  319. package/ds-canonical/hooks/tests/test_check_chrome_header_avatar_canonical.sh +6 -6
  320. package/ds-canonical/hooks/tests/test_check_chrome_header_handcraft.sh +193 -100
  321. package/ds-canonical/hooks/tests/test_check_codex_brief_invariants.sh +143 -17
  322. package/ds-canonical/hooks/tests/test_check_codex_collab_5step.sh +49 -5
  323. package/ds-canonical/hooks/tests/test_check_consumer_app_invariants.sh +128 -0
  324. package/ds-canonical/hooks/tests/test_check_consumer_app_story_title.sh +2 -2
  325. package/ds-canonical/hooks/tests/test_check_consumer_code_quality.sh +64 -0
  326. package/ds-canonical/hooks/tests/test_check_consumer_ds_primitive_misuse.sh +2 -2
  327. package/ds-canonical/hooks/tests/test_check_consumer_no_ds_catalog.sh +2 -2
  328. package/ds-canonical/hooks/tests/test_check_consumer_story_baseline.sh +2 -2
  329. package/ds-canonical/hooks/tests/test_check_data_table_size_num_to_meta_width.sh +26 -8
  330. package/ds-canonical/hooks/tests/test_check_datatable_invariants.sh +126 -12
  331. package/ds-canonical/hooks/tests/test_check_dim_count_drift.sh +13 -8
  332. package/ds-canonical/hooks/tests/test_check_ds_anchor_preflight.sh +53 -7
  333. package/ds-canonical/hooks/tests/test_check_dynamic_tailwind_class.sh +3 -3
  334. package/ds-canonical/hooks/tests/test_check_escape_marker_abuse.sh +17 -7
  335. package/ds-canonical/hooks/tests/test_check_field_family_invariants.sh +72 -16
  336. package/ds-canonical/hooks/tests/test_check_file_size_budget.sh +67 -5
  337. package/ds-canonical/hooks/tests/test_check_fork_user_plugin_install.sh +107 -4
  338. package/ds-canonical/hooks/tests/test_check_full_story_visual_interaction_sweep.sh +25 -15
  339. package/ds-canonical/hooks/tests/test_check_header_with_tabs_border.sh +177 -67
  340. package/ds-canonical/hooks/tests/test_check_item_list_gap.sh +7 -7
  341. package/ds-canonical/hooks/tests/test_check_layout_space_magic_numbers.sh +2 -2
  342. package/ds-canonical/hooks/tests/test_check_main_branch_workbench.sh +45 -110
  343. package/ds-canonical/hooks/tests/test_check_naming_and_abstraction.sh +19 -2
  344. package/ds-canonical/hooks/tests/test_check_opacity_token_usage.sh +114 -8
  345. package/ds-canonical/hooks/tests/test_check_orphan_ds_css.sh +38 -22
  346. package/ds-canonical/hooks/tests/test_check_overlay_open_focus_escape_probe.sh +2 -2
  347. package/ds-canonical/hooks/tests/test_check_pattern_invariants.sh +68 -6
  348. package/ds-canonical/hooks/tests/test_check_plugin_fork_health.sh +53 -0
  349. package/ds-canonical/hooks/tests/test_check_post_main_ssot_propagate.sh +37 -0
  350. package/ds-canonical/hooks/tests/test_check_propose_cite_required.sh +2 -2
  351. package/ds-canonical/hooks/tests/test_check_propose_discipline.sh +59 -0
  352. package/ds-canonical/hooks/tests/test_check_propose_plain_chinese.sh +7 -5
  353. package/ds-canonical/hooks/tests/test_check_propose_pre_grep_verify.sh +5 -5
  354. package/ds-canonical/hooks/tests/test_check_propose_without_benchmark.sh +45 -0
  355. package/ds-canonical/hooks/tests/test_check_sidebar_menu_button_implicit_wrap.sh +5 -5
  356. package/ds-canonical/hooks/tests/test_check_solo_workflow.sh +183 -105
  357. package/ds-canonical/hooks/tests/test_check_spec_class_drift.sh +35 -7
  358. package/ds-canonical/hooks/tests/{test_check_story_anatomy.sh.broken → test_check_story_anatomy.sh} +73 -4
  359. package/ds-canonical/hooks/tests/{test_check_story_category.sh.broken → test_check_story_category.sh} +82 -2
  360. package/ds-canonical/hooks/tests/test_check_story_determinism.sh +39 -0
  361. package/ds-canonical/hooks/tests/test_check_story_invariants.sh +559 -43
  362. package/ds-canonical/hooks/tests/{test_check_story_name_jargon.sh.broken → test_check_story_name_jargon.sh} +22 -1
  363. package/ds-canonical/hooks/tests/test_check_storybook_addon_packaging.sh +79 -0
  364. package/ds-canonical/hooks/tests/test_check_storybook_addon_preset_cjs.sh +2 -2
  365. package/ds-canonical/hooks/tests/test_check_substantive_edit_approval_preflight.sh +546 -28
  366. package/ds-canonical/hooks/tests/test_check_tab_lg_chrome_header_equal.sh +180 -98
  367. package/ds-canonical/hooks/tests/test_check_tabs_content_chrome_body_double_gap.sh +3 -3
  368. package/ds-canonical/hooks/tests/test_check_tailwind_wildcard_in_docs.sh +2 -2
  369. package/ds-canonical/hooks/tests/test_check_token_hygiene.sh +63 -15
  370. package/ds-canonical/hooks/tests/test_check_wrapper_primitive_schema_drift.sh +12 -6
  371. package/ds-canonical/hooks/tests/test_chrome_header_dispatcher.sh +125 -0
  372. package/ds-canonical/hooks/tests/test_enforce_home_charter.sh +57 -3
  373. package/ds-canonical/hooks/tests/test_governance_control_plane.sh +66 -0
  374. package/ds-canonical/hooks/tests/test_governance_coverage_check.sh +88 -0
  375. package/ds-canonical/hooks/tests/test_hook_integrity_classification.sh +217 -0
  376. package/ds-canonical/hooks/tests/test_inject_deploy_url_after_push.sh +85 -2
  377. package/ds-canonical/hooks/tests/test_inject_pending_self_audit.sh +116 -11
  378. package/ds-canonical/hooks/tests/test_log_governance_fires.sh +117 -1
  379. package/ds-canonical/hooks/tests/test_log_skill_invokes.sh +74 -5
  380. package/ds-canonical/hooks/tests/test_post_edit_dispatcher.sh +234 -77
  381. package/ds-canonical/hooks/tests/test_provider_peer_symmetry.sh +76 -0
  382. package/ds-canonical/hooks/tests/test_registration_output_contracts.sh +20 -0
  383. package/ds-canonical/hooks/tests/test_session_start_governance_check.sh +130 -18
  384. package/ds-canonical/hooks/tests/test_stop_audit_content_quality.sh +75 -0
  385. package/ds-canonical/hooks/tests/test_stop_capture_metrics.sh +101 -23
  386. package/ds-canonical/hooks/tests/test_stop_extract_canonical_rules.sh +75 -0
  387. package/ds-canonical/hooks/tests/{test_stop_governance_drift_check.sh.broken → test_stop_governance_drift_check.sh} +22 -12
  388. package/ds-canonical/hooks/tests/test_stop_passive_logging.sh +102 -1
  389. package/ds-canonical/hooks/tests/test_stop_repository_command_context.sh +38 -0
  390. package/ds-canonical/hooks/tests/test_stop_self_audit.sh +363 -9
  391. package/ds-canonical/references/README.md +8 -8
  392. package/ds-canonical/references/audit-coverage-vs-24-checklist.md +4 -4
  393. package/ds-canonical/references/build-ui-canonicals.md +3 -3
  394. package/ds-canonical/references/certified-surfaces.md +46 -15
  395. package/ds-canonical/references/cva-patterns.md +2 -2
  396. package/ds-canonical/references/failure-class-registry.json +3 -2
  397. package/ds-canonical/references/governance-audit-coverage.md +8 -8
  398. package/ds-canonical/references/naming-conventions.md +1 -1
  399. package/ds-canonical/references/preflight-gate-baseline.json +210 -3
  400. package/ds-canonical/references/principle-dim-map.json +15 -9
  401. package/ds-canonical/references/props-naming.md +1 -1
  402. package/ds-canonical/references/scenario-definition.md +33 -30
  403. package/ds-canonical/references/spec-rules.md +1 -1
  404. package/ds-canonical/references/ssot-consultation.md +3 -3
  405. package/ds-canonical/references/ssot-index.md +1 -1
  406. package/ds-canonical/references/story-baseline-registry.json +9 -6
  407. package/ds-canonical/references/story-baseline-registry.schema.json +145 -0
  408. package/ds-canonical/references/structural-token-retention.md +1 -1
  409. package/ds-canonical/references/tailwind-gotchas.md +2 -2
  410. package/ds-canonical/references/ui-dev-rules.md +1 -1
  411. package/ds-canonical/rules/README.md +14 -9
  412. package/ds-canonical/rules/meta-patterns.md +13 -13
  413. package/ds-canonical/rules/self-verify.md +12 -7
  414. package/ds-canonical/rules/spec-rules.md +1 -1
  415. package/ds-canonical/rules/ui-development.md +5 -5
  416. package/ds-canonical/skills/README.md +27 -15
  417. package/ds-canonical/skills/bug-fix-rhythm/SKILL.md +14 -7
  418. package/ds-canonical/skills/canonical-reviewer/SKILL.md +29 -0
  419. package/ds-canonical/skills/code-quality-audit/SKILL.md +11 -7
  420. package/ds-canonical/skills/codex-collab/SKILL.md +19 -238
  421. package/ds-canonical/skills/codex-collab/references/brief-template.md +37 -47
  422. package/ds-canonical/skills/codex-collab/references/transport.md +38 -57
  423. package/ds-canonical/skills/codify-corrections/SKILL.md +32 -31
  424. package/ds-canonical/skills/codify-principle/SKILL.md +33 -32
  425. package/ds-canonical/skills/component-quality-gate/SKILL.md +13 -13
  426. package/ds-canonical/skills/component-quality-gate/references/checklist.md +7 -7
  427. package/ds-canonical/skills/deep-audit-cross-codex/SKILL.md +28 -229
  428. package/ds-canonical/skills/deep-audit-cross-codex/references/phase-a-workflow.md +36 -131
  429. package/ds-canonical/skills/deep-audit-cross-codex/references/phase-b-codex-brief.md +33 -187
  430. package/ds-canonical/skills/deep-audit-cross-codex/references/skill-relationships-antipatterns-benchmarks.md +22 -24
  431. package/ds-canonical/skills/deep-audit-cross-codex/references/triage-rubric.md +15 -79
  432. package/ds-canonical/skills/deep-audit-cross-codex/references/upstream-directives-r-mapping.md +24 -23
  433. package/ds-canonical/skills/delivery-handoff/SKILL.md +14 -8
  434. package/ds-canonical/skills/design-system-audit/SKILL.md +63 -62
  435. package/ds-canonical/skills/design-system-audit/references/audit-prompts.md +86 -77
  436. package/ds-canonical/skills/design-system-audit/references/checkpoints.md +59 -50
  437. package/ds-canonical/skills/design-system-audit/references/historical-bugs.md +8 -8
  438. package/ds-canonical/skills/design-system-audit/references/principle-audit-protocol.md +37 -32
  439. package/ds-canonical/skills/design-system-audit/references/rule-placement.md +39 -38
  440. package/ds-canonical/skills/ensure-canonical/SKILL.md +36 -34
  441. package/ds-canonical/skills/governance-health/SKILL.md +26 -22
  442. package/ds-canonical/skills/governance-status/SKILL.md +30 -0
  443. package/ds-canonical/skills/independent-review/SKILL.md +37 -0
  444. package/ds-canonical/skills/independent-review/agents/openai.yaml +4 -0
  445. package/ds-canonical/skills/independent-review/references/evidence-contract.md +24 -0
  446. package/ds-canonical/skills/knowledge-prune/SKILL.md +45 -52
  447. package/ds-canonical/skills/knowledge-prune/references/phase-z-cross-repo-ssot-propagation.md +10 -7
  448. package/ds-canonical/skills/knowledge-prune/references/prune-dimensions-d5-d10.md +6 -6
  449. package/ds-canonical/skills/new-component/SKILL.md +18 -12
  450. package/ds-canonical/skills/new-component/references/new-component-checklist.md +7 -6
  451. package/ds-canonical/skills/performance-audit/SKILL.md +13 -10
  452. package/ds-canonical/skills/product-ui-audit/SKILL.md +27 -17
  453. package/ds-canonical/skills/product-ui-audit/references/audit-checks.md +7 -4
  454. package/ds-canonical/skills/product-ui-audit/references/report-template.md +30 -26
  455. package/ds-canonical/skills/propose-options/SKILL.md +1 -1
  456. package/ds-canonical/skills/prototype/SKILL.md +19 -21
  457. package/ds-canonical/skills/prototype/references/audit-checks.md +6 -5
  458. package/ds-canonical/skills/prototype/references/checkpoints.md +26 -17
  459. package/ds-canonical/skills/prototype/references/ooux-template.md +1 -1
  460. package/ds-canonical/skills/prototype/references/proposal-template.md +4 -4
  461. package/ds-canonical/skills/scan-similar-bugs/SKILL.md +22 -21
  462. package/ds-canonical/skills/story-auto-compile-migrate/SKILL.md +21 -20
  463. package/ds-canonical/skills/story-writing/SKILL.md +12 -12
  464. package/ds-canonical/skills/story-writing/references/anatomy-standard.md +1 -1
  465. package/ds-canonical/skills/story-writing/references/category-templates.md +5 -5
  466. package/ds-canonical/skills/ux-audit/SKILL.md +12 -9
  467. package/ds-canonical/skills/visual-audit/SKILL.md +41 -47
  468. package/ds-canonical/skills/visual-audit/references/audit-architecture.md +7 -7
  469. package/ds-canonical/skills/visual-audit/references/visual-checklist.md +12 -12
  470. package/ds-canonical/skills/visual-audit/references/world-class-benchmarks.md +3 -3
  471. package/ds-canonical/templates/_README.md +6 -7
  472. package/ds-canonical/templates/consumer-governance.md +78 -0
  473. package/ds-canonical/templates/dashboard-app.tsx +3 -1
  474. package/ds-canonical/templates/product-launchers/fork-governance-dispatcher.sh +154 -0
  475. package/ds-canonical/templates/product-launchers/format-provider-hook-output.mjs +25 -0
  476. package/ds-canonical/templates/product-launchers/independent-review.mjs +490 -0
  477. package/ds-canonical/templates/product-launchers/inject_fork_governance_preamble.sh +99 -0
  478. package/ds-canonical/templates/product-launchers/normalize-provider-event.mjs +355 -0
  479. package/ds-canonical/templates/product-launchers/product-hook-dispatch-runtime.mjs +1067 -0
  480. package/ds-canonical/templates/product-provider-wiring.json +80 -0
  481. package/ds-canonical/templates/product-provider-wiring.schema.json +151 -0
  482. package/llms-full.txt +6 -6
  483. package/llms.txt +2 -2
  484. package/package.json +15 -4
  485. package/src/tokens/utility-registry.json +119 -4
  486. package/src/tokens/utility-registry.schema.json +373 -0
  487. package/tools/README.md +9 -0
  488. package/tools/codemods/cli.mjs +93 -0
  489. package/tools/codemods/index.mjs +582 -0
  490. package/tools/shared/safe-filesystem.mjs +371 -0
  491. package/tools/visual-baseline/cli.mjs +97 -0
  492. package/tools/visual-baseline/index.mjs +522 -0
  493. /package/dist/{react-day-picker.css → index.css} +0 -0
@@ -1,213 +1,116 @@
1
- > **Generated(禁手改)**:本檔由 `build-fork-governance.mjs` 從 DS repo root `AGENTS.md` 投影(path 已改 node_modules 視角);隨 DS 發版重生,fork 端以 npm / `npm run sync-all` 取得最新。
2
- > **你是 FORK PRODUCT 開發者**:遵循檔內設計紀律(mindset / SSOT 消費 / 命名 / 4-Family / 稽核觀念);**忽略 DS-author 的發版/治理維護鏈**(`release:preflight` / tag / npm publish / codex-collab / DS `scripts/*.mjs` gate — 那是 DS 維護者的);git 節奏照 fork 的「預覽 → 確認 → 上線」(詳本 repo CLAUDE.md)。Deep detail → `node_modules/@qijenchen/design-system/ds-canonical/`。
3
-
4
- # 本專案 AI 治理核心(provider-neutral;AGENTS.md 開放標準)
5
-
6
- **本檔為所有 AI agent 的治理 SSOT bootstrap**:Codex 等支援 AGENTS.md 標準的 agent 原生載入;Claude Code 經 `CLAUDE.md` 的 `@AGENTS.md` import 載入同一份(Anthropic 官方共用模式)。增刪改治理核心**只改本檔**,兩邊自動同步。
7
- **最終 authority 不是本檔**:本檔引導行為;不可繞過的強制層 = `npm run release:preflight`(~30 deterministic gates)+ CI(release.yml / ci.yml)。**任何 provider 產出的不合規變更都無法通過 preflight/CI 發佈**。Claude 另有 write-time hooks 加速回饋(`.claude/hooks/`,provider 專屬加速器,非信任邊界)。
8
-
9
- # 每次任務前的 6 條 mindset(世界級設計系統的工作底色)
10
-
11
- 這 6 條是本專案所有規則背後的**態度**。接到任務先複習一遍,再看具體規則。
12
-
13
- 1. **對標世界級 + 不取巧省工**——每個設計決策都要能回答「Polaris / Material / Atlassian / Ant / Carbon / Apple HIG 怎麼做?」沒對齊又說不出理由 = 設計 bug。視覺整齊度不輸原版 + 符合 DS 語言**同時成立**。**禁止以「選較簡單」「省 N edits」為由選 shortcut**——一律最世界級做法。說「快速修」「省工程」是 yellow flag,停下重想。
14
- 2. **不憑直覺發明 / 優先消費既有**——新增任何值 / 名 / pattern / variant / layout primitive 前先 `grep` 既有。**強制 `# SSOT 消費 canonical` 清單**——寫視覺 code 前列消費的 components/patterns/tokens/spec。提建議也算定 pattern,給 option 必對照 DS canonical + ≥3 家世界級。**禁止憑印象列部分家**。
15
- 3. **改一處必看三處**——code / spec / story 三方聯動。改 cva `defaultVariants` / variant / token 前先 grep 該元件所有檔案,一次改完。
16
- 4. **範例必真實業務場景**——Jira / Stripe / Notion / Figma 可辨識情境;禁 `Option A/B/C`、「按鈕一」、極端不現實、ASCII art。
17
- 5. **猶豫就問**——無前例的決策:grep 既有 → 讀近親 spec → 仍不確定停下問。**禁止憑直覺造新 pattern**。
18
- 6. **大原則吸收瑣碎**——同類 bug 反覆糾正 = meta 層沒抓住。見 `node_modules/@qijenchen/design-system/ds-canonical/rules/meta-patterns.md` 31 active M-rules(M1-M32,M27/M33/M34/M35 retired,折入 M20/M7/M23(c)(d))。**AI 不需 user 提醒才找 root invariant**——rule 震盪 → AI 自跑 M12 benchmark + invariant test。User 第 2 次問 → 必截圖 verify(M13)。對話結論 → AUTO 5-layer pipeline(M14)。Visual / behavior decision 前必先 WebFetch ≥ 3 source(M26)。Solo-work git ops 必先 grep canonical(M28)。**視覺/結構 propose 前必 grep DS spec.md 找 owner SSOT(M29)— 出 3-column 表;否則提案不被接受**。使用者 tell me once 不該要 tell me twice。
19
-
20
- 完整 M-rules 詳 `node_modules/@qijenchen/design-system/ds-canonical/rules/meta-patterns.md`(必讀)。
21
-
22
- # Rule Index(progressive disclosure — 編對應檔案前必先讀)
23
-
24
- | 檔案 | 何時必讀 |
25
- |---|---|
26
- | `node_modules/@qijenchen/design-system/ds-canonical/rules/meta-patterns.md` | 每個任務(31 條 M-rules,fundamental)|
27
- | `node_modules/@qijenchen/design-system/ds-canonical/rules/spec-rules.md` | 編任何 `*.spec.md` 或 DS 內容 |
28
- | `node_modules/@qijenchen/design-system/ds-canonical/rules/ui-development.md` | 編任何 `.tsx`/`.ts`(Tailwind 5 條 / Token 4 條 / Props 命名 / shadcn / public-vs-internal)|
29
- | `node_modules/@qijenchen/design-system/ds-canonical/rules/story-rules.md` | 編任何 `*.stories.tsx`(三層定位 / Title / 範例準則)|
30
- | `node_modules/@qijenchen/design-system/ds-canonical/rules/self-verify.md` | 編任何檔案(Pre/Mid/Post/Pre-commit 4 階段自驗)|
31
- | `node_modules/@qijenchen/design-system/ds-canonical/references/ssot-consultation.md` | 寫視覺 code 前(9 項決策對應 SSOT + tsx 檔頭宣告)|
32
- | `node_modules/@qijenchen/design-system/ds-canonical/references/ssot-index.md` | 視覺/結構 propose 前(owner SSOT 對照)|
33
- | `node_modules/@qijenchen/design-system/ds-canonical/references/naming-conventions.md` | 命名新檔/變數/prop |
34
- | `node_modules/@qijenchen/design-system/ds-canonical/skills/design-system-audit/references/audit-prompts.md` | 稽核判準 SSOT(91 dim rubric,Claude 與 Codex 同判準)|
35
-
36
- (Claude Code 對 `node_modules/@qijenchen/design-system/ds-canonical/rules/` 有 path-scoped 自動載入;其他 agent 依本表在編對應檔案前主動讀取——**同一份檔案,零複製**。)
37
-
38
- # 治理 canonical(home 分層 + anti-bloat)
39
-
40
- ## 規則放哪 home(8-home 分層)
41
-
42
- | Level | Home | 收什麼 |
43
- |-------|------|--------|
44
- | 1 | `AGENTS.md`(本檔;Claude 經 CLAUDE.md import) | 每 session signal 的 mindset + 6 條 + 任務導航 |
45
- | 1.5 | `node_modules/@qijenchen/design-system/ds-canonical/rules/*.md` | path-scoped rules(Claude 自動載入;其他 agent 按 Rule Index 讀) |
46
- | 2 | `{name}.spec.md` | 單元件「何時用 / 為什麼」 |
47
- | 3 | Pattern `spec.md` | runtime 跨元件 primitive |
48
- | 4 | Code(`.tsx` / `.css`) | cva / 型別等機械強制 |
49
- | 5 | Skill(`node_modules/@qijenchen/design-system/ds-canonical/skills/`) | invoke 情境的多步驟 workflow + checkpoint |
50
- | 6 | Memory(`~/.claude/.../memory/` SSOT + repo `.claude/memory/` mirror)| 跨 session 狀態。本機編完跑 `npm run sync-memory` 推回 repo |
51
- | 7 | Hook(`.claude/hooks/`) | 機械化 pre/post tool 檢查(Claude write-time;最終兜底 = preflight/CI) |
52
- | 8 | Slash Command(`node_modules/@qijenchen/design-system/ds-canonical/commands/`) | 一次性單步 action |
53
- | 9 | Plan doc(`.claude/planning/`)| 完整 plan / RFC / spec 草稿 SSOT;memory file 是短 index pointer |
54
-
55
- **Q1 設計規則 → Level 1-4 / Q2 invoke 情境 → Skill or Command / Q3 隨時間變化 → Memory(short index)+ Plan doc / Q4 機械化 → Hook(+ preflight gate)**。完整 flowchart → `node_modules/@qijenchen/design-system/ds-canonical/skills/design-system-audit/references/rule-placement.md`。
56
-
57
- ## 行數預算(Anthropic 對齊)
58
-
59
- Bootstrap(AGENTS.md + CLAUDE.md 合計)target ≤ 250 / transition ≤ 400 / hard cap 800。SKILL ≤ 250 / spec ≤ 300(foundational SSOT 例外 ≤ 800-1200)/ memory **per-file ≤ 100 lines** + **MEMORY.md index ≤ 20 entries**(soft 18 / hard 20)。Hooks **26 soft / 60 hard**(SSOT = `session_start_governance_check.sh` Check 7)。動態值以 `scripts/sync-governance-counters.mjs` 跑出為準。
60
-
61
- ## Anti-bloat L1-L3
62
-
63
- - **L1 Pre-write**:`check_file_size_budget.sh`(+ governance hooks — dynamic SSOT 在 `.claude/hooks/`)
64
- - **L2 Per-edit**:`log_governance_fires.sh` → `.claude/logs/hook-fires.jsonl`
65
- - **L3 Periodic**(季度 / `--deep`):`/knowledge-prune` skill,retire ≥ 5%
66
-
67
- ## 加規則前必過 3 題
68
-
69
- 1. 既有 Meta-Pattern / 近親 spec / canonical chapter 命中 → append pointer 不新寫
70
- 2. **Rule-of-3**:同概念 ≥ 3 處 → 選 SSOT 其他 pointer
71
- 3. 7 天後還會 fire 嗎?不確定 → 不寫
72
-
73
- # 稽核 canonical
74
-
75
- 3 層級 × 6 維度。**Stakeholder-visible artifact**(prototype / 元件 merge / 產品 demo)**必過 code + visual 雙層 audit**(搭配 M6+M10)。
76
-
77
- | Tier | 時機 | Scope | Skill |
78
- |------|------|-------|------|
79
- | 1 Stakeholder-gate(強制)| 新元件 merge / prototype / demo | artifact-scoped | `/component-quality-gate` / `/prototype` P3.5 / `/product-ui-audit` P5 |
80
- | 2 Daily dev | bug / refactor / 文字改 | git diff + direct consumer | `visual-audit --scope=changed`(default) |
81
- | 3 Periodic deep | release / token 大改 / 季度 | full DS | `/design-system-audit --deep` |
82
-
83
- | 維度 | 對應 skill |
84
- |------|-----------|
85
- | D1 設計語言 | `/design-system-audit` |
86
- | D2 程式語言 | tsc + lint + `/design-system-audit` |
87
- | D3 元件效能 | `/performance-audit` |
88
- | D4 UX 行為 | `/ux-audit` |
89
- | D5 視覺品質 | `/visual-audit`(Layer A mechanical + B AI) |
90
- | D6 原則自檢 | `design-system-audit/references/principle-audit-protocol.md` |
91
-
92
- **Consistency 類稽核必 Phase 0 全掃再判**。**Deep audit 全掃優先 + 決策 batch-at-end 鐵律**(2026-07-11 user directive):先全 DS 掃完(NO-SAMPLE)→ 跨元件去重 → **最後一次**列「真問題 + 只影響 SSOT-UI/UX」決策清單給 user 拍板;非-SSOT autonomous 做完美;**禁**途中逐元件問 user。
93
-
94
- **Audit-vs-execute 分權**:動 canonical substantive meaning → STOP 提議;對齊 / 表達統一 / 清 duplicate / 補 pointer → AUTO。
95
-
96
- **Scope classifier — Surgical visual bug**:user 列 N 個 visual defects + 無新 canonical / 無新 API contract / 無 cross-component semantic 改動 → **Surgical scope**:no collab / no new M-rule / no audit report,batch fix + final pixel-quantified verify only。Substantive 改動走 audit-vs-execute STOP 提議流程。
97
-
98
- # Independent second opinion(跨 provider 對抗審查)
99
-
100
- **Canonical 概念**:重大變更(governance / Critical DS change / deep audit)需 **author provider ≠ reviewer provider** 的獨立第二意見。判準 = 同一份 rubric(`audit-prompts.md`),reviewer 只提 findings(rule 對照 + severity + evidence),**不得**自建規範。記錄雙方 provider/model/version。
101
- - Claude authored → Codex review(現行 driver = `/deep-audit-cross-codex` Phase B,transport = `scripts/codex-run-guarded.mjs`)
102
- - Codex authored → Claude review(對稱)
103
- - **Backend 不可用 → fail-closed**:標 review pending;禁同一 agent 假扮另一 provider;Critical change 不得取得 compliant 宣稱。
104
-
105
- # SSOT 消費 canonical
106
-
107
- 寫視覺 code 前必查對照 — 沒列 = 自創。**完整對照表 + 強制 checklist** → `node_modules/@qijenchen/design-system/ds-canonical/references/ssot-consultation.md`(SSOT owner;含 9 項決策對應 SSOT + 新元件 tsx 開頭「── 消費的 SSOT ──」段強制要求)。
108
-
109
- # 任務導航表
110
-
111
- | 任務 | 必讀 |
112
- |------|------|
113
- | **新增元件** | `node_modules/@qijenchen/design-system/ds-canonical/rules/ui-development.md` 「建立 UI 前必讀 / shadcn 元件規範」 + `node_modules/@qijenchen/design-system/ds-canonical/rules/spec-rules.md` → `/component-quality-gate` |
114
- | **修 variant / size / state** | 該元件 `spec.md` → `/story-writing` |
115
- | **新增 token** | `tokens/README.md` → `node_modules/@qijenchen/design-system/ds-canonical/rules/ui-development.md`「Token 命名 4 條硬規則」→ `tokens/xxx.spec.md` |
116
- | **寫 story / 視覺 code** | `/story-writing` + `# SSOT 消費 canonical` |
117
- | **命名新檔 / 變數 / prop** | `# 命名與語言一致性` + `node_modules/@qijenchen/design-system/ds-canonical/rules/ui-development.md`「元件 Props 命名」 |
118
- | **新元件 layout** | `# 4-Family Layout Model` |
119
- | **建產品 / 開新 product app** | `npm run create-app <name>` → `apps/<name>/`;**2-scenario architecture SSOT** → `node_modules/@qijenchen/design-system/ds-canonical/references/scenario-definition.md` |
120
- | **新 skill / hook / command** | `.claude/{home}/README.md` charter |
121
- | **無前例設計決策** | `# 遇不確定時的協議` |
122
- | **Tailwind 出怪事** | `node_modules/@qijenchen/design-system/ds-canonical/rules/ui-development.md`「Tailwind 5 條核心」+ `# 失敗記憶索引` |
123
- | **Stakeholder 產出 / 稽核** | `# 稽核 canonical` |
124
- | **User 糾正後** | `# 治理 canonical`(home 判斷) |
125
- | **跟 codex 討論 / 多輪震盪 / 任何 codex 輸出** | `node_modules/@qijenchen/design-system/ds-canonical/skills/codex-collab/SKILL.md`(M31 5-step canonical SSOT)+ M31 anchor in meta-patterns.md |
126
- | **PR merge 後 / session start branch 健檢** | `# Git solo-work canonical` |
127
-
128
- **找不到** → 進 `# 遇不確定時的協議`,不自決定。
129
-
130
- # Git solo-work canonical(SSOT → `.claude/memory/feedback_solo_dev_workflow.md`)
131
-
132
- **1 chat = 1 working branch**;**Netlify preview 是 user gate**;**「push」/「OK」trigger 才 merge main**。**Session-start 必先 grep canonical + 開 working branch,禁直接在 main 上 edit production code**(M28 sub-rule)。
133
-
134
- | 步驟 | 動作 |
135
- |------|------|
136
- | 1 Edit | AI 改 code |
137
- | 2 Commit + push working branch | 自動觸發 Netlify per-branch preview |
138
- | 3 告訴 user 主要 change(or preview URL)| 讓 user 知道看什麼 |
139
- | 4 等 user trigger | **「push / OK / 好 / 合 main」** → step 5;**「改 X / 不對 / 等等」** → 繼續 step 1 |
140
- | 5 Squash merge to main | 不開 PR(可 GitHub API squash-merge OR fast-forward)|
141
- | 5.5 **SSOT propagation gate** | 動到 skill/hook/spec/token/AGENTS/CLAUDE 等 SSOT-affecting paths + user 已給 merge trigger → AI 自動 bump → **`npm run release:preflight`**(唯一發版前 gate 指令)→ tag → publish → `npm view` 驗證,全程不停下問;user 隨時可喊停。bump npm `0.1.0-beta.<N+1>` |
142
- | 6 砍 remote branch | `git push origin --delete <branch>` |
143
- | 7 Local 對齊 | `git checkout main && git fetch && git reset --hard origin/main && git branch -d <branch>` |
144
-
145
- **禁止**:開 PR / AI 自決 push main / 同 chat 開多 branch / 留 stale 不刪 / 「下個 session 處理」deferred 措辭。
146
-
147
- # 命名與語言一致性
148
-
149
- **3 重 test**(governance):
150
- 1. **既有 DS 詞彙**:對齊 `compact/rich / sm/md/lg / action/indicator / scanning/reading`?
151
- 2. **世界級 idiom**:≥ 2 家 world-class DS 用此詞?
152
- 3. **跨元件認知衝突**:同字串在其他元件已有不同語義?
153
-
154
- 3 test 全過才採納。詳細 → `node_modules/@qijenchen/design-system/ds-canonical/references/naming-conventions.md`。
155
- **語言一致性**:spec.md 繁中(技術術語保留英) / code identifier 英 / 單一檔案不中英夾雜。
156
-
157
- # 4-Family Layout Model
158
-
159
- **每元件 spec 第一段必聲明 Layout Family**(1/2/3/4 或「self-contained」)。
160
-
161
- | Family | 用途 | SSOT |
162
- |--------|------|------|
163
- | 1 Menu item / 2 List item | scanning / reading | `patterns/element-anatomy/item-anatomy.spec.md` |
164
- | 3 Pill | 單行互動 pill | `components/Button/button.spec.md`「Pill Layout」|
165
- | 4 Field control | 可編輯資料輸入 | `components/Field/field-controls.spec.md` |
166
-
167
- # 自主執行 canonical(Autonomy Default)
168
-
169
- **Default = autonomous + complete + verify-to-perfection;省工 = anti-pattern(違 mindset #1)**。
170
-
171
- | 動作類別 | 預設 |
172
- |---------|-----|
173
- | **SSOT-affecting UI/UX**(增刪改 component / token / spec 視覺結構 / 跨元件 design language) | **ASK** — 中文具體人話講選項 + tradeoff,user 拍板才動 |
174
- | Bug fix / clean / refactor / 命名一致 / test / audit / verify | **AUTO** — 整批做完 + 完整驗證 + 撤回機制 |
175
- | Governance / hook / skill / spec **內部**(typo / pointer / 結構 — 不動 canonical meaning)| **AUTO** |
176
- | Perf / a11y / 漸進遷移(不動 SSOT)| **AUTO** — 整批 + verify |
177
-
178
- **自主執行同時優化 7 軸**:言簡意賅 / 效率+效能 / SSOT 鐵律 / 易懂維護擴充 / 世界級+一致設計語言 / 完整 self-verify / 自動 self-improve。
179
- **反 pattern**(禁):「省工」/「下次再做」/「下個 session」/「OK 嗎?」過度 ASK / shortcut 避 verify。
180
- **Trigger phrase auto-pipeline**:「依原則自主」/「不需問」/「馬不停蹄」/「全部做完」/「自動」→ autonomous mode,僅 SSOT-affecting UI/UX 停下 ASK。
181
- **Triple-verify before propose**:propose / 列 option / 發現「問題」前必 inline 跑 (1) grep DS-wide (2) Read spec.md / tsx (3) 對照 canonical exception。三題全過才 propose。
182
- **SSOT auto-sync invariant**:跨 file 數字禁 hardcode 多處;以 `scripts/sync-governance-counters.mjs` 機械對齊。
183
-
184
- # 遇不確定時的協議
185
-
186
- **無前例且影響 SSOT UI/UX 設計判斷**時 3 步,禁跳:**grep 既有**(30 秒)→ **讀近親 spec.md** → **仍不確定停下問** user。
187
- **非 SSOT-UI/UX**(refactor / test / perf / a11y / hook / skill / typo / 對齊既有 canonical)→ autonomous,無需問。
188
- 禁:跳 grep 憑記憶 / 隨便挑 / 留 TODO。可跳:bug 修 / 機械勞動 / user 明確指示。
189
-
190
- # 失敗記憶索引(技術沉默陷阱 only)
191
-
192
- | 技術陷阱 | 一行 anchor |
193
- |--------|-----------|
194
- | Tailwind v4 `[--foo]` 必 `var()` | silent 失效 |
195
- | tailwind-merge 自訂 utility 必註冊 group | 否則 strip |
196
- | 元件自包 Provider | 劫持全站 |
197
- | 清 unused imports 後 runtime | tsc 不充分,需 storybook |
198
- | shadcn compat alias 回流 | dark mode 不聯動 |
199
- | `asChild ? Slot : Native` 內部 JSX 仍渲染多 children | React.Children.only runtime fail;asChild 分支 render 只傳 consumer child |
200
- | `tsc -b` 不 emit declaration | TS4023 漏抓;型別 surface 改動必 `npm run build:lib` |
201
- | 工具 flag 沉默陷阱:`rsync -a` 等長同秒靜默跳過(必 `--checksum`)/ `rg` 黏寫 `-rn` 的 `-r`=replace 輸出假字串 | 寫後斷言 + flag 分開寫 |
202
- | DS css 不在 tokens.css aggregator 也沒被 tsx import = orphan | consumer 靜默拿不到 |
203
- | storybook-smoke 驗舊 build = 假綠 | smoke script 已加 stale-build guard |
204
-
205
- 新 bug → 歸 Meta-Pattern OR 本表 1 行;> 10 條 = 漏寫,評估 meta-merge 既有 M-rule。
206
-
207
- # 專案 Stack
208
-
209
- Vite + React + TypeScript + Tailwind v4 + shadcn/ui + Storybook + 自訂 Design Token;完整路徑 + Token 系統 → `node_modules/@qijenchen/design-system/src/tokens/README.md`(charter)— DS 內化在 npm workspace。
210
-
211
- # 元件完成 + Exploration
212
-
213
- merge 前 invoke `/component-quality-gate`(35 項 + visual + clean-code 三層)。正式 `node_modules/@qijenchen/design-system/src/` vs 比稿 `src/explorations/`;比稿 `*.v1.stories.tsx` + `notes.md`,定案升級 patterns/ 或 components/。
1
+ # Product consumer AI governance (provider-neutral)
2
+
3
+ > **Generated view**: upstream `build-fork-governance.mjs` publishes this role-specific source as
4
+ > `AGENTS.md`. Do not edit the generated copy. Claude loads it through `CLAUDE.md`; Codex and other
5
+ > AGENTS-compatible agents load it directly.
6
+
7
+ ## Authority and trust boundary
8
+
9
+ - This repository builds a product with exact versions of `@qijenchen/design-system` and
10
+ `@qijenchen/storybook-config`; it does not author or publish those packages.
11
+ - The deterministic local authority is the exact installed hooks-off checker:
12
+ `npm run governance:check`. Merge enforcement comes from protected `main` requiring it as a check.
13
+ - Native Claude/Codex hooks are fast feedback only; hookless operation is judged by the same
14
+ hooks-off checker. Generated hook commands scrub inherited startup injection before repository
15
+ launchers, and the running provider host stays an external trust boundary, so hooks never
16
+ replace protected CI.
17
+ - Run `npm run setup:all` in every fresh local checkout and hosted setup/cache-refresh lifecycle. It
18
+ installs the committed lock, verifies signatures, and runs the exact checker; SessionStart only verifies.
19
+ - `governance/lock.json`, managed provider adapters, and managed skills are generated upstream.
20
+ Product-specific, provider-neutral policy belongs in `governance/overlay.md`; read it when present.
21
+ It may add stricter product rules but must never replace or weaken upstream controls.
22
+ - Never install a mutable tag or semver range for internal packages. Upgrades are reviewed pull
23
+ requests that pin an exact version and include the regenerated lock/adapters.
24
+ <!-- canonical-decision-authority:start -->
25
+ **Decision/Engineering Authority**:user 保留所有產品/UI/UX SSOT 真取捨,以及任何會改變使用者可感知結果、產品語意或 canonical UI/UX SSOT 的決策權,包含 component behavior/contract、interaction/IA、visual/token/layout/content/a11y 語意、合理設計方案選擇、新增刪改 canonical design rule,以及無法證明維持既有 intent 的變更;positive evidence 必在同一 active scope 綁 exact target、choice、operation digest,引用/條件/舊 scope/target-wide 推定無效。其餘工程治理與 external writes 皆 Standing Authorization AUTO,包含已核准 UI/UX 語意的實作及機械式 generation/sync:由 policy 允許的最高 certified model/reasoning/compute,依 frozen scope、SSOT、repo evidence、tests/Harness、security、independent review、least privilege、staged rollout/rollback/readback 收斂;涵蓋 source→commit/PR/merge→GitHub/package/release→template/WM/certification/rollout/recovery,不逐 milestone 重問。需人類授權紀錄時,本 delegation 綁 target digest 寫入既有 audit record;無 certified peer 則 `REVIEW-BLOCKED`。
26
+
27
+ **Human-only boundaries**:僅不可代理 login/MFA/OAuth/owner/billing、缺 credential reference(只問 secret/vault/Environment/Secret Manager reference,禁貼 secret)、plan 外付費、法律/帳號/組織權限/商業承諾及上述產品決策。Agent 先定唯一工程方案/preflight,只給一個精確 human action,readback 繼續;retry/evidence 後 technical blocker 可 fail-closed,但非 human engineering decision。
28
+ <!-- canonical-decision-authority:end -->
29
+
30
+ ## Six working principles
31
+
32
+ 1. **World-class, no shortcuts**: visual and interaction decisions must be defensible against at
33
+ least three relevant systems such as Polaris, Material, Atlassian, Ant, Carbon, or Apple HIG.
34
+ 2. **Consume before inventing**: search the installed public API, nearest component spec, token, and
35
+ pattern before adding a value, wrapper, variant, or layout primitive.
36
+ 3. **Change all affected surfaces**: product code, tests/stories, and product documentation move
37
+ together. A DS defect is reported upstream with a minimal reproduction; never patch `node_modules`.
38
+ 4. **Use real product scenarios**: examples must represent recognizable business work, not Option
39
+ A/B/C placeholders or minimal mocks that conceal composition problems.
40
+ 5. **Ask only for a genuine product decision**: first search current product usage and the nearest
41
+ shipped DS spec. Stop only when the remaining choice changes product UX or canonical meaning.
42
+ 6. **Fix the invariant, not one symptom**: search for sibling occurrences, add a regression proof,
43
+ and route reusable DS/template defects to their canonical upstream owner.
44
+
45
+ ## Before changing product UI
46
+
47
+ Record the canonical inputs you inspected:
48
+
49
+ - public component/pattern exports from `@qijenchen/design-system`;
50
+ - the nearest shipped `*.spec.md` under
51
+ `node_modules/@qijenchen/design-system/src/`;
52
+ - relevant token docs under
53
+ `node_modules/@qijenchen/design-system/src/tokens/`;
54
+ - a nearest shipped story or a real product precedent;
55
+ - any product-specific exception and its concrete rationale.
56
+
57
+ Only import public package exports. Deep imports, copied DS source, raw primitive reimplementations,
58
+ magic visual values, and undocumented escape markers are governance failures.
59
+
60
+ ## Layout and composition model
61
+
62
+ Every new product composition identifies its closest family before implementation:
63
+
64
+ | Family | Use | Canonical owner |
65
+ |---|---|---|
66
+ | Menu/list item | Scanning and reading rows | shipped `patterns/element-anatomy` spec |
67
+ | Pill | One-line action or state pill | shipped `components/Button` spec |
68
+ | Field control | Editable input and display state | shipped `components/Field` specs |
69
+ | Self-contained | No shared row/field anatomy | nearest public component spec, with rationale |
70
+
71
+ Macro spacing consumes `--layout-space-{tight,loose,bottom}` as specified. Fixed micro geometry is
72
+ allowed only when the shipped spec makes it intentional and the exception is narrowly documented.
73
+
74
+ ## Verification contract
75
+
76
+ For every change, run the checks that exist in this product and report their real outcome. The
77
+ minimum repository-wide contract is:
78
+
79
+ 1. `npm run governance:check` (exact installed, hooks-off authority);
80
+ 2. `npm run typecheck`;
81
+ 3. `npm run build`;
82
+ 4. product lint/test/a11y scripts when present;
83
+ 5. browser or Storybook visual verification for user-visible changes.
84
+
85
+ Never replace a check with `true`, an empty script, a notice-only waiver, or an unverified claim.
86
+ Missing required tooling is a failure, not a pass. Evidence must bind the checked source snapshot.
87
+
88
+ ## Claude, Codex, and future agents
89
+
90
+ - Registry materializers project one skill source into every enabled provider view; no view is SSOT.
91
+ - Native events enter one immutable hook corpus; unsupported events use the exact checker/protected-CI
92
+ fallback and are never presented as native parity.
93
+ - Future providers read `AGENTS.md` and use the same checks; adapters cannot redefine semantics.
94
+ - `independent-review` requires a distinct certified peer, immutable read-only evidence, or reports
95
+ `REVIEW-BLOCKED`. Product review cannot authorize DS/template/release/promotion changes; route upstream.
96
+
97
+ ## Git and release flow
98
+
99
+ - One task uses one working branch and one PR into protected `main`; never direct-push `main`.
100
+ - Required checks, conversations, preview/canary evidence, and protection readback must be clear.
101
+ Then merge and verify under Standing Authorization—no self-approval or chat trigger.
102
+ - Product repos never publish the DS; exact-version upgrade PRs merge only after product canary gates.
103
+
104
+ ## Pilot and upstream feedback
105
+
106
+ This product may serve as a canary for the DS/product template. When a failure is reusable:
107
+
108
+ 1. preserve a minimal product reproduction and evidence;
109
+ 2. classify the owner as product, DS, template, governance corpus, or deployment infrastructure;
110
+ 3. fix the canonical owner first;
111
+ 4. release an immutable upstream version;
112
+ 5. upgrade this product by exact-version PR and rerun all gates;
113
+ 6. remove any temporary product workaround after the upstream fix lands.
114
+
115
+ WM is a pilot consumer, not an alternative governance authority. Its local checks may add product
116
+ coverage but may not replace or weaken the shipped lock/checker/provider surfaces.
@@ -0,0 +1,54 @@
1
+ @AGENTS.md
2
+
3
+ # Product Workspace — Claude Code Adapter
4
+
5
+ > **Generated view**: `build-fork-governance.mjs`; this adapter is governance-owned and must stay
6
+ > byte-identical to the exact installed payload. Put product-specific, provider-neutral additions in
7
+ > `governance/overlay.md`, never below this Claude-only adapter.
8
+
9
+ This file contains Claude Code mechanics only. Shared product rules, SSOT pointers, review requirements, and quality policy come from the imported `AGENTS.md`. Operational onboarding and deploy instructions live in `README.md` and `docs/`; do not duplicate them here.
10
+
11
+ ## Discovery surfaces
12
+
13
+ - `.claude/skills/**` is the generated Claude view of the same classified workflows published to `.agents/skills/**`. Change the DS canonical skill and regenerate; never maintain two versions by hand.
14
+ - `.claude/settings.json` registers the two provider-neutral thin adapters in `governance/bin/`.
15
+ The dispatcher invokes the exact-version npm governance payload; deleting or retiring the Claude
16
+ discovery surface cannot remove the shared launcher substrate used by other providers.
17
+ - `SessionStart` is verification-only. It may report missing `AGENTS.md`, governance lock, or installed dependencies, but it must never run `npm install`, resolve `@beta`/`latest`, rewrite a lockfile, or materialize skills.
18
+ - A native hook is fast feedback, not the trust boundary. The provider-neutral governance check and protected CI decide pass/fail even when hooks are disabled or unavailable.
19
+ - Generated hook commands clear Bash, Node, Python, and dynamic-loader startup injection before the
20
+ repository launcher. Claude's already-running host process and any command shell created before
21
+ that command are still the local host trust boundary; a repository hook cannot sanitize code that
22
+ has already executed.
23
+
24
+ ## Fresh environments
25
+
26
+ Use `npm run setup:all` as the Claude Code on the web environment **Setup script**. It runs
27
+ the shared locked install, signature audit, and exact installed hooks-off checker before work. The
28
+ web environment may reuse a cached setup result, so rebuild that cache or run the same command
29
+ explicitly whenever the committed lock changes. Opening or resuming a Claude session does not
30
+ mutate the checkout through repository SessionStart. If setup cannot authenticate the locked
31
+ snapshot, treat the environment as degraded and do not claim compliance.
32
+
33
+ No Claude plugin is required. Installing one may add convenience, but it cannot replace or override the committed bootstrap, exact release lock, generated provider views, or hard gates.
34
+
35
+ ## Exact upgrades
36
+
37
+ `npm run sync-all` is read-only planning. Applying an upgrade requires an exact semver on a clean dedicated branch:
38
+
39
+ ```text
40
+ npm run sync-all -- --to X.Y.Z
41
+ npm run sync-all -- --apply --to X.Y.Z
42
+ ```
43
+
44
+ Review the resulting diff and merge only through the protected upgrade PR after governance and product CI pass. Dist-tags and semver ranges are intentionally rejected.
45
+
46
+ ## Claude-specific timing
47
+
48
+ - Dispatcher bodies are read from the installed exact payload on each invocation.
49
+ - Changes to `.claude/settings.json` may hot-reload, but a fresh session only verifies discovery of
50
+ the reviewed adapter. It is not runtime certification; certification requires current,
51
+ independently signed target-bound evidence and external enforcement readback.
52
+ - Newly generated `.claude/skills/**` are discovered on the next session. Do not use `/clear` as a substitute for a reviewed upgrade.
53
+
54
+ For preview, Netlify, app creation, handoff, and product workflow, follow `README.md`; those rules are provider-neutral.
@@ -0,0 +1,207 @@
1
+ ---
2
+ name: bug-fix-rhythm
3
+ description: Batch-end-verify rhythm + parallel tool batch + user-listed N-rule MUST-ALL + claim runtime verify. Invoke when entering multi-fix session 或 user 列 numbered rules. Replaces M32(c)(d)(h1)(h2) sub-invariants(2026-05-12 split per Knowledge-Prune Checkpoint 2)。
4
+ ---
5
+
6
+ <!-- _generated: canonical provider skill projection; source: skills/bug-fix-rhythm/SKILL.md; provider: codex; do not edit this adapter view. -->
7
+
8
+ <!-- provider-binding: profile=repository-legacy-surfaces-v1; provider=codex; strategy=generated-binding-header; assumptionCount=6; assumptionFingerprint=sha256:b5e2cfe4a41bdd25605847b0d40fa92db96c4abf604decb830cb218b19ae38d9; evidence=packages/governance/canonical/providers.json#codex -->
9
+
10
+ ## Provider binding contract
11
+
12
+ This canonical workflow contains a committed inventory of legacy assumptions. Resolve them exactly as follows; an unavailable resolution or inventory drift is `ADAPTER-BLOCKED`:
13
+
14
+ - `provider-identity`: Treat historical provider names as provenance labels, never as the current runtime identity.
15
+ - `provider-surface-path`: Resolve legacy repository paths through generated views while treating ds-canonical as the semantic owner.
16
+
17
+ > **Product-role projection(build 自動)**:本 skill 的執行步驟已只保留本 product repo 實際存在的指令。DS-author-only executor 會被改寫為 browser/manual/product-CI 等價驗證,不得在 product 中嘗試不存在的腳本。
18
+
19
+ # /bug-fix-rhythm — 多 fix session 的 rhythm canonical
20
+
21
+ **目的**:當 session 有 ≥ 2 fixes(常見 visual bug session / user 列 N 條 numbered 規則),走 batch-end-verify rhythm,而非 per-fix verify cycle waste。**M32 split 後 (c)(d)(h1)(h2) 的 home**。
22
+
23
+ **對齊**:
24
+ - CLAUDE.md mindset #6「大原則吸收瑣碎」+ M14「對話結論 AUTO integrate」
25
+ - Bazel incremental-build / GitHub Actions matrix-batch idiom(per-step incremental = waste,batch-end = canonical)
26
+ - provider-neutral parallel execution canonical
27
+ - Toyota TPS jidoka(per-station per-item verify,不可 skip 任何 item)
28
+
29
+ ## When to invoke
30
+
31
+ **強制 auto-chain**:
32
+ - multi-issue session 內 ≥ 2 fix 待處理(visual / behavior / code 任 mix)
33
+ - user 列 numbered N 條規則(「規則 1...規則 N」/「Q1...QN」/ image 標 1234)→ 視作 **MUST-ALL checklist**
34
+
35
+ **手動 invoke**:user 明言「批 fix」「一次做完」「跑完再驗」「列規則」
36
+
37
+ **不 invoke**(對齊 current provider best practice 小修 skip):
38
+ - 單一 surgical fix(無 numbered rule + 無 cross-component)— per-fix verify 即可
39
+ - pure refactor / typo / import cleanup
40
+ - spec.md docs only
41
+
42
+ ## Non-goals
43
+
44
+ - 不擴展到「audit full-dim」(那是 `/design-system-audit`)
45
+ - 不取代 `/scan-similar-bugs`(那是 fix 後 root-pattern scan;本 skill 是 fix-過程 rhythm)
46
+ - 不在本 skill 自行擴張 canonical scope;若發現 canonical finding,依 shared authority
47
+ classifier 路由(P2E 自主修正,只有真產品/UI/UX SSOT 取捨才 P2H)
48
+
49
+ ---
50
+
51
+ ## Workflow(4 phases)
52
+
53
+ ### Phase 0 — Intake & MUST-ALL checklist 化(原 M32(h1))
54
+
55
+ 讀 user message:
56
+
57
+ **If user 列 numbered rules**(「規則 1: X / 規則 2: Y / ...」/「Q1 / Q2 / ...」/ image 標號 / bulleted list)→ 抽出 **MUST-ALL checklist**:
58
+
59
+ ```markdown
60
+ ## MUST-ALL checklist(per-rule 不可下放)
61
+ - [ ] 規則 1: <verbatim user wording> — 對應 fix: <target>
62
+ - [ ] 規則 2: <verbatim user wording> — 對應 fix: <target>
63
+ - ...
64
+ - [ ] 規則 N: <verbatim user wording> — 對應 fix: <target>
65
+ ```
66
+
67
+ **禁止**:
68
+ - 把 N 條視作 ranked-priority(「先修 1-3,4 之後再說」)
69
+ - 漏 N 條中第 K 條當「做完」report
70
+ - 改寫 user wording 為自己 paraphrase(verbatim 保留)
71
+
72
+ **Sweep-first, edit-second(2026-07-07 治理進化軌道 2 codify)**:任一 fix 屬「跨切面決策」
73
+ (改名 / 詞彙統一 / 規則性改動,可寫成 grep 謂詞者)→ **先跑謂詞產出「sweep manifest」**
74
+ (grep 指令 + 全庫命中清單,artifact 化),照清單做完、驗證清單歸零,才算該 fix 完成。
75
+ **禁**「先改直覺想到的檔、稽核抓漏再補」(anchor:2026-07-07 meta 詞彙統一三波 11→16→9 檔,
76
+ 規則在散文裡 → 三輪才收斂;寫成謂詞後一個 grep 掃平)。
77
+
78
+ ### Phase 1 — Parallel tool batch(原 M32(d))
79
+
80
+ Read / Grep / Glob 多檔需求 → **single message multi-tool-call**:
81
+
82
+ ```
83
+ ✓ Good: 1 message with [Read A, Read B, Read C, Grep D, Grep E] (~2s)
84
+ ✗ Bad : 5 messages sequential (~10s)
85
+ ```
86
+
87
+ **Heuristic**:任何 tool call 之間**無 dependency**(後一個不需前一個結果) → 必 parallel。
88
+
89
+ 對齊 provider-neutral best practice:「在依賴關係允許時並行執行」。
90
+
91
+ ### Phase 2 — Batch fix(原 M32(c))
92
+
93
+ 每 fix 用 Edit(不 Write,降風險)。**禁止 per-fix tsc / audit cycle**:
94
+
95
+ ```
96
+ ✓ Good: [Edit A] [Edit B] [Edit C] [Edit D] → final tsc + audit + visual (once)
97
+ ✗ Bad : [Edit A → tsc → audit → visual] [Edit B → tsc → audit → visual] ... (5× waste)
98
+ ```
99
+
100
+ 例外:某 fix 確實依賴前一 fix 的 type 結果 → sequential 必要時可,但 verify cycle 仍 batch-end-only。
101
+
102
+ ### ⚠️ Checkpoint 1 — Substantive vs surgical 分流
103
+
104
+ 每 fix 落地前 inline 判斷:
105
+
106
+ - **Surgical**(CLAUDE.md「Scope classifier — Surgical visual bug」):pixel / token / class adjustment, no new SSOT / API / cross-component → AUTO ship 此 fix
107
+ - **P2E engineering substantive**:治理/架構 SSOT、refactor、test、migration、adapter 或
108
+ 不改 public 行為的 cross-component invariant → **AUTO**,依 evidence + independent
109
+ review + hard gates 自主完成。
110
+ - **P2H product/UI/UX substantive**:新 public prop semantics、產品 workflow/interaction、
111
+ 視覺/文案 canonical meaning 或其他 user-visible tradeoff,且既有 SSOT 無唯一答案
112
+ → **STOP propose**,只接受 exact target-bound user decision。
113
+
114
+ 混合 batch:surgical + P2E 一起自主完成;P2H 保持 proposal-only。**禁止**:把 P2H
115
+ 偷渡進 engineering batch,也禁止把 P2E 轉交 user 做工程選擇。
116
+
117
+ ### Phase 3 — Final batch-end verify(原 M32(c)(h2))
118
+
119
+ 全 fix 完成後**一次性**驗證:
120
+
121
+ ```bash
122
+ npx tsc -b # type
123
+ npm run governance:check
124
+ use the active browser/Storybook screenshot workflow and preserve visual evidence
125
+ ```
126
+
127
+ **MUST-ALL re-check**(per Phase 0 checklist):
128
+
129
+ ```markdown
130
+ ## MUST-ALL verify report
131
+ - [x] 規則 1: ✓ verified via <tsc | audit script | pixel measurement | playwright>
132
+ - [x] 規則 2: ✓ verified via ...
133
+ - ...
134
+ - [x] 規則 N: ✓ verified via ...
135
+ ```
136
+
137
+ **禁止**(原 M32(h2) claim runtime verify):
138
+ - 寫「不會有問題」「無 side-effect」「verified」「都實作完了」**沒**對應 verify trace
139
+ - code-reading 推論當「verified」
140
+ - ranked-priority 漏 N 條中第 K 條當「做完」
141
+
142
+ 若某條無法 runtime verify → 明撤回 **「規則 K:未驗證,推論而已,user 真機 verify needed」**,不可假宣告。
143
+
144
+ 對齊 M20 claim-verify gap(M20 是 stop-hook 機制;本 skill Phase 3 是 active workflow side)。
145
+
146
+ ---
147
+
148
+ ## ⚠️ Checkpoints(禁止跳)
149
+
150
+ ### Checkpoint 1 — Phase 2 surgical vs substantive(見上)
151
+
152
+ ### Checkpoint 2 — Phase 3 verify trace 缺漏
153
+ 若 MUST-ALL N 條有 K 條無 verify trace → STOP report,先補 verify 再報 user。
154
+
155
+ ### Checkpoint 3 — User-listed rule wording 改寫
156
+ 若 Phase 0 抽 checklist 時改了 user wording → STOP,重抓 verbatim。
157
+
158
+ ---
159
+
160
+ ## 與其他 skill / hook 的關係
161
+
162
+ | Tool | Scope | 跟本 skill 關係 |
163
+ |---|---|---|
164
+ | `/scan-similar-bugs` | fix 後 DS-wide root-pattern scan | 本 skill batch-end-verify 後**才** chain `/scan-similar-bugs` |
165
+ | `/visual-audit` | 單次視覺對齊 | Phase 3 sub-step,本 skill 包它 |
166
+ | `/component-quality-gate` | stakeholder gate | 不重疊(stakeholder vs daily bug fix) |
167
+ | the installed immutable governance checker(hook) | claim-verify gap 攔 | 本 skill Phase 3 是 active side;hook 是 passive trip-wire |
168
+ | the installed immutable governance checker(hook) | M32(a) audit script(the product-specific verification workflow (when configured),canonical = `visual-audit.mjs`)必 pixel | 本 skill Phase 3 跑該 audit |
169
+
170
+ **3 層 防線**:
171
+ - **本 skill**(active workflow):MUST-ALL checklist + batch-end-verify rhythm
172
+ - **stop_self_audit.sh**(passive hook,claim-verify gap,BLOCKER)+ **check_codex_collab_5step.sh**(passive hook,codex-collab commit 缺 cite+verify+verdict marker,P1 soft stderr 不 block)
173
+ - **M20 / M32(a)**(meta-rule):上游 invariant
174
+
175
+ ---
176
+
177
+ ## 世界級對照
178
+
179
+ - **Bazel `bazel test //...`**:全 target 並行 + final report,而非 per-target sequential
180
+ - **GitHub Actions matrix**:N 個 job 並行,final aggregate verdict
181
+ - **Toyota TPS jidoka**:每 station per-item verify,**但** verify 是 station-end 而非 in-progress checkpoint
182
+ - **Provider-neutral execution discipline**:「依賴關係允許時並行執行」
183
+ - **Stripe / Linear engineering blog**:「batch deploy + single canary verify」over「per-PR canary」
184
+
185
+ ---
186
+
187
+ ## Self-improvement capture
188
+
189
+ 每次 invoke 完寫:
190
+ - (a) Phase 0 抽 MUST-ALL 時 user wording 是否變形?
191
+ - (b) Phase 2 surgical/substantive 分流是否準確?(false-positive 偷渡記錄)
192
+ - (c) Phase 3 verify trace 有沒有「runtime verify needed」的條目漏標?
193
+ - (d) 新發現 numbered-rule pattern → 加進 Phase 0 抽取 heuristic
194
+
195
+ 回填本 SKILL.md 或 references/。
196
+
197
+ ---
198
+
199
+ ## 歷史 absorbed failures(M32 split 來源)
200
+
201
+ 2026-05-12 4 prior failures absorbed by M32 → split 後本 skill 承接 (c)(d)(h1)(h2):
202
+ 1. cell-align audit「Δ=0 ALL PASS」但 user 抓 SKU/Qty 視覺垂直置中於 88px 高 row(audit 沒驗 Field collapse)
203
+ 2. divider 2px audit「ALL PASS」但 pinned panel 邊仍 2px(audit 沒驗 pixel overlap)
204
+ 3. breadcrumb tooltip audit「ALL PASS」但 user 連抓 hover 不 fire(audit 沒驗 Portal DOM bounding rect)
205
+ 4. row-alignment audit「Δ=0 ALL PASS」(attr 對齊,Field collapse 沒抓)
206
+
207
+ 具體 M32(a) pixel-quantified rule 仍在 meta-patterns.md,本 skill 是其 workflow side。