@bonesofspring/ai-rules 0.2.51 → 0.2.53

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 (376) hide show
  1. package/CHANGELOG.md +92 -0
  2. package/README.md +27 -3
  3. package/bin/cli.js +565 -61
  4. package/bin/lib/ai-local-drift.js +55 -14
  5. package/bin/lib/engine-scripts.js +10 -0
  6. package/bin/lib/mcp/clients.js +168 -0
  7. package/bin/lib/mcp/credentials.js +298 -0
  8. package/bin/lib/mcp/doctor.js +394 -0
  9. package/bin/lib/mcp/prompt.js +115 -0
  10. package/bin/lib/mcp/registry.js +170 -0
  11. package/bin/lib/mcp/run.js +123 -0
  12. package/bin/lib/merged-config.js +45 -0
  13. package/bin/lib/seed-ai-local-team.js +23 -7
  14. package/bin/lib/tool-installs.js +27 -0
  15. package/bin/mavis-install.js +2 -0
  16. package/bin/opencode-install.js +2 -0
  17. package/docs/LOCAL-OVERLAY.md +1 -1
  18. package/docs/MCP-SETUP.md +62 -0
  19. package/docs/PRESET-CONTRIBUTION.md +14 -10
  20. package/docs/TEAM-DB.md +173 -0
  21. package/docs/openapi/team-db.v1.json +5085 -0
  22. package/mcp/gitlab.mjs +123 -0
  23. package/mcp/lib/envfile.mjs +126 -0
  24. package/mcp/lib/yandex.mjs +384 -0
  25. package/mcp/yandex-mcp-proxy.mjs +155 -0
  26. package/mcp/yandex-token-refresh.mjs +65 -0
  27. package/package.json +18 -1
  28. package/presets/_shared/ai-local/scripts/manifest.mjs +112 -3
  29. package/presets/_shared/ai-local/scripts/rule-improver.mjs +428 -91
  30. package/presets/_shared/ai-local/scripts/run.mjs +22 -4
  31. package/presets/_shared/ai-local/scripts/signals.mjs +4 -1
  32. package/presets/_shared/ai-local/scripts/team-db-api.mjs +1275 -0
  33. package/presets/_shared/ai-local/scripts/team-db-dashboard.mjs +1067 -0
  34. package/presets/_shared/ai-local/scripts/team-db-openapi.mjs +1301 -0
  35. package/presets/_shared/ai-local/scripts/team-db-project.mjs +1506 -0
  36. package/presets/_shared/ai-local/scripts/team-db-schema.mjs +831 -0
  37. package/presets/_shared/ai-local/scripts/team-db.mjs +251 -0
  38. package/presets/_shared/core/meta/preset-pr-checklist.md +1 -1
  39. package/presets/_shared/core/quality/interactive-questions.md +8 -8
  40. package/presets/_shared/hooks/chain-team-phases.sh.tmpl +109 -0
  41. package/presets/claude/android-kotlin/agents/code-reviewer.md +1 -0
  42. package/presets/claude/android-kotlin/hooks/chain-team-phases.sh +109 -0
  43. package/presets/claude/android-kotlin/rules/tooling-and-review/interactive-questions.md +8 -8
  44. package/presets/claude/android-kotlin/rules/tooling-and-review/language-policy.md +1 -1
  45. package/presets/claude/android-kotlin/rules/tooling-and-review/preset-pr-checklist.md +1 -1
  46. package/presets/claude/android-kotlin/team/README.md +10 -0
  47. package/presets/claude/go/agents/code-reviewer.md +1 -0
  48. package/presets/claude/go/hooks/chain-team-phases.sh +109 -0
  49. package/presets/claude/go/rules/tooling-and-review/interactive-questions.md +8 -8
  50. package/presets/claude/go/rules/tooling-and-review/language-policy.md +1 -1
  51. package/presets/claude/go/rules/tooling-and-review/preset-pr-checklist.md +1 -1
  52. package/presets/claude/go/team/README.md +10 -0
  53. package/presets/claude/ios-swift/agents/code-reviewer.md +1 -0
  54. package/presets/claude/ios-swift/hooks/chain-team-phases.sh +109 -0
  55. package/presets/claude/ios-swift/rules/tooling-and-review/interactive-questions.md +8 -8
  56. package/presets/claude/ios-swift/rules/tooling-and-review/language-policy.md +1 -1
  57. package/presets/claude/ios-swift/rules/tooling-and-review/post-change-build.md +1 -1
  58. package/presets/claude/ios-swift/rules/tooling-and-review/preset-pr-checklist.md +1 -1
  59. package/presets/claude/ios-swift/team/README.md +10 -0
  60. package/presets/claude/java/agents/code-reviewer.md +1 -0
  61. package/presets/claude/java/hooks/chain-team-phases.sh +109 -0
  62. package/presets/claude/java/rules/tooling-and-review/interactive-questions.md +8 -8
  63. package/presets/claude/java/rules/tooling-and-review/language-policy.md +1 -1
  64. package/presets/claude/java/rules/tooling-and-review/preset-pr-checklist.md +1 -1
  65. package/presets/claude/java/team/README.md +10 -0
  66. package/presets/claude/mcp-ts/hooks/chain-team-phases.sh +109 -0
  67. package/presets/claude/mcp-ts/rules/tooling-and-review/interactive-questions.md +8 -8
  68. package/presets/claude/mcp-ts/rules/tooling-and-review/language-policy.md +1 -1
  69. package/presets/claude/mcp-ts/rules/tooling-and-review/preset-pr-checklist.md +1 -1
  70. package/presets/claude/mcp-ts/team/README.md +10 -0
  71. package/presets/claude/next/MCP.md +7 -0
  72. package/presets/claude/next/README.md +1 -1
  73. package/presets/claude/next/REPO_AGENTS.md +1 -1
  74. package/presets/claude/next/agents/README.md +3 -3
  75. package/presets/claude/next/agents/build-verifier.md +9 -3
  76. package/presets/claude/next/agents/code-reviewer.md +2 -1
  77. package/presets/claude/next/agents/codebase-analyzer.md +1 -1
  78. package/presets/claude/next/agents/feature-developer.md +18 -8
  79. package/presets/claude/next/agents/openspec-author.md +1 -1
  80. package/presets/claude/next/agents/playwright-test-generator.md +22 -68
  81. package/presets/claude/next/agents/playwright-test-healer.md +27 -54
  82. package/presets/claude/next/agents/playwright-test-planner.md +18 -51
  83. package/presets/claude/next/agents/task-analyst.md +25 -9
  84. package/presets/claude/next/agents/task-router.md +1 -1
  85. package/presets/claude/next/agents/tech-writer.md +1 -1
  86. package/presets/claude/next/hooks/chain-team-phases.sh +109 -0
  87. package/presets/claude/next/mcp.json +3 -3
  88. package/presets/claude/next/rules/anti-hallucination/react-next-anti-hallucination.md +1 -1
  89. package/presets/claude/next/rules/architecture/layer-barrel-exports.md +1 -1
  90. package/presets/claude/next/rules/architecture/reference-features.md +1 -1
  91. package/presets/claude/next/rules/stack/navigation-router-ui.md +1 -1
  92. package/presets/claude/next/rules/stack/navigation-router.md +14 -0
  93. package/presets/claude/next/rules/stack/next-app-core.md +19 -17
  94. package/presets/claude/next/rules/stack/next-app-router.md +5 -17
  95. package/presets/claude/next/rules/stack/next-static-export.md +1 -1
  96. package/presets/claude/next/rules/tooling-and-review/interactive-questions.md +8 -8
  97. package/presets/claude/next/rules/tooling-and-review/language-policy.md +1 -1
  98. package/presets/claude/next/rules/tooling-and-review/post-change-lint.md +1 -1
  99. package/presets/claude/next/rules/tooling-and-review/preset-pr-checklist.md +1 -1
  100. package/presets/claude/next/rules/tooling-and-review/preset-token-budget.md +1 -1
  101. package/presets/claude/next/rules/tooling-and-review/security-next.md +28 -3
  102. package/presets/claude/next/rules/ui-and-accessibility/css-property-order.md +1 -1
  103. package/presets/claude/next/rules/ui-and-accessibility/design-tokens-binding.md +4 -4
  104. package/presets/claude/next/rules/ui-and-accessibility/forms-validation.md +2 -2
  105. package/presets/claude/next/team/README.md +21 -0
  106. package/presets/claude/next/team/fixtures/feature-with-figma-url.json +10 -0
  107. package/presets/claude/next/team/fixtures/feature-with-ux-no-figma.json +10 -0
  108. package/presets/claude/next/team/fixtures/mockup-review-standalone.json +9 -0
  109. package/presets/claude/next/team/fixtures/ux-design-standalone.json +9 -0
  110. package/presets/claude/nuxt/agents/code-reviewer.md +1 -0
  111. package/presets/claude/nuxt/hooks/chain-team-phases.sh +109 -0
  112. package/presets/claude/nuxt/rules/architecture/layer-barrel-exports.md +1 -1
  113. package/presets/claude/nuxt/rules/stack/navigation-router-ui.md +1 -1
  114. package/presets/claude/nuxt/rules/tooling-and-review/interactive-questions.md +8 -8
  115. package/presets/claude/nuxt/rules/tooling-and-review/language-policy.md +1 -1
  116. package/presets/claude/nuxt/rules/tooling-and-review/post-change-lint.md +1 -1
  117. package/presets/claude/nuxt/rules/tooling-and-review/preset-pr-checklist.md +1 -1
  118. package/presets/claude/nuxt/team/README.md +10 -0
  119. package/presets/claude/php-hexagonal/agents/code-reviewer.md +1 -0
  120. package/presets/claude/php-hexagonal/hooks/chain-team-phases.sh +109 -0
  121. package/presets/claude/php-hexagonal/rules/tooling-and-review/interactive-questions.md +8 -8
  122. package/presets/claude/php-hexagonal/rules/tooling-and-review/language-policy.md +1 -1
  123. package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-pr-checklist.md +1 -1
  124. package/presets/claude/php-hexagonal/team/README.md +10 -0
  125. package/presets/claude/php-laravel/agents/code-reviewer.md +1 -0
  126. package/presets/claude/php-laravel/hooks/chain-team-phases.sh +109 -0
  127. package/presets/claude/php-laravel/rules/tooling-and-review/interactive-questions.md +8 -8
  128. package/presets/claude/php-laravel/rules/tooling-and-review/language-policy.md +1 -1
  129. package/presets/claude/php-laravel/rules/tooling-and-review/preset-pr-checklist.md +1 -1
  130. package/presets/claude/php-laravel/team/README.md +10 -0
  131. package/presets/claude/svelte/agents/code-reviewer.md +1 -0
  132. package/presets/claude/svelte/hooks/chain-team-phases.sh +109 -0
  133. package/presets/claude/svelte/rules/architecture/layer-barrel-exports.md +1 -1
  134. package/presets/claude/svelte/rules/tooling-and-review/interactive-questions.md +8 -8
  135. package/presets/claude/svelte/rules/tooling-and-review/language-policy.md +1 -1
  136. package/presets/claude/svelte/rules/tooling-and-review/post-change-lint.md +1 -1
  137. package/presets/claude/svelte/rules/tooling-and-review/preset-pr-checklist.md +1 -1
  138. package/presets/claude/svelte/team/README.md +10 -0
  139. package/presets/cursor/android-kotlin/agents/code-reviewer.md +1 -0
  140. package/presets/cursor/android-kotlin/hooks/chain-team-phases.sh +109 -0
  141. package/presets/cursor/android-kotlin/rules/README.md +1 -0
  142. package/presets/cursor/android-kotlin/rules/agent-team-orchestrator.mdc +3 -3
  143. package/presets/cursor/android-kotlin/rules/interactive-questions.mdc +8 -8
  144. package/presets/cursor/android-kotlin/rules/preset-pr-checklist.mdc +1 -1
  145. package/presets/cursor/android-kotlin/team/README.md +10 -0
  146. package/presets/cursor/go/agents/code-reviewer.md +1 -0
  147. package/presets/cursor/go/hooks/chain-team-phases.sh +109 -0
  148. package/presets/cursor/go/rules/agent-team-orchestrator.mdc +2 -2
  149. package/presets/cursor/go/rules/interactive-questions.mdc +8 -8
  150. package/presets/cursor/go/rules/preset-pr-checklist.mdc +1 -1
  151. package/presets/cursor/go/team/README.md +10 -0
  152. package/presets/cursor/ios-swift/agents/code-reviewer.md +1 -0
  153. package/presets/cursor/ios-swift/hooks/chain-team-phases.sh +109 -0
  154. package/presets/cursor/ios-swift/rules/README.md +1 -0
  155. package/presets/cursor/ios-swift/rules/agent-team-orchestrator.mdc +3 -3
  156. package/presets/cursor/ios-swift/rules/interactive-questions.mdc +8 -8
  157. package/presets/cursor/ios-swift/rules/preset-pr-checklist.mdc +1 -1
  158. package/presets/cursor/ios-swift/team/README.md +10 -0
  159. package/presets/cursor/java/agents/code-reviewer.md +1 -0
  160. package/presets/cursor/java/hooks/chain-team-phases.sh +109 -0
  161. package/presets/cursor/java/rules/agent-team-orchestrator.mdc +2 -2
  162. package/presets/cursor/java/rules/interactive-questions.mdc +8 -8
  163. package/presets/cursor/java/rules/preset-pr-checklist.mdc +1 -1
  164. package/presets/cursor/java/team/README.md +10 -0
  165. package/presets/cursor/mcp-ts/hooks/chain-team-phases.sh +109 -0
  166. package/presets/cursor/mcp-ts/rules/agent-team-orchestrator.mdc +2 -2
  167. package/presets/cursor/mcp-ts/rules/interactive-questions.mdc +8 -8
  168. package/presets/cursor/mcp-ts/rules/preset-pr-checklist.mdc +1 -1
  169. package/presets/cursor/mcp-ts/team/README.md +10 -0
  170. package/presets/cursor/next/MCP.md +14 -0
  171. package/presets/cursor/next/REPO_AGENTS.md +1 -1
  172. package/presets/cursor/next/agents/code-reviewer.md +1 -0
  173. package/presets/cursor/next/agents/playwright-test-healer.md +1 -0
  174. package/presets/cursor/next/ai-local/rules-library/router-pages.md +5 -5
  175. package/presets/cursor/next/hooks/chain-team-phases.sh +109 -0
  176. package/presets/cursor/next/mcp.json +3 -3
  177. package/presets/cursor/next/rules/README.md +1 -1
  178. package/presets/cursor/next/rules/agent-team-orchestrator.mdc +1 -1
  179. package/presets/cursor/next/rules/css-property-order-stylelint.mdc +1 -1
  180. package/presets/cursor/next/rules/design-tokens-binding.mdc +4 -4
  181. package/presets/cursor/next/rules/forms-validation.mdc +2 -2
  182. package/presets/cursor/next/rules/interactive-questions.mdc +8 -8
  183. package/presets/cursor/next/rules/navigation-router-stack.mdc +14 -1
  184. package/presets/cursor/next/rules/next-app-core.mdc +19 -17
  185. package/presets/cursor/next/rules/next-app-router.mdc +5 -17
  186. package/presets/cursor/next/rules/next-static-export.mdc +1 -1
  187. package/presets/cursor/next/rules/preset-pr-checklist.mdc +1 -1
  188. package/presets/cursor/next/rules/preset-token-budget.mdc +1 -1
  189. package/presets/cursor/next/rules/react-next-anti-hallucination.mdc +1 -1
  190. package/presets/cursor/next/rules/reference-features.mdc +1 -1
  191. package/presets/cursor/next/rules/security-next.mdc +28 -3
  192. package/presets/cursor/next/team/README.md +21 -0
  193. package/presets/cursor/next/team/fixtures/feature-with-figma-url.json +10 -0
  194. package/presets/cursor/next/team/fixtures/feature-with-ux-no-figma.json +10 -0
  195. package/presets/cursor/next/team/fixtures/mockup-review-standalone.json +9 -0
  196. package/presets/cursor/next/team/fixtures/ux-design-standalone.json +9 -0
  197. package/presets/cursor/nuxt/agents/code-reviewer.md +1 -0
  198. package/presets/cursor/nuxt/hooks/chain-team-phases.sh +109 -0
  199. package/presets/cursor/nuxt/rules/agent-team-orchestrator.mdc +1 -1
  200. package/presets/cursor/nuxt/rules/interactive-questions.mdc +8 -8
  201. package/presets/cursor/nuxt/rules/preset-pr-checklist.mdc +1 -1
  202. package/presets/cursor/nuxt/team/README.md +10 -0
  203. package/presets/cursor/php-hexagonal/agents/code-reviewer.md +1 -0
  204. package/presets/cursor/php-hexagonal/hooks/chain-team-phases.sh +109 -0
  205. package/presets/cursor/php-hexagonal/rules/agent-team-orchestrator.mdc +2 -2
  206. package/presets/cursor/php-hexagonal/rules/interactive-questions.mdc +8 -8
  207. package/presets/cursor/php-hexagonal/rules/preset-pr-checklist.mdc +1 -1
  208. package/presets/cursor/php-hexagonal/team/README.md +10 -0
  209. package/presets/cursor/php-laravel/agents/code-reviewer.md +1 -0
  210. package/presets/cursor/php-laravel/hooks/chain-team-phases.sh +109 -0
  211. package/presets/cursor/php-laravel/rules/agent-team-orchestrator.mdc +2 -2
  212. package/presets/cursor/php-laravel/rules/interactive-questions.mdc +8 -8
  213. package/presets/cursor/php-laravel/rules/preset-pr-checklist.mdc +1 -1
  214. package/presets/cursor/php-laravel/team/README.md +10 -0
  215. package/presets/cursor/svelte/agents/code-reviewer.md +1 -0
  216. package/presets/cursor/svelte/hooks/chain-team-phases.sh +109 -0
  217. package/presets/cursor/svelte/rules/agent-team-orchestrator.mdc +1 -1
  218. package/presets/cursor/svelte/rules/interactive-questions.mdc +8 -8
  219. package/presets/cursor/svelte/rules/preset-pr-checklist.mdc +1 -1
  220. package/presets/cursor/svelte/team/README.md +10 -0
  221. package/presets/mavis/android-kotlin/adapter-map.json +1 -1
  222. package/presets/mavis/android-kotlin/agents/code-reviewer.md +1 -0
  223. package/presets/mavis/android-kotlin/hooks/chain-team-phases.sh +109 -0
  224. package/presets/mavis/android-kotlin/rules/interactive-questions.md +8 -8
  225. package/presets/mavis/android-kotlin/rules/preset-pr-checklist.md +1 -1
  226. package/presets/mavis/android-kotlin/team/README.md +10 -0
  227. package/presets/mavis/go/adapter-map.json +1 -1
  228. package/presets/mavis/go/agents/code-reviewer.md +1 -0
  229. package/presets/mavis/go/hooks/chain-team-phases.sh +109 -0
  230. package/presets/mavis/go/rules/interactive-questions.md +8 -8
  231. package/presets/mavis/go/rules/preset-pr-checklist.md +1 -1
  232. package/presets/mavis/go/team/README.md +10 -0
  233. package/presets/mavis/ios-swift/adapter-map.json +1 -1
  234. package/presets/mavis/ios-swift/agents/code-reviewer.md +1 -0
  235. package/presets/mavis/ios-swift/hooks/chain-team-phases.sh +109 -0
  236. package/presets/mavis/ios-swift/rules/interactive-questions.md +8 -8
  237. package/presets/mavis/ios-swift/rules/preset-pr-checklist.md +1 -1
  238. package/presets/mavis/ios-swift/team/README.md +10 -0
  239. package/presets/mavis/java/adapter-map.json +1 -1
  240. package/presets/mavis/java/agents/code-reviewer.md +1 -0
  241. package/presets/mavis/java/hooks/chain-team-phases.sh +109 -0
  242. package/presets/mavis/java/rules/interactive-questions.md +8 -8
  243. package/presets/mavis/java/rules/preset-pr-checklist.md +1 -1
  244. package/presets/mavis/java/team/README.md +10 -0
  245. package/presets/mavis/mcp-ts/adapter-map.json +1 -1
  246. package/presets/mavis/mcp-ts/hooks/chain-team-phases.sh +109 -0
  247. package/presets/mavis/mcp-ts/rules/interactive-questions.md +8 -8
  248. package/presets/mavis/mcp-ts/rules/preset-pr-checklist.md +1 -1
  249. package/presets/mavis/mcp-ts/team/README.md +10 -0
  250. package/presets/mavis/next/MCP.md +14 -0
  251. package/presets/mavis/next/REPO_AGENTS.md +1 -1
  252. package/presets/mavis/next/adapter-map.json +1 -1
  253. package/presets/mavis/next/agents/code-reviewer.md +1 -0
  254. package/presets/mavis/next/agents/playwright-test-healer.md +1 -0
  255. package/presets/mavis/next/ai-local/rules-library/router-pages.md +5 -5
  256. package/presets/mavis/next/hooks/chain-team-phases.sh +109 -0
  257. package/presets/mavis/next/mcp.json +3 -3
  258. package/presets/mavis/next/rules/css-property-order-stylelint.md +1 -1
  259. package/presets/mavis/next/rules/design-tokens-binding.md +4 -4
  260. package/presets/mavis/next/rules/forms-validation.md +2 -2
  261. package/presets/mavis/next/rules/interactive-questions.md +8 -8
  262. package/presets/mavis/next/rules/navigation-router-stack.md +12 -0
  263. package/presets/mavis/next/rules/next-app-core.md +18 -17
  264. package/presets/mavis/next/rules/next-app-router.md +4 -17
  265. package/presets/mavis/next/rules/next-static-export.md +1 -1
  266. package/presets/mavis/next/rules/preset-pr-checklist.md +1 -1
  267. package/presets/mavis/next/rules/react-next-anti-hallucination.md +1 -1
  268. package/presets/mavis/next/rules/reference-features.md +1 -1
  269. package/presets/mavis/next/rules/security-next.md +24 -3
  270. package/presets/mavis/next/team/README.md +21 -0
  271. package/presets/mavis/next/team/fixtures/feature-with-figma-url.json +10 -0
  272. package/presets/mavis/next/team/fixtures/feature-with-ux-no-figma.json +10 -0
  273. package/presets/mavis/next/team/fixtures/mockup-review-standalone.json +9 -0
  274. package/presets/mavis/next/team/fixtures/ux-design-standalone.json +9 -0
  275. package/presets/mavis/nuxt/adapter-map.json +1 -1
  276. package/presets/mavis/nuxt/agents/code-reviewer.md +1 -0
  277. package/presets/mavis/nuxt/hooks/chain-team-phases.sh +109 -0
  278. package/presets/mavis/nuxt/rules/interactive-questions.md +8 -8
  279. package/presets/mavis/nuxt/rules/preset-pr-checklist.md +1 -1
  280. package/presets/mavis/nuxt/team/README.md +10 -0
  281. package/presets/mavis/php-hexagonal/adapter-map.json +1 -1
  282. package/presets/mavis/php-hexagonal/agents/code-reviewer.md +1 -0
  283. package/presets/mavis/php-hexagonal/hooks/chain-team-phases.sh +109 -0
  284. package/presets/mavis/php-hexagonal/rules/interactive-questions.md +8 -8
  285. package/presets/mavis/php-hexagonal/rules/preset-pr-checklist.md +1 -1
  286. package/presets/mavis/php-hexagonal/team/README.md +10 -0
  287. package/presets/mavis/php-laravel/adapter-map.json +1 -1
  288. package/presets/mavis/php-laravel/agents/code-reviewer.md +1 -0
  289. package/presets/mavis/php-laravel/hooks/chain-team-phases.sh +109 -0
  290. package/presets/mavis/php-laravel/rules/interactive-questions.md +8 -8
  291. package/presets/mavis/php-laravel/rules/preset-pr-checklist.md +1 -1
  292. package/presets/mavis/php-laravel/team/README.md +10 -0
  293. package/presets/mavis/svelte/adapter-map.json +1 -1
  294. package/presets/mavis/svelte/agents/code-reviewer.md +1 -0
  295. package/presets/mavis/svelte/hooks/chain-team-phases.sh +109 -0
  296. package/presets/mavis/svelte/rules/interactive-questions.md +8 -8
  297. package/presets/mavis/svelte/rules/preset-pr-checklist.md +1 -1
  298. package/presets/mavis/svelte/team/README.md +10 -0
  299. package/presets/opencode/android-kotlin/adapter-map.json +1 -1
  300. package/presets/opencode/android-kotlin/agents/code-reviewer.md +1 -0
  301. package/presets/opencode/android-kotlin/hooks/chain-team-phases.sh +109 -0
  302. package/presets/opencode/android-kotlin/rules/interactive-questions.md +8 -8
  303. package/presets/opencode/android-kotlin/rules/preset-pr-checklist.md +1 -1
  304. package/presets/opencode/android-kotlin/team/README.md +10 -0
  305. package/presets/opencode/go/adapter-map.json +1 -1
  306. package/presets/opencode/go/agents/code-reviewer.md +1 -0
  307. package/presets/opencode/go/hooks/chain-team-phases.sh +109 -0
  308. package/presets/opencode/go/rules/interactive-questions.md +8 -8
  309. package/presets/opencode/go/rules/preset-pr-checklist.md +1 -1
  310. package/presets/opencode/go/team/README.md +10 -0
  311. package/presets/opencode/ios-swift/adapter-map.json +1 -1
  312. package/presets/opencode/ios-swift/agents/code-reviewer.md +1 -0
  313. package/presets/opencode/ios-swift/hooks/chain-team-phases.sh +109 -0
  314. package/presets/opencode/ios-swift/rules/interactive-questions.md +8 -8
  315. package/presets/opencode/ios-swift/rules/preset-pr-checklist.md +1 -1
  316. package/presets/opencode/ios-swift/team/README.md +10 -0
  317. package/presets/opencode/java/adapter-map.json +1 -1
  318. package/presets/opencode/java/agents/code-reviewer.md +1 -0
  319. package/presets/opencode/java/hooks/chain-team-phases.sh +109 -0
  320. package/presets/opencode/java/rules/interactive-questions.md +8 -8
  321. package/presets/opencode/java/rules/preset-pr-checklist.md +1 -1
  322. package/presets/opencode/java/team/README.md +10 -0
  323. package/presets/opencode/mcp-ts/adapter-map.json +1 -1
  324. package/presets/opencode/mcp-ts/hooks/chain-team-phases.sh +109 -0
  325. package/presets/opencode/mcp-ts/rules/interactive-questions.md +8 -8
  326. package/presets/opencode/mcp-ts/rules/preset-pr-checklist.md +1 -1
  327. package/presets/opencode/mcp-ts/team/README.md +10 -0
  328. package/presets/opencode/next/MCP.md +14 -0
  329. package/presets/opencode/next/REPO_AGENTS.md +1 -1
  330. package/presets/opencode/next/adapter-map.json +1 -1
  331. package/presets/opencode/next/agents/code-reviewer.md +1 -0
  332. package/presets/opencode/next/agents/playwright-test-healer.md +1 -0
  333. package/presets/opencode/next/ai-local/rules-library/router-pages.md +5 -5
  334. package/presets/opencode/next/hooks/chain-team-phases.sh +109 -0
  335. package/presets/opencode/next/opencode.json +3 -3
  336. package/presets/opencode/next/rules/css-property-order-stylelint.md +1 -1
  337. package/presets/opencode/next/rules/design-tokens-binding.md +4 -4
  338. package/presets/opencode/next/rules/forms-validation.md +2 -2
  339. package/presets/opencode/next/rules/interactive-questions.md +8 -8
  340. package/presets/opencode/next/rules/navigation-router-stack.md +12 -0
  341. package/presets/opencode/next/rules/next-app-core.md +18 -17
  342. package/presets/opencode/next/rules/next-app-router.md +4 -17
  343. package/presets/opencode/next/rules/next-static-export.md +1 -1
  344. package/presets/opencode/next/rules/preset-pr-checklist.md +1 -1
  345. package/presets/opencode/next/rules/react-next-anti-hallucination.md +1 -1
  346. package/presets/opencode/next/rules/reference-features.md +1 -1
  347. package/presets/opencode/next/rules/security-next.md +24 -3
  348. package/presets/opencode/next/team/README.md +21 -0
  349. package/presets/opencode/next/team/fixtures/feature-with-figma-url.json +10 -0
  350. package/presets/opencode/next/team/fixtures/feature-with-ux-no-figma.json +10 -0
  351. package/presets/opencode/next/team/fixtures/mockup-review-standalone.json +9 -0
  352. package/presets/opencode/next/team/fixtures/ux-design-standalone.json +9 -0
  353. package/presets/opencode/nuxt/adapter-map.json +1 -1
  354. package/presets/opencode/nuxt/agents/code-reviewer.md +1 -0
  355. package/presets/opencode/nuxt/hooks/chain-team-phases.sh +109 -0
  356. package/presets/opencode/nuxt/rules/interactive-questions.md +8 -8
  357. package/presets/opencode/nuxt/rules/preset-pr-checklist.md +1 -1
  358. package/presets/opencode/nuxt/team/README.md +10 -0
  359. package/presets/opencode/php-hexagonal/adapter-map.json +1 -1
  360. package/presets/opencode/php-hexagonal/agents/code-reviewer.md +1 -0
  361. package/presets/opencode/php-hexagonal/hooks/chain-team-phases.sh +109 -0
  362. package/presets/opencode/php-hexagonal/rules/interactive-questions.md +8 -8
  363. package/presets/opencode/php-hexagonal/rules/preset-pr-checklist.md +1 -1
  364. package/presets/opencode/php-hexagonal/team/README.md +10 -0
  365. package/presets/opencode/php-laravel/adapter-map.json +1 -1
  366. package/presets/opencode/php-laravel/agents/code-reviewer.md +1 -0
  367. package/presets/opencode/php-laravel/hooks/chain-team-phases.sh +109 -0
  368. package/presets/opencode/php-laravel/rules/interactive-questions.md +8 -8
  369. package/presets/opencode/php-laravel/rules/preset-pr-checklist.md +1 -1
  370. package/presets/opencode/php-laravel/team/README.md +10 -0
  371. package/presets/opencode/svelte/adapter-map.json +1 -1
  372. package/presets/opencode/svelte/agents/code-reviewer.md +1 -0
  373. package/presets/opencode/svelte/hooks/chain-team-phases.sh +109 -0
  374. package/presets/opencode/svelte/rules/interactive-questions.md +8 -8
  375. package/presets/opencode/svelte/rules/preset-pr-checklist.md +1 -1
  376. package/presets/opencode/svelte/team/README.md +10 -0
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: playwright-test-planner
3
- description: Use this agent when you need to create comprehensive test plan for a web application or website
3
+ description: Playwright e2e planning specialist. Use when the task is to create or update browser test scenarios, *.cases.md plans, or QA coverage for a web flow.
4
4
  tools: Glob, Grep, Read, LS, mcp__playwright-test__browser_click, mcp__playwright-test__browser_close, mcp__playwright-test__browser_console_messages, mcp__playwright-test__browser_drag, mcp__playwright-test__browser_evaluate, mcp__playwright-test__browser_file_upload, mcp__playwright-test__browser_handle_dialog, mcp__playwright-test__browser_hover, mcp__playwright-test__browser_navigate, mcp__playwright-test__browser_navigate_back, mcp__playwright-test__browser_network_requests, mcp__playwright-test__browser_press_key, mcp__playwright-test__browser_run_code, mcp__playwright-test__browser_select_option, mcp__playwright-test__browser_snapshot, mcp__playwright-test__browser_take_screenshot, mcp__playwright-test__browser_type, mcp__playwright-test__browser_wait_for, mcp__playwright-test__planner_setup_page, mcp__playwright-test__planner_save_plan
5
5
  model: sonnet
6
6
  color: green
@@ -27,62 +27,29 @@ This subagent does **not** inherit the parent session context or `CLAUDE.md`. Re
27
27
 
28
28
  Also read matching `.ai.local/rules/*.md` (local overlay) for the active zone, and the project strict rules if present.
29
29
 
30
- You are an expert web test planner with extensive experience in quality assurance, user experience testing, and test
31
- scenario design. Your expertise includes functional testing, edge case identification, and comprehensive test coverage
32
- planning.
30
+ <!-- shared-core: quality/anti-hallucination-load-line.md -->
33
31
 
34
- ## Project-specific test structure (Next.js preset)
32
+ Load `anti-hallucination-contract` before asserting code, APIs, schemas, tool behavior, or task status.
33
+ Load `react-next-anti-hallucination` before writing or patching code or tests.
35
34
 
36
- In this project you MUST respect the existing e2e layout:
35
+ You are an expert web test planner for a Next.js frontend.
37
36
 
38
- - Test root: `app/__tests__/e2e`
39
- - Test plans/specs: `*.cases.md` files under `app/__tests__/e2e/**`
40
- - Executable tests: `*.spec.ts` files under `app/__tests__/e2e/**`
41
- - Seed test: `app/__tests__/e2e/seed.spec.ts`
42
-
43
- When you create or update a test plan:
44
-
45
- - Use the appropriate `*.cases.md` file under `app/__tests__/e2e/**` (for example,
46
- `app/__tests__/e2e/OrderHistory/order-history.cases.md`) instead of creating files in a separate `specs/` folder.
47
- - Treat these `*.cases.md` files as the canonical, human-readable test plans for the Generator and Healer agents.
48
-
49
- You will:
50
-
51
- 1. **Navigate and Explore**
52
- - Invoke the `planner_setup_page` tool once to set up page before using any other tools
53
- - Explore the browser snapshot
54
- - Do not take screenshots unless absolutely necessary
55
- - Use `browser_*` tools to navigate and discover interface
56
- - Thoroughly explore the interface, identifying all interactive elements, forms, navigation paths, and functionality
37
+ ## Project structure
57
38
 
58
- 2. **Analyze User Flows**
59
- - Map out the primary user journeys and identify critical paths through the application
60
- - Consider different user types and their typical behaviors
39
+ Follow **`playwright-agents.md`**, **`tests-e2e-structure.md`**, and the **`playwright-e2e` skill**:
61
40
 
62
- 3. **Design Comprehensive Scenarios**
63
-
64
- Create detailed test scenarios that cover:
65
- - Happy path scenarios (normal user behavior)
66
- - Edge cases and boundary conditions
67
- - Error handling and validation
68
-
69
- 4. **Structure Test Plans**
70
-
71
- Each scenario must include:
72
- - Clear, descriptive title
73
- - Detailed step-by-step instructions
74
- - Expected outcomes where appropriate
75
- - Assumptions about starting state (always assume blank/fresh state)
76
- - Success criteria and failure conditions
41
+ - Test root: `app/__tests__/e2e`
42
+ - Plans: `*.cases.md` under the relevant feature folder
43
+ - Specs: `*.spec.ts` in the same folder
44
+ - Seed/setup reference: `app/__tests__/e2e/seed.spec.ts`
77
45
 
78
- 5. **Create Documentation**
46
+ ## Work
79
47
 
80
- Submit your test plan using `planner_save_plan` tool.
48
+ 1. Read the task brief and existing `*.cases.md` files for the affected area.
49
+ 2. Explore the UI only when a running app/browser context is available.
50
+ 3. Add or update scenarios covering happy path, edge cases, validation, and error states.
51
+ 4. Keep scenarios independent and specific enough for a generator or human tester.
81
52
 
82
- **Quality Standards**:
83
- - Write steps that are specific enough for any tester to follow
84
- - Include negative testing scenarios
85
- - Ensure scenarios are independent and can be run in any order
53
+ ## Output
86
54
 
87
- **Output Format**: Always save the complete test plan as a markdown file with clear headings, numbered steps, and
88
- professional formatting suitable for sharing with development and QA teams.
55
+ Write or update the relevant `*.cases.md` file. If this is part of an agent team task, summarize changed plans and upsert the owned terminal receipt in `artifact-manifest.json`; do not mutate `status.json`.
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: task-analyst
3
3
  description: Task analysis specialist. Clarifies requirements, validates acceptance criteria, and decomposes work into concrete tasks. Use for task intake, or when the user asks to analyze or decompose a feature before coding. Writes only team artifacts; never writes production code.
4
- model: fast
4
+ model: haiku
5
5
  ---
6
6
 
7
7
  ## Rules to load (subagent context)
@@ -22,6 +22,10 @@ This subagent does **not** inherit the parent session context or `CLAUDE.md`. Re
22
22
 
23
23
  Also read matching `.ai.local/rules/*.md` (local overlay) for the active zone, and the project strict rules if present.
24
24
 
25
+ <!-- shared-core: quality/anti-hallucination-load-line.md -->
26
+
27
+ Load `anti-hallucination-contract` before asserting code, APIs, schemas, tool behavior, or task status.
28
+
25
29
  You are a senior business/technical analyst for a Next.js frontend team.
26
30
 
27
31
  Your job is to reach **Definition of Ready (DoR)** before any implementation starts. You may write only `.ai.local/team/**` artifacts. You do **not** write production code or modify application source files.
@@ -46,7 +50,7 @@ Before decomposing: state the **goal frame** (goal, user value, success criteria
46
50
 
47
51
  <!-- shared-core: agent-team/plan-graph.md -->
48
52
 
49
- Decompose as a **dependency graph**: each task carries `dependsOn[]`, the edges form a **DAG** with a critical path and parallelizable groups. Large flows are staged into **Epics / stages** with **exit criteria** (ratchet: bounded tasks stay flat). Plan revision is a named, auditable operation (`decision: replan rev N → N+1` in `.memlog.md`, then re-gate). Parallelizable groups are **proven conflict-free** before the router may mark them `parallel: true` — disjoint declared `writeScopes`, distinct agents and `artifactOutputIds`, and no producer→consumer edge. Keep task IDs stable so `steps[].taskIds` / `steps[].dependsOn[]` reuse this vocabulary (see **plan-graph** § Conflict model). Each task also lists the repo paths it may create or modify. Tasks with no `dependsOn` path between them keep those lists disjoint; a shared path stays sequential. The list is a subset of the implementing step's `writeScopes[]` when that step declares `writeScopes`. Do not put a `docs/specs/**` or `openspec/**` path and an `app/**` path in the same list.
53
+ Decompose as a **dependency graph**: each task carries `dependsOn[]`, the edges form a **DAG** with a critical path and parallelizable groups. Large flows are staged into **Epics / stages** with **exit criteria** (ratchet: bounded tasks stay flat). Plan revision is a named, auditable operation (`decision: replan rev N → N+1` in `.memlog.md`, then re-gate). Parallelizable groups are **proven conflict-free** before the router may mark them `parallel: true` — disjoint declared `writeScopes`, distinct agents and `artifactOutputIds`, and no producer→consumer edge. Keep task IDs stable so `steps[].taskIds` / `steps[].dependsOn[]` reuse this vocabulary (see **plan-graph** § Conflict model). Each task also lists the repo paths it may create or modify. Tasks with no `dependsOn` path between them keep those lists disjoint; a shared path stays sequential. The list is a subset of the implementing step's `writeScopes[]` when that step declares `writeScopes`. Do not put a `docs/specs/**` or `openspec/**` path and an `app/**` path in the same list. Maintain a `## Ready` section with the plan: the decomposition ready set is the task ids whose `dependsOn` are satisfied and whose manifest artifact or task row is not complete. A blocked row records `waiting_on` (the unmet dependency ids). See **plan-graph** § Ready.
50
54
 
51
55
  ## Claude next hand-agent parity (sync-in-change-set)
52
56
 
@@ -141,12 +145,28 @@ None | Affected — <surfaces: PD / medical data / analytics / SSR cookies / err
141
145
 
142
146
  ## Tasks
143
147
 
144
- | ID | Layer | Description | Depends on | Files | Done when |
145
- |----|-------|-------------|------------|-------|-----------|
148
+ | ID | Layer | Description | dependsOn | Files | Done when |
149
+ |----|-------|-------------|-----------|-------|-----------|
146
150
  | T1 | types | ... | — | `app/src/types/example.ts` | ... |
147
151
 
152
+ ## Dependency graph
153
+ - edges: `T2 ← T1` · critical path: `T1 → …` · parallelizable groups: `T2 | T3`
154
+
155
+ ## Ready
156
+
157
+ - ready: `T1`
158
+ - blocked: `T2` waiting_on `T1`
159
+
160
+ ## Epics / stages
161
+
162
+ | id | name | tasks | exit criteria |
163
+ |----|------|-------|---------------|
164
+
165
+ ## Plan revision
166
+ rev: 1 — record each replan as `decision: replan rev N → N+1` in `.memlog.md`, then re-gate.
167
+
148
168
  ## Suggested rule references
149
- - `rules/architecture/feature-delivery-workflow.md` for layer order
169
+ - feature-delivery-workflow.md for layer order
150
170
  ```
151
171
 
152
172
  ### Runtime state
@@ -183,7 +203,6 @@ Do not invoke the developer or any implementation subagent.
183
203
 
184
204
  **Author mode (Generate / Bootstrap):** When the user runs `/spec-start`, router intent is `spec-gen` / bootstrap, or brief/AC requests generation: load **`product-specs`** + **`product-specs-authoring`** and skill **`spec-authoring`**. You are the **primary author** (INDEX bootstrap included). Follow frontmatter v1 + required headings; update INDEX in the **same change set**; default `status: draft`. Block handoff via `open_questions` until the authoring self-check passes.
185
205
 
186
-
187
206
  **Spec mode:** Write `## Spec mode` in `brief.md` with exactly one of `consume` | `generate` | `none`. Infer if unset: spike/research/preset-only → `none`; `/spec-start` or router `spec-gen` → `generate`; otherwise `consume`. Router may echo `specMode` on `pipeline.json`.
188
207
 
189
208
  **`none`:** skip INDEX row requirement and author mode; do not invent a dummy INDEX.
@@ -204,7 +223,6 @@ Add to `brief.md`:
204
223
  - [ ] none | generate | bootstrap — sources: …
205
224
  ```
206
225
 
207
-
208
226
  ## UX design (behavioral)
209
227
 
210
228
  Load requestable skill **`ux-design`** and rule **`ux-design`** when:
@@ -222,14 +240,12 @@ Write `.ai.local/team/tasks/<slug>/ux-design.md` with the headings in rule `ux-d
222
240
 
223
241
  When produced, append `ux-design.md` to this step's **`analysis`** `authoritativePaths` / `evidencePaths`. No new manifest producer row.
224
242
 
225
-
226
243
  ## MCP usage
227
244
 
228
245
  Load requestable rule `mcp-usage` when verifying third-party library APIs (Context7) or when a local overlay MCP is present and the task fits. Discover tools at runtime; do not invent schemas. Overlay absence is not a blocker unless the user required that MCP as source of truth.
229
246
 
230
247
  If the prompt/brief has a tracker URL (Linear/Jira/Notion/…) and that MCP is ready, pull AC **read-only**. Task-folder artifacts remain SoT.
231
248
 
232
-
233
249
  ## Artifact contract
234
250
 
235
251
  - **Authoritative inputs:** read `.ai.local/team/tasks/<slug>/artifact-manifest.json` first; consume `pipeline.json`, the manifest routing entry, user-approved decisions, and any authoritative architecture/approval entries.
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: task-router
3
3
  description: Task routing specialist. Analyzes user prompt, detects intent, and writes pipeline.json with ordered agent steps. Use first for /task or when determining which subagents to run and in what order. Readonly — never writes production code.
4
- model: fast
4
+ model: haiku
5
5
  ---
6
6
 
7
7
  ## Rules to load (subagent context)
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: tech-writer
3
3
  description: Technical documentation specialist. Writes feature READMEs, migration guides, ADR summaries, and changelog entries from completed task artifacts. Docs-only — never edits production application code.
4
- model: fast
4
+ model: haiku
5
5
  ---
6
6
 
7
7
  ## Rules to load (subagent context)
@@ -2616,6 +2616,115 @@ if (!input || input.status !== 'completed') {
2616
2616
  process.exit(0);
2617
2617
  }
2618
2618
 
2619
+ // --- TEAM_DB_PROJECTION -------------------------------------------------------
2620
+ // The status, metrics, compaction and focus writes are already durable when this
2621
+ // postflight starts. The projection is a bounded child process: it must never
2622
+ // fail this stop, never change hook stdout/stderr beyond the capability line,
2623
+ // and never write a task file. A disabled switch, a missing script, or a
2624
+ // runtime without `node:sqlite` is a skip; a child failure is one log line.
2625
+ // This is a plain region marker, not a `hook-slot`: the block is identical in
2626
+ // all 40 rendered bodies and needs no per-stack fragment.
2627
+ // <<<team-db-projection>>>
2628
+ function teamDbTruthy(value) {
2629
+ if (typeof value !== 'string') return false;
2630
+ const normalized = value.trim().toLowerCase();
2631
+ return normalized === '1' || normalized === 'true' || normalized === 'yes';
2632
+ }
2633
+
2634
+ function teamDbLogPath(env) {
2635
+ const override = typeof env.AI_RULES_TEAM_DB_LOG === 'string' ? env.AI_RULES_TEAM_DB_LOG.trim() : '';
2636
+ if (override) return path.resolve(override);
2637
+ return path.join(process.cwd(), '.ai.local', 'team', 'team-db-errors.log');
2638
+ }
2639
+
2640
+ function teamDbLogPhase(env) {
2641
+ const value = typeof env.AI_RULES_TEAM_DB_SEAM === 'string' ? env.AI_RULES_TEAM_DB_SEAM.trim() : '';
2642
+ return value === 'hook' || value === 'receipt' || value === 'cli' || value === 'serve' ? value : 'hook';
2643
+ }
2644
+
2645
+ // One line per failure, newest 200 lines and at most 64 KiB. Never a prompt
2646
+ // body: only the code and the message this block owns.
2647
+ function teamDbLogFailure(env, code, message) {
2648
+ try {
2649
+ const target = teamDbLogPath(env);
2650
+ fs.mkdirSync(path.dirname(target), { recursive: true });
2651
+ const line = new Date().toISOString() + ' ' + code + ' ' + teamDbLogPhase(env) + ' ' + message;
2652
+ fs.appendFileSync(target, line + '\n');
2653
+ let content = fs.readFileSync(target, 'utf8');
2654
+ let lines = content.split('\n').filter(function (entry) { return entry.length > 0; });
2655
+ if (lines.length > 200) lines = lines.slice(lines.length - 200);
2656
+ while (Buffer.byteLength(lines.join('\n') + '\n', 'utf8') > 65536 && lines.length > 1) lines.shift();
2657
+ content = lines.join('\n') + (lines.length > 0 ? '\n' : '');
2658
+ fs.writeFileSync(target, content);
2659
+ } catch (error) {
2660
+ /* a log failure is not a stop failure */
2661
+ }
2662
+ }
2663
+
2664
+ function teamDbSqliteAvailable(env) {
2665
+ if (teamDbTruthy(env.AI_RULES_TEAM_DB_FORCE_FALLBACK)) return false;
2666
+ const match = /^(\d+)\.(\d+)\.(\d+)/.exec(String(process.versions.node || ''));
2667
+ if (!match) return false;
2668
+ const major = Number(match[1]);
2669
+ const minor = Number(match[2]);
2670
+ if (major < 22) return false;
2671
+ if (major === 22 && minor < 13) return false;
2672
+ try {
2673
+ const sqlite = require('node:sqlite');
2674
+ return typeof sqlite.DatabaseSync === 'function';
2675
+ } catch (error) {
2676
+ return false;
2677
+ }
2678
+ }
2679
+
2680
+ function teamDbProject() {
2681
+ try {
2682
+ const env = process.env;
2683
+ if (teamDbTruthy(env.AI_RULES_TEAM_DB_DISABLE)) return;
2684
+ // Same pattern as POSTFLIGHT_SLUG_RE above: the slug is re-derived from
2685
+ // `active-task.json` on this path too, so it cannot escape the tree.
2686
+ const slugPattern = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
2687
+ let slug = '';
2688
+ try {
2689
+ const active = JSON.parse(fs.readFileSync(path.join(process.cwd(), '.ai.local', 'team', 'active-task.json'), 'utf8'));
2690
+ slug = typeof active.slug === 'string' ? active.slug : '';
2691
+ } catch (error) {
2692
+ return;
2693
+ }
2694
+ if (!slug || slug.length > 48 || !slugPattern.test(slug)) return;
2695
+ const taskDir = path.join(process.cwd(), '.ai.local', 'team', 'tasks', slug);
2696
+ if (!fs.existsSync(path.join(taskDir, 'status.json'))) return;
2697
+ const script = path.join(process.cwd(), '.ai.local', 'scripts', 'team-db.mjs');
2698
+ if (!fs.existsSync(script)) return;
2699
+ if (!teamDbSqliteAvailable(env)) {
2700
+ process.stderr.write('team-db: projection skipped (node:sqlite unavailable); file-only mode\n');
2701
+ return;
2702
+ }
2703
+ const result = spawnSync(
2704
+ process.execPath,
2705
+ ['.ai.local/scripts/team-db.mjs', 'sync', '--slug', slug, '--quiet', '--no-rebuild', '--deadline-ms', '4500'],
2706
+ { cwd: process.cwd(), env: env, encoding: 'utf8', timeout: 5000, killSignal: 'SIGKILL', stdio: ['ignore', 'pipe', 'pipe'] },
2707
+ );
2708
+ if (result.error && result.error.code === 'ETIMEDOUT') {
2709
+ teamDbLogFailure(env, 'E_PROJECTION_TIMEOUT', 'projection exceeded 5000 ms and was killed');
2710
+ return;
2711
+ }
2712
+ if (result.error) {
2713
+ teamDbLogFailure(env, 'E_PROJECTION_FAILED', 'projection could not start: ' + String(result.error.code || 'unknown'));
2714
+ return;
2715
+ }
2716
+ if (typeof result.status === 'number' && result.status !== 0) {
2717
+ teamDbLogFailure(env, 'E_PROJECTION_FAILED', 'projection exited ' + result.status);
2718
+ }
2719
+ } catch (error) {
2720
+ /* the seam never fails the stop */
2721
+ }
2722
+ }
2723
+
2724
+ teamDbProject();
2725
+ // <<<team-db-projection-end>>>
2726
+ // --- end TEAM_DB_PROJECTION ---------------------------------------------------
2727
+
2619
2728
  // Ratchet: off for `light` pipelines and `spike` intents. A policy skip is
2620
2729
  // silent on purpose — a warning on every light receipt would make the
2621
2730
  // containment warnings below unreadable.
@@ -2,15 +2,15 @@
2
2
  "mcpServers": {
3
3
  "context7": {
4
4
  "command": "npx",
5
- "args": ["-y", "@upstash/context7-mcp@4.0.2"]
5
+ "args": ["-y", "@upstash/context7-mcp@4.5.0"]
6
6
  },
7
7
  "playwright-test": {
8
8
  "command": "npx",
9
- "args": ["-y", "@playwright/mcp@0.0.79"]
9
+ "args": ["-y", "@playwright/mcp@0.0.84"]
10
10
  },
11
11
  "chrome-devtools": {
12
12
  "command": "npx",
13
- "args": ["-y", "chrome-devtools-mcp@1.7.0"]
13
+ "args": ["-y", "chrome-devtools-mcp@1.12.0"]
14
14
  },
15
15
  "figma": {
16
16
  "type": "http",
@@ -55,7 +55,7 @@ The installed `next` may bundle version-pinned agent docs and a managed `AGENTS.
55
55
  |---------|----------|
56
56
  | Client `fetch` / raw HTTP from UI or `page.tsx` bypassing `@/api` | Services via `@/api` / established loaders (`api-and-data/api-services.md`, `api-and-data/http-client.md`) |
57
57
  | Invented `next/link` props that siblings never use (e.g. fake prefetch enums) | Match existing `<Link>` usage; verify against installed Next |
58
- | `getServerSideProps` / `getInitialProps`, `pages/api/**`, `route.ts`, `middleware.ts` in an `output: 'export'` repo | build-time `getStaticProps` / `getStaticPaths` or client store/thunk fetch (`stack/next-static-export.md`) |
58
+ | `getServerSideProps` / `getInitialProps`, `pages/api/**`, `route.ts`, `middleware.ts` / `proxy.ts` in an `output: 'export'` repo | build-time `getStaticProps` / `getStaticPaths` or client store/thunk fetch (`stack/next-static-export.md`) |
59
59
  | Hardcoded `/` root for links / assets when the repo uses `basePath` / `assetPrefix` | Derive from `basePath` / `assetPrefix` |
60
60
  | `next/image` `loader` / `sizes` / `quality` expecting the optimizer in a repo with `images.unoptimized: true` | The repo's image primitive; no optimizer assumptions |
61
61
 
@@ -45,7 +45,7 @@ The module is **not done** until the checklist passes.
45
45
 
46
46
  ## How to find regulated layers in the repo
47
47
 
48
- 1. `architecture/public-imports.md` rules in `.cursor/rules/`.
48
+ 1. `architecture/public-imports.md` rules in `.claude/rules/`.
49
49
  2. ESLint `no-restricted-imports` — patterns `@/<layer>/*` with barrel exception.
50
50
  3. `architecture/architecture-boundaries.md`, project README.
51
51
 
@@ -53,7 +53,7 @@ Path pointer and stack tables — in the preset adapter (`.ai.local/conventions.
53
53
 
54
54
  Before implementing, find a feature of the same type and **mirror its structure**; do not invent a new file organization.
55
55
 
56
- Taxonomy / shared core: [`presets/_shared/README.md`](../../../_shared/README.md) · [Preset contribution guide](../../../../docs/PRESET-CONTRIBUTION.md).
56
+ The preset source tree and the contribution guide are not installed in a consumer repo; copy patterns from your own codebase.
57
57
 
58
58
  ## Reference table
59
59
 
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: Navigation in UI components — short guide (full stack audit — navigation-router-stack.mdc)
2
+ description: Navigation in UI components — short guide (full stack audit — stack/navigation-router.md)
3
3
  paths:
4
4
  - app/src/ui/**/*.tsx
5
5
  ---
@@ -3,6 +3,8 @@ description: Choose navigation API by project stack (Next.js vs React Router)
3
3
  paths:
4
4
  - app/src/app/**/*
5
5
  - app/**/app/**/*
6
+ - app/src/pages/**/*
7
+ impact: HIGH
6
8
  ---
7
9
 
8
10
  # Navigation and routing: project stack first
@@ -61,3 +63,15 @@ Before proposing a navigation pattern **align with how the repo already does it*
61
63
  - **Mandatory check:** current **`dependencies`** in the relevant workspace `package.json` + **how routes and imports are already implemented** (repo search, neighboring files). Do not rely on a single signal alone (e.g. only the presence of an `app/` folder).
62
64
  - If the stack is unclear (two routers in dependencies, hybrid) — **cross-check lockfile / installed packages** and **dominant imports** in `src`/`app`, then choose the API.
63
65
  - Detect router mode and deployment model first (**`stack/next-app-core.md`**); App Router guidance (`next/navigation`) applies only when the repo uses App Router.
66
+
67
+ ## Incorrect
68
+
69
+ ```tsx
70
+ import { useRouter } from 'next/navigation' // in a Pages Router page
71
+ ```
72
+
73
+ ## Correct
74
+
75
+ ```tsx
76
+ import { useRouter } from 'next/router' // Pages Router
77
+ ```
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  description: Core principles, stack, and architecture of a Next.js application (preset)
3
+ impact: HIGH
3
4
  ---
4
5
 
5
6
  # Stack and environment
@@ -14,28 +15,29 @@ Concrete versions come **from `package.json` and configs of the target repositor
14
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 (`stack/next-app-router.md`, `stack/navigation-router.md`).
15
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 (`stack/next-static-export.md`).
16
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.
17
- - **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.
18
+ - **Env access:** `NEXT_PUBLIC_*` in `.env*` is inlined at build and is read through the repo's config module (e.g. `@/config`); `next.config.*` `env` is optional and used only when the repo already does.
19
+ - **Server/client env:** Server Components may read server-only env; Client Components never read `process.env` — import a server-only module or pass the value down as a prop.
18
20
 
19
21
  # Architectural layers
20
22
 
21
- | Layer | Directory | Details |
22
- |-------|-----------|---------|
23
- | UI | `app/src/ui/**` (pages, components) | `ui-and-accessibility/react-ui.md`, `architecture/architecture-boundaries-ui.md` |
24
- | Store | `app/src/store/**` (slices, middleware) | `api-and-data/store-rtk.md` |
25
- | API | `app/src/api/**` (services, clients, barrel) | `api-and-data/api-services.md`, `api-and-data/http-client.md` |
26
- | HTTP | `app/src/lib/clients/**`, `app/src/api/clients/**` | `api-and-data/http-client.md` |
27
- | Types | `app/src/types/**` | `architecture/public-imports.md`, `stack/types-jsdoc.md` |
28
- | Mocks | `app/src/mocks/**` | per repository layout |
29
-
30
- Layer boundaries, ports/adapters, UI→API — **`architecture/architecture-boundaries.md`**. Imports of `@/types`, `@/api` — **`architecture/public-imports.md`**.
23
+ - UI `app/src/ui/**` · Store `app/src/store/**` · API `app/src/api/**` · HTTP `app/src/lib/clients/**` / `app/src/api/clients/**` · Types `app/src/types/**` · Mocks `app/src/mocks/**`.
24
+ - Boundaries, ports/adapters, UI→API — `architecture/architecture-boundaries.md`; `@/types` / `@/api` imports — `architecture/public-imports.md`.
31
25
 
32
26
  # Agent work
33
27
 
34
- - Architecture and imports: `architecture/architecture-boundaries.md`, `architecture/public-imports.md`
35
- - Features: `architecture/feature-delivery-workflow.md` + skill `feature-delivery`
36
- - After edits: **invoke** `tooling-and-review/post-change-lint.md` (requestable, required after code edits); package manager: `tooling-and-review/package-manager.md`
37
- - Copy patterns from neighboring files in the target layer; do not use `any` (prefer `unknown` + narrowing)
28
+ - Architecture and imports — `architecture/architecture-boundaries.md`, `architecture/public-imports.md`; features — `architecture/feature-delivery-workflow.md` + skill `feature-delivery`.
29
+ - After edits: **invoke** `tooling-and-review/post-change-lint.md` (requestable, required after code edits); package manager: `tooling-and-review/package-manager.md`.
30
+ - Copy patterns from neighboring files in the target layer; do not use `any` (prefer `unknown` + narrowing).
31
+ - **Language:** resolve the dialogue language on every user message and reply in the user's **native language** (`tooling-and-review/language-policy.md`); development, reasoning, and artifacts stay **English**.
32
+
33
+ ## Incorrect
34
+
35
+ ```tsx
36
+ const apiUrl = process.env.NEXT_PUBLIC_API_URL
37
+ ```
38
38
 
39
- ## Language
39
+ ## Correct
40
40
 
41
- On every user message, before you answer, resolve the dialogue language and reply in the user's **native language**, including a question and a message without a slash command. Order: stored task `language:`, else `.ai.local` (`## Language`), else the prompt, else English. Development, reasoning, and artifacts stay **English**. Commands reuse this resolution. See `language-policy`.
41
+ ```tsx
42
+ const apiUrl = publicConfig.apiUrl // from the repo config module
43
+ ```
@@ -3,6 +3,7 @@ description: Next.js App Router — Server/Client Components, data fetching, loa
3
3
  paths:
4
4
  - app/src/app/**/*
5
5
  - app/**/app/**/*
6
+ impact: HIGH
6
7
  ---
7
8
 
8
9
  # Next.js App Router
@@ -40,7 +41,7 @@ Less guessed code is better than more. Cross-check APIs against the Next version
40
41
  |---------|----------|
41
42
  | Sync `params` / `searchParams` / `cookies()` / `headers()` when the installed Next treats them as async | `await params` / `await cookies()` / patterns from existing pages |
42
43
  | Invented `getSession()`-only server auth without project verify | Server session verify used by the repo (`tooling-and-review/security-next.md`) |
43
- | Auth enforcement only in Edge middleware | Layout/page/Server Action checks + middleware refresh if present |
44
+ | Auth enforcement only in `middleware` / `proxy` | Layout/page/Server Action checks + `middleware`/`proxy` token refresh if present |
44
45
  | New App Router APIs not in the installed Next major | Copy from a sibling route; mark `VERIFY` if unsure |
45
46
  | Client `fetch` in `page.tsx` bypassing `@/api` | Services via `@/api` / established data loaders |
46
47
 
@@ -53,26 +54,13 @@ Look at an existing route of similar complexity in `app/src/app/**` and repeat i
53
54
  ## Incorrect
54
55
 
55
56
  ```tsx
56
- import Head from 'next/head'
57
- import { useRouter } from 'next/router'
58
-
59
- export default function Page() {
60
- const router = useRouter()
61
- return <Head><title>Order</title></Head>
62
- }
57
+ 'use client'; export const metadata = { title: 'Order' }
63
58
  ```
64
59
 
65
60
  ## Correct
66
61
 
67
62
  ```tsx
68
- 'use client'
69
-
70
- import { useRouter } from 'next/navigation'
71
-
72
- export default function Page() {
73
- const router = useRouter()
74
- return null
75
- }
63
+ export const metadata = { title: 'Order' } // server page.tsx or layout.tsx
76
64
  ```
77
65
 
78
- App Router pages do not import `next/head` or `next/router`. Metadata lives in `export const metadata`. RTK hooks stay in a Client Component. Server data is loaded in the Server Component, not with `getServerSideProps`.
66
+ Metadata cannot be exported from a `'use client'` file: keep it in a server `layout.tsx` / `page.tsx` or a separate server wrapper.
@@ -14,7 +14,7 @@ Detect the deployment model **before** writing data-fetching or routing code: re
14
14
  ## Unavailable
15
15
 
16
16
  - `getServerSideProps`, `getInitialProps`.
17
- - API routes (`pages/api/**`, App Router `route.ts`) and `middleware.ts`.
17
+ - API routes (`pages/api/**`, App Router `route.ts`), `middleware.ts`, and `proxy.ts`.
18
18
  - Server Actions; server `cookies()` / `headers()`.
19
19
  - ISR / `revalidate` / `dynamic = 'force-dynamic'`.
20
20
  - The image optimizer when `images.unoptimized: true` (`next/image` `loader` / `sizes` buy nothing).
@@ -7,7 +7,7 @@ paths: []
7
7
 
8
8
  # Interactive questions (requestable)
9
9
 
10
- How to put a user-only decision to the user. Load when the answer blocks the work and the host offers an interactive question tool (OpenCode `question`, Claude Code `AskUserQuestion`, a client dialog). The always-on quality rule keeps the short preference; this file carries the full contract.
10
+ How to put a user-only decision to the user. Load when the answer blocks the work and the host offers an interactive question tool. The always-on quality rule keeps the short preference; this file carries the full contract.
11
11
 
12
12
  ## When to ask
13
13
 
@@ -17,16 +17,16 @@ How to put a user-only decision to the user. Load when the answer blocks the wor
17
17
 
18
18
  ## Widget format
19
19
 
20
- 4. **Header** → a short label (≤30 characters).
21
- 5. **Option label** → 1–5 words, in the user's terms.
20
+ 4. **Header** → a short label. Stay inside the host schema's length limit.
21
+ 5. **Option label** → a few words, in the user's terms, inside the host schema's label limit.
22
22
  6. **Option description** → the consequence or the trade-off, not a restatement of the label.
23
- 7. **Two to five options.** Put the option you recommend first and justify it in its description; do not pad the list with options you cannot defend.
24
- 8. **Multi-select** only when the choices are not mutually exclusive. The host's own free-form entry does not count toward the range.
23
+ 7. **Option count** → the host schema's range. Put the option you recommend first and justify it in its description; do not pad the list with options you cannot defend.
24
+ 8. **Multi-select** only when the choices are not mutually exclusive. A free-form entry the host adds itself does not count toward the range.
25
25
 
26
- ## The free-form answer is mandatory, the option is not
26
+ ## Free-form is a property of the host
27
27
 
28
- 9. OpenCode `question` and Claude Code `AskUserQuestion` append their own free-form entry for single and multi select. Never add an “other” option there: option values are labels, so a chosen “Other” returns that word, not the user’s text.
29
- 10. A host without that entry (a custom `dialog.select`, an MCP elicitation `enum`, a headless run) needs an explicit “Other” whose selection opens a text prompt — or prose when the answer cannot be enumerated.
28
+ 9. Use the host's free-form channel. When that channel already accepts typed text, do not add an option labeled "Other": a plain option returns its label, and the typed text belongs in the host's free-form field.
29
+ 10. A host with no free-form channel (an enum that returns only the selected label, a headless run) needs an explicit "Other" whose selection opens a text prompt — or prose when the answer cannot be enumerated.
30
30
 
31
31
  ## Fallback
32
32
 
@@ -3,7 +3,7 @@ description: "Native-language dialogue policy: development/reasoning/artifacts s
3
3
  paths:
4
4
  - .ai.local/**/*
5
5
  - AGENTS.md
6
- - .cursor/**/*
6
+ - .claude/**/*
7
7
  ---
8
8
 
9
9
  <!-- shared-core: agent-team/language-policy.md -->
@@ -11,7 +11,7 @@ paths: []
11
11
 
12
12
  After **any** change to source files in `app/**` (TS/TSX/JS/MJS, CSS, styled/Linaria in `.ts`/`.tsx`).
13
13
 
14
- Exceptions: documentation edits outside `app/`, CI configs, `.cursor/rules/**`, if application executable code did not change.
14
+ Exceptions: documentation edits outside `app/`, CI configs, `.claude/rules/**`, if application executable code did not change.
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
 
@@ -35,7 +35,7 @@ Checklist for PRs that touch `packages/ai-rules/presets/**` (and dogfood `.curso
35
35
  - [ ] **shared-core drift:** for embed-mode stems, run `packages/ai-rules/scripts/check-shared-core-drift.sh` (or document intentional fork)
36
36
  - [ ] **Packaging:** every installable preset ships `REPO_AGENTS.md`; default `hooks.json` does not reference `hooks/examples/`; `_shared/assets/docs-specs/` ships `INDEX.md` + `_templates/{page,feature}.md`; `product-specs` / `product-specs-authoring` stay requestable
37
37
  - [ ] **UI-only surfaces:** `mockup-reviewer`, `accessibility-reviewer`, `ux-design`, and the stack performance skill ship only on UI stacks (`check-preset-leakage.sh`)
38
- - [ ] **Rule eval (soft):** `node packages/ai-rules/scripts/check-rule-eval.mjs` when rule bodies changed
38
+ - [ ] **Rule eval (hard):** `node packages/ai-rules/scripts/check-rule-eval.mjs` runs inside `yarn check:preset-structure`; keep every registered golden stem paired
39
39
  - [ ] **Anti-hallucination:** `check-anti-hallucination-coverage.mjs` is green inside `yarn check:preset-structure`. Every role loads `anti-hallucination-contract`. Writer roles, including `code-reviewer`, also load `STACK_FLOOR_STEMS`. Register a new skill family in `SKILL_CONTRACT_CLASS` (`writer` or `reader`) or the gate FAILs.
40
40
  - [ ] **Gate:** `yarn check:preset-structure` from `packages/ai-rules/` (twin-map, token-budget, leakage, drift, i18n, local overlay, anti-hallucination coverage)
41
41
 
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: "Preset authoring: ≤3 always-on / session-start; meta rules never alwaysApply."
2
+ description: "Preset authoring: 3–10 always-on / session-start; meta rules never alwaysApply."
3
3
  paths:
4
4
  - packages/ai-rules/presets/**/*
5
5
  - packages/ai-rules/scripts/**/*