@bonesofspring/ai-rules 0.2.31 → 0.2.32

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 (313) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/docs/LOCAL-OVERLAY.md +14 -0
  3. package/package.json +1 -1
  4. package/presets/claude/android-kotlin/rules/tooling-and-review/agent-team-orchestrator.md +1 -2
  5. package/presets/claude/go/rules/tooling-and-review/agent-team-orchestrator.md +1 -2
  6. package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-orchestrator.md +1 -2
  7. package/presets/claude/java/rules/tooling-and-review/agent-team-orchestrator.md +1 -2
  8. package/presets/claude/mcp-ts/rules/tooling-and-review/agent-team-orchestrator.md +1 -2
  9. package/presets/claude/next/REPO_AGENTS.md +11 -1
  10. package/presets/claude/next/agents/build-verifier.md +1 -0
  11. package/presets/claude/next/agents/code-reviewer.md +1 -0
  12. package/presets/claude/next/agents/feature-developer.md +1 -0
  13. package/presets/claude/next/agents/openspec-author.md +2 -0
  14. package/presets/claude/next/agents/task-analyst.md +7 -0
  15. package/presets/claude/next/agents/task-router.md +1 -0
  16. package/presets/claude/next/rules/README.md +3 -0
  17. package/presets/claude/next/rules/anti-hallucination/react-next-anti-hallucination.md +10 -0
  18. package/presets/claude/next/rules/api-and-data/store-rtk.md +6 -0
  19. package/presets/claude/next/rules/architecture/feature-delivery-workflow.md +5 -1
  20. package/presets/claude/next/rules/architecture/product-specs-authoring.md +1 -0
  21. package/presets/claude/next/rules/architecture/product-specs.md +1 -0
  22. package/presets/claude/next/rules/architecture/reference-features.md +5 -0
  23. package/presets/claude/next/rules/stack/next-app-core.md +3 -0
  24. package/presets/claude/next/rules/stack/next-static-export.md +36 -0
  25. package/presets/claude/next/rules/testing/tests-e2e-structure.md +1 -0
  26. package/presets/claude/next/rules/testing/tests-unit.md +1 -0
  27. package/presets/claude/next/rules/tooling-and-review/agent-team-orchestrator.md +1 -2
  28. package/presets/claude/next/rules/tooling-and-review/ai-local-overlay.md +16 -2
  29. package/presets/claude/next/rules/tooling-and-review/code-review-mr.md +4 -0
  30. package/presets/claude/next/rules/tooling-and-review/mcp-usage.md +1 -0
  31. package/presets/claude/next/rules/tooling-and-review/post-change-lint.md +4 -0
  32. package/presets/claude/next/rules/tooling-and-review/security-next.md +13 -0
  33. package/presets/claude/next/rules/ui-and-accessibility/component-catalog-gate.md +39 -0
  34. package/presets/claude/next/rules/ui-and-accessibility/design-tokens-binding.md +1 -1
  35. package/presets/claude/next/rules/ui-and-accessibility/forms-validation.md +35 -0
  36. package/presets/claude/next/rules/ui-and-accessibility/react-ui.md +19 -1
  37. package/presets/claude/next/team/fixtures/feature-with-ux-no-figma.json +3 -4
  38. package/presets/claude/nuxt/rules/tooling-and-review/agent-team-orchestrator.md +1 -2
  39. package/presets/claude/php-hexagonal/rules/tooling-and-review/agent-team-orchestrator.md +1 -2
  40. package/presets/claude/php-laravel/rules/tooling-and-review/agent-team-orchestrator.md +1 -2
  41. package/presets/claude/svelte/rules/tooling-and-review/agent-team-orchestrator.md +1 -2
  42. package/presets/cursor/android-kotlin/rules/agent-team-orchestrator.mdc +1 -1
  43. package/presets/cursor/go/rules/agent-team-orchestrator.mdc +1 -1
  44. package/presets/cursor/ios-swift/rules/agent-team-orchestrator.mdc +1 -1
  45. package/presets/cursor/java/rules/agent-team-orchestrator.mdc +1 -1
  46. package/presets/cursor/mcp-ts/rules/agent-team-orchestrator.mdc +1 -1
  47. package/presets/cursor/next/REPO_AGENTS.md +11 -1
  48. package/presets/cursor/next/agents/build-verifier.md +1 -0
  49. package/presets/cursor/next/agents/code-reviewer.md +1 -0
  50. package/presets/cursor/next/agents/feature-developer.md +1 -0
  51. package/presets/cursor/next/agents/openspec-author.md +2 -0
  52. package/presets/cursor/next/agents/task-analyst.md +7 -0
  53. package/presets/cursor/next/agents/task-router.md +1 -0
  54. package/presets/cursor/next/ai-local/rules-library/agent-artifacts-no-local-paths.md +41 -8
  55. package/presets/cursor/next/ai-local/rules-library/agent-pipeline-gates.md +19 -0
  56. package/presets/cursor/next/ai-local/rules-library/analytics-events.md +18 -0
  57. package/presets/cursor/next/ai-local/rules-library/api-contract-source.md +14 -0
  58. package/presets/cursor/next/ai-local/rules-library/artifact-lifecycle.md +17 -0
  59. package/presets/cursor/next/ai-local/rules-library/code-style.md +68 -0
  60. package/presets/cursor/next/ai-local/rules-library/component-child-decomposition.md +81 -0
  61. package/presets/cursor/next/ai-local/rules-library/feature-flags-experiments.md +15 -0
  62. package/presets/cursor/next/ai-local/rules-library/mcp-required-for-ui-layout.md +1 -1
  63. package/presets/cursor/next/ai-local/rules-library/no-react-fc.md +46 -0
  64. package/presets/cursor/next/ai-local/rules-library/no-test-driven-behavior-change.md +1 -1
  65. package/presets/cursor/next/ai-local/rules-library/pwa-service-worker.md +15 -0
  66. package/presets/cursor/next/ai-local/rules-library/qa-test-cases.md +14 -0
  67. package/presets/cursor/next/ai-local/rules-library/router-pages.md +4 -2
  68. package/presets/cursor/next/ai-local/rules-library/single-source-copy-constants.md +3 -1
  69. package/presets/cursor/next/ai-local/rules-library/storybook-catalog-structure.md +62 -0
  70. package/presets/cursor/next/ai-local/rules-library/storybook-cleanup-temp-screenshots.md +40 -0
  71. package/presets/cursor/next/ai-local/rules-library/storybook-csf-authoring.md +100 -0
  72. package/presets/cursor/next/ai-local/rules-library/storybook-dev-compare-figma.md +67 -0
  73. package/presets/cursor/next/ai-local/rules-library/storybook-keep-tests-current.md +75 -0
  74. package/presets/cursor/next/ai-local/rules-library/storybook-modals.md +64 -0
  75. package/presets/cursor/next/ai-local/rules-library/storybook-no-app-node-modules.md +40 -0
  76. package/presets/cursor/next/ai-local/rules-library/storybook-ui-quality-gate.md +38 -0
  77. package/presets/cursor/next/ai-local/rules-library/task-levels.md +28 -0
  78. package/presets/cursor/next/ai-local/rules-library/ui-change-review-gate.md +14 -0
  79. package/presets/cursor/next/rules/README.md +4 -1
  80. package/presets/cursor/next/rules/agent-team-orchestrator.mdc +1 -1
  81. package/presets/cursor/next/rules/ai-local-overlay.mdc +16 -2
  82. package/presets/cursor/next/rules/code-review-mr.mdc +4 -0
  83. package/presets/cursor/next/rules/component-catalog-gate.mdc +38 -0
  84. package/presets/cursor/next/rules/design-tokens-binding.mdc +1 -1
  85. package/presets/cursor/next/rules/feature-delivery-workflow.mdc +5 -1
  86. package/presets/cursor/next/rules/forms-validation.mdc +33 -0
  87. package/presets/cursor/next/rules/mcp-usage.mdc +1 -0
  88. package/presets/cursor/next/rules/next-app-core.mdc +3 -0
  89. package/presets/cursor/next/rules/next-static-export.mdc +35 -0
  90. package/presets/cursor/next/rules/post-change-lint.mdc +4 -0
  91. package/presets/cursor/next/rules/product-specs-authoring.mdc +1 -0
  92. package/presets/cursor/next/rules/product-specs.mdc +1 -0
  93. package/presets/cursor/next/rules/react-next-anti-hallucination.mdc +10 -0
  94. package/presets/cursor/next/rules/react-ui.mdc +19 -1
  95. package/presets/cursor/next/rules/reference-features.mdc +5 -0
  96. package/presets/cursor/next/rules/security-next.mdc +12 -0
  97. package/presets/cursor/next/rules/store-rtk.mdc +6 -0
  98. package/presets/cursor/next/rules/tests-e2e-structure.mdc +1 -0
  99. package/presets/cursor/next/rules/tests-unit.mdc +1 -0
  100. package/presets/cursor/next/team/fixtures/feature-with-ux-no-figma.json +3 -4
  101. package/presets/cursor/nuxt/rules/agent-team-orchestrator.mdc +1 -1
  102. package/presets/cursor/php-hexagonal/rules/agent-team-orchestrator.mdc +1 -1
  103. package/presets/cursor/php-laravel/rules/agent-team-orchestrator.mdc +1 -1
  104. package/presets/cursor/svelte/rules/agent-team-orchestrator.mdc +1 -1
  105. package/presets/mavis/android-kotlin/adapter-map.json +1 -1
  106. package/presets/mavis/android-kotlin/rules/agent-team-orchestrator.md +1 -2
  107. package/presets/mavis/android-kotlin/rules/code-review-mr.md +6 -6
  108. package/presets/mavis/go/adapter-map.json +1 -1
  109. package/presets/mavis/go/rules/agent-team-orchestrator.md +1 -2
  110. package/presets/mavis/go/rules/code-quality-and-refactoring.md +1 -1
  111. package/presets/mavis/ios-swift/adapter-map.json +1 -1
  112. package/presets/mavis/ios-swift/rules/agent-team-orchestrator.md +1 -2
  113. package/presets/mavis/ios-swift/rules/code-quality-and-refactoring.md +1 -1
  114. package/presets/mavis/ios-swift/rules/code-review-mr.md +6 -6
  115. package/presets/mavis/ios-swift/rules/feature-delivery-workflow.md +14 -14
  116. package/presets/mavis/ios-swift/rules/reference-features.md +3 -3
  117. package/presets/mavis/java/adapter-map.json +1 -1
  118. package/presets/mavis/java/rules/agent-team-orchestrator.md +1 -2
  119. package/presets/mavis/java/rules/code-quality-and-refactoring.md +1 -1
  120. package/presets/mavis/mcp-ts/adapter-map.json +1 -1
  121. package/presets/mavis/mcp-ts/rules/agent-team-orchestrator.md +1 -2
  122. package/presets/mavis/next/REPO_AGENTS.md +11 -1
  123. package/presets/mavis/next/adapter-map.json +192 -8
  124. package/presets/mavis/next/agents/build-verifier.md +1 -0
  125. package/presets/mavis/next/agents/code-reviewer.md +1 -0
  126. package/presets/mavis/next/agents/feature-developer.md +1 -0
  127. package/presets/mavis/next/agents/openspec-author.md +2 -0
  128. package/presets/mavis/next/agents/task-analyst.md +7 -0
  129. package/presets/mavis/next/agents/task-router.md +1 -0
  130. package/presets/mavis/next/ai-local/rules-library/agent-artifacts-no-local-paths.md +41 -8
  131. package/presets/mavis/next/ai-local/rules-library/agent-pipeline-gates.md +19 -0
  132. package/presets/mavis/next/ai-local/rules-library/analytics-events.md +18 -0
  133. package/presets/mavis/next/ai-local/rules-library/api-contract-source.md +14 -0
  134. package/presets/mavis/next/ai-local/rules-library/artifact-lifecycle.md +17 -0
  135. package/presets/mavis/next/ai-local/rules-library/code-style.md +68 -0
  136. package/presets/mavis/next/ai-local/rules-library/component-child-decomposition.md +81 -0
  137. package/presets/mavis/next/ai-local/rules-library/feature-flags-experiments.md +15 -0
  138. package/presets/mavis/next/ai-local/rules-library/mcp-required-for-ui-layout.md +1 -1
  139. package/presets/mavis/next/ai-local/rules-library/no-react-fc.md +46 -0
  140. package/presets/mavis/next/ai-local/rules-library/no-test-driven-behavior-change.md +1 -1
  141. package/presets/mavis/next/ai-local/rules-library/pwa-service-worker.md +15 -0
  142. package/presets/mavis/next/ai-local/rules-library/qa-test-cases.md +14 -0
  143. package/presets/mavis/next/ai-local/rules-library/router-pages.md +4 -2
  144. package/presets/mavis/next/ai-local/rules-library/single-source-copy-constants.md +3 -1
  145. package/presets/mavis/next/ai-local/rules-library/storybook-catalog-structure.md +62 -0
  146. package/presets/mavis/next/ai-local/rules-library/storybook-cleanup-temp-screenshots.md +40 -0
  147. package/presets/mavis/next/ai-local/rules-library/storybook-csf-authoring.md +100 -0
  148. package/presets/mavis/next/ai-local/rules-library/storybook-dev-compare-figma.md +67 -0
  149. package/presets/mavis/next/ai-local/rules-library/storybook-keep-tests-current.md +75 -0
  150. package/presets/mavis/next/ai-local/rules-library/storybook-modals.md +64 -0
  151. package/presets/mavis/next/ai-local/rules-library/storybook-no-app-node-modules.md +40 -0
  152. package/presets/mavis/next/ai-local/rules-library/storybook-ui-quality-gate.md +38 -0
  153. package/presets/mavis/next/ai-local/rules-library/task-levels.md +28 -0
  154. package/presets/mavis/next/ai-local/rules-library/ui-change-review-gate.md +14 -0
  155. package/presets/mavis/next/rules/agent-team-orchestrator.md +1 -2
  156. package/presets/mavis/next/rules/ai-local-overlay.md +16 -2
  157. package/presets/mavis/next/rules/code-quality-and-refactoring.md +2 -2
  158. package/presets/mavis/next/rules/code-review-mr.md +11 -7
  159. package/presets/mavis/next/rules/component-catalog-gate.md +31 -0
  160. package/presets/mavis/next/rules/design-tokens-binding.md +1 -1
  161. package/presets/mavis/next/rules/feature-delivery-workflow.md +22 -18
  162. package/presets/mavis/next/rules/forms-validation.md +26 -0
  163. package/presets/mavis/next/rules/mcp-usage.md +1 -0
  164. package/presets/mavis/next/rules/mockup-review.md +1 -1
  165. package/presets/mavis/next/rules/next-app-core.md +3 -0
  166. package/presets/mavis/next/rules/next-static-export.md +28 -0
  167. package/presets/mavis/next/rules/post-change-lint.md +4 -0
  168. package/presets/mavis/next/rules/product-specs-authoring.md +1 -0
  169. package/presets/mavis/next/rules/product-specs.md +1 -0
  170. package/presets/mavis/next/rules/react-next-anti-hallucination.md +10 -0
  171. package/presets/mavis/next/rules/react-ui.md +19 -1
  172. package/presets/mavis/next/rules/reference-features.md +7 -2
  173. package/presets/mavis/next/rules/security-next.md +12 -0
  174. package/presets/mavis/next/rules/store-rtk.md +6 -0
  175. package/presets/mavis/next/rules/tests-e2e-structure.md +2 -1
  176. package/presets/mavis/next/rules/tests-unit.md +1 -0
  177. package/presets/mavis/next/team/fixtures/feature-with-ux-no-figma.json +3 -4
  178. package/presets/mavis/nuxt/adapter-map.json +1 -1
  179. package/presets/mavis/nuxt/rules/agent-team-orchestrator.md +1 -2
  180. package/presets/mavis/nuxt/rules/code-review-mr.md +6 -6
  181. package/presets/mavis/nuxt/rules/feature-delivery-workflow.md +15 -15
  182. package/presets/mavis/nuxt/rules/reference-features.md +2 -2
  183. package/presets/mavis/nuxt/rules/tests-e2e-structure.md +1 -1
  184. package/presets/mavis/php-hexagonal/adapter-map.json +1 -1
  185. package/presets/mavis/php-hexagonal/rules/agent-team-orchestrator.md +1 -2
  186. package/presets/mavis/php-hexagonal/rules/code-quality-and-refactoring.md +1 -1
  187. package/presets/mavis/php-laravel/adapter-map.json +1 -1
  188. package/presets/mavis/php-laravel/rules/agent-team-orchestrator.md +1 -2
  189. package/presets/mavis/php-laravel/rules/code-quality-and-refactoring.md +1 -1
  190. package/presets/mavis/svelte/adapter-map.json +1 -1
  191. package/presets/mavis/svelte/rules/agent-team-orchestrator.md +1 -2
  192. package/presets/mavis/svelte/rules/code-review-mr.md +6 -6
  193. package/presets/mavis/svelte/rules/feature-delivery-workflow.md +1 -1
  194. package/presets/mavis/svelte/rules/reference-features.md +2 -2
  195. package/presets/mavis/svelte/rules/tests-e2e-structure.md +1 -1
  196. package/presets/opencode/android-kotlin/adapter-map.json +1 -1
  197. package/presets/opencode/android-kotlin/rules/agent-team-orchestrator.md +1 -2
  198. package/presets/opencode/android-kotlin/rules/code-review-mr.md +6 -6
  199. package/presets/opencode/go/adapter-map.json +1 -1
  200. package/presets/opencode/go/rules/agent-team-orchestrator.md +1 -2
  201. package/presets/opencode/go/rules/code-quality-and-refactoring.md +1 -1
  202. package/presets/opencode/ios-swift/adapter-map.json +1 -1
  203. package/presets/opencode/ios-swift/rules/agent-team-orchestrator.md +1 -2
  204. package/presets/opencode/ios-swift/rules/code-quality-and-refactoring.md +1 -1
  205. package/presets/opencode/ios-swift/rules/code-review-mr.md +6 -6
  206. package/presets/opencode/ios-swift/rules/feature-delivery-workflow.md +14 -14
  207. package/presets/opencode/ios-swift/rules/reference-features.md +3 -3
  208. package/presets/opencode/java/adapter-map.json +1 -1
  209. package/presets/opencode/java/rules/agent-team-orchestrator.md +1 -2
  210. package/presets/opencode/java/rules/code-quality-and-refactoring.md +1 -1
  211. package/presets/opencode/mcp-ts/adapter-map.json +1 -1
  212. package/presets/opencode/mcp-ts/rules/agent-team-orchestrator.md +1 -2
  213. package/presets/opencode/next/REPO_AGENTS.md +11 -1
  214. package/presets/opencode/next/adapter-map.json +192 -8
  215. package/presets/opencode/next/agents/build-verifier.md +1 -0
  216. package/presets/opencode/next/agents/code-reviewer.md +1 -0
  217. package/presets/opencode/next/agents/feature-developer.md +1 -0
  218. package/presets/opencode/next/agents/openspec-author.md +2 -0
  219. package/presets/opencode/next/agents/task-analyst.md +7 -0
  220. package/presets/opencode/next/agents/task-router.md +1 -0
  221. package/presets/opencode/next/ai-local/rules-library/agent-artifacts-no-local-paths.md +41 -8
  222. package/presets/opencode/next/ai-local/rules-library/agent-pipeline-gates.md +19 -0
  223. package/presets/opencode/next/ai-local/rules-library/analytics-events.md +18 -0
  224. package/presets/opencode/next/ai-local/rules-library/api-contract-source.md +14 -0
  225. package/presets/opencode/next/ai-local/rules-library/artifact-lifecycle.md +17 -0
  226. package/presets/opencode/next/ai-local/rules-library/code-style.md +68 -0
  227. package/presets/opencode/next/ai-local/rules-library/component-child-decomposition.md +81 -0
  228. package/presets/opencode/next/ai-local/rules-library/feature-flags-experiments.md +15 -0
  229. package/presets/opencode/next/ai-local/rules-library/mcp-required-for-ui-layout.md +1 -1
  230. package/presets/opencode/next/ai-local/rules-library/no-react-fc.md +46 -0
  231. package/presets/opencode/next/ai-local/rules-library/no-test-driven-behavior-change.md +1 -1
  232. package/presets/opencode/next/ai-local/rules-library/pwa-service-worker.md +15 -0
  233. package/presets/opencode/next/ai-local/rules-library/qa-test-cases.md +14 -0
  234. package/presets/opencode/next/ai-local/rules-library/router-pages.md +4 -2
  235. package/presets/opencode/next/ai-local/rules-library/single-source-copy-constants.md +3 -1
  236. package/presets/opencode/next/ai-local/rules-library/storybook-catalog-structure.md +62 -0
  237. package/presets/opencode/next/ai-local/rules-library/storybook-cleanup-temp-screenshots.md +40 -0
  238. package/presets/opencode/next/ai-local/rules-library/storybook-csf-authoring.md +100 -0
  239. package/presets/opencode/next/ai-local/rules-library/storybook-dev-compare-figma.md +67 -0
  240. package/presets/opencode/next/ai-local/rules-library/storybook-keep-tests-current.md +75 -0
  241. package/presets/opencode/next/ai-local/rules-library/storybook-modals.md +64 -0
  242. package/presets/opencode/next/ai-local/rules-library/storybook-no-app-node-modules.md +40 -0
  243. package/presets/opencode/next/ai-local/rules-library/storybook-ui-quality-gate.md +38 -0
  244. package/presets/opencode/next/ai-local/rules-library/task-levels.md +28 -0
  245. package/presets/opencode/next/ai-local/rules-library/ui-change-review-gate.md +14 -0
  246. package/presets/opencode/next/rules/agent-team-orchestrator.md +1 -2
  247. package/presets/opencode/next/rules/ai-local-overlay.md +16 -2
  248. package/presets/opencode/next/rules/code-quality-and-refactoring.md +2 -2
  249. package/presets/opencode/next/rules/code-review-mr.md +11 -7
  250. package/presets/opencode/next/rules/component-catalog-gate.md +31 -0
  251. package/presets/opencode/next/rules/design-tokens-binding.md +1 -1
  252. package/presets/opencode/next/rules/feature-delivery-workflow.md +22 -18
  253. package/presets/opencode/next/rules/forms-validation.md +26 -0
  254. package/presets/opencode/next/rules/mcp-usage.md +1 -0
  255. package/presets/opencode/next/rules/mockup-review.md +1 -1
  256. package/presets/opencode/next/rules/next-app-core.md +3 -0
  257. package/presets/opencode/next/rules/next-static-export.md +28 -0
  258. package/presets/opencode/next/rules/post-change-lint.md +4 -0
  259. package/presets/opencode/next/rules/product-specs-authoring.md +1 -0
  260. package/presets/opencode/next/rules/product-specs.md +1 -0
  261. package/presets/opencode/next/rules/react-next-anti-hallucination.md +10 -0
  262. package/presets/opencode/next/rules/react-ui.md +19 -1
  263. package/presets/opencode/next/rules/reference-features.md +7 -2
  264. package/presets/opencode/next/rules/security-next.md +12 -0
  265. package/presets/opencode/next/rules/store-rtk.md +6 -0
  266. package/presets/opencode/next/rules/tests-e2e-structure.md +2 -1
  267. package/presets/opencode/next/rules/tests-unit.md +1 -0
  268. package/presets/opencode/next/team/fixtures/feature-with-ux-no-figma.json +3 -4
  269. package/presets/opencode/nuxt/adapter-map.json +1 -1
  270. package/presets/opencode/nuxt/rules/agent-team-orchestrator.md +1 -2
  271. package/presets/opencode/nuxt/rules/code-review-mr.md +6 -6
  272. package/presets/opencode/nuxt/rules/feature-delivery-workflow.md +15 -15
  273. package/presets/opencode/nuxt/rules/reference-features.md +2 -2
  274. package/presets/opencode/nuxt/rules/tests-e2e-structure.md +1 -1
  275. package/presets/opencode/php-hexagonal/adapter-map.json +1 -1
  276. package/presets/opencode/php-hexagonal/rules/agent-team-orchestrator.md +1 -2
  277. package/presets/opencode/php-hexagonal/rules/code-quality-and-refactoring.md +1 -1
  278. package/presets/opencode/php-laravel/adapter-map.json +1 -1
  279. package/presets/opencode/php-laravel/rules/agent-team-orchestrator.md +1 -2
  280. package/presets/opencode/php-laravel/rules/code-quality-and-refactoring.md +1 -1
  281. package/presets/opencode/svelte/adapter-map.json +1 -1
  282. package/presets/opencode/svelte/rules/agent-team-orchestrator.md +1 -2
  283. package/presets/opencode/svelte/rules/code-review-mr.md +6 -6
  284. package/presets/opencode/svelte/rules/feature-delivery-workflow.md +1 -1
  285. package/presets/opencode/svelte/rules/reference-features.md +2 -2
  286. package/presets/opencode/svelte/rules/tests-e2e-structure.md +1 -1
  287. package/scripts/check-generated-drift.mjs +42 -2
  288. package/scripts/check-local-overlay.sh +39 -0
  289. package/scripts/fixtures/cli-golden/claude/next.json +44 -41
  290. package/scripts/fixtures/cli-golden/cursor/next.json +69 -46
  291. package/scripts/fixtures/cli-golden/mavis/android-kotlin.json +21 -21
  292. package/scripts/fixtures/cli-golden/mavis/go.json +8 -8
  293. package/scripts/fixtures/cli-golden/mavis/ios-swift.json +12 -12
  294. package/scripts/fixtures/cli-golden/mavis/java.json +8 -8
  295. package/scripts/fixtures/cli-golden/mavis/mcp-ts.json +5 -5
  296. package/scripts/fixtures/cli-golden/mavis/next.json +70 -47
  297. package/scripts/fixtures/cli-golden/mavis/nuxt.json +25 -25
  298. package/scripts/fixtures/cli-golden/mavis/php-hexagonal.json +8 -8
  299. package/scripts/fixtures/cli-golden/mavis/php-laravel.json +8 -8
  300. package/scripts/fixtures/cli-golden/mavis/svelte.json +25 -25
  301. package/scripts/fixtures/cli-golden/opencode/android-kotlin.json +21 -21
  302. package/scripts/fixtures/cli-golden/opencode/go.json +8 -8
  303. package/scripts/fixtures/cli-golden/opencode/ios-swift.json +12 -12
  304. package/scripts/fixtures/cli-golden/opencode/java.json +8 -8
  305. package/scripts/fixtures/cli-golden/opencode/mcp-ts.json +5 -5
  306. package/scripts/fixtures/cli-golden/opencode/next.json +70 -47
  307. package/scripts/fixtures/cli-golden/opencode/nuxt.json +25 -25
  308. package/scripts/fixtures/cli-golden/opencode/php-hexagonal.json +8 -8
  309. package/scripts/fixtures/cli-golden/opencode/php-laravel.json +8 -8
  310. package/scripts/fixtures/cli-golden/opencode/svelte.json +25 -25
  311. package/scripts/lib/generate-adapter-common.mjs +17 -0
  312. package/scripts/lib/generate-mavis-adapter.mjs +9 -3
  313. package/scripts/lib/generate-opencode-adapter.mjs +9 -3
package/CHANGELOG.md CHANGED
@@ -2,6 +2,17 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ### Next: runtime-model, catalog, seeds, and generated-tree correctness
6
+
7
+ - **Generated trees no longer ship dangling `.mdc` pointers.** `generate-mavis` / `generate-opencode` rewrite in-body `.mdc` cross-references to sibling rule `.md` stems (embed-mode bodies previously kept Cursor `## Stack notes` verbatim); author `preset-*` meta-rules keep their intentional Cursor `.mdc` references. `check-generated-drift.mjs` now fails on a dangling sibling-stem `.mdc` in any generated rule tree.
8
+ - **New `next` rules (requestable):** `next-static-export` (static-export/SPA runtime model — no SSR/route handlers/middleware/ISR; `getStaticProps` build-time only; `basePath`; `images.unoptimized`), `component-catalog-gate` (Storybook/catalog is the UI dev + visual-review surface; stories ship with the change; catalog package isolation), `forms-validation` (repo form library + DS fields + shared validators).
9
+ - **`security-next` deployment caveat** + a **Compliance / personal data** section; `next-app-core` gains deployment-model, `.ai/context` discovery, and env-through-config guidance; `react-next-anti-hallucination` and `mcp-usage` point at Next's own bundled docs (`node_modules/next/dist/docs/`).
10
+ - **`react-ui` gains** "one component / one styled element — one purpose", a CSS-in-JS interpolation-function rule (no inline arrows in `styled` `${…}`), and async-UI-state guidance; `store-rtk` gains middleware/cross-slice orchestration (`_complexSlices`, no slice→slice imports); `reference-features` adds scaffold/singletons/layouts/guards/cross-feature-hook/internal-slice rows.
11
+ - **Design-token binding no longer hardcodes `next/image`** — binds to the project image primitive (the optimizer may be off under static export).
12
+ - **Seed library fixes + growth:** 4 seeds had `src/**` globs that never matched the `app/src/**` layout (now fixed); `ai-local-overlay`, root `AGENTS.md`, and `docs/LOCAL-OVERLAY.md` now document `.ai.local/rules-library/**` activation; `scripts/check-local-overlay.sh` fails on a bare-`src/` seed glob. New seeds: `analytics-events`, `feature-flags-experiments`, `pwa-service-worker`, `task-levels`, `qa-test-cases`; `router-pages` gains nginx slug + router-ready guard rules.
13
+ - **Pipeline/agent wiring:** `task-router` and `feature-delivery-workflow` require `mockup-reviewer` for UI scope **without** a Figma URL; `build-verifier` runs the catalog suite; `code-review-mr` adds a spec/docs sync gate; `task-analyst`/`openspec-author` templates gain `## Hard rules applied` and `## Compliance impact`; `feature-developer`/`code-reviewer` return a `## Human commits` plan.
14
+ - **`init` overwrite contract documented** (managed vs preserved) in `ai-local-overlay`, root `AGENTS.md`, and `docs/LOCAL-OVERLAY.md`; `post-change-lint`/`tests-unit` prefer package scripts and cover secondary packages.
15
+
5
16
  ### Claude session-start overlay, settings hooks, and dogfood sync
6
17
 
7
18
  - Claude `ai-local-overlay` is session-start (no `paths:`) on all 10 stacks, inside the 3–5 budget, with entry-file probe text in `CLAUDE.md` and root `AGENTS.md`.
@@ -11,6 +11,7 @@ Put a `.ai.local/` directory in your repo. Write rules as plain markdown. The `a
11
11
  ├── rules/
12
12
  │ ├── our-stack.md # applied like a rule
13
13
  │ └── testing-policy.md # applied like a rule
14
+ ├── rules-library/ # staged-inactive seeds shipped by `init` (move to activate)
14
15
  ├── conventions.md # living gotchas (highest priority)
15
16
  └── team/ # shared agent-team pipeline artifacts (not rules)
16
17
  ├── README.md
@@ -27,6 +28,19 @@ No IDE config, no `@include`, no codegen. Same files work in Cursor, Claude Code
27
28
  3. If a local rule conflicts with a preset rule, **the local rule wins**.
28
29
  4. **Deeper wins** in monorepos: walk `packages/*/.ai.local/` and apply all levels; the model treats the deepest one as the most recent guidance.
29
30
 
31
+ ## Seed library (`.ai.local/rules-library/`)
32
+
33
+ `init` also seeds **staged-inactive** rule templates into `.ai.local/rules-library/`. They ship with every install but **do not apply** until you move a matching file into `.ai.local/rules/`.
34
+
35
+ Why staged: they encode common repo shapes (Pages Router, no-`FC`, a component-catalog quality gate, commit hygiene) that only matter once you confirm your repo actually needs them. Keeping them inactive avoids spending context on rules that do not apply.
36
+
37
+ The `ai-local-overlay` rule instructs the model to treat a matching seed as the applicable local rule and to recommend activation. The next-stack seed set (27 files) includes: `router-pages` (`override: kill next-app-router` for Pages Router repos), `no-react-fc`, `component-child-decomposition`, `single-source-copy-constants`, `commit-hygiene`, `pre-pr-checklist`, `api-contract-source`, `agent-pipeline-gates`, `artifact-lifecycle`, `agent-artifacts-no-local-paths`, `no-test-driven-behavior-change`, `mcp-required-for-ui-layout`, `ui-change-review-gate`, `task-levels`, `analytics-events`, `feature-flags-experiments`, `pwa-service-worker`, `qa-test-cases`, `forms-validation`, and the `storybook-*` set.
38
+
39
+ ```bash
40
+ # activate a seed
41
+ git mv .ai.local/rules-library/router-pages.md .ai.local/rules/router-pages.md
42
+ ```
43
+
30
44
  ## How to write `.ai.local/rules/*.md`
31
45
 
32
46
  One file = one rule. Plain markdown. **No YAML frontmatter** — the format is shared across IDEs, so each file uses a tiny markdown header for scoping.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bonesofspring/ai-rules",
3
- "version": "0.2.31",
3
+ "version": "0.2.32",
4
4
  "description": "Presets of Cursor, Claude, Mavis, and OpenCode rules/commands for Revy Ross personal use",
5
5
  "license": "MIT",
6
6
  "author": "Revy Ross",
@@ -77,8 +77,7 @@ Each slug has one `artifact-manifest.json` at `.ai.local/team/tasks/<slug>/`. Sc
77
77
 
78
78
  - Read the manifest before broad prior-artifact discovery. Each step receives authoritative input entry IDs, owns named output entry IDs, and finishes with one terminal receipt linked to AC/task IDs.
79
79
  - Markdown remains detailed evidence; the manifest records producer, status, authoritative paths, timestamps, outcome, and evidence paths.
80
- -
81
- Agents upsert only the items in `manifest.artifacts[]` they own and preserve foreign items. Parallel agents use distinct IDs; the parent/orchestrator serializes manifest merges.
80
+ - Agents upsert only the items they own in `manifest.artifacts[]` and preserve all foreign items in that array. Parallel agents use distinct IDs; the parent/orchestrator serializes manifest merges. The top-level array key is `artifacts` — not `entries`; see `agent-artifact-contracts.md` for the schema callout.
82
81
  - The orchestration runtime/hook is the single writer for `status.json` lifecycle fields and `metrics.json`. Agents read status for eligibility but never rewrite state, gate, retry, attempt, timestamp, or metrics fields.
83
82
  - Missing/stale manifests are reported as a handoff gap; fall back to `brief.md`, `decomposition.md`, and `pipeline.json` rather than inventing authority.
84
83
 
@@ -77,8 +77,7 @@ Each slug has one `artifact-manifest.json` at `.ai.local/team/tasks/<slug>/`. Sc
77
77
 
78
78
  - Read the manifest before broad prior-artifact discovery. Each step receives authoritative input entry IDs, owns named output entry IDs, and finishes with one terminal receipt linked to AC/task IDs.
79
79
  - Markdown remains detailed evidence; the manifest records producer, status, authoritative paths, timestamps, outcome, and evidence paths.
80
- -
81
- Agents upsert only the items in `manifest.artifacts[]` they own and preserve foreign items. Parallel agents use distinct IDs; the parent/orchestrator serializes manifest merges.
80
+ - Agents upsert only the items they own in `manifest.artifacts[]` and preserve all foreign items in that array. Parallel agents use distinct IDs; the parent/orchestrator serializes manifest merges. The top-level array key is `artifacts` — not `entries`; see `agent-artifact-contracts.md` for the schema callout.
82
81
  - The orchestration runtime/hook is the single writer for `status.json` lifecycle fields and `metrics.json`. Agents read status for eligibility but never rewrite state, gate, retry, attempt, timestamp, or metrics fields.
83
82
  - Missing/stale manifests are reported as a handoff gap; fall back to `brief.md`, `decomposition.md`, and `pipeline.json` rather than inventing authority.
84
83
 
@@ -77,8 +77,7 @@ Each slug has one `artifact-manifest.json` at `.ai.local/team/tasks/<slug>/`. Sc
77
77
 
78
78
  - Read the manifest before broad prior-artifact discovery. Each step receives authoritative input entry IDs, owns named output entry IDs, and finishes with one terminal receipt linked to AC/task IDs.
79
79
  - Markdown remains detailed evidence; the manifest records producer, status, authoritative paths, timestamps, outcome, and evidence paths.
80
- -
81
- Agents upsert only the items in `manifest.artifacts[]` they own and preserve foreign items. Parallel agents use distinct IDs; the parent/orchestrator serializes manifest merges.
80
+ - Agents upsert only the items they own in `manifest.artifacts[]` and preserve all foreign items in that array. Parallel agents use distinct IDs; the parent/orchestrator serializes manifest merges. The top-level array key is `artifacts` — not `entries`; see `agent-artifact-contracts.md` for the schema callout.
82
81
  - The orchestration runtime/hook is the single writer for `status.json` lifecycle fields and `metrics.json`. Agents read status for eligibility but never rewrite state, gate, retry, attempt, timestamp, or metrics fields.
83
82
  - Missing/stale manifests are reported as a handoff gap; fall back to `brief.md`, `decomposition.md`, and `pipeline.json` rather than inventing authority.
84
83
 
@@ -78,8 +78,7 @@ Each slug has one `artifact-manifest.json` at `.ai.local/team/tasks/<slug>/`. Sc
78
78
 
79
79
  - Read the manifest before broad prior-artifact discovery. Each step receives authoritative input entry IDs, owns named output entry IDs, and finishes with one terminal receipt linked to AC/task IDs.
80
80
  - Markdown remains detailed evidence; the manifest records producer, status, authoritative paths, timestamps, outcome, and evidence paths.
81
- -
82
- Agents upsert only the items in `manifest.artifacts[]` they own and preserve foreign items. Parallel agents use distinct IDs; the parent/orchestrator serializes manifest merges.
81
+ - Agents upsert only the items they own in `manifest.artifacts[]` and preserve all foreign items in that array. Parallel agents use distinct IDs; the parent/orchestrator serializes manifest merges. The top-level array key is `artifacts` — not `entries`; see `agent-artifact-contracts.md` for the schema callout.
83
82
  - The orchestration runtime/hook is the single writer for `status.json` lifecycle fields and `metrics.json`. Agents read status for eligibility but never rewrite state, gate, retry, attempt, timestamp, or metrics fields.
84
83
  - Missing/stale manifests are reported as a handoff gap; fall back to `brief.md`, `decomposition.md`, and `pipeline.json` rather than inventing authority.
85
84
 
@@ -74,8 +74,7 @@ Each slug has one `artifact-manifest.json` at `.ai.local/team/tasks/<slug>/`. Sc
74
74
 
75
75
  - Read the manifest before broad prior-artifact discovery. Each step receives authoritative input entry IDs, owns named output entry IDs, and finishes with one terminal receipt linked to AC/task IDs.
76
76
  - Markdown remains detailed evidence; the manifest records producer, status, authoritative paths, timestamps, outcome, and evidence paths.
77
- -
78
- Agents upsert only the items in `manifest.artifacts[]` they own and preserve foreign items. Parallel agents use distinct IDs; the parent/orchestrator serializes manifest merges.
77
+ - Agents upsert only the items they own in `manifest.artifacts[]` and preserve all foreign items in that array. Parallel agents use distinct IDs; the parent/orchestrator serializes manifest merges. The top-level array key is `artifacts` — not `entries`; see `agent-artifact-contracts.md` for the schema callout.
79
78
  - The orchestration runtime/hook is the single writer for `status.json` lifecycle fields and `metrics.json`. Agents read status for eligibility but never rewrite state, gate, retry, attempt, timestamp, or metrics fields.
80
79
  - Missing/stale manifests are reported as a handoff gap; fall back to `brief.md`, `decomposition.md`, and `pipeline.json` rather than inventing authority.
81
80
 
@@ -43,6 +43,8 @@ Working directory for app scripts: **`app/`**. Detect the package manager from l
43
43
 
44
44
  After code edits: invoke **`post-change-lint`** (requestable). Full gate: agent `build-verifier`.
45
45
 
46
+ Repositories with more than one package (e.g. `app/` + `storybook/`) run each package's own scripts from its own directory; do not conflate runners.
47
+
46
48
  ## Security basics
47
49
 
48
50
  - Do not commit secrets (`.env`, tokens, credentials).
@@ -65,10 +67,18 @@ Skills: `.cursor/skills/`, `.claude/skills/`, `.mavis/skills/`, or `.opencode/sk
65
67
 
66
68
  Gotchas, local patterns, and team decisions: **`.ai.local/conventions.md`** (fill after init; `init` does not overwrite it).
67
69
 
70
+ ## Seed library (`.ai.local/rules-library/`)
71
+
72
+ `init` seeds **staged-inactive** rule templates here (Cursor `.mdc` sources analog: `presets/cursor/next/ai-local/rules-library/**`). They are **not** active until moved into `.ai.local/rules/`. When a seed matches the task scope, apply it and tell the owner to move it. Typical seeds: `router-pages` (Pages Router override), `no-react-fc`, `component-child-decomposition`, `single-source-copy-constants`, `commit-hygiene`, `pre-pr-checklist`, `api-contract-source`, `agent-pipeline-gates`, `task-levels`, `analytics-events`, `feature-flags-experiments`, `pwa-service-worker`, `qa-test-cases`, `forms-validation`, and the `storybook-*` set.
73
+
74
+ ## Managed vs preserved
75
+
76
+ `init` owns `.cursor/**`, `.claude/**`, `.mavis/**`, `.opencode/**`, root `AGENTS.md`, and the tool MCP config; it **overwrites/merges** them. Durable project config and authoritative specs belong **outside** those trees: `.ai.local/**`, `.ai/context/**`, `docs/specs/**`, `openspec/**`, repo-root `.mcp.json`. After a re-init, re-check any consumer-owned block added to a managed file.
77
+
68
78
  ## Local overlay (`.ai.local/`) — MANDATORY
69
79
 
70
80
  A `.ai.local/` directory MAY exist at the repo root or at any nesting depth in monorepos. **All agents MUST read and apply it on every turn.** Rules there override preset rules; in conflicts, the local rule wins. `override: kill <preset-rule-name>` drops the named preset rule from the agent's context entirely.
71
81
 
72
- Plain markdown rules under `.ai.local/rules/*.md` are read by the agent with higher priority than preset rules. Living gotchas live in `.ai.local/conventions.md`.
82
+ Plain markdown rules under `.ai.local/rules/*.md` are read by the agent with higher priority than preset rules. Living gotchas live in `.ai.local/conventions.md`. Staged seeds live in `.ai.local/rules-library/**`; a matching seed must be moved into `.ai.local/rules/` to activate.
73
83
 
74
84
  On every turn, probe `ls -la .ai.local`, apply `.ai.local/rules/*.md` and `.ai.local/conventions.md`, and acknowledge `Using .ai.local: <rule-name>`. Authoring guide: `docs/LOCAL-OVERLAY.md` in the `@bonesofspring/ai-rules` package. The `ai-local-overlay` rule is always-on on Cursor and session-start on Claude (no `paths:`). Mavis and OpenCode have no native `alwaysApply`; this section plus the platform entry's essential-rules list is the reinforcement.
@@ -39,6 +39,7 @@ Use **`rules/tooling-and-review/package-manager.md`** for the repo package manag
39
39
  2. **`lint:css`** — full Stylelint.
40
40
  3. **`type-check`** — when TypeScript changed.
41
41
  4. **Unit tests** — run specs for changed modules (paths from diff); if unclear, run the narrowest parent suite that covers changed mappers/services/store.
42
+ 5. **Component catalog** — when the repo ships a catalog (e.g. `storybook/`) and `app/src/ui/**` or catalog files changed, run the catalog's own test/visual-baseline suite from the catalog package and require green **without** `--update` (`component-catalog-gate`). A green app unit run does not cover catalog stories.
42
43
 
43
44
  Prefer **`lint`** (= js + css + type-check) before handoff on large changes.
44
45
 
@@ -116,5 +116,6 @@ Do not mix this output with retrospective facilitation — keep review and retro
116
116
 
117
117
  - **Authoritative inputs:** read `.ai.local/team/tasks/<slug>/artifact-manifest.json` first; consume handoff `artifactInputIds` when supplied, otherwise consume the items in `manifest.artifacts[]` for brief/decomposition, implementation, validation evidence, and the scoped git diff.
118
118
  - **Owned outputs:** `review.md`; upsert only the entry in `manifest.artifacts[]` assigned by handoff (`artifactOutputId`; fallback `review`) and preserve all foreign items in `manifest.artifacts[]`.
119
+ - **Commit hygiene:** never run `git commit` / `git push`. Reviewer turns end with findings only; when asked for commit guidance, propose an area-split commit plan (source / artifacts / docs) with the owning slug.
119
120
  - **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `changes_requested`. Bind it to the supplied `attemptId` when present.
120
121
  - **Shared state:** never create or mutate `status.json` or `metrics.json`; the orchestration runtime/hook owns lifecycle, gates, retries, attempts, and timestamps.
@@ -149,5 +149,6 @@ Shipped browser split: Playwright MCP for e2e specs/selectors; Chrome DevTools M
149
149
 
150
150
  - **Authoritative inputs:** read `.ai.local/team/tasks/<slug>/artifact-manifest.json` first; consume handoff `artifactInputIds` when supplied, otherwise consume the items in `manifest.artifacts[]` for `brief.md`, `decomposition.md`, current scope, and applicable prior findings.
151
151
  - **Owned outputs:** `implementation.md` plus changed implementation/test paths; upsert only the entry in `manifest.artifacts[]` assigned by handoff (`artifactOutputId`; fallback `implementation`) and preserve all foreign items in `manifest.artifacts[]`.
152
+ - **Commit hygiene:** never run `git commit` / `git push`. At the end of the turn return a `## Human commits` block: files touched + a proposed commit message, split by area (source / artifacts / docs) with the owning slug/ticket in the subject. See the consumer `commit-hygiene` local rule.
152
153
  - **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present.
153
154
  - **Shared state:** never create or mutate `status.json` or `metrics.json`; the orchestration runtime/hook owns lifecycle, gates, retries, attempts, and timestamps.
@@ -77,6 +77,8 @@ Hard constraints (read `config.yaml rules.proposal` first — they win):
77
77
 
78
78
  - `proposal.md` ≤ 500 words.
79
79
  - `## Non-goals` section mandatory (omit → `blocked`).
80
+ - `## Compliance impact` block mandatory in `proposal.md` and `design.md` (None | Affected — list PD / medical / analytics / SSR-cookie / third-party surfaces); when unclear, default to `Affected` and block.
81
+ - `## Hard rules applied` block at the top of `proposal.md` / `design.md` / `tasks.md` (applicable rules + how applied; `N/A — reason` for the rest), when the consumer repo maintains hard rules.
80
82
  - `## What Changes` lists capability deltas **only**; no implementation steps.
81
83
  - `## Capabilities` table groups deltas by capability slug; cite spec paths.
82
84
  - Spec deltas use `## MODIFIED Requirements` heading (or `## REMOVED Requirements`); Each `### Requirement:` block carries `SHALL` statements and `#### Scenario:` Given/When/Then. Mirror existing capability voice.
@@ -66,6 +66,13 @@ Create or update files under `.ai.local/team/tasks/<slug>/`:
66
66
  ## Slug
67
67
  <slug>
68
68
 
69
+ ## Hard rules applied
70
+ - <applicable preset/local rule> — <how applied>
71
+ - N/A — <reason> (list non-applicable hard rules explicitly)
72
+
73
+ ## Compliance impact
74
+ None | Affected — <surfaces: PD / medical data / analytics / SSR cookies / error reporting / third-party scripts>
75
+
69
76
  ## Goal
70
77
  ...
71
78
 
@@ -117,6 +117,7 @@ Keep top-level `profile` and emit this top-level object in every new `pipeline.j
117
117
  - If prompt or `brief.md` contains `figma.com` on `feature` / `refactor` / `spike` / `spec-gen`, insert **mockup-reviewer** after **task-analyst** (when present) and before **solution-architect** and **feature-developer**. Set `model: "strong"` on that step. Do not add static `humanGates: ["after:mockup-reviewer"]` (FAIL-only hook exception). Never put `mockup-reviewer` in a `parallel: true` step (FAIL-only gate is serial).
118
118
  - Classify intent `mockup-review` **before** `ux-design` **before** `review-only`. A `figma.com` URL with review-not-implement language is `mockup-review` even without the word «макет», including when the user said «ревью UX». <!-- i18n-keep: E4 -->
119
119
  - If UI stack and (required-signal or advisory UI AC), instruct **task-analyst** to load skill `ux-design` (no new pipeline step; analyst default model, not `strong`). Required-signal: user asked UX, or AC require flows/states, or spec-gen page/feature.
120
+ - If the resolved scope touches UI paths (`app/src/ui/**`, or the repo's component-catalog root) on `feature` / `refactor`, insert **mockup-reviewer** even **without** a `figma.com` URL — it reviews against the AC / `ux-design.md` instead of Figma. Pair it with a **`mockup-review.md`** terminal artifact requirement (the UI change is not complete without it) and, where the repo ships a component catalog, a catalog-test note on `build-verifier` (`component-catalog-gate`).
120
121
  - Skip **task-analyst** if AC/scope fully specified → document in `skipped`.
121
122
  - Add **solution-architect** for cross-layer / new public APIs — after analyst, before developer.
122
123
  - Add **api-contract-reviewer** for new/changed backend contracts — before developer.
@@ -44,6 +44,7 @@ When editing `app/src/ui/**/*.tsx`, a **reduced** set loads:
44
44
  | `design-guidance.mdc` | `tooling-and-review/design-guidance.md` |
45
45
  | `mcp-usage.mdc` | `tooling-and-review/mcp-usage.md` |
46
46
  | `next-app-router.mdc` | `stack/next-app-router.md` |
47
+ | `next-static-export.mdc` | `stack/next-static-export.md` |
47
48
  | `arrow-functions.mdc` | `stack/arrow-functions.md` |
48
49
  | `types-jsdoc.mdc` | `stack/types-jsdoc.md` |
49
50
  | `no-type-assertion-as-import-export.mdc` | `stack/no-type-assertion.md` |
@@ -62,6 +63,8 @@ When editing `app/src/ui/**/*.tsx`, a **reduced** set loads:
62
63
  | `store-rtk.mdc` | `api-and-data/store-rtk.md` |
63
64
  | `react-ui.mdc` | `ui-and-accessibility/react-ui.md` |
64
65
  | `design-tokens-binding.mdc` | `ui-and-accessibility/design-tokens-binding.md` | Figma → repo token binding (typography/color/spacing/imagery); per-element parity + self-check |
66
+ | `component-catalog-gate.mdc` | `ui-and-accessibility/component-catalog-gate.md` | Storybook/catalog is the UI dev + visual-review surface; stories ship with the change |
67
+ | `forms-validation.mdc` | `ui-and-accessibility/forms-validation.md` | Forms via the repo form library + DS fields + shared validators |
65
68
  | `react-a11y-coding.mdc` | `ui-and-accessibility/react-a11y-coding.md` |
66
69
  | `no-props-spread.mdc` | `ui-and-accessibility/no-props-spread.md` |
67
70
  | `css-property-order-stylelint.mdc` | `ui-and-accessibility/css-property-order.md` |
@@ -11,6 +11,13 @@ These rows **OVERRIDE** generation for the listed patterns. Before inventing an
11
11
 
12
12
  App Router–specific rows (async `params` / `cookies()`, invented auth helpers, etc.) stay in **`stack/next-app-router.md`**. This rule covers broader React / RTK / Next phantom imports and boundary mistakes across `app/**`.
13
13
 
14
+ ## 0. Installed Next ships its own docs (read them first)
15
+
16
+ The installed `next` may bundle version-pinned agent docs and a managed `AGENTS.md` block written by `next dev`:
17
+
18
+ - Docs: `node_modules/next/dist/docs/` (`01-app`, `02-pages`, `03-architecture`, …). Prefer these over blog posts and over training data for framework APIs — they match the installed major.
19
+ - Managed block: `<!-- BEGIN:nextjs-agent-rules -->` in `AGENTS.md` (see `node_modules/next/dist/server/lib/generate-agent-files.js`). **Do not delete it** — `next dev` re-creates it; commit it with your change to keep the tree clean.
20
+
14
21
  ## 1. Phantom / wrong Next imports
15
22
 
16
23
  | ❌ Avoid | ✅ Prefer |
@@ -56,6 +63,9 @@ App Router–specific rows (async `params` / `cookies()`, invented auth helpers,
56
63
  | `Router.push` / Pages `withRouter` patterns in `app/` UI | App Router navigation helpers already used in `app/src/ui/**` |
57
64
  | Client `fetch` / raw HTTP from UI or `page.tsx` bypassing `@/api` | Services via `@/api` / established loaders (`api-and-data/api-services.md`, `api-and-data/http-client.md`) |
58
65
  | Invented `next/link` props that siblings never use (e.g. fake prefetch enums) | Match existing `<Link>` usage; verify against installed Next |
66
+ | `getServerSideProps` / `getInitialProps`, `pages/api/**`, `route.ts`, `middleware.ts` in an `output: 'export'` repo | build-time `getStaticProps` / `getStaticPaths` or client store/thunk fetch (`stack/next-static-export.md`) |
67
+ | Hardcoded `/` root for links / assets when the repo uses `basePath` / `assetPrefix` | Derive from `basePath` / `assetPrefix` |
68
+ | `next/image` `loader` / `sizes` / `quality` expecting the optimizer in a repo with `images.unoptimized: true` | The repo's image primitive; no optimizer assumptions |
59
69
 
60
70
  ## 6. Version drift
61
71
 
@@ -49,6 +49,12 @@ impact: HIGH
49
49
  - avoid duplicating entity descriptions in multiple places.
50
50
  - **Domain boundary**: in **state**, store domain models; the client **response wrapper** type is acceptable as a thunk **return type** or interim before mapping — without duplicating DTOs in state fields unnecessarily (aligned with `api-and-data/api-services.md` and `api-and-data/http-client.md`).
51
51
 
52
+ # Middleware and cross-slice orchestration
53
+
54
+ - Cross-cutting side effects (analytics, captcha, file lifecycle, cross-slice sync) live in **listener middleware** at `app/src/store/middleware/<Domain>Middleware/`, registered in the store factory — follow the repo's `prepend`/`concat` order.
55
+ - A slice **must not import another slice**. When two domains must react to each other, orchestrate in middleware or a dedicated `_complexSlices/<Domain>` module (`_utilsSlices` for pure helpers) — never a direct slice→slice import.
56
+ - Prefer a thunk for a single request/response; prefer middleware for reactions that span slices or emit analytics.
57
+
52
58
  # Slice testing
53
59
 
54
60
  - For important slices:
@@ -8,6 +8,10 @@ paths:
8
8
 
9
9
  When the prompt or `brief.md` contains a `figma.com` URL, **mockup review** (`mockup-reviewer` / skill `mockup-review`) must complete — or the user must continue past FAIL/`BLOCKED_MCP` via `/task-continue` — **before UI implementation**. Non-UI tasks no-op this gate. When required-signal and **no** `figma.com`, **`ux-design.md`** (on the analysis manifest entry) must exist and not be `INCOMPLETE` before UI work — else **blocked**, hand back to `task-analyst`. Parallel to the mockup gate.
10
10
 
11
+ **UI-scope gate (no Figma).** When the scope touches `app/src/ui/**` or the component-catalog root on `feature` / `refactor`, a terminal `mockup-review.md` is required **even without** a `figma.com` URL — reviewed against the AC / `ux-design.md`. Where the repo ships a component catalog, stories ship with the UI and `build-verifier` runs the catalog suite green (`ui-and-accessibility/component-catalog-gate.md`).
12
+
13
+ **Consumer context.** When `.ai/context/**` exists, read it before deriving architecture, domain vocabulary, or test placement.
14
+
11
15
  ## Style discovery (mandatory)
12
16
 
13
17
  Before writing a new file in a layer, open **1–2 analog files** in the same layer and mirror: export shape, name prefixes (`T` / `I` where the repo uses them), file suffixes (`.apiMethods.ts`, `.endpoints.ts`, `.data.ts`, `.hooks.ts`, `styles.ts`), mapper / selector / thunk naming, and barrel shape. Record the analogs in the handoff. Where this preset's examples differ from the repo, **the repo wins**.
@@ -16,7 +20,7 @@ Before writing a new file in a layer, open **1–2 analog files** in the same la
16
20
 
17
21
  When the prompt or `brief.md` contains a Figma URL with a node id (`?node-id=…`), `mockup-reviewer` must walk the node subtree via Figma MCP and emit **two sections** in `mockup-review.md`:
18
22
 
19
- - `## Design contract` — Figma variables, text styles, components/assets used by the subtree, with the repo mapping (`@sds/tokens-colors` / `@sds/brand-colors` / `@sds/tokens-typography` / `@sds/tokens` / DS components / `next/image` with Figma-derived `src/width/height`). This is the binding table the developer uses for typography, color, spacing, and imagery.
23
+ - `## Design contract` — Figma variables, text styles, components/assets used by the subtree, with the repo mapping (`@sds/tokens-colors` / `@sds/brand-colors` / `@sds/tokens-typography` / `@sds/tokens` / DS components / the project image primitive with Figma-derived `src/width/height`). This is the binding table the developer uses for typography, color, spacing, and imagery.
20
24
  - `## Node decomposition (AC-2)` — the child→component map (with a `Bindings` column for the Figma design bindings).
21
25
 
22
26
  `feature-developer` must **not** start UI implementation until both sections are present, and must load requestable `ui-and-accessibility/design-tokens-binding.md` to bind every value to a Figma variable / text style / repo token (raw `#…` / `px` are a finding). The full procedure and verdict rule live in the `mockup-reviewer` agent prompt and the `mockup-review` Stack notes.
@@ -119,5 +119,6 @@ Block handoff via `open_questions` until fixed:
119
119
  ## Stack notes
120
120
 
121
121
  - Author via skill `spec-authoring`; templates from package assets / consumer `docs/specs/_templates/`.
122
+ - **Glossary & contrast (mandatory):** before authoring, read the repo glossary (`openspec/config.yaml` `context:`, `.ai/context/**`, domain README). Each generated spec maps product terms to code symbols + record types and adds one **contrast** requirement/scenario against the nearest confusable symbol. Declare **compliance impact** (None | Affected) for any spec touching medical/personal data or analytics.
122
123
  - Field semantics match discovery stem (`routes` = URL paths; `e2e` = Playwright).
123
124
  - Requestable — not always-on / session-start.
@@ -63,5 +63,6 @@ Same-changeset INDEX updates, frontmatter v1, required body headings, templates,
63
63
  ## Stack notes
64
64
 
65
65
  - `routes`: app URL paths. `ui` / `store`: presentation + RTK/store paths (e.g. `app/src/ui/pages/...`). `e2e`: Playwright paths under `app/__tests__/e2e/**` (or repo equivalent).
66
+ - **Domain glossary & contrast:** read the repo glossary first (e.g. `openspec/config.yaml` `context:`). Every spec that names a domain states a **term → code symbol + record type** mapping and includes one **contrast** scenario naming the nearest confusable symbol/page (e.g. an in-person-consultation spec contrasts `OfflineConsultation*` with `OnlineConsultationPage`). This prevents the highest-frequency domain-confusion bug in these repos.
66
67
  - Dogfood example (emedcard-web AnalysisPage): `docs/specs/domains/analysis/analysis-page.md`.
67
68
  - Requestable / `docs/specs/**` globs — not always-on / session-start.
@@ -27,6 +27,11 @@ Replace **TBD** with real paths after team agreement (or on `ai-rules init` in t
27
27
  | Types module | **TBD** `app/src/types/<example>/` | domain types, JSDoc, barrel export |
28
28
  | Unit tests | **TBD** mirrored under `app/__tests__/unit/<rel>` | `*.spec.ts`, describe/it naming |
29
29
  | E2E area | **TBD** `app/__tests__/e2e/<Area>/` | `*.cases.md`, page objects, `_shared/` |
30
+ | Scaffold | **TBD** `app/src/boilerplate/**` | new-component skeleton (copy, then rename) |
31
+ | Global singletons | **TBD** `app/src/ui/components/_singletons/**` | app-root-mounted containers (modals, sync, flags) |
32
+ | Layout / guard | **TBD** `app/src/ui/layouts/**`, `app/src/ui/guards/**` | route wrapping (auth, chrome) |
33
+ | Cross-feature hooks | **TBD** `app/src/core/**` | reusable feature hooks used across pages |
34
+ | Internal slices | **TBD** `app/src/store/slices/_complexSlices/**`, `_utilsSlices/**` | cross-slice orchestration / pure helpers — **no** direct slice→slice imports |
30
35
 
31
36
  ## How to use
32
37
 
@@ -8,6 +8,9 @@ Concrete versions come **from `package.json` and configs of the target repositor
8
8
  - `app/tsconfig.json`: `paths: { "@/*": ["./src/*"] }` (`baseUrl` may be absent with TS ≥5 / `moduleResolution: bundler` — check the file, do not add it blindly).
9
9
  - **Requirement:** `@/*` instead of relative imports that climb the tree.
10
10
  - **Router mode:** detect from the repo before adding routes — App Router (`app/src/app/**`, `page.tsx`) vs Pages Router (`app/src/pages/**`, `_app.tsx`). Do **not** assume App Router; follow the mode already in use (`stack/next-app-router.md`, `stack/navigation-router.md`).
11
+ - **Deployment model:** read `output` in `next.config.*`. With `output: 'export'` the app is a static SPA — no server runtime, no API routes / middleware / SSR (`stack/next-static-export.md`).
12
+ - **Consumer context:** when `.ai/context/**` exists, read it for the repo's compressed architecture, domain glossary, and test-placement conventions before deriving them yourself.
13
+ - **Env access:** read `NEXT_PUBLIC_*` through the repo's config module (e.g. `@/config`); new public keys must also be listed in `next.config.*` `env`. Never read `process.env` inside components.
11
14
 
12
15
  # Architectural layers
13
16
 
@@ -0,0 +1,36 @@
1
+ ---
2
+ description: Static-export / SPA Next.js (output 'export') — no server runtime; what is unavailable and what to use instead
3
+ impact: HIGH
4
+ paths:
5
+ - app/next.config.*
6
+ - app/src/pages/**/*
7
+ ---
8
+
9
+ # Static export (Next.js `output: 'export'`)
10
+
11
+ Detect the deployment model **before** writing data-fetching or routing code: read `output` in `next.config.*`. With `output: 'export'` the build produces a static SPA — there is no server runtime at request time.
12
+
13
+ ## Unavailable
14
+
15
+ - `getServerSideProps`, `getInitialProps`.
16
+ - API routes (`pages/api/**`, App Router `route.ts`) and `middleware.ts`.
17
+ - Server Actions; server `cookies()` / `headers()`.
18
+ - ISR / `revalidate` / `dynamic = 'force-dynamic'`.
19
+ - The image optimizer when `images.unoptimized: true` (`next/image` `loader` / `sizes` buy nothing).
20
+
21
+ ## Available / preferred
22
+
23
+ - `getStaticProps` / `getStaticPaths` run at **build** time only.
24
+ - Runtime data comes from the browser: store thunk → `@/api` service (`store-rtk.md`, `api-services.md`).
25
+ - Auth / session are enforced by the BFF plus a client route guard — not by a Next server.
26
+ - `basePath` / `assetPrefix`: build local links and asset URLs from those values; never hardcode `/`.
27
+
28
+ ## Agent requirement
29
+
30
+ - Copy the data-fetch and navigation pattern from a sibling page under `app/src/pages/**`; do not port SSR/RSC examples from docs or blogs into a static-export repo.
31
+ - If a requested feature implies a server runtime, mark it **N/A — static export** and propose the client/BFF alternative instead of writing server code.
32
+
33
+ ## Related
34
+
35
+ - `react-next-anti-hallucination.md` — phantom-import banlist for this deployment model.
36
+ - `navigation-router-stack.md` — Pages Router vs App Router.
@@ -77,6 +77,7 @@ Bad (no capital after period; or wrong locale for configured ESLint):
77
77
  ## Stack notes
78
78
 
79
79
  - Runner: Playwright (`@playwright/test`).
80
+ - Consolidated QA docs (`docs/qa/**`): when present they are a derived view of the spec + `*.cases.md` (route table, `as-is`/`target` marking, PREFIX map). Cite the source per case and keep them in sync on behaviour change — do not treat them as a second SoT.
80
81
  - E2E folder: `app/__tests__/e2e/**`.
81
82
  - Placement mirrors source paths: `app/src/<rel>` → `app/__tests__/e2e/<rel>`. Use the deepest folder of the source under test; page-wide scenarios mirror the page folder.
82
83
  - Scenario plans: `*.cases.md` files — canonical source of scenarios.
@@ -87,6 +87,7 @@ Bad (no capital after period; or wrong locale for configured ESLint):
87
87
  - `app/src/mocks/**` — shared fixtures and MSW handlers live here (or repo equivalent).
88
88
  - Unit-test placement mirrors source paths: `app/src/<rel>` → `app/__tests__/unit/<rel>`. Do not colocate `*.spec.ts(x)` or `*.test.ts(x)` under `app/src/**`.
89
89
  - HTTP-client behavior tests live under the mirrored `app/__tests__/unit/lib/clients/**` path (prefer `*.spec.ts`).
90
+ - Prefer the package script over a bare runner (`yarn test`, not `npx jest`): scripts carry env (`TZ`), coverage, and reporters that CI depends on.
90
91
  - UI tests live under the mirrored `app/__tests__/unit/ui/**` path. Import the source under test through the `@/` alias.
91
92
  - `## Stack notes` content is stripped by `scripts/check-shared-core-drift.sh` before byte-comparing this file against `_shared/core/testing/testing-principles.md`; keep prose above (core content) verbatim against the core file.
92
93
 
@@ -91,8 +91,7 @@ Each slug has one `artifact-manifest.json` at `.ai.local/team/tasks/<slug>/`. Sc
91
91
 
92
92
  - Read the manifest before broad prior-artifact discovery. Each step receives authoritative input entry IDs, owns named output entry IDs, and finishes with one terminal receipt linked to AC/task IDs.
93
93
  - Markdown remains detailed evidence; the manifest records producer, status, authoritative paths, timestamps, outcome, and evidence paths.
94
- -
95
- Agents upsert only the items in `manifest.artifacts[]` they own and preserve foreign items. Parallel agents use distinct IDs; the parent/orchestrator serializes manifest merges.
94
+ - Agents upsert only the items they own in `manifest.artifacts[]` and preserve all foreign items in that array. Parallel agents use distinct IDs; the parent/orchestrator serializes manifest merges. The top-level array key is `artifacts` — not `entries`; see `agent-artifact-contracts.md` for the schema callout.
96
95
  - The orchestration runtime/hook is the single writer for `status.json` lifecycle fields and `metrics.json`. Agents read status for eligibility but never rewrite state, gate, retry, attempt, timestamp, or metrics fields.
97
96
  - Missing/stale manifests are reported as a handoff gap; fall back to `brief.md`, `decomposition.md`, and `pipeline.json` rather than inventing authority.
98
97
 
@@ -12,8 +12,9 @@ This rule is mandatory. **You MUST** obey it on every turn, without exception.
12
12
  1. **Probe** — before answering, run `ls -la .ai.local` from the repository root.
13
13
  2. **Walk** — if `.ai.local/` exists at multiple levels (monorepo), read every level from root to leaf. **Deeper wins** in practice: more specific rules appear later in the assembled context and take precedence.
14
14
  3. **Apply** — treat every `.ai.local/rules/*.md` and `.ai.local/conventions.md` as a higher-priority rule for this repo. Do **not** load `.ai.local/team/**` as rules (shared pipeline artifacts). The block below ("Authoring `.ai.local/rules/*.md`") defines the conventions.
15
- 4. **Conflict** — if a local rule conflicts with a preset rule, **the local rule wins**. If a local rule body contains `override: kill <preset-rule-name>`, drop that preset rule from your context window entirely.
16
- 5. **Acknowledge** — when answering a user question, briefly state which `.ai.local/` rules apply to the current task (one line is enough). Format: `Using .ai.local: <rule-name>(, <rule-name>)*`. If no `.ai.local/` exists, do NOT mention this rule.
15
+ 4. **Activate seeds** — if `.ai.local/rules-library/<seed>.md` exists and matches the current task scope, treat it as the applicable local rule and tell the owner to move it into `.ai.local/rules/`. Seeds are **staged-inactive** templates shipped by `init` (e.g. `router-pages`, `no-react-fc`, `storybook-ui-quality-gate`, `component-child-decomposition`); they do **not** apply until moved.
16
+ 5. **Conflict** — if a local rule conflicts with a preset rule, **the local rule wins**. If a local rule body contains `override: kill <preset-rule-name>`, drop that preset rule from your context window entirely.
17
+ 6. **Acknowledge** — when answering a user question, briefly state which `.ai.local/` rules apply to the current task (one line is enough). Format: `Using .ai.local: <rule-name>(, <rule-name>)*`. If no `.ai.local/` exists, do NOT mention this rule.
17
18
 
18
19
  If `.ai.local/` does not exist → **no-op**, do not error. Do not produce any log line about its absence.
19
20
 
@@ -29,6 +30,18 @@ Each `.ai.local/rules/<name>.md` is a plain-markdown rule body. The model parses
29
30
 
30
31
  Keep files ≤ 120 lines. Match the style of preset rules (short sections, bullets, code examples).
31
32
 
33
+ ## What `init` overwrites vs preserves
34
+
35
+ `init` manages the tool trees; they are **not** the home of durable project config.
36
+
37
+ | Overwritten / merged by `init` | Preserved |
38
+ |---|---|
39
+ | `.cursor/**`, `.claude/**`, `.mavis/**`, `.opencode/**` (rules, agents, skills, commands, hooks) | `.ai.local/**` |
40
+ | root `AGENTS.md` (from `REPO_AGENTS.md`) | `docs/specs/**`, `openspec/**` |
41
+ | tool MCP config (`.cursor/mcp.json`; `opencode.json` — `mcp` merged, other blocks may be rewritten) | repo-root `.mcp.json`, `.ai/context/**`, `.ai.local/rules/**` |
42
+
43
+ Put durable project-owned agent config and authoritative specs **outside** the tool trees (`.ai.local/`, `.ai/context/`, repo-root `.mcp.json`). After any re-init, verify consumer-owned blocks you added to a managed file (e.g. `opencode.json` `instructions` / `permission.bash`) survived.
44
+
32
45
  ## Limitations (read this)
33
46
 
34
47
  - Cursor, Claude, Mavis, and OpenCode do **not** natively read `.ai.local/`. This rule is a **prompt-only** mechanism: it asks you, the model, to read and apply the files. Reliability is high but not 100%.
@@ -40,4 +53,5 @@ Keep files ≤ 120 lines. Match the style of preset rules (short sections, bulle
40
53
 
41
54
  - Authoring guide: `docs/LOCAL-OVERLAY.md` in the `@bonesofspring/ai-rules` package.
42
55
  - Living gotchas: `.ai.local/conventions.md`. Pipeline artifacts: `.ai.local/team/` (do not load as rules).
56
+ - Staged seeds: `.ai.local/rules-library/**` (move a matching seed into `.ai.local/rules/` to activate).
43
57
  - Root `AGENTS.md` reinforces this rule with a `MANDATORY` section.
@@ -69,3 +69,7 @@ When the diff touches UI / layout / styling (paths under `app/src/ui/**`, global
69
69
  - Findings: `path:line` + Figma node id + viewport + severity. Emit a `## Figma parity (UI)` section in `review.md`.
70
70
  - **Storybook visual baselines are not a substitute.** Approving a UI MR on Storybook baselines alone is not acceptable when a Figma reference exists.
71
71
  - Missing or `unable_to_compare` parity section on a UI-touching MR with a Figma reference → `REQUEST_CHANGES`. Unbound raw values where a token exists (typography / color / spacing / imagery) → `blocker` / `important`. The full gate lives in the `code-reviewer` agent prompt; this rule cross-references it.
72
+
73
+ ### Spec / docs sync (behaviour change)
74
+
75
+ When the diff changes documented `app/src/**` behaviour and the repo carries a spec tree (`docs/specs/**`, `openspec/specs/**`, `docs/qa/**`, or `*.cases.md`), the same changeset must update the linked page / spec / QA case (or record an explicit open-question gap). A missing update on an **AC-named** surface → `REQUEST_CHANGES`; on a non-AC surface → `important`. Do not treat `docs/specs` and `openspec` as substitutes for each other — keep both in sync.
@@ -93,6 +93,7 @@ Policy is stack-class-specific — see adapter **Stack notes**. If a Figma **plu
93
93
 
94
94
  ## Stack notes
95
95
 
96
+ - **Installed Next docs first:** the installed `next` may ship version-pinned agent docs at `node_modules/next/dist/docs/` and a managed `AGENTS.md` block. Prefer them for framework APIs (they match the installed major) — reach for Context7 only when they are insufficient or absent.
96
97
  - Pipeline **`mockup-reviewer`** is the only agent that reads Figma for mockup review. See `mockup-review`.
97
98
  - Shipped besides Context7: browser automation MCP (`playwright` / `playwright-test` / `user-playwright`) and `chrome-devtools`.
98
99
  - **Split:** Playwright MCP → e2e agents (planner/generator/healer), selector checks, spec reproduction. Chrome DevTools MCP → `debugger` / `performance-auditor` against a **running app** (console, network, traces). Not a substitute for e2e.
@@ -19,6 +19,10 @@ Exceptions: documentation edits outside `app/`, CI configs, `.claude/rules/**`,
19
19
 
20
20
  **Pipeline exception:** if the task runs through the agent team and the next step is `build-verifier`, the developer may limit lint/type-check to **changed files**; full run is `build-verifier`’s duty. In single-agent mode (no pipeline) — always a full run.
21
21
 
22
+ **Secondary packages:** when the repo has more than one package with a manifest (e.g. `app/` + `storybook/`), run each package's own scripts from its own directory. Do not conflate runners (app unit runner vs catalog runner).
23
+
24
+ **Run the package script, not a bare runner:** prefer `yarn lint:js` / `yarn test` over `npx eslint` / `npx jest`. Scripts carry env (`TZ`), coverage, and reporters that CI depends on; a bare runner can diverge from CI.
25
+
22
26
  ## Required commands
23
27
 
24
28
  Working directory — **`app/`**. Package manager — **`tooling-and-review/package-manager.md`**.
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  description: Next.js frontend security — secrets, auth, XSS, Server Actions, env
3
+ impact: CRITICAL
3
4
  paths:
4
5
  - "app/src/**/*.{ts,tsx}"
5
6
  - "app/**/app/**/*.{ts,tsx}"
@@ -14,6 +15,8 @@ paths:
14
15
 
15
16
  Coding-time checklist. Full audit → agent `security-reviewer` + skill `code-review`.
16
17
 
18
+ **Deployment model first.** Read `output` in `next.config.*`. With `output: 'export'` there is **no server tier**: the Server Actions / route handlers / middleware items below are **N/A**. The applicable subset is Secrets & env, XSS, redirects, data exposure, and third-party scripts — and auth/session are enforced by the BFF plus a client route guard.
19
+
17
20
  ## Secrets and env
18
21
 
19
22
  - Never put service / secret keys in `NEXT_PUBLIC_*` or client bundles (`sk_`, private API keys, DB URLs).
@@ -26,6 +29,7 @@ Coding-time checklist. Full audit → agent `security-reviewer` + skill `code-re
26
29
  - Middleware may refresh sessions; do not treat middleware alone as authorization.
27
30
  - Prefer httpOnly secure cookies over `localStorage` for tokens when the repo pattern allows.
28
31
  - Never trust client-only session claims without a server verify step used by the project.
32
+ - **Static-export / SPA repos:** there is no server session verify — use the repo's client route guard plus BFF-issued httpOnly cookies; do not invent a server verifier.
29
33
 
30
34
  ## Mutations and input
31
35
 
@@ -51,6 +55,15 @@ Coding-time checklist. Full audit → agent `security-reviewer` + skill `code-re
51
55
  | Invented auth helpers not in `package.json` / codebase | Copy patterns from existing auth routes |
52
56
  | Putting secrets in `NEXT_PUBLIC_*` | Server-only env + server modules |
53
57
  | Auth only in middleware | Server `getUser` / session verify in layout/page/action |
58
+ | Server session verifier / Server Action in a static-export repo | Client route guard + BFF-issued httpOnly cookie |
59
+
60
+ ## Compliance / personal data (regulated apps)
61
+
62
+ For apps that ship medical or personal data (e.g. GDPR / local data-protection law):
63
+
64
+ - Logs, traces, analytics payloads, error reports, and third-party scripts must **not** carry PD, full record text, raw auth tokens, or full URL search params.
65
+ - Flag every new third-party script and every change to the SSR/cookie payload shape for review.
66
+ - Any change touching PD, medical data, analytics, or third-party scripts declares a **compliance impact** block (None | Affected) in its L2+ artifact; when unclear, default to Affected and block.
54
67
 
55
68
  ## Agent requirement
56
69
 
@@ -0,0 +1,39 @@
1
+ ---
2
+ description: Component catalog (Storybook/Ladle) is the required UI dev + visual-review surface — stories ship with the UI change
3
+ impact: MEDIUM
4
+ paths:
5
+ - app/src/ui/**/*
6
+ - storybook/**/*
7
+ ---
8
+
9
+ # Component catalog gate (UI quality)
10
+
11
+ When the repo ships a **component catalog** (Storybook, Ladle, Chromatic, or a `stories/` tree), it is the required surface for developing and reviewing UI. A route screenshot, a source-only review, or unit tests without stories is **not** enough.
12
+
13
+ ## Scope
14
+
15
+ - Triggers: a new `app/src/ui/**` component / page / block / modal, or a visual/interaction refactor (layout, styles, tokens, copy, hover/open, empty / error / loading).
16
+ - Skip: types / API / store / mocks with no render or style change.
17
+
18
+ ## Rules
19
+
20
+ - **Stories ship with the UI**, in the same change — not after.
21
+ - **Compare against the design source** (Figma, else the AC): the catalog is the canvas, the design is the truth. Visual baselines are a **regression detector**, not a design spec — fix the implementation first, then update the baseline.
22
+ - **Package isolation:** when the catalog is its own package (own `package.json` / lockfile / `node_modules`), it resolves dependencies from **its own** `node_modules` — never the app's. Missing package ⇒ add it to the catalog manifest; never alias into the app.
23
+ - **Clean up** temp screenshots you created this turn; keep only intentional baselines and product assets.
24
+ - Keep catalog tests green — do not finish with red or stale baselines.
25
+
26
+ ## Stack notes
27
+
28
+ - Catalog: Storybook. Developer loop: read Figma → implement → preview the story → screenshot → compare → fix → **update baselines last**.
29
+ - Run the catalog runner from the catalog directory (e.g. its own Vitest project), not the app's unit runner.
30
+
31
+ ## Handoff
32
+
33
+ - `feature-developer`: a UI work package in a catalog repo is **not done** without a story and a green catalog test run.
34
+ - `code-reviewer`: a UI-touching MR with a catalog present and no story → `REQUEST_CHANGES`.
35
+
36
+ ## Related
37
+
38
+ - `design-tokens-binding.md` — Figma → repo token binding for the implementation.
39
+ - `mockup-review.md` — the reviewer-side parity gate.
@@ -29,7 +29,7 @@ The implementation must mirror the Figma mockup token-for-token. Raw design valu
29
29
 
30
30
  ## Imagery & icons
31
31
 
32
- - **Images:** use the Figma asset source from `get_design_context` / the node’s image fill. Repo: `next/image` (or repo convention) with `src`, `width`, `height` derived from Figma. Do not use a placeholder, do not invent a URL, do not change aspect ratio.
32
+ - **Images:** use the Figma asset source from `get_design_context` / the node’s image fill. Repo: **the project’s image primitive** — check the nearest component in the same layer (often a plain `<img>` or a DS image component; `next/image` only where the config keeps the optimizer enabled). Derive `src`, `width`, `height` from Figma. Do not use a placeholder, do not invent a URL, do not change aspect ratio.
33
33
  - **Icons:** use the `@sds/icon` (or project DS) symbol name from the Figma component instance / metadata. Do not invent icon names. The Figma node’s component name (e.g. `Icon / chevron-right`) maps to the DS symbol.
34
34
  - `alt` text from the Figma node name when meaningful; otherwise from the design context copy.
35
35