@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
@@ -0,0 +1,28 @@
1
+ glob: always
2
+
3
+ ## Body
4
+
5
+ # Task artifact levels (L0–L3)
6
+
7
+ When sizing a task before starting, acknowledge: `Using .ai.local: task-levels(, …)*`.
8
+
9
+ Every non-trivial task must live as a file artifact, never only in chat. Pick one level by size and impact; when unsure, pick the higher level.
10
+
11
+ ## Levels
12
+
13
+ | Level | When | Where | Required files |
14
+ |---|---|---|---|
15
+ | **L0 — note** | 1 file, < 30 min, no plan needed | chat todos + `git diff` | none |
16
+ | **L1 — team task** | 2–10 files, one feature/fix with discrete steps | `.ai.local/team/tasks/<slug>/` | `pipeline.json` + `status.json` + `brief.md` + `decomposition.md` + `.memlog.md` (+ per-agent artifacts) |
17
+ | **L2 — change spec** | architecture / boundary change, compliance boundary touched, > 10 files, or multi-role review | `openspec/changes/<YYYY-MM-DD>-<slug>/` | `proposal.md` + `design.md` + `tasks.md` |
18
+ | **L3 — hybrid** | formal change that also needs an execution pipeline | L2 (contract) + L1 (execution), cross-referenced | all of L2 + L1 |
19
+
20
+ ## Selection order (apply in order)
21
+
22
+ 1. Touches PD / medical data / analytics / third-party scripts / SSR-cookie shape → **L2 minimum** (with a compliance block).
23
+ 2. Changes the data flow or a module boundary → **L2**.
24
+ 3. > 10 files or > 1 subsystem → **L2**.
25
+ 4. Otherwise multi-step (planning + implementation + verification) → **L1**.
26
+ 5. Otherwise → **L0**.
27
+
28
+ Never demote a task to keep the artifact small.
@@ -0,0 +1,14 @@
1
+ globs: app/src/ui/**/*.{ts,tsx}
2
+
3
+ ## Body
4
+
5
+ # UI change review gate
6
+
7
+ Before a UI change is considered complete, acknowledge: `Using .ai.local: ui-change-review-gate(, …)*`.
8
+
9
+ ## Required before completion
10
+
11
+ 1. **Mockup review artifact.** If the task scope contains `app/src/ui/**`, a terminal `mockup-review.md` with verdict `PASS`/`PASS_WITH_NOTES` exists — even when no `figma.com` URL was supplied (then review against AC / `ux-design.md`). Missing artifact = incomplete work, not a warning.
12
+ 2. **Composed frame.** For a page or block, the review node set includes the **composed page frame**, not only isolated component sets. A node id claimed by another task must be declared in `## Scope`.
13
+ 3. **Same-day rewrite.** Do not rewrite a block shipped the same day without a new review artifact and an owner (single-writer rule).
14
+ 4. **Storybook tests run.** Targeted storybook tests green without `--update`.
@@ -12,7 +12,7 @@
12
12
  - **`alwaysApply: true`** (Cursor) / **without `paths:`** (Claude) — base invariants (Cursor/Claude 3–5):
13
13
  - Cursor: `next-app-core`, `package-manager`, `code-quality-and-refactoring`, `ai-local-overlay`
14
14
  - Claude: `next-app-core`, `package-manager`, `code-quality`
15
- - **On-demand / requestable** — `post-change-lint` (**required after code edits**, not always-on), `agent-team-intake` (via orchestrator/commands), `agent-team-orchestrator`, architecture, imports, UI, tests, feature-delivery-workflow, `design-guidance`, `mcp-usage`, `anti-sycophancy-discipline`, `react-next-anti-hallucination`, reference-features, product-specs, product-specs-authoring, next-app-router, `security-next`, react-a11y-coding, `technical-retro`, `mockup-review`, `ux-design`, `design-tokens-binding`
15
+ - **On-demand / requestable** — `post-change-lint` (**required after code edits**, not always-on), `agent-team-intake` (via orchestrator/commands), `agent-team-orchestrator`, architecture, imports, UI, tests, feature-delivery-workflow, `design-guidance`, `mcp-usage`, `anti-sycophancy-discipline`, `react-next-anti-hallucination`, reference-features, product-specs, product-specs-authoring, next-app-router, next-static-export, `security-next`, react-a11y-coding, component-catalog-gate, forms-validation, `technical-retro`, `mockup-review`, `ux-design`, `design-tokens-binding`
16
16
  - **Preset author meta** (globs `packages/ai-rules/presets/**`, never alwaysApply): `preset-layering`, `preset-twin-sync`, `preset-token-budget`, `preset-pr-checklist`, `preset-no-cross-stack-leakage`
17
17
  - **Skills** — long procedures (`feature-delivery`, `spec-authoring`, `spec-discovery`, `code-review`, …)
18
18
 
@@ -55,6 +55,9 @@ When editing `app/src/ui/**/*.tsx`, a **reduced** set loads (not all of `app/src
55
55
  | `no-props-spread.mdc` | `app/src/**/*.tsx` | Explicit props |
56
56
  | `arrow-functions.mdc` | `app/src/**` | Syntax |
57
57
  | `design-tokens-binding.mdc` | `app/src/ui/**/*.{ts,tsx,css}`, `app/src/styles/**` | Figma → repo token binding (typography/color/spacing/imagery); no raw values where a token exists |
58
+ | `component-catalog-gate.mdc` | `app/src/ui/**`, `storybook/**` | Stories ship with the UI; catalog tests green |
59
+ | `forms-validation.mdc` | `app/src/**/*Form*.tsx`, `app/src/**/*Modal*.tsx` | Repo form library + DS fields + shared validators |
60
+ | `next-static-export.mdc` | `app/src/pages/**`, `app/next.config.*` | No server runtime; what to use instead |
58
61
 
59
62
  **Not loaded on typical UI edit:** `architecture-boundaries` (api/store/types/lib), `layer-barrel-exports` (only `index.ts`), `navigation-router-stack` (only `app/src/app/**`). Colocated styles — in `react-ui.mdc` (deprecated stub `no-cross-component-styles-import` removed).
60
63
 
@@ -95,7 +95,7 @@ Each slug has one `artifact-manifest.json` at `.ai.local/team/tasks/<slug>/`. Sc
95
95
 
96
96
  - 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.
97
97
  - Markdown remains detailed evidence; the manifest records producer, status, authoritative paths, timestamps, outcome, and evidence paths.
98
- - 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.
98
+ - 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.
99
99
  - 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.
100
100
  - Missing/stale manifests are reported as a handoff gap; fall back to `brief.md`, `decomposition.md`, and `pipeline.json` rather than inventing authority.
101
101
 
@@ -13,8 +13,9 @@ This rule is mandatory. **You MUST** obey it on every turn, without exception.
13
13
  1. **Probe** — before answering, run `ls -la .ai.local` from the repository root.
14
14
  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.
15
15
  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.
16
- 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.
17
- 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.
16
+ 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.
17
+ 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.
18
+ 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.
18
19
 
19
20
  If `.ai.local/` does not exist → **no-op**, do not error. Do not produce any log line about its absence.
20
21
 
@@ -30,6 +31,18 @@ Each `.ai.local/rules/<name>.md` is a plain-markdown rule body. The model parses
30
31
 
31
32
  Keep files ≤ 120 lines. Match the style of preset rules (short sections, bullets, code examples).
32
33
 
34
+ ## What `init` overwrites vs preserves
35
+
36
+ `init` manages the tool trees; they are **not** the home of durable project config.
37
+
38
+ | Overwritten / merged by `init` | Preserved |
39
+ |---|---|
40
+ | `.cursor/**`, `.claude/**`, `.mavis/**`, `.opencode/**` (rules, agents, skills, commands, hooks) | `.ai.local/**` |
41
+ | root `AGENTS.md` (from `REPO_AGENTS.md`) | `docs/specs/**`, `openspec/**` |
42
+ | tool MCP config (`.cursor/mcp.json`; `opencode.json` — `mcp` merged, other blocks may be rewritten) | repo-root `.mcp.json`, `.ai/context/**`, `.ai.local/rules/**` |
43
+
44
+ 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.
45
+
33
46
  ## Limitations (read this)
34
47
 
35
48
  - 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.
@@ -66,3 +66,7 @@ When the diff touches UI / layout / styling (paths under `app/src/ui/**`, global
66
66
  - Findings: `path:line` + Figma node id + viewport + severity. Emit a `## Figma parity (UI)` section in `review.md`.
67
67
  - **Storybook visual baselines are not a substitute.** Approving a UI MR on Storybook baselines alone is not acceptable when a Figma reference exists.
68
68
  - 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.
69
+
70
+ ### Spec / docs sync (behaviour change)
71
+
72
+ 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.
@@ -0,0 +1,38 @@
1
+ ---
2
+ description: Component catalog (Storybook/Ladle) is the required UI dev + visual-review surface — stories ship with the UI change
3
+ globs: app/src/ui/**/*,storybook/**/*,stories/**/*
4
+ alwaysApply: false
5
+ impact: MEDIUM
6
+ ---
7
+
8
+ # Component catalog gate (UI quality)
9
+
10
+ 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.
11
+
12
+ ## Scope
13
+
14
+ - Triggers: a new `app/src/ui/**` component / page / block / modal, or a visual/interaction refactor (layout, styles, tokens, copy, hover/open, empty / error / loading).
15
+ - Skip: types / API / store / mocks with no render or style change.
16
+
17
+ ## Rules
18
+
19
+ - **Stories ship with the UI**, in the same change — not after.
20
+ - **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.
21
+ - **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.
22
+ - **Clean up** temp screenshots you created this turn; keep only intentional baselines and product assets.
23
+ - Keep catalog tests green — do not finish with red or stale baselines.
24
+
25
+ ## Stack notes
26
+
27
+ - Catalog: Storybook. Developer loop: read Figma → implement → preview the story → screenshot → compare → fix → **update baselines last**.
28
+ - Run the catalog runner from the catalog directory (e.g. its own Vitest project), not the app's unit runner.
29
+
30
+ ## Handoff
31
+
32
+ - `feature-developer`: a UI work package in a catalog repo is **not done** without a story and a green catalog test run.
33
+ - `code-reviewer`: a UI-touching MR with a catalog present and no story → `REQUEST_CHANGES`.
34
+
35
+ ## Related
36
+
37
+ - `design-tokens-binding.mdc` — Figma → repo token binding for the implementation.
38
+ - `mockup-review.mdc` — the reviewer-side parity gate.
@@ -28,7 +28,7 @@ The implementation must mirror the Figma mockup token-for-token. Raw design valu
28
28
 
29
29
  ## Imagery & icons
30
30
 
31
- - **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.
31
+ - **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.
32
32
  - **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.
33
33
  - `alt` text from the Figma node name when meaningful; otherwise from the design context copy.
34
34
 
@@ -11,6 +11,10 @@ alwaysApply: false
11
11
 
12
12
  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.
13
13
 
14
+ **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 (`component-catalog-gate`).
15
+
16
+ **Consumer context.** When `.ai/context/**` exists, read it before deriving architecture, domain vocabulary, or test placement.
17
+
14
18
  ## Style discovery (mandatory)
15
19
 
16
20
  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**.
@@ -19,7 +23,7 @@ Before writing a new file in a layer, open **1–2 analog files** in the same la
19
23
 
20
24
  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`:
21
25
 
22
- - `## 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.
26
+ - `## 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.
23
27
  - `## Node decomposition (AC-2)` — the child→component map (with a `Bindings` column for the Figma design bindings).
24
28
 
25
29
  `feature-developer` must **not** start UI implementation until both sections are present, and must load requestable `design-tokens-binding.mdc` 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.
@@ -0,0 +1,33 @@
1
+ ---
2
+ description: Forms and validation — use the repo's form library + design-system fields + shared validators, not ad-hoc state
3
+ globs: app/src/**/*Form*.tsx,app/src/**/*Form*.ts,app/src/**/*Modal*.tsx
4
+ alwaysApply: false
5
+ impact: MEDIUM
6
+ ---
7
+
8
+ # Forms and validation
9
+
10
+ Use the form solution already in the repo (`package.json` + the nearest form component). Do not hand-roll form state with `useState` when a form library is present.
11
+
12
+ ## Rules
13
+
14
+ - One form-hook instance per form; register design-system fields through the library's controller/wrapper (controlled) — not a raw `<input>` when a DS field exists.
15
+ - Validate with the repo's resolver/schema library and reuse the shared validators under the repo's validation utils — never re-implement email / phone / date / length rules inline.
16
+ - Masked inputs (phone, date, card) go through the repo's mask library, not ad-hoc regex on change.
17
+ - Disable submit while `!isValid` / `isSubmitting`; surface field errors from the form library's error state.
18
+ - Keep side effects out of field components: the form owns `onSubmit`; data flows to store/API through the repo's layers (`architecture-boundaries-ui.mdc`).
19
+
20
+ ## Accessibility
21
+
22
+ - Every field has a visible label and an associated error message; do not rely on placeholder-only labels.
23
+ - Field errors are announced and tied to the input; keep the DS field's wiring instead of a bespoke error node.
24
+
25
+ ## Stack notes
26
+
27
+ - Library: `react-hook-form` + `yup` resolver; `mode: 'onTouched'`.
28
+ - DS fields: `app/src/ui/components/_form/**`; shared validators: `app/src/lib/utils/validations/**`; masks: `imask` / `react-imask`.
29
+
30
+ ## Related
31
+
32
+ - `react-ui.mdc` — component structure and decomposition.
33
+ - `architecture-boundaries-ui.mdc` — no API/DTO in UI.
@@ -92,6 +92,7 @@ Policy is stack-class-specific — see adapter **Stack notes**. If a Figma **plu
92
92
 
93
93
  ## Stack notes
94
94
 
95
+ - **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.
95
96
  - Pipeline **`mockup-reviewer`** is the only agent that reads Figma for mockup review. See `mockup-review`.
96
97
  - Shipped besides Context7: browser automation MCP (`playwright` / `playwright-test` / `user-playwright`) and `chrome-devtools`.
97
98
  - **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.
@@ -13,6 +13,9 @@ Concrete versions come **from `package.json` and configs of the target repositor
13
13
  - `app/tsconfig.json`: `paths: { "@/*": ["./src/*"] }` (`baseUrl` may be absent with TS ≥5 / `moduleResolution: bundler` — check the file, do not add it blindly).
14
14
  - **Requirement:** `@/*` instead of relative imports that climb the tree.
15
15
  - **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 (`next-app-router.mdc`, `navigation-router-stack.mdc`).
16
+ - **Deployment model:** read `output` in `next.config.*`. With `output: 'export'` the app is a static SPA — no server runtime, no API routes / middleware / SSR (`next-static-export.mdc`).
17
+ - **Consumer context:** when `.ai/context/**` exists, read it for the repo's compressed architecture, domain glossary, and test-placement conventions before deriving them yourself.
18
+ - **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.
16
19
 
17
20
  # Architectural layers
18
21
 
@@ -0,0 +1,35 @@
1
+ ---
2
+ description: Static-export / SPA Next.js (output 'export') — no server runtime; what is unavailable and what to use instead
3
+ globs: app/next.config.*,app/src/pages/**/*,app/src/pages/_*.tsx
4
+ alwaysApply: false
5
+ impact: HIGH
6
+ ---
7
+
8
+ # Static export (Next.js `output: 'export'`)
9
+
10
+ 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.
11
+
12
+ ## Unavailable
13
+
14
+ - `getServerSideProps`, `getInitialProps`.
15
+ - API routes (`pages/api/**`, App Router `route.ts`) and `middleware.ts`.
16
+ - Server Actions; server `cookies()` / `headers()`.
17
+ - ISR / `revalidate` / `dynamic = 'force-dynamic'`.
18
+ - The image optimizer when `images.unoptimized: true` (`next/image` `loader` / `sizes` buy nothing).
19
+
20
+ ## Available / preferred
21
+
22
+ - `getStaticProps` / `getStaticPaths` run at **build** time only.
23
+ - Runtime data comes from the browser: store thunk → `@/api` service (`store-rtk.mdc`, `api-services.mdc`).
24
+ - Auth / session are enforced by the BFF plus a client route guard — not by a Next server.
25
+ - `basePath` / `assetPrefix`: build local links and asset URLs from those values; never hardcode `/`.
26
+
27
+ ## Agent requirement
28
+
29
+ - 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.
30
+ - 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.
31
+
32
+ ## Related
33
+
34
+ - `react-next-anti-hallucination.mdc` — phantom-import banlist for this deployment model.
35
+ - `navigation-router-stack.mdc` — Pages Router vs App Router.
@@ -15,6 +15,10 @@ Exceptions: documentation edits outside `app/`, CI configs, `.cursor/rules/**`,
15
15
 
16
16
  **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** responsibility. In single-agent mode (no pipeline) — always a full run.
17
17
 
18
+ **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).
19
+
20
+ **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.
21
+
18
22
  ## Required commands
19
23
 
20
24
  Working directory — **`app/`**. Package manager — **`package-manager.mdc`**.
@@ -121,5 +121,6 @@ Block handoff via `open_questions` until fixed:
121
121
  ## Stack notes
122
122
 
123
123
  - Author via skill `spec-authoring`; templates from package assets / consumer `docs/specs/_templates/`.
124
+ - **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.
124
125
  - Field semantics match discovery stem (`routes` = URL paths; `e2e` = Playwright).
125
126
  - Requestable — not always-on / session-start.
@@ -65,5 +65,6 @@ Same-changeset INDEX updates, frontmatter v1, required body headings, templates,
65
65
  ## Stack notes
66
66
 
67
67
  - `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).
68
+ - **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.
68
69
  - Dogfood example (emedcard-web AnalysisPage): `docs/specs/domains/analysis/analysis-page.md`.
69
70
  - Requestable / `docs/specs/**` globs — not always-on / session-start.
@@ -10,6 +10,13 @@ These rows **OVERRIDE** generation for the listed patterns. Before inventing an
10
10
 
11
11
  App Router–specific rows (async `params` / `cookies()`, invented auth helpers, etc.) stay in **`next-app-router.mdc`**. This rule covers broader React / RTK / Next phantom imports and boundary mistakes across `app/**`.
12
12
 
13
+ ## 0. Installed Next ships its own docs (read them first)
14
+
15
+ The installed `next` may bundle version-pinned agent docs and a managed `AGENTS.md` block written by `next dev`:
16
+
17
+ - 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.
18
+ - 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.
19
+
13
20
  ## 1. Phantom / wrong Next imports
14
21
 
15
22
  | ❌ Avoid | ✅ Prefer |
@@ -55,6 +62,9 @@ App Router–specific rows (async `params` / `cookies()`, invented auth helpers,
55
62
  | `Router.push` / Pages `withRouter` patterns in `app/` UI | App Router navigation helpers already used in `app/src/ui/**` |
56
63
  | Client `fetch` / raw HTTP from UI or `page.tsx` bypassing `@/api` | Services via `@/api` / established loaders (`api-services.mdc`, `http-client.mdc`) |
57
64
  | Invented `next/link` props that siblings never use (e.g. fake prefetch enums) | Match existing `<Link>` usage; verify against installed Next |
65
+ | `getServerSideProps` / `getInitialProps`, `pages/api/**`, `route.ts`, `middleware.ts` in an `output: 'export'` repo | build-time `getStaticProps` / `getStaticPaths` or client store/thunk fetch (`next-static-export.mdc`) |
66
+ | Hardcoded `/` root for links / assets when the repo uses `basePath` / `assetPrefix` | Derive from `basePath` / `assetPrefix` |
67
+ | `next/image` `loader` / `sizes` / `quality` expecting the optimizer in a repo with `images.unoptimized: true` | The repo's image primitive; no optimizer assumptions |
58
68
 
59
69
  ## 6. Version drift
60
70
 
@@ -24,6 +24,24 @@ impact: HIGH
24
24
  - No nested ternaries in JSX. For not-ready / empty / error, use an early return or a dedicated `EmptyState` / `ErrorState` component.
25
25
  - A `variant` / `mode` flag that renders two unrelated layouts is **two** components, not one.
26
26
 
27
+ # One component / one styled element — one purpose
28
+
29
+ - Each component **and** each styled element serves exactly **one** purpose. Do not drive two distinct shapes (different padding, slot set, alignment, visual identity) from a `variant` / `is…` flag or branchy styles.
30
+ - Two call sites that need visibly different markup → two named components (or two named styled exports). Share the base via a small primitive (`BaseCard` styled block + two thin extensions), not a universal branchy `Card`.
31
+ - A flag that flips a single non-layout property (`compact`, `disabled`) is fine; a flag that flips layout, slots, or visual identity is not — split it.
32
+
33
+ # CSS-in-JS interpolation functions
34
+
35
+ - Inside `${…}` interpolations of a styled template (`styled.*`), do **not** write an inline arrow (`${({ tone }) => …}` or `${({ gap }) => gap}`). Reference a **module-level function** that takes the styled props: `${getPromoStatusColor}`.
36
+ - Name it `get` + the value (`getColor`, `getGap`, `getPromoStatusColor`); keep the prop type shared between the styled generic and the function parameter.
37
+ - A module-level function is debuggable, type-checkable in isolation, and reusable across sibling styled blocks; an inline arrow compiles to an untestable one-shot.
38
+
39
+ # Async UI states
40
+
41
+ - Loading, empty, error, and load-failed are **distinct** states — render each explicitly; do not collapse them into one spinner/blank branch.
42
+ - Prefer a **per-block skeleton** over a page-level spinner, and reuse the repo's existing primitives (`Skeleton`, `EmptyState`, `ErrorState`, load-failed stub, global `ErrorBoundary`) instead of inventing new ones.
43
+ - Error boundaries are usually mounted once at the app root; add a local boundary only when the repo already does so for that region.
44
+
27
45
  ## Incorrect
28
46
 
29
47
  ```tsx
@@ -97,7 +115,7 @@ For a reusable component:
97
115
  - **Forbidden** to import another component's `styles` (`../Other/styles`, `../../styles`). Allowed: `./styles`, shared primitives from `@/ui/components/...` or design-system packages.
98
116
  - CSS / `styled` order — Stylelint idiomatic-order: `css-property-order-stylelint.mdc` (loads on `styles.ts` / `.css`).
99
117
  - For visuals use **the style stack and tokens already in the project** (variables, theme, shared classes, design package).
100
- - **Token binding (Figma → repo):** typography, color, spacing, radius, shadow, and imagery must bind to the project token module and the design system (`@sds/tokens-*` / `@sds/brand-colors` / DS components like `Text variant="…"`, `@sds/icon`, `next/image`). Raw `#…` / `rgb(…)` / `px` where a token exists is a finding. The full discipline — including the per-element parity checklist and the developer self-check vs Figma — is in **`design-tokens-binding.mdc`**. When a Figma reference exists, the `mockup-review.md` `## Design contract` section is the binding table; use it.
118
+ - **Token binding (Figma → repo):** typography, color, spacing, radius, shadow, and imagery must bind to the project token module and the design system (`@sds/tokens-*` / `@sds/brand-colors` / DS components like `Text variant="…"`, `@sds/icon`, the project image primitive). Raw `#…` / `rgb(…)` / `px` where a token exists is a finding. The full discipline — including the per-element parity checklist and the developer self-check vs Figma — is in **`design-tokens-binding.mdc`**. When a Figma reference exists, the `mockup-review.md` `## Design contract` section is the binding table; use it.
101
119
  - Avoid:
102
120
  - inline styles except simple cases;
103
121
  - duplicating styling already covered by shared primitives;
@@ -30,6 +30,11 @@ Replace **TBD** with real paths after team agreement (or on `ai-rules init` in t
30
30
  | Types module | **TBD** `app/src/types/<example>/` | domain types, JSDoc, barrel export |
31
31
  | Unit tests | **TBD** mirrored under `app/__tests__/unit/<rel>` | `*.spec.ts`, describe/it naming |
32
32
  | E2E area | **TBD** `app/__tests__/e2e/<Area>/` | `*.cases.md`, page objects, `_shared/` |
33
+ | Scaffold | **TBD** `app/src/boilerplate/**` | new-component skeleton (copy, then rename) |
34
+ | Global singletons | **TBD** `app/src/ui/components/_singletons/**` | app-root-mounted containers (modals, sync, flags) |
35
+ | Layout / guard | **TBD** `app/src/ui/layouts/**`, `app/src/ui/guards/**` | route wrapping (auth, chrome) |
36
+ | Cross-feature hooks | **TBD** `app/src/core/**` | reusable feature hooks used across pages |
37
+ | Internal slices | **TBD** `app/src/store/slices/_complexSlices/**`, `_utilsSlices/**` | cross-slice orchestration / pure helpers — **no** direct slice→slice imports |
33
38
 
34
39
  ## How to use
35
40
 
@@ -14,6 +14,8 @@ impact: CRITICAL
14
14
 
15
15
  Coding-time checklist. Full audit → agent `security-reviewer` + skill `code-review`.
16
16
 
17
+ **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.
18
+
17
19
  ## Secrets and env
18
20
 
19
21
  - Never put service / secret keys in `NEXT_PUBLIC_*` or client bundles (`sk_`, private API keys, DB URLs).
@@ -26,6 +28,7 @@ Coding-time checklist. Full audit → agent `security-reviewer` + skill `code-re
26
28
  - Middleware may refresh sessions; do not treat middleware alone as authorization.
27
29
  - Prefer httpOnly secure cookies over `localStorage` for tokens when the repo pattern allows.
28
30
  - Never trust client-only session claims without a server verify step used by the project.
31
+ - **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
32
 
30
33
  ## Mutations and input
31
34
 
@@ -51,6 +54,15 @@ Coding-time checklist. Full audit → agent `security-reviewer` + skill `code-re
51
54
  | Invented auth helpers not in `package.json` / codebase | Copy patterns from existing auth routes |
52
55
  | Putting secrets in `NEXT_PUBLIC_*` | Server-only env + server modules |
53
56
  | Auth only in middleware | Server `getUser` / session verify in layout/page/action |
57
+ | Server session verifier / Server Action in a static-export repo | Client route guard + BFF-issued httpOnly cookie |
58
+
59
+ ## Compliance / personal data (regulated apps)
60
+
61
+ For apps that ship medical or personal data (e.g. GDPR / local data-protection law):
62
+
63
+ - 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.
64
+ - Flag every new third-party script and every change to the SSR/cookie payload shape for review.
65
+ - 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
66
 
55
67
  ## Agent requirement
56
68
 
@@ -50,6 +50,12 @@ impact: HIGH
50
50
  - avoid duplicating entity descriptions in multiple places.
51
51
  - **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-services.mdc` and `http-client.mdc`).
52
52
 
53
+ # Middleware and cross-slice orchestration
54
+
55
+ - 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.
56
+ - 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.
57
+ - Prefer a thunk for a single request/response; prefer middleware for reactions that span slices or emit analytics.
58
+
53
59
  # Slice testing
54
60
 
55
61
  - For important slices:
@@ -80,6 +80,7 @@ Bad (no capital after period; or wrong locale for configured ESLint):
80
80
  ## Stack notes
81
81
 
82
82
  - Runner: Playwright (`@playwright/test`).
83
+ - 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.
83
84
  - E2E folder: `app/__tests__/e2e/**`.
84
85
  - 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.
85
86
  - Scenario plans: `*.cases.md` files — canonical source of scenarios.
@@ -90,6 +90,7 @@ Bad (no capital after period; or wrong locale for configured ESLint):
90
90
  - `app/src/mocks/**` — shared fixtures and MSW handlers live here (or repo equivalent).
91
91
  - 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/**`.
92
92
  - HTTP-client behavior tests live under the mirrored `app/__tests__/unit/lib/clients/**` path (prefer `*.spec.ts`).
93
+ - Prefer the package script over a bare runner (`yarn test`, not `npx jest`): scripts carry env (`TZ`), coverage, and reporters that CI depends on.
93
94
  - UI tests live under the mirrored `app/__tests__/unit/ui/**` path. Import the source under test through the `@/` alias.
94
95
  - `## 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.
95
96
 
@@ -2,16 +2,15 @@
2
2
  "slug": "example-feature-with-ux-no-figma",
3
3
  "intent": "feature",
4
4
  "profile": "standard",
5
- "summary": "Feature with required-signal UX and no Figma URL — task-analyst loads skill ux-design; no mockup-reviewer step",
5
+ "summary": "UI-scope feature with required-signal UX and no Figma URL — task-analyst loads skill ux-design; UI scope forces mockup-reviewer (reviewed against AC / ux-design.md)",
6
6
  "steps": [
7
7
  { "agent": "task-analyst", "label": "Clarify, UX design, decompose" },
8
+ { "agent": "mockup-reviewer", "label": "UI review vs AC / ux-design" },
8
9
  { "agent": "feature-developer", "label": "Implement" },
9
10
  { "agent": "build-verifier", "label": "Validation gate", "model": "cheap" },
10
11
  { "agent": "code-reviewer", "label": "Code review", "model": "cheap" }
11
12
  ],
12
13
  "humanGates": ["after:task-analyst"],
13
14
  "autoChain": true,
14
- "skipped": [
15
- { "agent": "mockup-reviewer", "reason": "No figma.com URL; analyst skill ux-design covers behavioral UX" }
16
- ]
15
+ "skipped": []
17
16
  }
@@ -96,7 +96,7 @@ Each slug has one `artifact-manifest.json` at `.ai.local/team/tasks/<slug>/`. Sc
96
96
 
97
97
  - 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.
98
98
  - Markdown remains detailed evidence; the manifest records producer, status, authoritative paths, timestamps, outcome, and evidence paths.
99
- - 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.
99
+ - 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.
100
100
  - 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.
101
101
  - Missing/stale manifests are reported as a handoff gap; fall back to `brief.md`, `decomposition.md`, and `pipeline.json` rather than inventing authority.
102
102
 
@@ -72,7 +72,7 @@ Each slug has one `artifact-manifest.json` at `.ai.local/team/tasks/<slug>/`. Sc
72
72
 
73
73
  - 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.
74
74
  - Markdown remains detailed evidence; the manifest records producer, status, authoritative paths, timestamps, outcome, and evidence paths.
75
- - 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.
75
+ - 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.
76
76
  - 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.
77
77
  - Missing/stale manifests are reported as a handoff gap; fall back to `brief.md`, `decomposition.md`, and `pipeline.json` rather than inventing authority.
78
78
 
@@ -72,7 +72,7 @@ Each slug has one `artifact-manifest.json` at `.ai.local/team/tasks/<slug>/`. Sc
72
72
 
73
73
  - 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.
74
74
  - Markdown remains detailed evidence; the manifest records producer, status, authoritative paths, timestamps, outcome, and evidence paths.
75
- - 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.
75
+ - 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.
76
76
  - 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.
77
77
  - Missing/stale manifests are reported as a handoff gap; fall back to `brief.md`, `decomposition.md`, and `pipeline.json` rather than inventing authority.
78
78
 
@@ -96,7 +96,7 @@ Each slug has one `artifact-manifest.json` at `.ai.local/team/tasks/<slug>/`. Sc
96
96
 
97
97
  - 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.
98
98
  - Markdown remains detailed evidence; the manifest records producer, status, authoritative paths, timestamps, outcome, and evidence paths.
99
- - 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.
99
+ - 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.
100
100
  - 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.
101
101
  - Missing/stale manifests are reported as a handoff gap; fall back to `brief.md`, `decomposition.md`, and `pipeline.json` rather than inventing authority.
102
102
 
@@ -3,7 +3,7 @@
3
3
  "platform": "mavis",
4
4
  "stack": "android-kotlin",
5
5
  "semanticSource": "cursor/android-kotlin",
6
- "sourceRevision": "6e09f86a97133b60a3818076d68660709ce3b9119175f1e00ef160b3bc747def",
6
+ "sourceRevision": "3c548e6420c847099873f9c3bc9570f75c30162dd6b135c436a71e12fe3de8ed",
7
7
  "entries": [
8
8
  {
9
9
  "source": "AGENTS.md",
@@ -109,8 +109,7 @@ Each slug has one `artifact-manifest.json` at `.ai.local/team/tasks/<slug>/`. Th
109
109
 
110
110
  - 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.
111
111
  - Markdown remains detailed evidence; the manifest points to authoritative paths and records producer, status, timestamps, outcome, and evidence paths.
112
- -
113
- 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.
112
+ - 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.
114
113
  - The orchestration runtime/hook is the single writer for `status.json` lifecycle fields and `metrics.json`. Agents read status for eligibility but never rewrite unrelated state, gate, retry, attempt, timestamp, or metrics fields.
115
114
  - Missing/stale manifests are reported as a handoff gap; fall back to `brief.md`, `decomposition.md`, and `pipeline.json` rather than inventing authority.
116
115
 
@@ -48,7 +48,7 @@ On-demand rule for review flows (not always-on).
48
48
  - Rely on the local repository: branch, `git diff`, open files.
49
49
 
50
50
  - **What the agent must check**
51
- - **Architecture and layers** (`architecture-boundaries.mdc`, `android-app-core.mdc`):
51
+ - **Architecture and layers** (`architecture-boundaries.md`, `android-app-core.md`):
52
52
  - View does not call APIs and does not know DTOs.
53
53
  - ViewModel does not depend on Data implementations directly.
54
54
  - Domain does not import Jetpack Compose/Android View system.
@@ -57,21 +57,21 @@ On-demand rule for review flows (not always-on).
57
57
  - DI via protocols; composition / holders in `applications/` + feature DI.
58
58
  - No deep-import between features.
59
59
  - Files in the correct layers (`presentation`, `domain`, `data`, design-system / `api`/`impl`).
60
- - **Kotlin and concurrency** (`kotlin-conventions.mdc`):
60
+ - **Kotlin and concurrency** (`kotlin-conventions.md`):
61
61
  - `main-safe / viewModelScope` on UI; no unjustified `!!`s.
62
62
  - Typed errors; structured concurrency / cancellation where needed.
63
- - **UI** (`compose-ui.mdc`):
63
+ - **UI** (`compose-ui.md`):
64
64
  - Thin Views; Design System tokens; semantics / content descriptions for testable elements.
65
- - **Networking and data** (`networking-data.mdc`):
65
+ - **Networking and data** (`networking-data.md`):
66
66
  - DTOs separated from domain; mappers cover edge cases.
67
67
  - **Tests**:
68
- - Non-trivial logic — unit (`tests-unit.mdc`); user flows — UI (`tests-ui.mdc`).
68
+ - Non-trivial logic — unit (`tests-unit.md`); user flows — UI (`tests-ui.md`).
69
69
  - State which tests to add or update.
70
70
 
71
71
  - **Depth and format**
72
72
  - Focus on the **MR diff**, not the whole project.
73
73
  - Overview first (MR goal, risks), then concrete comments with file and a fix suggestion matching repo patterns.
74
- - No “big refactors” without a request (`code-quality-and-refactoring.mdc`).
74
+ - No “big refactors” without a request (`code-quality-and-refactoring.md`).
75
75
 
76
76
  - **Constraints**
77
77
  - Do not invent CI/MR hosting metadata without local data.