@bonesofspring/ai-rules 0.2.30 → 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 (752) 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/_shared/core/agent-team/agent-artifact-contracts.md +6 -4
  5. package/presets/_shared/core/agent-team/agent-task-metrics.md +14 -1
  6. package/presets/_shared/core/agent-team/agent-team-orchestrator.md +3 -1
  7. package/presets/claude/android-kotlin/agents/accessibility-reviewer.md +2 -2
  8. package/presets/claude/android-kotlin/agents/api-contract-reviewer.md +2 -2
  9. package/presets/claude/android-kotlin/agents/build-verifier.md +1 -1
  10. package/presets/claude/android-kotlin/agents/ci-investigator.md +2 -2
  11. package/presets/claude/android-kotlin/agents/code-reviewer.md +2 -2
  12. package/presets/claude/android-kotlin/agents/debugger.md +2 -2
  13. package/presets/claude/android-kotlin/agents/feature-developer.md +2 -2
  14. package/presets/claude/android-kotlin/agents/migration-specialist.md +2 -2
  15. package/presets/claude/android-kotlin/agents/mockup-reviewer.md +2 -2
  16. package/presets/claude/android-kotlin/agents/openspec-author.md +2 -2
  17. package/presets/claude/android-kotlin/agents/performance-auditor.md +2 -2
  18. package/presets/claude/android-kotlin/agents/qa-tester.md +2 -2
  19. package/presets/claude/android-kotlin/agents/security-reviewer.md +2 -2
  20. package/presets/claude/android-kotlin/agents/task-analyst.md +1 -1
  21. package/presets/claude/android-kotlin/agents/task-router.md +1 -1
  22. package/presets/claude/android-kotlin/agents/tech-writer.md +2 -2
  23. package/presets/claude/android-kotlin/agents/unit-test-generator.md +2 -2
  24. package/presets/claude/android-kotlin/agents/unit-test-healer.md +2 -2
  25. package/presets/claude/android-kotlin/agents/unit-test-planner.md +2 -2
  26. package/presets/claude/android-kotlin/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
  27. package/presets/claude/go/agents/build-verifier.md +2 -2
  28. package/presets/claude/go/agents/code-reviewer.md +2 -2
  29. package/presets/claude/go/agents/feature-developer.md +2 -2
  30. package/presets/claude/go/agents/openspec-author.md +2 -2
  31. package/presets/claude/go/agents/task-analyst.md +1 -1
  32. package/presets/claude/go/agents/task-router.md +1 -1
  33. package/presets/claude/go/rules/tooling-and-review/agent-team-orchestrator.md +3 -1
  34. package/presets/claude/ios-swift/agents/build-verifier.md +2 -2
  35. package/presets/claude/ios-swift/agents/code-reviewer.md +2 -2
  36. package/presets/claude/ios-swift/agents/feature-developer.md +2 -2
  37. package/presets/claude/ios-swift/agents/mockup-reviewer.md +2 -2
  38. package/presets/claude/ios-swift/agents/openspec-author.md +2 -2
  39. package/presets/claude/ios-swift/agents/task-analyst.md +1 -1
  40. package/presets/claude/ios-swift/agents/task-router.md +1 -1
  41. package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
  42. package/presets/claude/java/agents/build-verifier.md +2 -2
  43. package/presets/claude/java/agents/code-reviewer.md +2 -2
  44. package/presets/claude/java/agents/feature-developer.md +2 -2
  45. package/presets/claude/java/agents/openspec-author.md +2 -2
  46. package/presets/claude/java/agents/task-analyst.md +1 -1
  47. package/presets/claude/java/agents/task-router.md +1 -1
  48. package/presets/claude/java/rules/tooling-and-review/agent-team-orchestrator.md +3 -1
  49. package/presets/claude/mcp-ts/agents/build-verifier.md +2 -2
  50. package/presets/claude/mcp-ts/agents/feature-developer.md +2 -2
  51. package/presets/claude/mcp-ts/agents/task-analyst.md +1 -1
  52. package/presets/claude/mcp-ts/agents/task-router.md +1 -1
  53. package/presets/claude/mcp-ts/rules/tooling-and-review/agent-team-orchestrator.md +3 -1
  54. package/presets/claude/next/REPO_AGENTS.md +11 -1
  55. package/presets/claude/next/agents/accessibility-reviewer.md +2 -2
  56. package/presets/claude/next/agents/api-contract-reviewer.md +2 -2
  57. package/presets/claude/next/agents/build-verifier.md +3 -2
  58. package/presets/claude/next/agents/ci-investigator.md +2 -2
  59. package/presets/claude/next/agents/code-reviewer.md +3 -2
  60. package/presets/claude/next/agents/debugger.md +2 -2
  61. package/presets/claude/next/agents/feature-developer.md +3 -2
  62. package/presets/claude/next/agents/migration-specialist.md +2 -2
  63. package/presets/claude/next/agents/mockup-reviewer.md +2 -2
  64. package/presets/claude/next/agents/openspec-author.md +4 -2
  65. package/presets/claude/next/agents/performance-auditor.md +2 -2
  66. package/presets/claude/next/agents/qa-tester.md +2 -2
  67. package/presets/claude/next/agents/security-reviewer.md +2 -2
  68. package/presets/claude/next/agents/solution-architect.md +2 -2
  69. package/presets/claude/next/agents/task-analyst.md +8 -1
  70. package/presets/claude/next/agents/task-router.md +2 -1
  71. package/presets/claude/next/agents/tech-writer.md +2 -2
  72. package/presets/claude/next/agents/unit-test-generator.md +2 -2
  73. package/presets/claude/next/agents/unit-test-healer.md +2 -2
  74. package/presets/claude/next/agents/unit-test-planner.md +2 -2
  75. package/presets/claude/next/hooks/chain-team-phases.sh +46 -1
  76. package/presets/claude/next/rules/README.md +3 -0
  77. package/presets/claude/next/rules/anti-hallucination/react-next-anti-hallucination.md +10 -0
  78. package/presets/claude/next/rules/api-and-data/store-rtk.md +6 -0
  79. package/presets/claude/next/rules/architecture/feature-delivery-workflow.md +5 -1
  80. package/presets/claude/next/rules/architecture/product-specs-authoring.md +1 -0
  81. package/presets/claude/next/rules/architecture/product-specs.md +1 -0
  82. package/presets/claude/next/rules/architecture/reference-features.md +5 -0
  83. package/presets/claude/next/rules/stack/next-app-core.md +3 -0
  84. package/presets/claude/next/rules/stack/next-static-export.md +36 -0
  85. package/presets/claude/next/rules/testing/tests-e2e-structure.md +1 -0
  86. package/presets/claude/next/rules/testing/tests-unit.md +1 -0
  87. package/presets/claude/next/rules/tooling-and-review/agent-team-orchestrator.md +3 -1
  88. package/presets/claude/next/rules/tooling-and-review/ai-local-overlay.md +16 -2
  89. package/presets/claude/next/rules/tooling-and-review/code-review-mr.md +4 -0
  90. package/presets/claude/next/rules/tooling-and-review/mcp-usage.md +1 -0
  91. package/presets/claude/next/rules/tooling-and-review/post-change-lint.md +4 -0
  92. package/presets/claude/next/rules/tooling-and-review/security-next.md +13 -0
  93. package/presets/claude/next/rules/ui-and-accessibility/component-catalog-gate.md +39 -0
  94. package/presets/claude/next/rules/ui-and-accessibility/design-tokens-binding.md +1 -1
  95. package/presets/claude/next/rules/ui-and-accessibility/forms-validation.md +35 -0
  96. package/presets/claude/next/rules/ui-and-accessibility/react-ui.md +19 -1
  97. package/presets/claude/next/team/fixtures/feature-with-ux-no-figma.json +3 -4
  98. package/presets/claude/nuxt/agents/accessibility-reviewer.md +2 -2
  99. package/presets/claude/nuxt/agents/api-contract-reviewer.md +2 -2
  100. package/presets/claude/nuxt/agents/build-verifier.md +2 -2
  101. package/presets/claude/nuxt/agents/ci-investigator.md +2 -2
  102. package/presets/claude/nuxt/agents/code-reviewer.md +2 -2
  103. package/presets/claude/nuxt/agents/debugger.md +2 -2
  104. package/presets/claude/nuxt/agents/feature-developer.md +2 -2
  105. package/presets/claude/nuxt/agents/migration-specialist.md +2 -2
  106. package/presets/claude/nuxt/agents/mockup-reviewer.md +2 -2
  107. package/presets/claude/nuxt/agents/openspec-author.md +2 -2
  108. package/presets/claude/nuxt/agents/performance-auditor.md +2 -2
  109. package/presets/claude/nuxt/agents/qa-tester.md +2 -2
  110. package/presets/claude/nuxt/agents/security-reviewer.md +2 -2
  111. package/presets/claude/nuxt/agents/solution-architect.md +2 -2
  112. package/presets/claude/nuxt/agents/task-analyst.md +1 -1
  113. package/presets/claude/nuxt/agents/task-router.md +1 -1
  114. package/presets/claude/nuxt/agents/tech-writer.md +2 -2
  115. package/presets/claude/nuxt/agents/unit-test-generator.md +2 -2
  116. package/presets/claude/nuxt/agents/unit-test-healer.md +2 -2
  117. package/presets/claude/nuxt/agents/unit-test-planner.md +2 -2
  118. package/presets/claude/nuxt/rules/tooling-and-review/agent-team-orchestrator.md +3 -1
  119. package/presets/claude/php-hexagonal/agents/build-verifier.md +2 -2
  120. package/presets/claude/php-hexagonal/agents/code-reviewer.md +2 -2
  121. package/presets/claude/php-hexagonal/agents/feature-developer.md +2 -2
  122. package/presets/claude/php-hexagonal/agents/openspec-author.md +2 -2
  123. package/presets/claude/php-hexagonal/agents/task-analyst.md +1 -1
  124. package/presets/claude/php-hexagonal/agents/task-router.md +1 -1
  125. package/presets/claude/php-hexagonal/rules/tooling-and-review/agent-team-orchestrator.md +3 -1
  126. package/presets/claude/php-laravel/agents/build-verifier.md +2 -2
  127. package/presets/claude/php-laravel/agents/code-reviewer.md +2 -2
  128. package/presets/claude/php-laravel/agents/feature-developer.md +2 -2
  129. package/presets/claude/php-laravel/agents/openspec-author.md +2 -2
  130. package/presets/claude/php-laravel/agents/task-analyst.md +1 -1
  131. package/presets/claude/php-laravel/agents/task-router.md +1 -1
  132. package/presets/claude/php-laravel/rules/tooling-and-review/agent-team-orchestrator.md +3 -1
  133. package/presets/claude/svelte/agents/accessibility-reviewer.md +2 -2
  134. package/presets/claude/svelte/agents/api-contract-reviewer.md +2 -2
  135. package/presets/claude/svelte/agents/build-verifier.md +2 -2
  136. package/presets/claude/svelte/agents/ci-investigator.md +2 -2
  137. package/presets/claude/svelte/agents/code-reviewer.md +2 -2
  138. package/presets/claude/svelte/agents/debugger.md +2 -2
  139. package/presets/claude/svelte/agents/feature-developer.md +2 -2
  140. package/presets/claude/svelte/agents/migration-specialist.md +2 -2
  141. package/presets/claude/svelte/agents/mockup-reviewer.md +2 -2
  142. package/presets/claude/svelte/agents/openspec-author.md +2 -2
  143. package/presets/claude/svelte/agents/performance-auditor.md +2 -2
  144. package/presets/claude/svelte/agents/qa-tester.md +2 -2
  145. package/presets/claude/svelte/agents/security-reviewer.md +2 -2
  146. package/presets/claude/svelte/agents/solution-architect.md +2 -2
  147. package/presets/claude/svelte/agents/task-analyst.md +1 -1
  148. package/presets/claude/svelte/agents/task-router.md +1 -1
  149. package/presets/claude/svelte/agents/tech-writer.md +2 -2
  150. package/presets/claude/svelte/agents/unit-test-generator.md +2 -2
  151. package/presets/claude/svelte/agents/unit-test-healer.md +2 -2
  152. package/presets/claude/svelte/agents/unit-test-planner.md +2 -2
  153. package/presets/claude/svelte/rules/tooling-and-review/agent-team-orchestrator.md +3 -1
  154. package/presets/cursor/android-kotlin/agents/accessibility-reviewer.md +2 -2
  155. package/presets/cursor/android-kotlin/agents/api-contract-reviewer.md +2 -2
  156. package/presets/cursor/android-kotlin/agents/build-verifier.md +1 -1
  157. package/presets/cursor/android-kotlin/agents/ci-investigator.md +2 -2
  158. package/presets/cursor/android-kotlin/agents/code-reviewer.md +2 -2
  159. package/presets/cursor/android-kotlin/agents/debugger.md +2 -2
  160. package/presets/cursor/android-kotlin/agents/feature-developer.md +2 -2
  161. package/presets/cursor/android-kotlin/agents/migration-specialist.md +2 -2
  162. package/presets/cursor/android-kotlin/agents/mockup-reviewer.md +2 -2
  163. package/presets/cursor/android-kotlin/agents/openspec-author.md +2 -2
  164. package/presets/cursor/android-kotlin/agents/performance-auditor.md +2 -2
  165. package/presets/cursor/android-kotlin/agents/qa-tester.md +2 -2
  166. package/presets/cursor/android-kotlin/agents/security-reviewer.md +2 -2
  167. package/presets/cursor/android-kotlin/agents/task-analyst.md +1 -1
  168. package/presets/cursor/android-kotlin/agents/task-router.md +1 -1
  169. package/presets/cursor/android-kotlin/agents/tech-writer.md +2 -2
  170. package/presets/cursor/android-kotlin/agents/unit-test-generator.md +2 -2
  171. package/presets/cursor/android-kotlin/agents/unit-test-healer.md +2 -2
  172. package/presets/cursor/android-kotlin/agents/unit-test-planner.md +2 -2
  173. package/presets/cursor/android-kotlin/rules/agent-team-orchestrator.mdc +1 -1
  174. package/presets/cursor/go/agents/build-verifier.md +2 -2
  175. package/presets/cursor/go/agents/code-reviewer.md +2 -2
  176. package/presets/cursor/go/agents/feature-developer.md +2 -2
  177. package/presets/cursor/go/agents/openspec-author.md +2 -2
  178. package/presets/cursor/go/agents/task-analyst.md +1 -1
  179. package/presets/cursor/go/agents/task-router.md +1 -1
  180. package/presets/cursor/go/rules/agent-team-orchestrator.mdc +3 -1
  181. package/presets/cursor/ios-swift/agents/build-verifier.md +2 -2
  182. package/presets/cursor/ios-swift/agents/code-reviewer.md +2 -2
  183. package/presets/cursor/ios-swift/agents/feature-developer.md +2 -2
  184. package/presets/cursor/ios-swift/agents/mockup-reviewer.md +2 -2
  185. package/presets/cursor/ios-swift/agents/openspec-author.md +2 -2
  186. package/presets/cursor/ios-swift/agents/task-analyst.md +1 -1
  187. package/presets/cursor/ios-swift/agents/task-router.md +1 -1
  188. package/presets/cursor/ios-swift/rules/agent-team-orchestrator.mdc +1 -1
  189. package/presets/cursor/java/agents/build-verifier.md +2 -2
  190. package/presets/cursor/java/agents/code-reviewer.md +2 -2
  191. package/presets/cursor/java/agents/feature-developer.md +2 -2
  192. package/presets/cursor/java/agents/openspec-author.md +2 -2
  193. package/presets/cursor/java/agents/task-analyst.md +1 -1
  194. package/presets/cursor/java/agents/task-router.md +1 -1
  195. package/presets/cursor/java/rules/agent-team-orchestrator.mdc +3 -1
  196. package/presets/cursor/mcp-ts/agents/build-verifier.md +2 -2
  197. package/presets/cursor/mcp-ts/agents/feature-developer.md +2 -2
  198. package/presets/cursor/mcp-ts/agents/task-analyst.md +1 -1
  199. package/presets/cursor/mcp-ts/agents/task-router.md +1 -1
  200. package/presets/cursor/mcp-ts/rules/agent-team-orchestrator.mdc +3 -1
  201. package/presets/cursor/next/REPO_AGENTS.md +11 -1
  202. package/presets/cursor/next/agents/accessibility-reviewer.md +2 -2
  203. package/presets/cursor/next/agents/api-contract-reviewer.md +2 -2
  204. package/presets/cursor/next/agents/build-verifier.md +3 -2
  205. package/presets/cursor/next/agents/ci-investigator.md +2 -2
  206. package/presets/cursor/next/agents/code-reviewer.md +3 -2
  207. package/presets/cursor/next/agents/debugger.md +2 -2
  208. package/presets/cursor/next/agents/feature-developer.md +3 -2
  209. package/presets/cursor/next/agents/migration-specialist.md +2 -2
  210. package/presets/cursor/next/agents/mockup-reviewer.md +2 -2
  211. package/presets/cursor/next/agents/openspec-author.md +4 -2
  212. package/presets/cursor/next/agents/performance-auditor.md +2 -2
  213. package/presets/cursor/next/agents/qa-tester.md +2 -2
  214. package/presets/cursor/next/agents/security-reviewer.md +2 -2
  215. package/presets/cursor/next/agents/solution-architect.md +2 -2
  216. package/presets/cursor/next/agents/task-analyst.md +8 -1
  217. package/presets/cursor/next/agents/task-router.md +2 -1
  218. package/presets/cursor/next/agents/tech-writer.md +2 -2
  219. package/presets/cursor/next/agents/unit-test-generator.md +2 -2
  220. package/presets/cursor/next/agents/unit-test-healer.md +2 -2
  221. package/presets/cursor/next/agents/unit-test-planner.md +2 -2
  222. package/presets/cursor/next/ai-local/rules-library/agent-artifacts-no-local-paths.md +41 -8
  223. package/presets/cursor/next/ai-local/rules-library/agent-pipeline-gates.md +19 -0
  224. package/presets/cursor/next/ai-local/rules-library/analytics-events.md +18 -0
  225. package/presets/cursor/next/ai-local/rules-library/api-contract-source.md +14 -0
  226. package/presets/cursor/next/ai-local/rules-library/artifact-lifecycle.md +17 -0
  227. package/presets/cursor/next/ai-local/rules-library/code-style.md +68 -0
  228. package/presets/cursor/next/ai-local/rules-library/component-child-decomposition.md +81 -0
  229. package/presets/cursor/next/ai-local/rules-library/feature-flags-experiments.md +15 -0
  230. package/presets/cursor/next/ai-local/rules-library/mcp-required-for-ui-layout.md +1 -1
  231. package/presets/cursor/next/ai-local/rules-library/no-react-fc.md +46 -0
  232. package/presets/cursor/next/ai-local/rules-library/no-test-driven-behavior-change.md +1 -1
  233. package/presets/cursor/next/ai-local/rules-library/pwa-service-worker.md +15 -0
  234. package/presets/cursor/next/ai-local/rules-library/qa-test-cases.md +14 -0
  235. package/presets/cursor/next/ai-local/rules-library/router-pages.md +4 -2
  236. package/presets/cursor/next/ai-local/rules-library/single-source-copy-constants.md +3 -1
  237. package/presets/cursor/next/ai-local/rules-library/storybook-catalog-structure.md +62 -0
  238. package/presets/cursor/next/ai-local/rules-library/storybook-cleanup-temp-screenshots.md +40 -0
  239. package/presets/cursor/next/ai-local/rules-library/storybook-csf-authoring.md +100 -0
  240. package/presets/cursor/next/ai-local/rules-library/storybook-dev-compare-figma.md +67 -0
  241. package/presets/cursor/next/ai-local/rules-library/storybook-keep-tests-current.md +75 -0
  242. package/presets/cursor/next/ai-local/rules-library/storybook-modals.md +64 -0
  243. package/presets/cursor/next/ai-local/rules-library/storybook-no-app-node-modules.md +40 -0
  244. package/presets/cursor/next/ai-local/rules-library/storybook-ui-quality-gate.md +38 -0
  245. package/presets/cursor/next/ai-local/rules-library/task-levels.md +28 -0
  246. package/presets/cursor/next/ai-local/rules-library/ui-change-review-gate.md +14 -0
  247. package/presets/cursor/next/hooks/chain-team-phases.sh +46 -1
  248. package/presets/cursor/next/rules/README.md +4 -1
  249. package/presets/cursor/next/rules/agent-team-orchestrator.mdc +3 -1
  250. package/presets/cursor/next/rules/ai-local-overlay.mdc +16 -2
  251. package/presets/cursor/next/rules/code-review-mr.mdc +4 -0
  252. package/presets/cursor/next/rules/component-catalog-gate.mdc +38 -0
  253. package/presets/cursor/next/rules/design-tokens-binding.mdc +1 -1
  254. package/presets/cursor/next/rules/feature-delivery-workflow.mdc +5 -1
  255. package/presets/cursor/next/rules/forms-validation.mdc +33 -0
  256. package/presets/cursor/next/rules/mcp-usage.mdc +1 -0
  257. package/presets/cursor/next/rules/next-app-core.mdc +3 -0
  258. package/presets/cursor/next/rules/next-static-export.mdc +35 -0
  259. package/presets/cursor/next/rules/post-change-lint.mdc +4 -0
  260. package/presets/cursor/next/rules/product-specs-authoring.mdc +1 -0
  261. package/presets/cursor/next/rules/product-specs.mdc +1 -0
  262. package/presets/cursor/next/rules/react-next-anti-hallucination.mdc +10 -0
  263. package/presets/cursor/next/rules/react-ui.mdc +19 -1
  264. package/presets/cursor/next/rules/reference-features.mdc +5 -0
  265. package/presets/cursor/next/rules/security-next.mdc +12 -0
  266. package/presets/cursor/next/rules/store-rtk.mdc +6 -0
  267. package/presets/cursor/next/rules/tests-e2e-structure.mdc +1 -0
  268. package/presets/cursor/next/rules/tests-unit.mdc +1 -0
  269. package/presets/cursor/next/team/fixtures/feature-with-ux-no-figma.json +3 -4
  270. package/presets/cursor/nuxt/agents/accessibility-reviewer.md +2 -2
  271. package/presets/cursor/nuxt/agents/api-contract-reviewer.md +2 -2
  272. package/presets/cursor/nuxt/agents/build-verifier.md +2 -2
  273. package/presets/cursor/nuxt/agents/ci-investigator.md +2 -2
  274. package/presets/cursor/nuxt/agents/code-reviewer.md +2 -2
  275. package/presets/cursor/nuxt/agents/debugger.md +2 -2
  276. package/presets/cursor/nuxt/agents/feature-developer.md +2 -2
  277. package/presets/cursor/nuxt/agents/migration-specialist.md +2 -2
  278. package/presets/cursor/nuxt/agents/mockup-reviewer.md +2 -2
  279. package/presets/cursor/nuxt/agents/openspec-author.md +2 -2
  280. package/presets/cursor/nuxt/agents/performance-auditor.md +2 -2
  281. package/presets/cursor/nuxt/agents/qa-tester.md +2 -2
  282. package/presets/cursor/nuxt/agents/security-reviewer.md +2 -2
  283. package/presets/cursor/nuxt/agents/solution-architect.md +2 -2
  284. package/presets/cursor/nuxt/agents/task-analyst.md +1 -1
  285. package/presets/cursor/nuxt/agents/task-router.md +1 -1
  286. package/presets/cursor/nuxt/agents/tech-writer.md +2 -2
  287. package/presets/cursor/nuxt/agents/unit-test-generator.md +2 -2
  288. package/presets/cursor/nuxt/agents/unit-test-healer.md +2 -2
  289. package/presets/cursor/nuxt/agents/unit-test-planner.md +2 -2
  290. package/presets/cursor/nuxt/rules/agent-team-orchestrator.mdc +3 -1
  291. package/presets/cursor/php-hexagonal/agents/build-verifier.md +2 -2
  292. package/presets/cursor/php-hexagonal/agents/code-reviewer.md +2 -2
  293. package/presets/cursor/php-hexagonal/agents/feature-developer.md +2 -2
  294. package/presets/cursor/php-hexagonal/agents/openspec-author.md +2 -2
  295. package/presets/cursor/php-hexagonal/agents/task-analyst.md +1 -1
  296. package/presets/cursor/php-hexagonal/agents/task-router.md +1 -1
  297. package/presets/cursor/php-hexagonal/rules/agent-team-orchestrator.mdc +3 -1
  298. package/presets/cursor/php-laravel/agents/build-verifier.md +2 -2
  299. package/presets/cursor/php-laravel/agents/code-reviewer.md +2 -2
  300. package/presets/cursor/php-laravel/agents/feature-developer.md +2 -2
  301. package/presets/cursor/php-laravel/agents/openspec-author.md +2 -2
  302. package/presets/cursor/php-laravel/agents/task-analyst.md +1 -1
  303. package/presets/cursor/php-laravel/agents/task-router.md +1 -1
  304. package/presets/cursor/php-laravel/rules/agent-team-orchestrator.mdc +3 -1
  305. package/presets/cursor/svelte/agents/accessibility-reviewer.md +2 -2
  306. package/presets/cursor/svelte/agents/api-contract-reviewer.md +2 -2
  307. package/presets/cursor/svelte/agents/build-verifier.md +2 -2
  308. package/presets/cursor/svelte/agents/ci-investigator.md +2 -2
  309. package/presets/cursor/svelte/agents/code-reviewer.md +2 -2
  310. package/presets/cursor/svelte/agents/debugger.md +2 -2
  311. package/presets/cursor/svelte/agents/feature-developer.md +2 -2
  312. package/presets/cursor/svelte/agents/migration-specialist.md +2 -2
  313. package/presets/cursor/svelte/agents/mockup-reviewer.md +2 -2
  314. package/presets/cursor/svelte/agents/openspec-author.md +2 -2
  315. package/presets/cursor/svelte/agents/performance-auditor.md +2 -2
  316. package/presets/cursor/svelte/agents/qa-tester.md +2 -2
  317. package/presets/cursor/svelte/agents/security-reviewer.md +2 -2
  318. package/presets/cursor/svelte/agents/solution-architect.md +2 -2
  319. package/presets/cursor/svelte/agents/task-analyst.md +1 -1
  320. package/presets/cursor/svelte/agents/task-router.md +1 -1
  321. package/presets/cursor/svelte/agents/tech-writer.md +2 -2
  322. package/presets/cursor/svelte/agents/unit-test-generator.md +2 -2
  323. package/presets/cursor/svelte/agents/unit-test-healer.md +2 -2
  324. package/presets/cursor/svelte/agents/unit-test-planner.md +2 -2
  325. package/presets/cursor/svelte/rules/agent-team-orchestrator.mdc +3 -1
  326. package/presets/mavis/android-kotlin/adapter-map.json +1 -1
  327. package/presets/mavis/android-kotlin/agents/accessibility-reviewer.md +2 -2
  328. package/presets/mavis/android-kotlin/agents/api-contract-reviewer.md +2 -2
  329. package/presets/mavis/android-kotlin/agents/build-verifier.md +1 -1
  330. package/presets/mavis/android-kotlin/agents/ci-investigator.md +2 -2
  331. package/presets/mavis/android-kotlin/agents/code-reviewer.md +2 -2
  332. package/presets/mavis/android-kotlin/agents/debugger.md +2 -2
  333. package/presets/mavis/android-kotlin/agents/feature-developer.md +2 -2
  334. package/presets/mavis/android-kotlin/agents/migration-specialist.md +2 -2
  335. package/presets/mavis/android-kotlin/agents/mockup-reviewer.md +2 -2
  336. package/presets/mavis/android-kotlin/agents/openspec-author.md +2 -2
  337. package/presets/mavis/android-kotlin/agents/performance-auditor.md +2 -2
  338. package/presets/mavis/android-kotlin/agents/qa-tester.md +2 -2
  339. package/presets/mavis/android-kotlin/agents/security-reviewer.md +2 -2
  340. package/presets/mavis/android-kotlin/agents/task-analyst.md +1 -1
  341. package/presets/mavis/android-kotlin/agents/task-router.md +1 -1
  342. package/presets/mavis/android-kotlin/agents/tech-writer.md +2 -2
  343. package/presets/mavis/android-kotlin/agents/unit-test-generator.md +2 -2
  344. package/presets/mavis/android-kotlin/agents/unit-test-healer.md +2 -2
  345. package/presets/mavis/android-kotlin/agents/unit-test-planner.md +2 -2
  346. package/presets/mavis/android-kotlin/rules/agent-team-orchestrator.md +3 -1
  347. package/presets/mavis/android-kotlin/rules/code-review-mr.md +6 -6
  348. package/presets/mavis/go/adapter-map.json +1 -1
  349. package/presets/mavis/go/agents/build-verifier.md +2 -2
  350. package/presets/mavis/go/agents/code-reviewer.md +2 -2
  351. package/presets/mavis/go/agents/feature-developer.md +2 -2
  352. package/presets/mavis/go/agents/openspec-author.md +2 -2
  353. package/presets/mavis/go/agents/task-analyst.md +1 -1
  354. package/presets/mavis/go/agents/task-router.md +1 -1
  355. package/presets/mavis/go/rules/agent-team-orchestrator.md +3 -1
  356. package/presets/mavis/go/rules/code-quality-and-refactoring.md +1 -1
  357. package/presets/mavis/ios-swift/adapter-map.json +1 -1
  358. package/presets/mavis/ios-swift/agents/build-verifier.md +2 -2
  359. package/presets/mavis/ios-swift/agents/code-reviewer.md +2 -2
  360. package/presets/mavis/ios-swift/agents/feature-developer.md +2 -2
  361. package/presets/mavis/ios-swift/agents/mockup-reviewer.md +2 -2
  362. package/presets/mavis/ios-swift/agents/openspec-author.md +2 -2
  363. package/presets/mavis/ios-swift/agents/task-analyst.md +1 -1
  364. package/presets/mavis/ios-swift/agents/task-router.md +1 -1
  365. package/presets/mavis/ios-swift/rules/agent-team-orchestrator.md +3 -1
  366. package/presets/mavis/ios-swift/rules/code-quality-and-refactoring.md +1 -1
  367. package/presets/mavis/ios-swift/rules/code-review-mr.md +6 -6
  368. package/presets/mavis/ios-swift/rules/feature-delivery-workflow.md +14 -14
  369. package/presets/mavis/ios-swift/rules/reference-features.md +3 -3
  370. package/presets/mavis/java/adapter-map.json +1 -1
  371. package/presets/mavis/java/agents/build-verifier.md +2 -2
  372. package/presets/mavis/java/agents/code-reviewer.md +2 -2
  373. package/presets/mavis/java/agents/feature-developer.md +2 -2
  374. package/presets/mavis/java/agents/openspec-author.md +2 -2
  375. package/presets/mavis/java/agents/task-analyst.md +1 -1
  376. package/presets/mavis/java/agents/task-router.md +1 -1
  377. package/presets/mavis/java/rules/agent-team-orchestrator.md +3 -1
  378. package/presets/mavis/java/rules/code-quality-and-refactoring.md +1 -1
  379. package/presets/mavis/mcp-ts/adapter-map.json +1 -1
  380. package/presets/mavis/mcp-ts/agents/build-verifier.md +2 -2
  381. package/presets/mavis/mcp-ts/agents/feature-developer.md +2 -2
  382. package/presets/mavis/mcp-ts/agents/task-analyst.md +1 -1
  383. package/presets/mavis/mcp-ts/agents/task-router.md +1 -1
  384. package/presets/mavis/mcp-ts/rules/agent-team-orchestrator.md +3 -1
  385. package/presets/mavis/next/REPO_AGENTS.md +11 -1
  386. package/presets/mavis/next/adapter-map.json +192 -8
  387. package/presets/mavis/next/agents/accessibility-reviewer.md +2 -2
  388. package/presets/mavis/next/agents/api-contract-reviewer.md +2 -2
  389. package/presets/mavis/next/agents/build-verifier.md +3 -2
  390. package/presets/mavis/next/agents/ci-investigator.md +2 -2
  391. package/presets/mavis/next/agents/code-reviewer.md +3 -2
  392. package/presets/mavis/next/agents/debugger.md +2 -2
  393. package/presets/mavis/next/agents/feature-developer.md +3 -2
  394. package/presets/mavis/next/agents/migration-specialist.md +2 -2
  395. package/presets/mavis/next/agents/mockup-reviewer.md +2 -2
  396. package/presets/mavis/next/agents/openspec-author.md +4 -2
  397. package/presets/mavis/next/agents/performance-auditor.md +2 -2
  398. package/presets/mavis/next/agents/qa-tester.md +2 -2
  399. package/presets/mavis/next/agents/security-reviewer.md +2 -2
  400. package/presets/mavis/next/agents/solution-architect.md +2 -2
  401. package/presets/mavis/next/agents/task-analyst.md +8 -1
  402. package/presets/mavis/next/agents/task-router.md +2 -1
  403. package/presets/mavis/next/agents/tech-writer.md +2 -2
  404. package/presets/mavis/next/agents/unit-test-generator.md +2 -2
  405. package/presets/mavis/next/agents/unit-test-healer.md +2 -2
  406. package/presets/mavis/next/agents/unit-test-planner.md +2 -2
  407. package/presets/mavis/next/ai-local/rules-library/agent-artifacts-no-local-paths.md +41 -8
  408. package/presets/mavis/next/ai-local/rules-library/agent-pipeline-gates.md +19 -0
  409. package/presets/mavis/next/ai-local/rules-library/analytics-events.md +18 -0
  410. package/presets/mavis/next/ai-local/rules-library/api-contract-source.md +14 -0
  411. package/presets/mavis/next/ai-local/rules-library/artifact-lifecycle.md +17 -0
  412. package/presets/mavis/next/ai-local/rules-library/code-style.md +68 -0
  413. package/presets/mavis/next/ai-local/rules-library/component-child-decomposition.md +81 -0
  414. package/presets/mavis/next/ai-local/rules-library/feature-flags-experiments.md +15 -0
  415. package/presets/mavis/next/ai-local/rules-library/mcp-required-for-ui-layout.md +1 -1
  416. package/presets/mavis/next/ai-local/rules-library/no-react-fc.md +46 -0
  417. package/presets/mavis/next/ai-local/rules-library/no-test-driven-behavior-change.md +1 -1
  418. package/presets/mavis/next/ai-local/rules-library/pwa-service-worker.md +15 -0
  419. package/presets/mavis/next/ai-local/rules-library/qa-test-cases.md +14 -0
  420. package/presets/mavis/next/ai-local/rules-library/router-pages.md +4 -2
  421. package/presets/mavis/next/ai-local/rules-library/single-source-copy-constants.md +3 -1
  422. package/presets/mavis/next/ai-local/rules-library/storybook-catalog-structure.md +62 -0
  423. package/presets/mavis/next/ai-local/rules-library/storybook-cleanup-temp-screenshots.md +40 -0
  424. package/presets/mavis/next/ai-local/rules-library/storybook-csf-authoring.md +100 -0
  425. package/presets/mavis/next/ai-local/rules-library/storybook-dev-compare-figma.md +67 -0
  426. package/presets/mavis/next/ai-local/rules-library/storybook-keep-tests-current.md +75 -0
  427. package/presets/mavis/next/ai-local/rules-library/storybook-modals.md +64 -0
  428. package/presets/mavis/next/ai-local/rules-library/storybook-no-app-node-modules.md +40 -0
  429. package/presets/mavis/next/ai-local/rules-library/storybook-ui-quality-gate.md +38 -0
  430. package/presets/mavis/next/ai-local/rules-library/task-levels.md +28 -0
  431. package/presets/mavis/next/ai-local/rules-library/ui-change-review-gate.md +14 -0
  432. package/presets/mavis/next/hooks/chain-team-phases.sh +46 -1
  433. package/presets/mavis/next/rules/agent-team-orchestrator.md +3 -1
  434. package/presets/mavis/next/rules/ai-local-overlay.md +16 -2
  435. package/presets/mavis/next/rules/code-quality-and-refactoring.md +2 -2
  436. package/presets/mavis/next/rules/code-review-mr.md +11 -7
  437. package/presets/mavis/next/rules/component-catalog-gate.md +31 -0
  438. package/presets/mavis/next/rules/design-tokens-binding.md +1 -1
  439. package/presets/mavis/next/rules/feature-delivery-workflow.md +22 -18
  440. package/presets/mavis/next/rules/forms-validation.md +26 -0
  441. package/presets/mavis/next/rules/mcp-usage.md +1 -0
  442. package/presets/mavis/next/rules/mockup-review.md +1 -1
  443. package/presets/mavis/next/rules/next-app-core.md +3 -0
  444. package/presets/mavis/next/rules/next-static-export.md +28 -0
  445. package/presets/mavis/next/rules/post-change-lint.md +4 -0
  446. package/presets/mavis/next/rules/product-specs-authoring.md +1 -0
  447. package/presets/mavis/next/rules/product-specs.md +1 -0
  448. package/presets/mavis/next/rules/react-next-anti-hallucination.md +10 -0
  449. package/presets/mavis/next/rules/react-ui.md +19 -1
  450. package/presets/mavis/next/rules/reference-features.md +7 -2
  451. package/presets/mavis/next/rules/security-next.md +12 -0
  452. package/presets/mavis/next/rules/store-rtk.md +6 -0
  453. package/presets/mavis/next/rules/tests-e2e-structure.md +2 -1
  454. package/presets/mavis/next/rules/tests-unit.md +1 -0
  455. package/presets/mavis/next/team/fixtures/feature-with-ux-no-figma.json +3 -4
  456. package/presets/mavis/nuxt/adapter-map.json +1 -1
  457. package/presets/mavis/nuxt/agents/accessibility-reviewer.md +2 -2
  458. package/presets/mavis/nuxt/agents/api-contract-reviewer.md +2 -2
  459. package/presets/mavis/nuxt/agents/build-verifier.md +2 -2
  460. package/presets/mavis/nuxt/agents/ci-investigator.md +2 -2
  461. package/presets/mavis/nuxt/agents/code-reviewer.md +2 -2
  462. package/presets/mavis/nuxt/agents/debugger.md +2 -2
  463. package/presets/mavis/nuxt/agents/feature-developer.md +2 -2
  464. package/presets/mavis/nuxt/agents/migration-specialist.md +2 -2
  465. package/presets/mavis/nuxt/agents/mockup-reviewer.md +2 -2
  466. package/presets/mavis/nuxt/agents/openspec-author.md +2 -2
  467. package/presets/mavis/nuxt/agents/performance-auditor.md +2 -2
  468. package/presets/mavis/nuxt/agents/qa-tester.md +2 -2
  469. package/presets/mavis/nuxt/agents/security-reviewer.md +2 -2
  470. package/presets/mavis/nuxt/agents/solution-architect.md +2 -2
  471. package/presets/mavis/nuxt/agents/task-analyst.md +1 -1
  472. package/presets/mavis/nuxt/agents/task-router.md +1 -1
  473. package/presets/mavis/nuxt/agents/tech-writer.md +2 -2
  474. package/presets/mavis/nuxt/agents/unit-test-generator.md +2 -2
  475. package/presets/mavis/nuxt/agents/unit-test-healer.md +2 -2
  476. package/presets/mavis/nuxt/agents/unit-test-planner.md +2 -2
  477. package/presets/mavis/nuxt/rules/agent-team-orchestrator.md +3 -1
  478. package/presets/mavis/nuxt/rules/code-review-mr.md +6 -6
  479. package/presets/mavis/nuxt/rules/feature-delivery-workflow.md +15 -15
  480. package/presets/mavis/nuxt/rules/reference-features.md +2 -2
  481. package/presets/mavis/nuxt/rules/tests-e2e-structure.md +1 -1
  482. package/presets/mavis/php-hexagonal/adapter-map.json +1 -1
  483. package/presets/mavis/php-hexagonal/agents/build-verifier.md +2 -2
  484. package/presets/mavis/php-hexagonal/agents/code-reviewer.md +2 -2
  485. package/presets/mavis/php-hexagonal/agents/feature-developer.md +2 -2
  486. package/presets/mavis/php-hexagonal/agents/openspec-author.md +2 -2
  487. package/presets/mavis/php-hexagonal/agents/task-analyst.md +1 -1
  488. package/presets/mavis/php-hexagonal/agents/task-router.md +1 -1
  489. package/presets/mavis/php-hexagonal/rules/agent-team-orchestrator.md +3 -1
  490. package/presets/mavis/php-hexagonal/rules/code-quality-and-refactoring.md +1 -1
  491. package/presets/mavis/php-laravel/adapter-map.json +1 -1
  492. package/presets/mavis/php-laravel/agents/build-verifier.md +2 -2
  493. package/presets/mavis/php-laravel/agents/code-reviewer.md +2 -2
  494. package/presets/mavis/php-laravel/agents/feature-developer.md +2 -2
  495. package/presets/mavis/php-laravel/agents/openspec-author.md +2 -2
  496. package/presets/mavis/php-laravel/agents/task-analyst.md +1 -1
  497. package/presets/mavis/php-laravel/agents/task-router.md +1 -1
  498. package/presets/mavis/php-laravel/rules/agent-team-orchestrator.md +3 -1
  499. package/presets/mavis/php-laravel/rules/code-quality-and-refactoring.md +1 -1
  500. package/presets/mavis/svelte/adapter-map.json +1 -1
  501. package/presets/mavis/svelte/agents/accessibility-reviewer.md +2 -2
  502. package/presets/mavis/svelte/agents/api-contract-reviewer.md +2 -2
  503. package/presets/mavis/svelte/agents/build-verifier.md +2 -2
  504. package/presets/mavis/svelte/agents/ci-investigator.md +2 -2
  505. package/presets/mavis/svelte/agents/code-reviewer.md +2 -2
  506. package/presets/mavis/svelte/agents/debugger.md +2 -2
  507. package/presets/mavis/svelte/agents/feature-developer.md +2 -2
  508. package/presets/mavis/svelte/agents/migration-specialist.md +2 -2
  509. package/presets/mavis/svelte/agents/mockup-reviewer.md +2 -2
  510. package/presets/mavis/svelte/agents/openspec-author.md +2 -2
  511. package/presets/mavis/svelte/agents/performance-auditor.md +2 -2
  512. package/presets/mavis/svelte/agents/qa-tester.md +2 -2
  513. package/presets/mavis/svelte/agents/security-reviewer.md +2 -2
  514. package/presets/mavis/svelte/agents/solution-architect.md +2 -2
  515. package/presets/mavis/svelte/agents/task-analyst.md +1 -1
  516. package/presets/mavis/svelte/agents/task-router.md +1 -1
  517. package/presets/mavis/svelte/agents/tech-writer.md +2 -2
  518. package/presets/mavis/svelte/agents/unit-test-generator.md +2 -2
  519. package/presets/mavis/svelte/agents/unit-test-healer.md +2 -2
  520. package/presets/mavis/svelte/agents/unit-test-planner.md +2 -2
  521. package/presets/mavis/svelte/rules/agent-team-orchestrator.md +3 -1
  522. package/presets/mavis/svelte/rules/code-review-mr.md +6 -6
  523. package/presets/mavis/svelte/rules/feature-delivery-workflow.md +1 -1
  524. package/presets/mavis/svelte/rules/reference-features.md +2 -2
  525. package/presets/mavis/svelte/rules/tests-e2e-structure.md +1 -1
  526. package/presets/opencode/android-kotlin/adapter-map.json +1 -1
  527. package/presets/opencode/android-kotlin/agents/accessibility-reviewer.md +2 -2
  528. package/presets/opencode/android-kotlin/agents/api-contract-reviewer.md +2 -2
  529. package/presets/opencode/android-kotlin/agents/build-verifier.md +1 -1
  530. package/presets/opencode/android-kotlin/agents/ci-investigator.md +2 -2
  531. package/presets/opencode/android-kotlin/agents/code-reviewer.md +2 -2
  532. package/presets/opencode/android-kotlin/agents/debugger.md +2 -2
  533. package/presets/opencode/android-kotlin/agents/feature-developer.md +2 -2
  534. package/presets/opencode/android-kotlin/agents/migration-specialist.md +2 -2
  535. package/presets/opencode/android-kotlin/agents/mockup-reviewer.md +2 -2
  536. package/presets/opencode/android-kotlin/agents/openspec-author.md +2 -2
  537. package/presets/opencode/android-kotlin/agents/performance-auditor.md +2 -2
  538. package/presets/opencode/android-kotlin/agents/qa-tester.md +2 -2
  539. package/presets/opencode/android-kotlin/agents/security-reviewer.md +2 -2
  540. package/presets/opencode/android-kotlin/agents/task-analyst.md +1 -1
  541. package/presets/opencode/android-kotlin/agents/task-router.md +1 -1
  542. package/presets/opencode/android-kotlin/agents/tech-writer.md +2 -2
  543. package/presets/opencode/android-kotlin/agents/unit-test-generator.md +2 -2
  544. package/presets/opencode/android-kotlin/agents/unit-test-healer.md +2 -2
  545. package/presets/opencode/android-kotlin/agents/unit-test-planner.md +2 -2
  546. package/presets/opencode/android-kotlin/rules/agent-team-orchestrator.md +3 -1
  547. package/presets/opencode/android-kotlin/rules/code-review-mr.md +6 -6
  548. package/presets/opencode/go/adapter-map.json +1 -1
  549. package/presets/opencode/go/agents/build-verifier.md +2 -2
  550. package/presets/opencode/go/agents/code-reviewer.md +2 -2
  551. package/presets/opencode/go/agents/feature-developer.md +2 -2
  552. package/presets/opencode/go/agents/openspec-author.md +2 -2
  553. package/presets/opencode/go/agents/task-analyst.md +1 -1
  554. package/presets/opencode/go/agents/task-router.md +1 -1
  555. package/presets/opencode/go/rules/agent-team-orchestrator.md +3 -1
  556. package/presets/opencode/go/rules/code-quality-and-refactoring.md +1 -1
  557. package/presets/opencode/ios-swift/adapter-map.json +1 -1
  558. package/presets/opencode/ios-swift/agents/build-verifier.md +2 -2
  559. package/presets/opencode/ios-swift/agents/code-reviewer.md +2 -2
  560. package/presets/opencode/ios-swift/agents/feature-developer.md +2 -2
  561. package/presets/opencode/ios-swift/agents/mockup-reviewer.md +2 -2
  562. package/presets/opencode/ios-swift/agents/openspec-author.md +2 -2
  563. package/presets/opencode/ios-swift/agents/task-analyst.md +1 -1
  564. package/presets/opencode/ios-swift/agents/task-router.md +1 -1
  565. package/presets/opencode/ios-swift/rules/agent-team-orchestrator.md +3 -1
  566. package/presets/opencode/ios-swift/rules/code-quality-and-refactoring.md +1 -1
  567. package/presets/opencode/ios-swift/rules/code-review-mr.md +6 -6
  568. package/presets/opencode/ios-swift/rules/feature-delivery-workflow.md +14 -14
  569. package/presets/opencode/ios-swift/rules/reference-features.md +3 -3
  570. package/presets/opencode/java/adapter-map.json +1 -1
  571. package/presets/opencode/java/agents/build-verifier.md +2 -2
  572. package/presets/opencode/java/agents/code-reviewer.md +2 -2
  573. package/presets/opencode/java/agents/feature-developer.md +2 -2
  574. package/presets/opencode/java/agents/openspec-author.md +2 -2
  575. package/presets/opencode/java/agents/task-analyst.md +1 -1
  576. package/presets/opencode/java/agents/task-router.md +1 -1
  577. package/presets/opencode/java/rules/agent-team-orchestrator.md +3 -1
  578. package/presets/opencode/java/rules/code-quality-and-refactoring.md +1 -1
  579. package/presets/opencode/mcp-ts/adapter-map.json +1 -1
  580. package/presets/opencode/mcp-ts/agents/build-verifier.md +2 -2
  581. package/presets/opencode/mcp-ts/agents/feature-developer.md +2 -2
  582. package/presets/opencode/mcp-ts/agents/task-analyst.md +1 -1
  583. package/presets/opencode/mcp-ts/agents/task-router.md +1 -1
  584. package/presets/opencode/mcp-ts/rules/agent-team-orchestrator.md +3 -1
  585. package/presets/opencode/next/REPO_AGENTS.md +11 -1
  586. package/presets/opencode/next/adapter-map.json +192 -8
  587. package/presets/opencode/next/agents/accessibility-reviewer.md +2 -2
  588. package/presets/opencode/next/agents/api-contract-reviewer.md +2 -2
  589. package/presets/opencode/next/agents/build-verifier.md +3 -2
  590. package/presets/opencode/next/agents/ci-investigator.md +2 -2
  591. package/presets/opencode/next/agents/code-reviewer.md +3 -2
  592. package/presets/opencode/next/agents/debugger.md +2 -2
  593. package/presets/opencode/next/agents/feature-developer.md +3 -2
  594. package/presets/opencode/next/agents/migration-specialist.md +2 -2
  595. package/presets/opencode/next/agents/mockup-reviewer.md +2 -2
  596. package/presets/opencode/next/agents/openspec-author.md +4 -2
  597. package/presets/opencode/next/agents/performance-auditor.md +2 -2
  598. package/presets/opencode/next/agents/qa-tester.md +2 -2
  599. package/presets/opencode/next/agents/security-reviewer.md +2 -2
  600. package/presets/opencode/next/agents/solution-architect.md +2 -2
  601. package/presets/opencode/next/agents/task-analyst.md +8 -1
  602. package/presets/opencode/next/agents/task-router.md +2 -1
  603. package/presets/opencode/next/agents/tech-writer.md +2 -2
  604. package/presets/opencode/next/agents/unit-test-generator.md +2 -2
  605. package/presets/opencode/next/agents/unit-test-healer.md +2 -2
  606. package/presets/opencode/next/agents/unit-test-planner.md +2 -2
  607. package/presets/opencode/next/ai-local/rules-library/agent-artifacts-no-local-paths.md +41 -8
  608. package/presets/opencode/next/ai-local/rules-library/agent-pipeline-gates.md +19 -0
  609. package/presets/opencode/next/ai-local/rules-library/analytics-events.md +18 -0
  610. package/presets/opencode/next/ai-local/rules-library/api-contract-source.md +14 -0
  611. package/presets/opencode/next/ai-local/rules-library/artifact-lifecycle.md +17 -0
  612. package/presets/opencode/next/ai-local/rules-library/code-style.md +68 -0
  613. package/presets/opencode/next/ai-local/rules-library/component-child-decomposition.md +81 -0
  614. package/presets/opencode/next/ai-local/rules-library/feature-flags-experiments.md +15 -0
  615. package/presets/opencode/next/ai-local/rules-library/mcp-required-for-ui-layout.md +1 -1
  616. package/presets/opencode/next/ai-local/rules-library/no-react-fc.md +46 -0
  617. package/presets/opencode/next/ai-local/rules-library/no-test-driven-behavior-change.md +1 -1
  618. package/presets/opencode/next/ai-local/rules-library/pwa-service-worker.md +15 -0
  619. package/presets/opencode/next/ai-local/rules-library/qa-test-cases.md +14 -0
  620. package/presets/opencode/next/ai-local/rules-library/router-pages.md +4 -2
  621. package/presets/opencode/next/ai-local/rules-library/single-source-copy-constants.md +3 -1
  622. package/presets/opencode/next/ai-local/rules-library/storybook-catalog-structure.md +62 -0
  623. package/presets/opencode/next/ai-local/rules-library/storybook-cleanup-temp-screenshots.md +40 -0
  624. package/presets/opencode/next/ai-local/rules-library/storybook-csf-authoring.md +100 -0
  625. package/presets/opencode/next/ai-local/rules-library/storybook-dev-compare-figma.md +67 -0
  626. package/presets/opencode/next/ai-local/rules-library/storybook-keep-tests-current.md +75 -0
  627. package/presets/opencode/next/ai-local/rules-library/storybook-modals.md +64 -0
  628. package/presets/opencode/next/ai-local/rules-library/storybook-no-app-node-modules.md +40 -0
  629. package/presets/opencode/next/ai-local/rules-library/storybook-ui-quality-gate.md +38 -0
  630. package/presets/opencode/next/ai-local/rules-library/task-levels.md +28 -0
  631. package/presets/opencode/next/ai-local/rules-library/ui-change-review-gate.md +14 -0
  632. package/presets/opencode/next/hooks/chain-team-phases.sh +46 -1
  633. package/presets/opencode/next/rules/agent-team-orchestrator.md +3 -1
  634. package/presets/opencode/next/rules/ai-local-overlay.md +16 -2
  635. package/presets/opencode/next/rules/code-quality-and-refactoring.md +2 -2
  636. package/presets/opencode/next/rules/code-review-mr.md +11 -7
  637. package/presets/opencode/next/rules/component-catalog-gate.md +31 -0
  638. package/presets/opencode/next/rules/design-tokens-binding.md +1 -1
  639. package/presets/opencode/next/rules/feature-delivery-workflow.md +22 -18
  640. package/presets/opencode/next/rules/forms-validation.md +26 -0
  641. package/presets/opencode/next/rules/mcp-usage.md +1 -0
  642. package/presets/opencode/next/rules/mockup-review.md +1 -1
  643. package/presets/opencode/next/rules/next-app-core.md +3 -0
  644. package/presets/opencode/next/rules/next-static-export.md +28 -0
  645. package/presets/opencode/next/rules/post-change-lint.md +4 -0
  646. package/presets/opencode/next/rules/product-specs-authoring.md +1 -0
  647. package/presets/opencode/next/rules/product-specs.md +1 -0
  648. package/presets/opencode/next/rules/react-next-anti-hallucination.md +10 -0
  649. package/presets/opencode/next/rules/react-ui.md +19 -1
  650. package/presets/opencode/next/rules/reference-features.md +7 -2
  651. package/presets/opencode/next/rules/security-next.md +12 -0
  652. package/presets/opencode/next/rules/store-rtk.md +6 -0
  653. package/presets/opencode/next/rules/tests-e2e-structure.md +2 -1
  654. package/presets/opencode/next/rules/tests-unit.md +1 -0
  655. package/presets/opencode/next/team/fixtures/feature-with-ux-no-figma.json +3 -4
  656. package/presets/opencode/nuxt/adapter-map.json +1 -1
  657. package/presets/opencode/nuxt/agents/accessibility-reviewer.md +2 -2
  658. package/presets/opencode/nuxt/agents/api-contract-reviewer.md +2 -2
  659. package/presets/opencode/nuxt/agents/build-verifier.md +2 -2
  660. package/presets/opencode/nuxt/agents/ci-investigator.md +2 -2
  661. package/presets/opencode/nuxt/agents/code-reviewer.md +2 -2
  662. package/presets/opencode/nuxt/agents/debugger.md +2 -2
  663. package/presets/opencode/nuxt/agents/feature-developer.md +2 -2
  664. package/presets/opencode/nuxt/agents/migration-specialist.md +2 -2
  665. package/presets/opencode/nuxt/agents/mockup-reviewer.md +2 -2
  666. package/presets/opencode/nuxt/agents/openspec-author.md +2 -2
  667. package/presets/opencode/nuxt/agents/performance-auditor.md +2 -2
  668. package/presets/opencode/nuxt/agents/qa-tester.md +2 -2
  669. package/presets/opencode/nuxt/agents/security-reviewer.md +2 -2
  670. package/presets/opencode/nuxt/agents/solution-architect.md +2 -2
  671. package/presets/opencode/nuxt/agents/task-analyst.md +1 -1
  672. package/presets/opencode/nuxt/agents/task-router.md +1 -1
  673. package/presets/opencode/nuxt/agents/tech-writer.md +2 -2
  674. package/presets/opencode/nuxt/agents/unit-test-generator.md +2 -2
  675. package/presets/opencode/nuxt/agents/unit-test-healer.md +2 -2
  676. package/presets/opencode/nuxt/agents/unit-test-planner.md +2 -2
  677. package/presets/opencode/nuxt/rules/agent-team-orchestrator.md +3 -1
  678. package/presets/opencode/nuxt/rules/code-review-mr.md +6 -6
  679. package/presets/opencode/nuxt/rules/feature-delivery-workflow.md +15 -15
  680. package/presets/opencode/nuxt/rules/reference-features.md +2 -2
  681. package/presets/opencode/nuxt/rules/tests-e2e-structure.md +1 -1
  682. package/presets/opencode/php-hexagonal/adapter-map.json +1 -1
  683. package/presets/opencode/php-hexagonal/agents/build-verifier.md +2 -2
  684. package/presets/opencode/php-hexagonal/agents/code-reviewer.md +2 -2
  685. package/presets/opencode/php-hexagonal/agents/feature-developer.md +2 -2
  686. package/presets/opencode/php-hexagonal/agents/openspec-author.md +2 -2
  687. package/presets/opencode/php-hexagonal/agents/task-analyst.md +1 -1
  688. package/presets/opencode/php-hexagonal/agents/task-router.md +1 -1
  689. package/presets/opencode/php-hexagonal/rules/agent-team-orchestrator.md +3 -1
  690. package/presets/opencode/php-hexagonal/rules/code-quality-and-refactoring.md +1 -1
  691. package/presets/opencode/php-laravel/adapter-map.json +1 -1
  692. package/presets/opencode/php-laravel/agents/build-verifier.md +2 -2
  693. package/presets/opencode/php-laravel/agents/code-reviewer.md +2 -2
  694. package/presets/opencode/php-laravel/agents/feature-developer.md +2 -2
  695. package/presets/opencode/php-laravel/agents/openspec-author.md +2 -2
  696. package/presets/opencode/php-laravel/agents/task-analyst.md +1 -1
  697. package/presets/opencode/php-laravel/agents/task-router.md +1 -1
  698. package/presets/opencode/php-laravel/rules/agent-team-orchestrator.md +3 -1
  699. package/presets/opencode/php-laravel/rules/code-quality-and-refactoring.md +1 -1
  700. package/presets/opencode/svelte/adapter-map.json +1 -1
  701. package/presets/opencode/svelte/agents/accessibility-reviewer.md +2 -2
  702. package/presets/opencode/svelte/agents/api-contract-reviewer.md +2 -2
  703. package/presets/opencode/svelte/agents/build-verifier.md +2 -2
  704. package/presets/opencode/svelte/agents/ci-investigator.md +2 -2
  705. package/presets/opencode/svelte/agents/code-reviewer.md +2 -2
  706. package/presets/opencode/svelte/agents/debugger.md +2 -2
  707. package/presets/opencode/svelte/agents/feature-developer.md +2 -2
  708. package/presets/opencode/svelte/agents/migration-specialist.md +2 -2
  709. package/presets/opencode/svelte/agents/mockup-reviewer.md +2 -2
  710. package/presets/opencode/svelte/agents/openspec-author.md +2 -2
  711. package/presets/opencode/svelte/agents/performance-auditor.md +2 -2
  712. package/presets/opencode/svelte/agents/qa-tester.md +2 -2
  713. package/presets/opencode/svelte/agents/security-reviewer.md +2 -2
  714. package/presets/opencode/svelte/agents/solution-architect.md +2 -2
  715. package/presets/opencode/svelte/agents/task-analyst.md +1 -1
  716. package/presets/opencode/svelte/agents/task-router.md +1 -1
  717. package/presets/opencode/svelte/agents/tech-writer.md +2 -2
  718. package/presets/opencode/svelte/agents/unit-test-generator.md +2 -2
  719. package/presets/opencode/svelte/agents/unit-test-healer.md +2 -2
  720. package/presets/opencode/svelte/agents/unit-test-planner.md +2 -2
  721. package/presets/opencode/svelte/rules/agent-team-orchestrator.md +3 -1
  722. package/presets/opencode/svelte/rules/code-review-mr.md +6 -6
  723. package/presets/opencode/svelte/rules/feature-delivery-workflow.md +1 -1
  724. package/presets/opencode/svelte/rules/reference-features.md +2 -2
  725. package/presets/opencode/svelte/rules/tests-e2e-structure.md +1 -1
  726. package/scripts/check-generated-drift.mjs +42 -2
  727. package/scripts/check-local-overlay.sh +39 -0
  728. package/scripts/fixtures/cli-golden/claude/next.json +44 -41
  729. package/scripts/fixtures/cli-golden/cursor/next.json +69 -46
  730. package/scripts/fixtures/cli-golden/mavis/android-kotlin.json +21 -21
  731. package/scripts/fixtures/cli-golden/mavis/go.json +8 -8
  732. package/scripts/fixtures/cli-golden/mavis/ios-swift.json +12 -12
  733. package/scripts/fixtures/cli-golden/mavis/java.json +8 -8
  734. package/scripts/fixtures/cli-golden/mavis/mcp-ts.json +5 -5
  735. package/scripts/fixtures/cli-golden/mavis/next.json +70 -47
  736. package/scripts/fixtures/cli-golden/mavis/nuxt.json +25 -25
  737. package/scripts/fixtures/cli-golden/mavis/php-hexagonal.json +8 -8
  738. package/scripts/fixtures/cli-golden/mavis/php-laravel.json +8 -8
  739. package/scripts/fixtures/cli-golden/mavis/svelte.json +25 -25
  740. package/scripts/fixtures/cli-golden/opencode/android-kotlin.json +21 -21
  741. package/scripts/fixtures/cli-golden/opencode/go.json +8 -8
  742. package/scripts/fixtures/cli-golden/opencode/ios-swift.json +12 -12
  743. package/scripts/fixtures/cli-golden/opencode/java.json +8 -8
  744. package/scripts/fixtures/cli-golden/opencode/mcp-ts.json +5 -5
  745. package/scripts/fixtures/cli-golden/opencode/next.json +70 -47
  746. package/scripts/fixtures/cli-golden/opencode/nuxt.json +25 -25
  747. package/scripts/fixtures/cli-golden/opencode/php-hexagonal.json +8 -8
  748. package/scripts/fixtures/cli-golden/opencode/php-laravel.json +8 -8
  749. package/scripts/fixtures/cli-golden/opencode/svelte.json +25 -25
  750. package/scripts/lib/generate-adapter-common.mjs +17 -0
  751. package/scripts/lib/generate-mavis-adapter.mjs +9 -3
  752. package/scripts/lib/generate-opencode-adapter.mjs +9 -3
@@ -0,0 +1,100 @@
1
+ globs: storybook/**/*.stories.tsx, storybook/**/*.fixtures.ts, storybook/**/*.fixtures.data.ts, storybook/**/*.stories.meta.ts
2
+
3
+ ## Body
4
+
5
+ # Storybook CSF authoring
6
+
7
+ When editing CSF/fixtures, acknowledge: `Using .ai.local: storybook-csf-authoring(, …)*`.
8
+
9
+ ## CSF3 skeleton
10
+
11
+ ```tsx
12
+ import type { Meta, StoryObj } from '@storybook/react';
13
+
14
+ const meta = {
15
+ title: 'UI/Pages/ExamplePage',
16
+ component: ExamplePage,
17
+ tags: ['test', 'snapshot'],
18
+ decorators: [withStoreProvider({ preloadedState })],
19
+ parameters: { layout: 'fullscreen', viewport: { defaultViewport: 'desktop' } },
20
+ } satisfies Meta<typeof ExamplePage>;
21
+
22
+ export default meta;
23
+ type TStory = StoryObj<typeof meta>;
24
+
25
+ /** S01 — default loaded state */
26
+ export const Default: TStory = { /* … */ };
27
+ ```
28
+
29
+ ## Imports
30
+
31
+ - Production: `@/ui/...`, `@/store/...`, `@/types/...`.
32
+ - Storybook: the project's shared decorators/helpers (`withStoreProvider`, `withGreyCanvas`, `withStorybookSearchParams`, `withDocumentReferrer`), the shared MSW helper, and the test utilities (`expect`, `within`, `userEvent`, `fn`, `waitFor`).
33
+ - Play helpers: co-locate in `*.stories.meta.ts` or `*.fixtures.ts` — do not duplicate selectors.
34
+
35
+ ## Data & decorators
36
+
37
+ - MSW: `parameters: { ...storyMsw(handlers) }` from the shared MSW helper.
38
+ - Store: `decorators: [withStoreProvider({ preloadedState })]` — use fixture builders.
39
+ - Search params: `withStorybookSearchParams({ key: 'value' })`.
40
+ - Browser globals (render-time): `withDocumentReferrer('')` — `document.referrer` and in-app list session signals are **story fixtures**, not play-only setup. Reset session keys when production reads them at render.
41
+ - White-card isolated blocks **only** (a solid white surface token): `withGreyCanvas`. Do not use on grey primary/secondary roots.
42
+ - **Never** `parameters.nextjs.appDirectory`. Do not null-guard production `useSearchParams`.
43
+
44
+ ## Fixtures
45
+
46
+ Split: handlers/ids (`*.fixtures.ts`), static data (`*.fixtures.data.ts`), play constants (`*.stories.meta.ts`).
47
+ Reuse page fixtures before inventing ids. Document story-local id ranges in the README.
48
+
49
+ ## One CSF file per `title` (strict)
50
+
51
+ Allowed: `PageName.stories.tsx`, `Components/<Block>.stories.tsx`, `modals/<Domain>/<Modal>.stories.tsx`.
52
+
53
+ **Forbidden:**
54
+
55
+ - New `*.p1.stories.tsx`, `*.p2.stories.tsx`, or any `*.pN.stories.tsx`.
56
+ - Adding exports to existing p1/p2 files.
57
+ - Numbered overflow siblings sharing the same `title`.
58
+
59
+ Existing p1/p2 in a repo are **legacy — do not copy or extend**. If the main file is large, extract a page block into `Components/` (new `title`).
60
+
61
+ ## No mobile/viewport duplicates (strict)
62
+
63
+ One desktop canvas per logical state; reviewers use the Storybook viewport toolbar.
64
+
65
+ **Ban:** `export const Mobile*`, `Mobile_*`, `defaultViewport: 'mobile1'` / `'mobile2'`, `isMobile: true` preloads, `*MobileMediaPreload` fixtures, dedicated `*Mobile*.stories.tsx` for viewport variants.
66
+
67
+ **Keep only** product UI whose name is Mobile (a distinct component, not a second viewport of a page).
68
+
69
+ ## Play vs visual
70
+
71
+ - Every snapshot story has a `play` asserting primary `data-testid`s or visible copy.
72
+ - Call the visual-settle helper after icon/header paint (~300ms) when flaking — use it on isolated blocks/modals with masked icons before vis.
73
+ - Portals: assert `within(canvasElement.ownerDocument.body)`.
74
+ - **Loading / spinner vis:** preload the store slice (`loadingStatus: 'loading'`) or MSW `delay('infinite')`. **Forbidden:** click download/submit then vis the in-flight frame without pinning the request.
75
+ - Freeze animations only on spinner/QR/skeleton stories, as the last line of `play`; then `--update -t` that story only.
76
+ - **Intentional** `LoadFailed` export (MSW 500) ≠ an accidental "failed to load the page" (missing API mocking).
77
+
78
+ ## Tags & layout
79
+
80
+ - `tags: ['test', 'snapshot']` on visual catalog entries.
81
+ - Page: `layout: 'fullscreen'`, `viewport.defaultViewport: 'desktop'`.
82
+ - Isolated block: `layout: 'centered'` unless the block needs width.
83
+
84
+ ## Grey canvas (white cards only)
85
+
86
+ Apply the grey-canvas decorator **only** when the production root is a solid white surface. Use the project's grey-surface token. Never hex.
87
+
88
+ ```tsx
89
+ import { withGreyCanvas } from '<shared-decorators>' // adjust depth
90
+
91
+ decorators: [withGreyCanvas], // outer; width shells stay inside
92
+ ```
93
+
94
+ **Do not apply** when the root is already grey, transparent, a fullscreen page, or a modal. Grey-on-grey hides radius and rest/hover fills.
95
+
96
+ **Forbidden:** `parameters.backgrounds` hex lists; a grey wrapper the same size as the card (edge still invisible).
97
+
98
+ ## After batch
99
+
100
+ Mandatory: **`storybook-ui-quality-gate`** — preview stories, compare canvas vs mockup, then run story tests. Then **`storybook-keep-tests-current`**: fix play/fixtures, targeted vitest, `--update` vis after intentional visual changes, re-run green. Then **`storybook-cleanup-temp-screenshots`** — delete dump PNGs from this turn; do not commit them.
@@ -0,0 +1,67 @@
1
+ globs: app/src/ui/**/*.tsx, app/src/ui/**/*.ts, storybook/stories/**/*.stories.tsx
2
+
3
+ ## Body
4
+
5
+ # Storybook dev-time Figma visual compare (mandatory)
6
+
7
+ When this rule applies, acknowledge: `Using .ai.local: storybook-dev-compare-figma(, …)*`.
8
+
9
+ While implementing or refactoring `app/src/ui/**` (new component, visual/interaction change, layout, styles, copy, hover/open), the **source of visual truth is Figma** — not Storybook vis-baselines. Vis-baselines are a **regression detector** (they catch "you broke what was working"), not a design spec (they do not validate "this matches the Figma mockup"). They can lock in a wrong implementation as the baseline if `--update` is run before the implementation is correct.
10
+
11
+ This rule makes the dev-loop **mandatory** and forbids the failure mode where an agent captures a `--update` baseline against a wrong implementation, the wrong implementation becomes the "correct" baseline, and the next round of changes is compared against the wrong baseline — drift is hidden forever.
12
+
13
+ ## The required loop (every visual change)
14
+
15
+ 1. **Read Figma first** — `figma_get_metadata` for the node structure, `figma_get_design_context` for the actual styles/tokens, `figma_get_variable_defs` for design tokens, `figma_get_screenshot` for the visual reference. Do not pick the wrong reference node (e.g. a wrapper frame instead of the card component). Pick the **innermost** matching node.
16
+ 2. **Implement to spec** — every token (color, padding, gap, font, radius) must come from `figma_get_design_context` / `figma_get_variable_defs`, not from memory or from guessing. If a style is not in the Figma spec, the implementation is wrong; do not invent.
17
+ 3. **Open the story in a browser** — navigate to the story URL (e.g. `http://localhost:6006/?path=/story/<story-id>`). If Storybook is not running, start it with `yarn storybook` from `storybook/`.
18
+ 4. **Take a screenshot** — of the **opened dialog / visible state**, not the Storybook iframe placeholder.
19
+ 5. **Visual compare with Figma** — open the Figma screenshot in the same view (saved PNG of the Figma node). Compare element-by-element:
20
+ - Title (font, size, weight, color, line-height, letter-spacing)
21
+ - Subtitle / supporting text (same)
22
+ - Container (background, border, radius, padding, gap)
23
+ - Icon (image content, size, container styling)
24
+ - Status / state (text + color)
25
+ - Disclosure / actions (icon, size, position)
26
+ - Hover state (compare in both the Figma "Hover" variant AND Storybook hover)
27
+ 6. **Diff and fix** — if the Storybook render does not match the Figma, fix the production code (or fixture, if the data was wrong) and re-screenshot. Do not `--update` the baseline until the Figma match is confirmed by a human-readable visual side-by-side.
28
+ 7. **Only then `--update`** — `yarn vitest run --project=storybook <path> --update` records the now-correct baseline. After the rewrite, run **without** `--update` once to confirm the new baseline is stable.
29
+
30
+ ## Why baselines are NOT enough
31
+
32
+ A baseline is a pixel diff against an existing image. If the existing image is wrong, the baseline silently approves future wrongness.
33
+
34
+ The failure mode this guards against: an agent implements UI with wrong border, wrong icon, wrong font, and wrong background; captures a `--update` baseline; vis-tests go green. The next round tightens tokens but keeps the wrong icon; `--update` again; still green. An operator later opens the story and it looks nothing like Figma. The "green" vis-tests had been comparing to a wrong baseline for two rounds.
35
+
36
+ The fix is not "more `--update` discipline". The fix is a **mandatory dev-time visual compare with Figma** before any `--update`.
37
+
38
+ ## Forbidden
39
+
40
+ - Running `yarn vitest -u` against a story that has not been visually compared with Figma in the current session.
41
+ - "Vis-tests are green" used as evidence the UI matches Figma.
42
+ - Comparing only via a single Figma screenshot and then trusting memory for the rest of the change.
43
+ - Using a Figma screenshot of a **different node** as the reference (e.g. the outer modal instead of the card component, the empty state instead of the loaded state, the desktop variant instead of the mobile variant).
44
+ - Skipping the dev-time compare and relying on the operator to spot drift after the fact.
45
+
46
+ ## Required when
47
+
48
+ Mandatory for any change under `app/src/ui/**` that affects:
49
+
50
+ - Layout, padding, gap, alignment
51
+ - Typography (font, size, weight, color)
52
+ - Color, background, border, radius, shadow
53
+ - Icon / image / illustration
54
+ - Hover / open / focused / error / empty / loading visual states
55
+ - Storybook vis-baseline first capture (`--update`) or any intentional change to baselines
56
+
57
+ ## MCP wiring
58
+
59
+ - `chrome-devtools_*` (in the session MCP catalog) is the preferred browser navigation / screenshot tool for the dev-time compare. If it is `error` / `needsAuth` / `loading`, **stop** and report the block, do not approximate.
60
+ - `playwright` MCP can be used as a substitute **only if** `chrome-devtools` is unavailable — but `chrome-devtools` is preferred because it gives a real DOM + screenshot of the running app.
61
+ - A `localhost:6006` reached via a browser MCP is the right way; a screenshot of the production Next.js route is **not** an acceptable substitute (per `mcp-required-for-ui-layout.md`).
62
+
63
+ ## Reference
64
+
65
+ - `storybook-ui-quality-gate.md` — this rule makes its "compare with mockup" step mandatory and dev-time, not at-the-end.
66
+ - `storybook-keep-tests-current.md` — the post-change half (play + baseline refresh); this rule is the pre-`--update` half.
67
+ - `mcp-required-for-ui-layout.md` — Figma + Storybook MCP gate.
@@ -0,0 +1,75 @@
1
+ globs: storybook/**/*.stories.tsx, storybook/**/*.fixtures.ts, storybook/**/*.fixtures.data.ts, storybook/**/*.stories.meta.ts, storybook/stories/**/README.md, app/src/ui/**/*.tsx, app/src/ui/**/*.ts
2
+
3
+ ## Body
4
+
5
+ # Storybook keep tests current
6
+
7
+ When this rule applies, acknowledge: `Using .ai.local: storybook-keep-tests-current(, …)*`.
8
+
9
+ ## When (mandatory)
10
+
11
+ Storybook tests and vis baselines are **part of the change**. Do not finish with red or stale snapshots.
12
+
13
+ Triggers:
14
+
15
+ 1. Add or edit a story, fixture, `*.stories.meta.ts`, or page Storybook README.
16
+ 2. Change production UI a story imports (`app/src/ui/**`) — layout, styles, copy, `data-testid`, states. New/refactored UI must already have stories via **`storybook-ui-quality-gate`** (preview vs mockup); this rule is the test/baseline half.
17
+ 3. Change mocks / domain / store fields that stories preload — grep `storybook/stories` and apply this gate.
18
+
19
+ Leaving play broken or skipping `--update` after an intentional visual change is incomplete work.
20
+
21
+ ## Find related stories
22
+
23
+ Grep `storybook/stories` for the component name and its import. Cover **all** hits: page, `Components/<Block>`, cards, modals — not only the file you opened. Check the page `README.md` state map.
24
+
25
+ ## Keep working
26
+
27
+ - **Play:** selectors, copy, `data-testid`s, settle/portal helpers must match the new UI.
28
+ - **Fixtures / MSW / preloadedState:** match domain after mapper or store changes.
29
+ - New production visual state → new story export (catalog structure). Removed UI → delete or retarget the story.
30
+ - Page `README.md`: state → export → fixture id.
31
+
32
+ **Forbidden:** commenting out `play`; dropping `test` / `snapshot` tags to silence failures; ignoring vis drift.
33
+
34
+ ## Computed copy & browser fixtures
35
+
36
+ When play asserts **visible copy** that production derives from `document.referrer`, sessionStorage, in-app signals, or i18n: stub those inputs in a **decorator** (sync before mount). Play is too late.
37
+
38
+ - Do not treat a hard-coded label as a stable selector when the same `data-testid` can show two production strings. Assert the variant's **inputs** first, then the copy.
39
+ - After adding/changing a story that depends on browser document state, grep production for `document.referrer` / session keys used at render.
40
+
41
+ ## Play queries & timeouts
42
+
43
+ - Static shells (no fetch): prefer `getByTestId` / `getByRole` so a missing node fails immediately, not `Test timed out in 30000ms`.
44
+ - `findBy*` / `waitFor` only when UI is actually async (MSW, loader). Cap timeout (e.g. 3–5s). Never wait for a testid that production does not mount without mocks.
45
+ - Vitest `testTimeout` includes the vis auto-snapshot `afterEach`. A 30s timeout on a story with a tiny `play` is often vis (icon masks, large SVG, full header/footer), not a missing node. Isolated green + full-suite 30s timeout → cap the wait, do not raise `testTimeout`.
46
+ - Any `new Image()` / mask-URL wait **must** have a 3–5s cap. Unbounded `Image()` → full-suite hang while isolated still passes.
47
+ - **Vis loading race:** a `userEvent.click` that dispatches an unmocked thunk (download, fetch) → vis captures spinner **or** idle. Pin the frame: preload the store slice (`loadingStatus: 'loading'`) or MSW `delay('infinite')`. **Forbidden:** click-then-snapshot an in-flight request.
48
+
49
+ ## Run (from `storybook/`)
50
+
51
+ Targeted path only — do not `--update` the whole catalog.
52
+
53
+ ```bash
54
+ yarn vitest run --project=storybook <path>
55
+ ```
56
+
57
+ Play / fixture failures: **fix CSF**, then re-run. Do not `--update` to hide a broken `play`.
58
+
59
+ After an **intentional** visual change, refresh baselines (`--update` **after** the path):
60
+
61
+ ```bash
62
+ yarn vitest run --project=storybook <path> --update
63
+ yarn vitest run --project=storybook <path> -t '<Story name>' --update
64
+ ```
65
+
66
+ `--update` on a **file path** rewrites **every** export in that file. A spinner/animation-freeze story can recapture siblings not yet painted. Use `-t '<Story name>'` for one snapshot. Review each rewritten PNG; do not blind-accept.
67
+
68
+ Re-run **without** `--update` until exit 0. After a vis/timeout flake: re-run the **originally failing files together** (isolated green ≠ full-suite green).
69
+
70
+ ## Baselines
71
+
72
+ - Local: `storybook/__vis__/local` (gitignored) — still refresh so the next local run is green.
73
+ - CI: `storybook/__vis__/<platform>/__baselines__` — add when those files exist in git.
74
+ - Done only when targeted vitest is green **without** `--update`.
75
+ - Done only after **`storybook-cleanup-temp-screenshots`**: no leftover dump PNGs from this turn.
@@ -0,0 +1,64 @@
1
+ globs: storybook/stories/modals/**
2
+
3
+ ## Body
4
+
5
+ # Storybook modals catalog
6
+
7
+ When editing modal stories, acknowledge: `Using .ai.local: storybook-modals(, …)*`.
8
+
9
+ ## Scope
10
+
11
+ - Isolated modal components only — no page underlay.
12
+ - No "card wrapper" stories when `UI/Modals/...` already covers the trigger (see the modals README reuse table).
13
+ - A component-catalog open-by-default `ConfirmModal` is a component-catalog exception — **do not copy** that pattern here.
14
+
15
+ ## Title & path
16
+
17
+ - Title: `UI/Modals/<Domain>/<ModalName>` matching `storybook/stories/modals/<Domain>/`.
18
+ - Never place modal titles under `UI/Pages/` or `UI/Components/`.
19
+
20
+ ## Closed by default
21
+
22
+ First paint shows a labeled trigger (`BasicButton`), not an open dialog.
23
+
24
+ - Trigger: a stable `data-testid` (e.g. `modal-story__open-trigger`).
25
+ - **Forbidden:** always-open default export; snapshot variants that skip the closed state unless separately named + justified in README.
26
+
27
+ ## Render helpers
28
+
29
+ From the shared modal decorators module:
30
+
31
+ - `createReduxModalStoryRender` — dispatch prod open actions from a closed `preloadedState`.
32
+ - `createLocalModalStoryRender` — `useState(isOpen)` harness.
33
+ - A `ModalStoryShell` wrapper; pass `isMounted` when prod conditionally mounts the modal.
34
+
35
+ ## Play sequence
36
+
37
+ 1. `expectNoModalDialog`
38
+ 2. `clickModalStoryTrigger`
39
+ 3. `expectVisibleTextInModal` / `expectVisibleTestIdInModal`
40
+ 4. Close via prod affordances (overlay, cancel/confirm) — no story-only close button.
41
+
42
+ Portals: assert `within(canvasElement.ownerDocument.body)`.
43
+
44
+ ## Visual
45
+
46
+ Vis addon snapshots **after** play (opened dialog + trigger). Document per-modal exceptions (e.g. a modal that closes after confirm).
47
+
48
+ - After open + copy assertions: call the visual-settle helper when the dialog has masked icons. Isolated green + full-suite `Test timed out in 30000ms` → vis afterEach / unbounded icon wait, not a missing node.
49
+ - Do not add `new Image()` / mask waits without a 3–5s cap.
50
+ - Do not raise story `testTimeout` to hide a CDN hang.
51
+
52
+ After add/edit/UI refactor: **`storybook-ui-quality-gate`** (preview vs mockup) then **`storybook-keep-tests-current`** — play + `--update` + re-run green.
53
+
54
+ ## MSW / store / query-open
55
+
56
+ - Fetch-on-mount: shared MSW helper + store provider (same as pages).
57
+ - Postpayment / query-open modals: shell-controlled `isOpen` + `withStorybookSearchParams` when prod uses query params.
58
+
59
+ ## Forbidden
60
+
61
+ - Always-open default export.
62
+ - Duplicate card modals under `modals/` when listed in the modals README reuse table.
63
+ - Viewport-duplicate modal stories (`Mobile*`, `defaultViewport: 'mobile*'`).
64
+ - New `*.pN.stories.tsx` overflow files — one CSF per modal `title`.
@@ -0,0 +1,40 @@
1
+ glob: always
2
+
3
+ ## Body
4
+
5
+ # Storybook must not resolve packages from app/node_modules
6
+
7
+ When this rule applies, acknowledge: `Using .ai.local: storybook-no-app-node-modules`.
8
+
9
+ ## Rule
10
+
11
+ When Storybook lives in its own package (`storybook/package.json`, `storybook/yarn.lock`, `storybook/node_modules`), it **must not** load npm dependencies from the app's `node_modules`.
12
+
13
+ Categorical. Missing a design-system package, "versions match `app/`", ESLint plugin lookup, a Vite alias, or a Docker `COPY` of `app/node_modules` do not waive it. Do not cite an existing violation as a pattern to copy.
14
+
15
+ ## Forbidden
16
+
17
+ Any mechanism that makes Storybook (dev, build, test, lint, typecheck, Docker) import an installed package from `app/node_modules`:
18
+
19
+ - Vite/webpack `resolve.alias`, `resolve.modules`, `optimizeDeps`, `dedupe`, or a plugin `resolveId` aimed at `app/node_modules` / `../app/node_modules`.
20
+ - `paths` in any `storybook/**/tsconfig*.json` that point at `../app/node_modules/**`.
21
+ - `NODE_PATH`, yarn/npm/pnpm link, workspace hoisting, or a symlink from `storybook/node_modules` into `app/node_modules`.
22
+ - Docker `COPY`, volume, or bind-mount of `app/node_modules` into a Storybook stage or image.
23
+ - ESLint, Stylelint, Vitest, or another Storybook tool resolving plugins or packages from `app/node_modules`.
24
+
25
+ ## Allowed
26
+
27
+ Application **source and static files**, not installed packages:
28
+
29
+ - `@/` → `app/src/**`
30
+ - `app/next.config.ts`, `app/environment.d.ts`, `app/public/**`, `app/src/assets/**`
31
+
32
+ `server.fs.allow` may include `app/` so Vite can read that source. It must not be used to import from `app/node_modules`.
33
+
34
+ ## If a package is missing
35
+
36
+ Add it to `storybook/package.json`, install it into `storybook/node_modules`, and align the version with `app/package.json`. Do not alias it into `app/node_modules`.
37
+
38
+ ## Known violations — do not extend
39
+
40
+ Existing aliases, `paths`, and Docker `COPY` sites that resolve through `app/node_modules` today are violations, not a pattern. A change that edits one of those sites removes that `app/node_modules` binding in the same change.
@@ -0,0 +1,38 @@
1
+ glob: always
2
+
3
+ ## Body
4
+
5
+ # Storybook UI quality gate
6
+
7
+ When this rule applies, acknowledge: `Using .ai.local: storybook-ui-quality-gate(, …)*`.
8
+
9
+ Storybook is the **mandatory** surface for developing and refactoring UI. Use it to compare the canvas with the mockup and to control visual/interaction quality. A Next.js route screenshot, source-only review, or unit tests without stories is **not** enough.
10
+
11
+ ## When (mandatory)
12
+
13
+ Triggers:
14
+
15
+ 1. New page, block, modal, or reusable component (`app/src/ui/**`).
16
+ 2. Visual or interaction refactor — layout, styles, tokens, copy, hover/open, empty/error/loading.
17
+ 3. Existing UI that already has stories (then also **`storybook-keep-tests-current`**).
18
+
19
+ **Skip:** types / API / store / mocks with **no** render or style change.
20
+
21
+ ## Loop (do not skip steps)
22
+
23
+ 1. **Before UI code:** read the Storybook story instructions (Storybook MCP) if available. Copy the nearest analog CSF. If the brief has a `figma.com` URL, keep that node as the visual SoT.
24
+ 2. **Stories with the UI — not after.** Cover **every implemented visual state** (see `storybook-catalog-structure`). New state without an export is incomplete work.
25
+ 3. **Compare with mockup:** preview the stories and open **every** returned URL. Side-by-side story canvas vs Figma (or vs AC / `ux-design.md` when there is no Figma). Check spacing, tokens, typography, empty/error/loading, hover/open. Use the viewport **toolbar** — no `Mobile*` duplicate stories.
26
+ 4. **Quality:** run the story tests, then **`storybook-keep-tests-current`** (play + vis green without `--update`). Then **`storybook-cleanup-temp-screenshots`**.
27
+
28
+ Mismatch with the mockup → fix **production** (or the fixture if data was wrong), then preview again. Do not "accept" drift.
29
+
30
+ MCP down: `yarn storybook` + folder README analog; still visually review the canvas and run vitest from `storybook/`.
31
+
32
+ ## Forbidden
33
+
34
+ - Shipping UI without stories for new/changed visual states.
35
+ - "Looks fine on the Next.js page" without Storybook preview.
36
+ - Skipping preview / story tests when MCP is up.
37
+ - Treating Storybook as post-hoc docs after the feature is "done".
38
+ - Closing the task while canvas ≠ mockup for a state that was in scope.
@@ -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`.
@@ -119,7 +119,21 @@ function mutateMetrics(mutator) {
119
119
  try { metrics = JSON.parse(fs.readFileSync(METRICS_PATH, 'utf8')); } catch {
120
120
  const runId = status.metricsRunId || `${slug}-${Date.now()}-${Math.random().toString(16).slice(2)}`;
121
121
  status.metricsRunId = runId;
122
- metrics = { schemaVersion: 1, task: { runId, slug, preset: 'ai-rules', stack: STACK, platform: PLATFORM, intent: status.intent || 'unknown', profile: 'unknown' }, events: [] };
122
+ // Resolve profile from pipeline.json (preferred) or status.json, falling back to 'unknown'.
123
+ // The router/agent must never write profile into status.json — pipeline.json is the SoT.
124
+ let profile = 'unknown';
125
+ try {
126
+ if (fs.existsSync(pipelinePath)) {
127
+ const pipe = JSON.parse(fs.readFileSync(pipelinePath, 'utf8'));
128
+ if (pipe && (pipe.profile === 'light' || pipe.profile === 'standard' || pipe.profile === 'full')) {
129
+ profile = pipe.profile;
130
+ }
131
+ }
132
+ } catch {}
133
+ if (profile === 'unknown' && (status.profile === 'light' || status.profile === 'standard' || status.profile === 'full')) {
134
+ profile = status.profile;
135
+ }
136
+ metrics = { schemaVersion: 1, task: { runId, slug, preset: 'ai-rules', stack: STACK, platform: PLATFORM, intent: status.intent || 'unknown', profile }, events: [] };
123
137
  metrics.events.push({ eventId: `${runId}:task_started`, type: 'task_started', at: now, source: 'hook', attributionConfidence: 'high' });
124
138
  }
125
139
  mutator(metrics);
@@ -205,9 +219,33 @@ function readBoundReceiptOutcome(agent, step, resolved) {
205
219
  if (!fs.existsSync(manifestPath)) return { outcome: null, receiptRequired: false };
206
220
  try {
207
221
  const manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf8'));
222
+ // Guard: the schema key is `artifacts` (see agent-artifact-contracts.md). A top-level
223
+ // `entries` key is a silent bug — producer wrote to a wrong field, hook would not
224
+ // see the receipt, and the step hangs in `awaiting_artifact_receipt`. Warn loudly.
225
+ if (manifest && typeof manifest === 'object' && !Array.isArray(manifest.artifacts) && Array.isArray(manifest.entries)) {
226
+ process.stderr.write(`WARNING: ${manifestPath} has top-level "entries" but no "artifacts" array; reading only "artifacts" per schema. The producer likely upserted into the wrong key. See agent-artifact-contracts.md (Schema field name).` + '\n');
227
+ } else if (manifest && typeof manifest === 'object' && Array.isArray(manifest.entries) && Array.isArray(manifest.artifacts)) {
228
+ process.stderr.write(`WARNING: ${manifestPath} has both "artifacts" and "entries" keys; reading only "artifacts" per schema. Foreign "entries" content is ignored.` + '\n');
229
+ }
208
230
  const artifacts = Array.isArray(manifest.artifacts) ? manifest.artifacts : [];
209
231
  const expectedOutputId = artifactOutputIdFor(step, agent);
210
232
  const attemptStartedAt = Date.parse(resolved.entry.startedAt);
233
+ // Pre-scan: warn on the silent-bug classes the filter below would otherwise drop.
234
+ // A receipt with a non-matching attemptId is dropped silently; without this warning,
235
+ // the step hangs in `awaiting_artifact_receipt` with no signal of why. Same for
236
+ // receipts whose terminal timestamp is older than the active attempt (stale retry).
237
+ const activeIds = new Set(Object.keys(status.activeAttempts || {}));
238
+ for (const entry of artifacts) {
239
+ if (!entry || entry.producer !== agent || !entry.receipt || typeof entry.receipt.outcome !== 'string') continue;
240
+ const rid = entry.receipt.attemptId;
241
+ if (typeof rid === 'string' && rid !== resolved.attemptId && !activeIds.has(rid)) {
242
+ process.stderr.write(`WARNING: ${manifestPath} receipt for producer "${agent}" id "${entry.id}" carries attemptId "${rid}" that does not match the active attempt "${resolved.attemptId}". The receipt is being dropped; step will hang in \`awaiting_artifact_receipt\` unless the producer retries. Common cause: agent reused an attemptId from a prior failed attempt. See agent-artifact-contracts.md (Receipt binding).` + '\n');
243
+ }
244
+ const terminalAt = Date.parse(entry.timestamps?.completedAt || entry.timestamps?.updatedAt || '');
245
+ if (Number.isFinite(attemptStartedAt) && Number.isFinite(terminalAt) && terminalAt < attemptStartedAt) {
246
+ process.stderr.write(`WARNING: ${manifestPath} receipt for producer "${agent}" id "${entry.id}" has timestamps.completedAt older than the active attempt's startedAt. Likely a stale receipt from a previous attempt; it is being dropped. See agent-artifact-contracts.md (Receipt binding).` + '\n');
247
+ }
248
+ }
211
249
  const owned = artifacts
212
250
  .filter((entry) => {
213
251
  if (!entry || entry.producer !== agent || !entry.receipt || typeof entry.receipt.outcome !== 'string') return false;
@@ -222,6 +260,13 @@ function readBoundReceiptOutcome(agent, step, resolved) {
222
260
  const tb = Date.parse(b.timestamps?.completedAt || b.timestamps?.updatedAt || 0) || 0;
223
261
  return tb - ta;
224
262
  });
263
+ // Bonus: warn if the active attempt's receipts all lack attemptId in a non-parallel step.
264
+ // The orchestrator always provides attemptId, so a missing one means the agent dropped it
265
+ // (model output, JSON.stringify omission, etc.). boundByOutput still binds the receipt by
266
+ // expectedOutputId, so this is not fatal — but it is a contract violation worth flagging.
267
+ if (owned.length > 0 && owned[0].receipt.attemptId == null && !(step && step.parallel && Array.isArray(getStepAgents(step)) && getStepAgents(step).length > 1)) {
268
+ process.stderr.write(`WARNING: ${manifestPath} receipt for producer "${agent}" id "${owned[0].id}" lacks entry.receipt.attemptId on a non-parallel step. The receipt is bound by output-id fallback; the agent should always include the attemptId the orchestrator provides. See agent-artifact-contracts.md (Receipt binding).` + '\n');
269
+ }
225
270
  return { outcome: owned[0]?.receipt?.outcome || null, receiptRequired: true };
226
271
  } catch {
227
272
  return { outcome: null, receiptRequired: false };
@@ -109,7 +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
- - Agents upsert only entries they own and preserve foreign entries. 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.
113
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.
114
114
  - Missing/stale manifests are reported as a handoff gap; fall back to `brief.md`, `decomposition.md`, and `pipeline.json` rather than inventing authority.
115
115
 
@@ -145,6 +145,8 @@ Each slug has one `artifact-manifest.json` at `.ai.local/team/tasks/<slug>/`. Th
145
145
  | `awaiting_approval` | Human gate; wait for `/task-continue` |
146
146
  | `changes_requested` | Reviewer blocked; re-run developer (`retryAfterFix`) |
147
147
  | `validation_failed` | build-verifier failed; re-run developer then build-verifier |
148
+ | `blocked` | Pipeline / step cannot proceed (e.g. `pipeline_parse_error`, completion of a parallel step whose producer's receipt was missing — see `agent-artifact-contracts.md` § Completion receipts) |
149
+ | `awaiting_artifact_receipt` | Producer stopped but the bound or assigned-output receipt was missing or stale; hook keeps the attempt active and does not advance. See `agent-artifact-contracts.md` (Schema field name + Receipt binding) for the silent-bug class that lands here. |
148
150
 
149
151
  On each `subagentStop`, the hook reconciles `status.state` from the completing producer's terminal `artifact-manifest.json` receipt (`completed` \| `changes_requested` \| `validation_failed`) when agents left lifecycle fields untouched. Parent orchestrators must wait for that handoff before invoking the next step.
150
152
 
@@ -7,8 +7,9 @@ This rule is mandatory. **You MUST** obey it on every turn, without exception.
7
7
  1. **Probe** — before answering, run `ls -la .ai.local` from the repository root.
8
8
  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.
9
9
  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.
10
- 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.
11
- 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.
10
+ 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.
11
+ 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.
12
+ 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.
12
13
 
13
14
  If `.ai.local/` does not exist → **no-op**, do not error. Do not produce any log line about its absence.
14
15
 
@@ -24,6 +25,18 @@ Each `.ai.local/rules/<name>.md` is a plain-markdown rule body. The model parses
24
25
 
25
26
  Keep files ≤ 120 lines. Match the style of preset rules (short sections, bullets, code examples).
26
27
 
28
+ ## What `init` overwrites vs preserves
29
+
30
+ `init` manages the tool trees; they are **not** the home of durable project config.
31
+
32
+ | Overwritten / merged by `init` | Preserved |
33
+ |---|---|
34
+ | `.cursor/**`, `.claude/**`, `.mavis/**`, `.opencode/**` (rules, agents, skills, commands, hooks) | `.ai.local/**` |
35
+ | root `AGENTS.md` (from `REPO_AGENTS.md`) | `docs/specs/**`, `openspec/**` |
36
+ | tool MCP config (`.cursor/mcp.json`; `opencode.json` — `mcp` merged, other blocks may be rewritten) | repo-root `.mcp.json`, `.ai/context/**`, `.ai.local/rules/**` |
37
+
38
+ 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.
39
+
27
40
  ## Limitations (read this)
28
41
 
29
42
  - 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%.
@@ -34,4 +47,5 @@ Keep files ≤ 120 lines. Match the style of preset rules (short sections, bulle
34
47
 
35
48
  - Authoring guide: `docs/LOCAL-OVERLAY.md` in the `@bonesofspring/ai-rules` package.
36
49
  - Living gotchas: `.ai.local/conventions.md`. Pipeline artifacts: `.ai.local/team/` (do not load as rules).
50
+ - Staged seeds: `.ai.local/rules-library/**` (move a matching seed into `.ai.local/rules/` to activate).
37
51
  - Root `AGENTS.md` reinforces this rule with a `MANDATORY` section.
@@ -48,6 +48,6 @@ Style enforcement (formatter / linter / post-change gate) lives in the **stack t
48
48
  ## Stack notes
49
49
 
50
50
  - Before adding a new UI control, check existing UI code and project packages.
51
- - Public API: index/barrel files and explicitly exported entities (`public-imports.mdc`, `layer-barrel-exports.mdc`).
51
+ - Public API: index/barrel files and explicitly exported entities (`public-imports.md`, `layer-barrel-exports.md`).
52
52
  - Allowed examples: shared hook/utility; typing `any`/`unknown`; splitting a large component; CSS tokens instead of “magic” values.
53
- - Lint/stylelint — only **`post-change-lint.mdc`**; ESLint config: `app/eslint.config.mjs`. Disabling a rule (`eslint-disable`) — only **locally** (line/small block) with a short “why” comment. Style prose in domain rules stays thin — prefer ESLint/Stylelint over duplicating formatter recipes.
53
+ - Lint/stylelint — only **`post-change-lint.md`**; ESLint config: `app/eslint.config.mjs`. Disabling a rule (`eslint-disable`) — only **locally** (line/small block) with a short “why” comment. Style prose in domain rules stays thin — prefer ESLint/Stylelint over duplicating formatter recipes.
@@ -45,19 +45,23 @@ On-demand rule for review flows. **Procedure and output format:** skill `code-re
45
45
 
46
46
  ### Checklist references
47
47
 
48
- - Architecture layers: `architecture-boundaries.mdc`, `next-app-core.mdc`; network: `http-client.mdc`
49
- - Imports: `public-imports.mdc`, `layer-barrel-exports.mdc`
50
- - UI: `react-ui.mdc`
51
- - Security: `security-next.mdc`
52
- - Tests: `tests-unit.mdc`, `playwright-agents.mdc`, `tests-e2e-structure.mdc`
53
- - Lint gate before final report: `post-change-lint.mdc`
48
+ - Architecture layers: `architecture-boundaries.md`, `next-app-core.md`; network: `http-client.md`
49
+ - Imports: `public-imports.md`, `layer-barrel-exports.md`
50
+ - UI: `react-ui.md`
51
+ - Security: `security-next.md`
52
+ - Tests: `tests-unit.md`, `playwright-agents.md`, `tests-e2e-structure.md`
53
+ - Lint gate before final report: `post-change-lint.md`
54
54
 
55
55
  ### UI / Figma parity (web)
56
56
 
57
57
  When the diff touches UI / layout / styling (paths under `app/src/ui/**`, global layout/CSS/tokens) AND a Figma mockup is referenced in `brief.md` / `decomposition.md` (URL, fileKey, or node id) **or** `mockup-review.md` is present:
58
58
 
59
59
  - The `code-reviewer` agent must perform a **detailed, pixel-accurate** comparison of the implementation against the mockup, **across every viewport the project uses** (the `mockup-review` AC-8 / Stack notes set — web buckets ~375 / ~768 / ~1280 small/medium/large — and the Storybook viewport toolbar in this repo). Figma frames via Figma MCP `get_screenshot`; the running app via Playwright MCP / Chrome DevTools MCP at the matching width.
60
- - The comparison is a **per-element parity check** (typography / color / spacing / imagery / states / structure / auto-layout intent) per the `code-reviewer` UI / Figma parity gate. Bind to the `mockup-review.md` `## Design contract` and the **`design-tokens-binding.mdc`** discipline (`@sds/tokens-*` / DS components, no raw `#…` / `px` where a token exists).
60
+ - The comparison is a **per-element parity check** (typography / color / spacing / imagery / states / structure / auto-layout intent) per the `code-reviewer` UI / Figma parity gate. Bind to the `mockup-review.md` `## Design contract` and the **`design-tokens-binding.md`** discipline (`@sds/tokens-*` / DS components, no raw `#…` / `px` where a token exists).
61
61
  - Findings: `path:line` + Figma node id + viewport + severity. Emit a `## Figma parity (UI)` section in `review.md`.
62
62
  - **Storybook visual baselines are not a substitute.** Approving a UI MR on Storybook baselines alone is not acceptable when a Figma reference exists.
63
63
  - 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.
64
+
65
+ ### Spec / docs sync (behaviour change)
66
+
67
+ 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.