@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,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 };
@@ -12,7 +12,7 @@
12
12
  - **`alwaysApply: true`** (Cursor) / **without `paths:`** (Claude) — base invariants (Cursor/Claude 3–5):
13
13
  - Cursor: `next-app-core`, `package-manager`, `code-quality-and-refactoring`, `ai-local-overlay`
14
14
  - Claude: `next-app-core`, `package-manager`, `code-quality`
15
- - **On-demand / requestable** — `post-change-lint` (**required after code edits**, not always-on), `agent-team-intake` (via orchestrator/commands), `agent-team-orchestrator`, architecture, imports, UI, tests, feature-delivery-workflow, `design-guidance`, `mcp-usage`, `anti-sycophancy-discipline`, `react-next-anti-hallucination`, reference-features, product-specs, product-specs-authoring, next-app-router, `security-next`, react-a11y-coding, `technical-retro`, `mockup-review`, `ux-design`, `design-tokens-binding`
15
+ - **On-demand / requestable** — `post-change-lint` (**required after code edits**, not always-on), `agent-team-intake` (via orchestrator/commands), `agent-team-orchestrator`, architecture, imports, UI, tests, feature-delivery-workflow, `design-guidance`, `mcp-usage`, `anti-sycophancy-discipline`, `react-next-anti-hallucination`, reference-features, product-specs, product-specs-authoring, next-app-router, next-static-export, `security-next`, react-a11y-coding, component-catalog-gate, forms-validation, `technical-retro`, `mockup-review`, `ux-design`, `design-tokens-binding`
16
16
  - **Preset author meta** (globs `packages/ai-rules/presets/**`, never alwaysApply): `preset-layering`, `preset-twin-sync`, `preset-token-budget`, `preset-pr-checklist`, `preset-no-cross-stack-leakage`
17
17
  - **Skills** — long procedures (`feature-delivery`, `spec-authoring`, `spec-discovery`, `code-review`, …)
18
18
 
@@ -55,6 +55,9 @@ When editing `app/src/ui/**/*.tsx`, a **reduced** set loads (not all of `app/src
55
55
  | `no-props-spread.mdc` | `app/src/**/*.tsx` | Explicit props |
56
56
  | `arrow-functions.mdc` | `app/src/**` | Syntax |
57
57
  | `design-tokens-binding.mdc` | `app/src/ui/**/*.{ts,tsx,css}`, `app/src/styles/**` | Figma → repo token binding (typography/color/spacing/imagery); no raw values where a token exists |
58
+ | `component-catalog-gate.mdc` | `app/src/ui/**`, `storybook/**` | Stories ship with the UI; catalog tests green |
59
+ | `forms-validation.mdc` | `app/src/**/*Form*.tsx`, `app/src/**/*Modal*.tsx` | Repo form library + DS fields + shared validators |
60
+ | `next-static-export.mdc` | `app/src/pages/**`, `app/next.config.*` | No server runtime; what to use instead |
58
61
 
59
62
  **Not loaded on typical UI edit:** `architecture-boundaries` (api/store/types/lib), `layer-barrel-exports` (only `index.ts`), `navigation-router-stack` (only `app/src/app/**`). Colocated styles — in `react-ui.mdc` (deprecated stub `no-cross-component-styles-import` removed).
60
63
 
@@ -95,7 +95,7 @@ Each slug has one `artifact-manifest.json` at `.ai.local/team/tasks/<slug>/`. Sc
95
95
 
96
96
  - Read the manifest before broad prior-artifact discovery. Each step receives authoritative input entry IDs, owns named output entry IDs, and finishes with one terminal receipt linked to AC/task IDs.
97
97
  - Markdown remains detailed evidence; the manifest records producer, status, authoritative paths, timestamps, outcome, and evidence paths.
98
- - Agents upsert only entries they own and preserve foreign entries. Parallel agents use distinct IDs; the parent/orchestrator serializes manifest merges.
98
+ - Agents upsert only the items they own in `manifest.artifacts[]` and preserve all foreign items in that array. Parallel agents use distinct IDs; the parent/orchestrator serializes manifest merges. The top-level array key is `artifacts` — not `entries`; see `agent-artifact-contracts.md` for the schema callout.
99
99
  - The orchestration runtime/hook is the single writer for `status.json` lifecycle fields and `metrics.json`. Agents read status for eligibility but never rewrite state, gate, retry, attempt, timestamp, or metrics fields.
100
100
  - Missing/stale manifests are reported as a handoff gap; fall back to `brief.md`, `decomposition.md`, and `pipeline.json` rather than inventing authority.
101
101
 
@@ -133,6 +133,8 @@ On each `subagentStop`, the hook reconciles `status.state` from the completing p
133
133
  | `awaiting_approval` | Human gate; wait for `/task-continue` |
134
134
  | `changes_requested` | Reviewer blocked; re-run developer (`retryAfterFix`) |
135
135
  | `validation_failed` | build-verifier failed; re-run developer then build-verifier |
136
+ | `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) |
137
+ | `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. |
136
138
 
137
139
  ## Pipeline step options
138
140
 
@@ -13,8 +13,9 @@ This rule is mandatory. **You MUST** obey it on every turn, without exception.
13
13
  1. **Probe** — before answering, run `ls -la .ai.local` from the repository root.
14
14
  2. **Walk** — if `.ai.local/` exists at multiple levels (monorepo), read every level from root to leaf. **Deeper wins** in practice: more specific rules appear later in the assembled context and take precedence.
15
15
  3. **Apply** — treat every `.ai.local/rules/*.md` and `.ai.local/conventions.md` as a higher-priority rule for this repo. Do **not** load `.ai.local/team/**` as rules (shared pipeline artifacts). The block below ("Authoring `.ai.local/rules/*.md`") defines the conventions.
16
- 4. **Conflict** — if a local rule conflicts with a preset rule, **the local rule wins**. If a local rule body contains `override: kill <preset-rule-name>`, drop that preset rule from your context window entirely.
17
- 5. **Acknowledge** — when answering a user question, briefly state which `.ai.local/` rules apply to the current task (one line is enough). Format: `Using .ai.local: <rule-name>(, <rule-name>)*`. If no `.ai.local/` exists, do NOT mention this rule.
16
+ 4. **Activate seeds** — if `.ai.local/rules-library/<seed>.md` exists and matches the current task scope, treat it as the applicable local rule and tell the owner to move it into `.ai.local/rules/`. Seeds are **staged-inactive** templates shipped by `init` (e.g. `router-pages`, `no-react-fc`, `storybook-ui-quality-gate`, `component-child-decomposition`); they do **not** apply until moved.
17
+ 5. **Conflict** — if a local rule conflicts with a preset rule, **the local rule wins**. If a local rule body contains `override: kill <preset-rule-name>`, drop that preset rule from your context window entirely.
18
+ 6. **Acknowledge** — when answering a user question, briefly state which `.ai.local/` rules apply to the current task (one line is enough). Format: `Using .ai.local: <rule-name>(, <rule-name>)*`. If no `.ai.local/` exists, do NOT mention this rule.
18
19
 
19
20
  If `.ai.local/` does not exist → **no-op**, do not error. Do not produce any log line about its absence.
20
21
 
@@ -30,6 +31,18 @@ Each `.ai.local/rules/<name>.md` is a plain-markdown rule body. The model parses
30
31
 
31
32
  Keep files ≤ 120 lines. Match the style of preset rules (short sections, bullets, code examples).
32
33
 
34
+ ## What `init` overwrites vs preserves
35
+
36
+ `init` manages the tool trees; they are **not** the home of durable project config.
37
+
38
+ | Overwritten / merged by `init` | Preserved |
39
+ |---|---|
40
+ | `.cursor/**`, `.claude/**`, `.mavis/**`, `.opencode/**` (rules, agents, skills, commands, hooks) | `.ai.local/**` |
41
+ | root `AGENTS.md` (from `REPO_AGENTS.md`) | `docs/specs/**`, `openspec/**` |
42
+ | tool MCP config (`.cursor/mcp.json`; `opencode.json` — `mcp` merged, other blocks may be rewritten) | repo-root `.mcp.json`, `.ai/context/**`, `.ai.local/rules/**` |
43
+
44
+ Put durable project-owned agent config and authoritative specs **outside** the tool trees (`.ai.local/`, `.ai/context/`, repo-root `.mcp.json`). After any re-init, verify consumer-owned blocks you added to a managed file (e.g. `opencode.json` `instructions` / `permission.bash`) survived.
45
+
33
46
  ## Limitations (read this)
34
47
 
35
48
  - Cursor, Claude, Mavis, and OpenCode do **not** natively read `.ai.local/`. This rule is a **prompt-only** mechanism: it asks you, the model, to read and apply the files. Reliability is high but not 100%.
@@ -40,4 +53,5 @@ Keep files ≤ 120 lines. Match the style of preset rules (short sections, bulle
40
53
 
41
54
  - Authoring guide: `docs/LOCAL-OVERLAY.md` in the `@bonesofspring/ai-rules` package.
42
55
  - Living gotchas: `.ai.local/conventions.md`. Pipeline artifacts: `.ai.local/team/` (do not load as rules).
56
+ - Staged seeds: `.ai.local/rules-library/**` (move a matching seed into `.ai.local/rules/` to activate).
43
57
  - Root `AGENTS.md` reinforces this rule with a `MANDATORY` section.
@@ -66,3 +66,7 @@ When the diff touches UI / layout / styling (paths under `app/src/ui/**`, global
66
66
  - Findings: `path:line` + Figma node id + viewport + severity. Emit a `## Figma parity (UI)` section in `review.md`.
67
67
  - **Storybook visual baselines are not a substitute.** Approving a UI MR on Storybook baselines alone is not acceptable when a Figma reference exists.
68
68
  - Missing or `unable_to_compare` parity section on a UI-touching MR with a Figma reference → `REQUEST_CHANGES`. Unbound raw values where a token exists (typography / color / spacing / imagery) → `blocker` / `important`. The full gate lives in the `code-reviewer` agent prompt; this rule cross-references it.
69
+
70
+ ### Spec / docs sync (behaviour change)
71
+
72
+ When the diff changes documented `app/src/**` behaviour and the repo carries a spec tree (`docs/specs/**`, `openspec/specs/**`, `docs/qa/**`, or `*.cases.md`), the same changeset must update the linked page / spec / QA case (or record an explicit open-question gap). A missing update on an **AC-named** surface → `REQUEST_CHANGES`; on a non-AC surface → `important`. Do not treat `docs/specs` and `openspec` as substitutes for each other — keep both in sync.
@@ -0,0 +1,38 @@
1
+ ---
2
+ description: Component catalog (Storybook/Ladle) is the required UI dev + visual-review surface — stories ship with the UI change
3
+ globs: app/src/ui/**/*,storybook/**/*,stories/**/*
4
+ alwaysApply: false
5
+ impact: MEDIUM
6
+ ---
7
+
8
+ # Component catalog gate (UI quality)
9
+
10
+ When the repo ships a **component catalog** (Storybook, Ladle, Chromatic, or a `stories/` tree), it is the required surface for developing and reviewing UI. A route screenshot, a source-only review, or unit tests without stories is **not** enough.
11
+
12
+ ## Scope
13
+
14
+ - Triggers: a new `app/src/ui/**` component / page / block / modal, or a visual/interaction refactor (layout, styles, tokens, copy, hover/open, empty / error / loading).
15
+ - Skip: types / API / store / mocks with no render or style change.
16
+
17
+ ## Rules
18
+
19
+ - **Stories ship with the UI**, in the same change — not after.
20
+ - **Compare against the design source** (Figma, else the AC): the catalog is the canvas, the design is the truth. Visual baselines are a **regression detector**, not a design spec — fix the implementation first, then update the baseline.
21
+ - **Package isolation:** when the catalog is its own package (own `package.json` / lockfile / `node_modules`), it resolves dependencies from **its own** `node_modules` — never the app's. Missing package ⇒ add it to the catalog manifest; never alias into the app.
22
+ - **Clean up** temp screenshots you created this turn; keep only intentional baselines and product assets.
23
+ - Keep catalog tests green — do not finish with red or stale baselines.
24
+
25
+ ## Stack notes
26
+
27
+ - Catalog: Storybook. Developer loop: read Figma → implement → preview the story → screenshot → compare → fix → **update baselines last**.
28
+ - Run the catalog runner from the catalog directory (e.g. its own Vitest project), not the app's unit runner.
29
+
30
+ ## Handoff
31
+
32
+ - `feature-developer`: a UI work package in a catalog repo is **not done** without a story and a green catalog test run.
33
+ - `code-reviewer`: a UI-touching MR with a catalog present and no story → `REQUEST_CHANGES`.
34
+
35
+ ## Related
36
+
37
+ - `design-tokens-binding.mdc` — Figma → repo token binding for the implementation.
38
+ - `mockup-review.mdc` — the reviewer-side parity gate.
@@ -28,7 +28,7 @@ The implementation must mirror the Figma mockup token-for-token. Raw design valu
28
28
 
29
29
  ## Imagery & icons
30
30
 
31
- - **Images:** use the Figma asset source from `get_design_context` / the node’s image fill. Repo: `next/image` (or repo convention) with `src`, `width`, `height` derived from Figma. Do not use a placeholder, do not invent a URL, do not change aspect ratio.
31
+ - **Images:** use the Figma asset source from `get_design_context` / the node’s image fill. Repo: **the project’s image primitive** — check the nearest component in the same layer (often a plain `<img>` or a DS image component; `next/image` only where the config keeps the optimizer enabled). Derive `src`, `width`, `height` from Figma. Do not use a placeholder, do not invent a URL, do not change aspect ratio.
32
32
  - **Icons:** use the `@sds/icon` (or project DS) symbol name from the Figma component instance / metadata. Do not invent icon names. The Figma node’s component name (e.g. `Icon / chevron-right`) maps to the DS symbol.
33
33
  - `alt` text from the Figma node name when meaningful; otherwise from the design context copy.
34
34
 
@@ -11,6 +11,10 @@ alwaysApply: false
11
11
 
12
12
  When the prompt or `brief.md` contains a `figma.com` URL, **mockup review** (`mockup-reviewer` / skill `mockup-review`) must complete — or the user must continue past FAIL/`BLOCKED_MCP` via `/task-continue` — **before UI implementation**. Non-UI tasks no-op this gate. When required-signal and **no** `figma.com`, **`ux-design.md`** (on the analysis manifest entry) must exist and not be `INCOMPLETE` before UI work — else **blocked**, hand back to `task-analyst`. Parallel to the mockup gate.
13
13
 
14
+ **UI-scope gate (no Figma).** When the scope touches `app/src/ui/**` or the component-catalog root on `feature` / `refactor`, a terminal `mockup-review.md` is required **even without** a `figma.com` URL — reviewed against the AC / `ux-design.md`. Where the repo ships a component catalog, stories ship with the UI and `build-verifier` runs the catalog suite green (`component-catalog-gate`).
15
+
16
+ **Consumer context.** When `.ai/context/**` exists, read it before deriving architecture, domain vocabulary, or test placement.
17
+
14
18
  ## Style discovery (mandatory)
15
19
 
16
20
  Before writing a new file in a layer, open **1–2 analog files** in the same layer and mirror: export shape, name prefixes (`T` / `I` where the repo uses them), file suffixes (`.apiMethods.ts`, `.endpoints.ts`, `.data.ts`, `.hooks.ts`, `styles.ts`), mapper / selector / thunk naming, and barrel shape. Record the analogs in the handoff. Where this preset's examples differ from the repo, **the repo wins**.
@@ -19,7 +23,7 @@ Before writing a new file in a layer, open **1–2 analog files** in the same la
19
23
 
20
24
  When the prompt or `brief.md` contains a Figma URL with a node id (`?node-id=…`), `mockup-reviewer` must walk the node subtree via Figma MCP and emit **two sections** in `mockup-review.md`:
21
25
 
22
- - `## Design contract` — Figma variables, text styles, components/assets used by the subtree, with the repo mapping (`@sds/tokens-colors` / `@sds/brand-colors` / `@sds/tokens-typography` / `@sds/tokens` / DS components / `next/image` with Figma-derived `src/width/height`). This is the binding table the developer uses for typography, color, spacing, and imagery.
26
+ - `## Design contract` — Figma variables, text styles, components/assets used by the subtree, with the repo mapping (`@sds/tokens-colors` / `@sds/brand-colors` / `@sds/tokens-typography` / `@sds/tokens` / DS components / the project image primitive with Figma-derived `src/width/height`). This is the binding table the developer uses for typography, color, spacing, and imagery.
23
27
  - `## Node decomposition (AC-2)` — the child→component map (with a `Bindings` column for the Figma design bindings).
24
28
 
25
29
  `feature-developer` must **not** start UI implementation until both sections are present, and must load requestable `design-tokens-binding.mdc` to bind every value to a Figma variable / text style / repo token (raw `#…` / `px` are a finding). The full procedure and verdict rule live in the `mockup-reviewer` agent prompt and the `mockup-review` Stack notes.
@@ -0,0 +1,33 @@
1
+ ---
2
+ description: Forms and validation — use the repo's form library + design-system fields + shared validators, not ad-hoc state
3
+ globs: app/src/**/*Form*.tsx,app/src/**/*Form*.ts,app/src/**/*Modal*.tsx
4
+ alwaysApply: false
5
+ impact: MEDIUM
6
+ ---
7
+
8
+ # Forms and validation
9
+
10
+ Use the form solution already in the repo (`package.json` + the nearest form component). Do not hand-roll form state with `useState` when a form library is present.
11
+
12
+ ## Rules
13
+
14
+ - One form-hook instance per form; register design-system fields through the library's controller/wrapper (controlled) — not a raw `<input>` when a DS field exists.
15
+ - Validate with the repo's resolver/schema library and reuse the shared validators under the repo's validation utils — never re-implement email / phone / date / length rules inline.
16
+ - Masked inputs (phone, date, card) go through the repo's mask library, not ad-hoc regex on change.
17
+ - Disable submit while `!isValid` / `isSubmitting`; surface field errors from the form library's error state.
18
+ - Keep side effects out of field components: the form owns `onSubmit`; data flows to store/API through the repo's layers (`architecture-boundaries-ui.mdc`).
19
+
20
+ ## Accessibility
21
+
22
+ - Every field has a visible label and an associated error message; do not rely on placeholder-only labels.
23
+ - Field errors are announced and tied to the input; keep the DS field's wiring instead of a bespoke error node.
24
+
25
+ ## Stack notes
26
+
27
+ - Library: `react-hook-form` + `yup` resolver; `mode: 'onTouched'`.
28
+ - DS fields: `app/src/ui/components/_form/**`; shared validators: `app/src/lib/utils/validations/**`; masks: `imask` / `react-imask`.
29
+
30
+ ## Related
31
+
32
+ - `react-ui.mdc` — component structure and decomposition.
33
+ - `architecture-boundaries-ui.mdc` — no API/DTO in UI.
@@ -92,6 +92,7 @@ Policy is stack-class-specific — see adapter **Stack notes**. If a Figma **plu
92
92
 
93
93
  ## Stack notes
94
94
 
95
+ - **Installed Next docs first:** the installed `next` may ship version-pinned agent docs at `node_modules/next/dist/docs/` and a managed `AGENTS.md` block. Prefer them for framework APIs (they match the installed major) — reach for Context7 only when they are insufficient or absent.
95
96
  - Pipeline **`mockup-reviewer`** is the only agent that reads Figma for mockup review. See `mockup-review`.
96
97
  - Shipped besides Context7: browser automation MCP (`playwright` / `playwright-test` / `user-playwright`) and `chrome-devtools`.
97
98
  - **Split:** Playwright MCP → e2e agents (planner/generator/healer), selector checks, spec reproduction. Chrome DevTools MCP → `debugger` / `performance-auditor` against a **running app** (console, network, traces). Not a substitute for e2e.
@@ -13,6 +13,9 @@ Concrete versions come **from `package.json` and configs of the target repositor
13
13
  - `app/tsconfig.json`: `paths: { "@/*": ["./src/*"] }` (`baseUrl` may be absent with TS ≥5 / `moduleResolution: bundler` — check the file, do not add it blindly).
14
14
  - **Requirement:** `@/*` instead of relative imports that climb the tree.
15
15
  - **Router mode:** detect from the repo before adding routes — App Router (`app/src/app/**`, `page.tsx`) vs Pages Router (`app/src/pages/**`, `_app.tsx`). Do **not** assume App Router; follow the mode already in use (`next-app-router.mdc`, `navigation-router-stack.mdc`).
16
+ - **Deployment model:** read `output` in `next.config.*`. With `output: 'export'` the app is a static SPA — no server runtime, no API routes / middleware / SSR (`next-static-export.mdc`).
17
+ - **Consumer context:** when `.ai/context/**` exists, read it for the repo's compressed architecture, domain glossary, and test-placement conventions before deriving them yourself.
18
+ - **Env access:** read `NEXT_PUBLIC_*` through the repo's config module (e.g. `@/config`); new public keys must also be listed in `next.config.*` `env`. Never read `process.env` inside components.
16
19
 
17
20
  # Architectural layers
18
21
 
@@ -0,0 +1,35 @@
1
+ ---
2
+ description: Static-export / SPA Next.js (output 'export') — no server runtime; what is unavailable and what to use instead
3
+ globs: app/next.config.*,app/src/pages/**/*,app/src/pages/_*.tsx
4
+ alwaysApply: false
5
+ impact: HIGH
6
+ ---
7
+
8
+ # Static export (Next.js `output: 'export'`)
9
+
10
+ Detect the deployment model **before** writing data-fetching or routing code: read `output` in `next.config.*`. With `output: 'export'` the build produces a static SPA — there is no server runtime at request time.
11
+
12
+ ## Unavailable
13
+
14
+ - `getServerSideProps`, `getInitialProps`.
15
+ - API routes (`pages/api/**`, App Router `route.ts`) and `middleware.ts`.
16
+ - Server Actions; server `cookies()` / `headers()`.
17
+ - ISR / `revalidate` / `dynamic = 'force-dynamic'`.
18
+ - The image optimizer when `images.unoptimized: true` (`next/image` `loader` / `sizes` buy nothing).
19
+
20
+ ## Available / preferred
21
+
22
+ - `getStaticProps` / `getStaticPaths` run at **build** time only.
23
+ - Runtime data comes from the browser: store thunk → `@/api` service (`store-rtk.mdc`, `api-services.mdc`).
24
+ - Auth / session are enforced by the BFF plus a client route guard — not by a Next server.
25
+ - `basePath` / `assetPrefix`: build local links and asset URLs from those values; never hardcode `/`.
26
+
27
+ ## Agent requirement
28
+
29
+ - Copy the data-fetch and navigation pattern from a sibling page under `app/src/pages/**`; do not port SSR/RSC examples from docs or blogs into a static-export repo.
30
+ - If a requested feature implies a server runtime, mark it **N/A — static export** and propose the client/BFF alternative instead of writing server code.
31
+
32
+ ## Related
33
+
34
+ - `react-next-anti-hallucination.mdc` — phantom-import banlist for this deployment model.
35
+ - `navigation-router-stack.mdc` — Pages Router vs App Router.
@@ -15,6 +15,10 @@ Exceptions: documentation edits outside `app/`, CI configs, `.cursor/rules/**`,
15
15
 
16
16
  **Pipeline exception:** if the task runs through the agent team and the next step is `build-verifier`, the developer may limit lint/type-check to **changed files**; full run is **`build-verifier`’s** responsibility. In single-agent mode (no pipeline) — always a full run.
17
17
 
18
+ **Secondary packages:** when the repo has more than one package with a manifest (e.g. `app/` + `storybook/`), run each package's own scripts from its own directory. Do not conflate runners (app unit runner vs catalog runner).
19
+
20
+ **Run the package script, not a bare runner:** prefer `yarn lint:js` / `yarn test` over `npx eslint` / `npx jest`. Scripts carry env (`TZ`), coverage, and reporters that CI depends on; a bare runner can diverge from CI.
21
+
18
22
  ## Required commands
19
23
 
20
24
  Working directory — **`app/`**. Package manager — **`package-manager.mdc`**.
@@ -121,5 +121,6 @@ Block handoff via `open_questions` until fixed:
121
121
  ## Stack notes
122
122
 
123
123
  - Author via skill `spec-authoring`; templates from package assets / consumer `docs/specs/_templates/`.
124
+ - **Glossary & contrast (mandatory):** before authoring, read the repo glossary (`openspec/config.yaml` `context:`, `.ai/context/**`, domain README). Each generated spec maps product terms to code symbols + record types and adds one **contrast** requirement/scenario against the nearest confusable symbol. Declare **compliance impact** (None | Affected) for any spec touching medical/personal data or analytics.
124
125
  - Field semantics match discovery stem (`routes` = URL paths; `e2e` = Playwright).
125
126
  - Requestable — not always-on / session-start.