@bonesofspring/ai-rules 0.2.61 → 0.2.63

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 (343) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +3 -3
  3. package/bin/lib/seed-ai-local-team.js +3 -0
  4. package/bin/mavis-install.js +3 -1
  5. package/bin/opencode-install.js +3 -1
  6. package/bin/zcode-install.js +3 -1
  7. package/docs/MAVIS.md +5 -2
  8. package/docs/OPENCODE.md +5 -2
  9. package/docs/PLATFORMS.md +1 -1
  10. package/docs/PRESET-CONTRIBUTION.md +19 -16
  11. package/docs/TEAM-DB.md +7 -1
  12. package/package.json +3 -3
  13. package/presets/_shared/ai-local/scripts/check-write-scope.mjs +176 -28
  14. package/presets/_shared/ai-local/scripts/lock.mjs +60 -121
  15. package/presets/_shared/core/agent-team/agent-artifact-contracts.md +4 -0
  16. package/presets/_shared/core/agent-team/agent-team-intake.md +1 -0
  17. package/presets/_shared/core/agent-team/agent-team-orchestrator.md +5 -2
  18. package/presets/_shared/core/meta/preset-pr-checklist.md +4 -4
  19. package/presets/_shared/core/meta/preset-twin-sync.md +1 -1
  20. package/presets/_shared/hooks/check-preset-update.mjs +4 -3
  21. package/presets/claude/android-kotlin/hooks/check-preset-update.mjs +4 -3
  22. package/presets/claude/android-kotlin/rules/tooling-and-review/agent-team-intake.md +1 -0
  23. package/presets/claude/android-kotlin/rules/tooling-and-review/agent-team-orchestrator.md +5 -2
  24. package/presets/claude/android-kotlin/rules/tooling-and-review/preset-pr-checklist.md +4 -4
  25. package/presets/claude/android-kotlin/rules/tooling-and-review/preset-twin-sync.md +1 -1
  26. package/presets/claude/go/hooks/check-preset-update.mjs +4 -3
  27. package/presets/claude/go/rules/tooling-and-review/agent-team-intake.md +1 -0
  28. package/presets/claude/go/rules/tooling-and-review/agent-team-orchestrator.md +5 -2
  29. package/presets/claude/go/rules/tooling-and-review/preset-pr-checklist.md +4 -4
  30. package/presets/claude/go/rules/tooling-and-review/preset-twin-sync.md +1 -1
  31. package/presets/claude/ios-swift/hooks/check-preset-update.mjs +4 -3
  32. package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-intake.md +1 -0
  33. package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-orchestrator.md +5 -2
  34. package/presets/claude/ios-swift/rules/tooling-and-review/preset-pr-checklist.md +4 -4
  35. package/presets/claude/ios-swift/rules/tooling-and-review/preset-twin-sync.md +1 -1
  36. package/presets/claude/java/hooks/check-preset-update.mjs +4 -3
  37. package/presets/claude/java/rules/tooling-and-review/agent-team-intake.md +1 -0
  38. package/presets/claude/java/rules/tooling-and-review/agent-team-orchestrator.md +5 -2
  39. package/presets/claude/java/rules/tooling-and-review/preset-pr-checklist.md +4 -4
  40. package/presets/claude/java/rules/tooling-and-review/preset-twin-sync.md +1 -1
  41. package/presets/claude/mcp-ts/hooks/check-preset-update.mjs +4 -3
  42. package/presets/claude/mcp-ts/rules/tooling-and-review/agent-team-intake.md +1 -0
  43. package/presets/claude/mcp-ts/rules/tooling-and-review/agent-team-orchestrator.md +5 -2
  44. package/presets/claude/mcp-ts/rules/tooling-and-review/preset-pr-checklist.md +4 -4
  45. package/presets/claude/mcp-ts/rules/tooling-and-review/preset-twin-sync.md +1 -1
  46. package/presets/claude/mol/hooks/check-preset-update.mjs +4 -3
  47. package/presets/claude/mol/rules/tooling-and-review/agent-team-intake.md +1 -0
  48. package/presets/claude/mol/rules/tooling-and-review/agent-team-orchestrator.md +5 -2
  49. package/presets/claude/mol/rules/tooling-and-review/preset-pr-checklist.md +4 -4
  50. package/presets/claude/mol/rules/tooling-and-review/preset-twin-sync.md +1 -1
  51. package/presets/claude/next/agents/build-verifier.md +16 -3
  52. package/presets/claude/next/agents/feature-developer.md +2 -1
  53. package/presets/claude/next/agents/task-analyst.md +2 -0
  54. package/presets/claude/next/hooks/check-preset-update.mjs +4 -3
  55. package/presets/claude/next/rules/tooling-and-review/agent-team-intake.md +1 -0
  56. package/presets/claude/next/rules/tooling-and-review/agent-team-orchestrator.md +5 -2
  57. package/presets/claude/next/rules/tooling-and-review/preset-pr-checklist.md +4 -4
  58. package/presets/claude/next/rules/tooling-and-review/preset-twin-sync.md +1 -1
  59. package/presets/claude/nuxt/hooks/check-preset-update.mjs +4 -3
  60. package/presets/claude/nuxt/rules/tooling-and-review/agent-team-intake.md +1 -0
  61. package/presets/claude/nuxt/rules/tooling-and-review/agent-team-orchestrator.md +5 -2
  62. package/presets/claude/nuxt/rules/tooling-and-review/preset-pr-checklist.md +4 -4
  63. package/presets/claude/nuxt/rules/tooling-and-review/preset-twin-sync.md +1 -1
  64. package/presets/claude/php-hexagonal/hooks/check-preset-update.mjs +4 -3
  65. package/presets/claude/php-hexagonal/rules/tooling-and-review/agent-team-intake.md +1 -0
  66. package/presets/claude/php-hexagonal/rules/tooling-and-review/agent-team-orchestrator.md +5 -2
  67. package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-pr-checklist.md +4 -4
  68. package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-twin-sync.md +1 -1
  69. package/presets/claude/php-laravel/hooks/check-preset-update.mjs +4 -3
  70. package/presets/claude/php-laravel/rules/tooling-and-review/agent-team-intake.md +1 -0
  71. package/presets/claude/php-laravel/rules/tooling-and-review/agent-team-orchestrator.md +5 -2
  72. package/presets/claude/php-laravel/rules/tooling-and-review/preset-pr-checklist.md +4 -4
  73. package/presets/claude/php-laravel/rules/tooling-and-review/preset-twin-sync.md +1 -1
  74. package/presets/claude/svelte/hooks/check-preset-update.mjs +4 -3
  75. package/presets/claude/svelte/rules/tooling-and-review/agent-team-intake.md +1 -0
  76. package/presets/claude/svelte/rules/tooling-and-review/agent-team-orchestrator.md +5 -2
  77. package/presets/claude/svelte/rules/tooling-and-review/preset-pr-checklist.md +4 -4
  78. package/presets/claude/svelte/rules/tooling-and-review/preset-twin-sync.md +1 -1
  79. package/presets/cursor/android-kotlin/hooks/check-preset-update.mjs +4 -3
  80. package/presets/cursor/android-kotlin/rules/agent-team-intake.mdc +1 -0
  81. package/presets/cursor/android-kotlin/rules/agent-team-orchestrator.mdc +2 -1
  82. package/presets/cursor/android-kotlin/rules/preset-pr-checklist.mdc +4 -4
  83. package/presets/cursor/android-kotlin/rules/preset-twin-sync.mdc +1 -1
  84. package/presets/cursor/go/hooks/check-preset-update.mjs +4 -3
  85. package/presets/cursor/go/rules/agent-team-intake.mdc +1 -0
  86. package/presets/cursor/go/rules/agent-team-orchestrator.mdc +2 -1
  87. package/presets/cursor/go/rules/preset-pr-checklist.mdc +4 -4
  88. package/presets/cursor/go/rules/preset-twin-sync.mdc +1 -1
  89. package/presets/cursor/ios-swift/hooks/check-preset-update.mjs +4 -3
  90. package/presets/cursor/ios-swift/rules/agent-team-intake.mdc +1 -0
  91. package/presets/cursor/ios-swift/rules/agent-team-orchestrator.mdc +2 -1
  92. package/presets/cursor/ios-swift/rules/preset-pr-checklist.mdc +4 -4
  93. package/presets/cursor/ios-swift/rules/preset-twin-sync.mdc +1 -1
  94. package/presets/cursor/java/hooks/check-preset-update.mjs +4 -3
  95. package/presets/cursor/java/rules/agent-team-intake.mdc +1 -0
  96. package/presets/cursor/java/rules/agent-team-orchestrator.mdc +2 -1
  97. package/presets/cursor/java/rules/preset-pr-checklist.mdc +4 -4
  98. package/presets/cursor/java/rules/preset-twin-sync.mdc +1 -1
  99. package/presets/cursor/mcp-ts/hooks/check-preset-update.mjs +4 -3
  100. package/presets/cursor/mcp-ts/rules/agent-team-intake.mdc +1 -0
  101. package/presets/cursor/mcp-ts/rules/agent-team-orchestrator.mdc +2 -1
  102. package/presets/cursor/mcp-ts/rules/preset-pr-checklist.mdc +4 -4
  103. package/presets/cursor/mcp-ts/rules/preset-twin-sync.mdc +1 -1
  104. package/presets/cursor/mol/hooks/check-preset-update.mjs +4 -3
  105. package/presets/cursor/mol/rules/agent-team-intake.mdc +1 -0
  106. package/presets/cursor/mol/rules/agent-team-orchestrator.mdc +2 -1
  107. package/presets/cursor/mol/rules/preset-pr-checklist.mdc +4 -4
  108. package/presets/cursor/mol/rules/preset-twin-sync.mdc +1 -1
  109. package/presets/cursor/next/agents/build-verifier.md +16 -3
  110. package/presets/cursor/next/agents/feature-developer.md +2 -1
  111. package/presets/cursor/next/agents/task-analyst.md +2 -0
  112. package/presets/cursor/next/hooks/check-preset-update.mjs +4 -3
  113. package/presets/cursor/next/rules/agent-team-intake.mdc +1 -0
  114. package/presets/cursor/next/rules/agent-team-orchestrator.mdc +2 -1
  115. package/presets/cursor/next/rules/preset-pr-checklist.mdc +4 -4
  116. package/presets/cursor/next/rules/preset-twin-sync.mdc +1 -1
  117. package/presets/cursor/nuxt/hooks/check-preset-update.mjs +4 -3
  118. package/presets/cursor/nuxt/rules/agent-team-intake.mdc +1 -0
  119. package/presets/cursor/nuxt/rules/agent-team-orchestrator.mdc +2 -1
  120. package/presets/cursor/nuxt/rules/preset-pr-checklist.mdc +4 -4
  121. package/presets/cursor/nuxt/rules/preset-twin-sync.mdc +1 -1
  122. package/presets/cursor/php-hexagonal/hooks/check-preset-update.mjs +4 -3
  123. package/presets/cursor/php-hexagonal/rules/agent-team-intake.mdc +1 -0
  124. package/presets/cursor/php-hexagonal/rules/agent-team-orchestrator.mdc +2 -1
  125. package/presets/cursor/php-hexagonal/rules/preset-pr-checklist.mdc +4 -4
  126. package/presets/cursor/php-hexagonal/rules/preset-twin-sync.mdc +1 -1
  127. package/presets/cursor/php-laravel/hooks/check-preset-update.mjs +4 -3
  128. package/presets/cursor/php-laravel/rules/agent-team-intake.mdc +1 -0
  129. package/presets/cursor/php-laravel/rules/agent-team-orchestrator.mdc +2 -1
  130. package/presets/cursor/php-laravel/rules/preset-pr-checklist.mdc +4 -4
  131. package/presets/cursor/php-laravel/rules/preset-twin-sync.mdc +1 -1
  132. package/presets/cursor/svelte/hooks/check-preset-update.mjs +4 -3
  133. package/presets/cursor/svelte/rules/agent-team-intake.mdc +1 -0
  134. package/presets/cursor/svelte/rules/agent-team-orchestrator.mdc +2 -1
  135. package/presets/cursor/svelte/rules/preset-pr-checklist.mdc +4 -4
  136. package/presets/cursor/svelte/rules/preset-twin-sync.mdc +1 -1
  137. package/presets/mavis/android-kotlin/adapter-map.json +1 -1
  138. package/presets/mavis/android-kotlin/hooks/check-preset-update.mjs +4 -3
  139. package/presets/mavis/android-kotlin/rules/agent-team-intake.md +1 -0
  140. package/presets/mavis/android-kotlin/rules/agent-team-orchestrator.md +5 -2
  141. package/presets/mavis/android-kotlin/rules/preset-pr-checklist.md +4 -4
  142. package/presets/mavis/android-kotlin/rules/preset-twin-sync.md +1 -1
  143. package/presets/mavis/go/adapter-map.json +1 -1
  144. package/presets/mavis/go/hooks/check-preset-update.mjs +4 -3
  145. package/presets/mavis/go/rules/agent-team-intake.md +1 -0
  146. package/presets/mavis/go/rules/agent-team-orchestrator.md +5 -2
  147. package/presets/mavis/go/rules/preset-pr-checklist.md +4 -4
  148. package/presets/mavis/go/rules/preset-twin-sync.md +1 -1
  149. package/presets/mavis/ios-swift/adapter-map.json +1 -1
  150. package/presets/mavis/ios-swift/hooks/check-preset-update.mjs +4 -3
  151. package/presets/mavis/ios-swift/rules/agent-team-intake.md +1 -0
  152. package/presets/mavis/ios-swift/rules/agent-team-orchestrator.md +5 -2
  153. package/presets/mavis/ios-swift/rules/preset-pr-checklist.md +4 -4
  154. package/presets/mavis/ios-swift/rules/preset-twin-sync.md +1 -1
  155. package/presets/mavis/java/adapter-map.json +1 -1
  156. package/presets/mavis/java/hooks/check-preset-update.mjs +4 -3
  157. package/presets/mavis/java/rules/agent-team-intake.md +1 -0
  158. package/presets/mavis/java/rules/agent-team-orchestrator.md +5 -2
  159. package/presets/mavis/java/rules/preset-pr-checklist.md +4 -4
  160. package/presets/mavis/java/rules/preset-twin-sync.md +1 -1
  161. package/presets/mavis/mcp-ts/adapter-map.json +1 -1
  162. package/presets/mavis/mcp-ts/hooks/check-preset-update.mjs +4 -3
  163. package/presets/mavis/mcp-ts/rules/agent-team-intake.md +1 -0
  164. package/presets/mavis/mcp-ts/rules/agent-team-orchestrator.md +5 -2
  165. package/presets/mavis/mcp-ts/rules/preset-pr-checklist.md +4 -4
  166. package/presets/mavis/mcp-ts/rules/preset-twin-sync.md +1 -1
  167. package/presets/mavis/mol/adapter-map.json +1 -1
  168. package/presets/mavis/mol/hooks/check-preset-update.mjs +4 -3
  169. package/presets/mavis/mol/rules/agent-team-intake.md +1 -0
  170. package/presets/mavis/mol/rules/agent-team-orchestrator.md +5 -2
  171. package/presets/mavis/mol/rules/preset-pr-checklist.md +4 -4
  172. package/presets/mavis/mol/rules/preset-twin-sync.md +1 -1
  173. package/presets/mavis/next/adapter-map.json +1 -1
  174. package/presets/mavis/next/agents/build-verifier.md +16 -3
  175. package/presets/mavis/next/agents/feature-developer.md +2 -1
  176. package/presets/mavis/next/agents/task-analyst.md +2 -0
  177. package/presets/mavis/next/hooks/check-preset-update.mjs +4 -3
  178. package/presets/mavis/next/rules/agent-team-intake.md +1 -0
  179. package/presets/mavis/next/rules/agent-team-orchestrator.md +5 -2
  180. package/presets/mavis/next/rules/preset-pr-checklist.md +4 -4
  181. package/presets/mavis/next/rules/preset-twin-sync.md +1 -1
  182. package/presets/mavis/nuxt/adapter-map.json +1 -1
  183. package/presets/mavis/nuxt/hooks/check-preset-update.mjs +4 -3
  184. package/presets/mavis/nuxt/rules/agent-team-intake.md +1 -0
  185. package/presets/mavis/nuxt/rules/agent-team-orchestrator.md +5 -2
  186. package/presets/mavis/nuxt/rules/preset-pr-checklist.md +4 -4
  187. package/presets/mavis/nuxt/rules/preset-twin-sync.md +1 -1
  188. package/presets/mavis/php-hexagonal/adapter-map.json +1 -1
  189. package/presets/mavis/php-hexagonal/hooks/check-preset-update.mjs +4 -3
  190. package/presets/mavis/php-hexagonal/rules/agent-team-intake.md +1 -0
  191. package/presets/mavis/php-hexagonal/rules/agent-team-orchestrator.md +5 -2
  192. package/presets/mavis/php-hexagonal/rules/preset-pr-checklist.md +4 -4
  193. package/presets/mavis/php-hexagonal/rules/preset-twin-sync.md +1 -1
  194. package/presets/mavis/php-laravel/adapter-map.json +1 -1
  195. package/presets/mavis/php-laravel/hooks/check-preset-update.mjs +4 -3
  196. package/presets/mavis/php-laravel/rules/agent-team-intake.md +1 -0
  197. package/presets/mavis/php-laravel/rules/agent-team-orchestrator.md +5 -2
  198. package/presets/mavis/php-laravel/rules/preset-pr-checklist.md +4 -4
  199. package/presets/mavis/php-laravel/rules/preset-twin-sync.md +1 -1
  200. package/presets/mavis/svelte/adapter-map.json +1 -1
  201. package/presets/mavis/svelte/hooks/check-preset-update.mjs +4 -3
  202. package/presets/mavis/svelte/rules/agent-team-intake.md +1 -0
  203. package/presets/mavis/svelte/rules/agent-team-orchestrator.md +5 -2
  204. package/presets/mavis/svelte/rules/preset-pr-checklist.md +4 -4
  205. package/presets/mavis/svelte/rules/preset-twin-sync.md +1 -1
  206. package/presets/opencode/android-kotlin/adapter-map.json +1 -1
  207. package/presets/opencode/android-kotlin/hooks/check-preset-update.mjs +4 -3
  208. package/presets/opencode/android-kotlin/rules/agent-team-intake.md +1 -0
  209. package/presets/opencode/android-kotlin/rules/agent-team-orchestrator.md +5 -2
  210. package/presets/opencode/android-kotlin/rules/preset-pr-checklist.md +4 -4
  211. package/presets/opencode/android-kotlin/rules/preset-twin-sync.md +1 -1
  212. package/presets/opencode/go/adapter-map.json +1 -1
  213. package/presets/opencode/go/hooks/check-preset-update.mjs +4 -3
  214. package/presets/opencode/go/rules/agent-team-intake.md +1 -0
  215. package/presets/opencode/go/rules/agent-team-orchestrator.md +5 -2
  216. package/presets/opencode/go/rules/preset-pr-checklist.md +4 -4
  217. package/presets/opencode/go/rules/preset-twin-sync.md +1 -1
  218. package/presets/opencode/ios-swift/adapter-map.json +1 -1
  219. package/presets/opencode/ios-swift/hooks/check-preset-update.mjs +4 -3
  220. package/presets/opencode/ios-swift/rules/agent-team-intake.md +1 -0
  221. package/presets/opencode/ios-swift/rules/agent-team-orchestrator.md +5 -2
  222. package/presets/opencode/ios-swift/rules/preset-pr-checklist.md +4 -4
  223. package/presets/opencode/ios-swift/rules/preset-twin-sync.md +1 -1
  224. package/presets/opencode/java/adapter-map.json +1 -1
  225. package/presets/opencode/java/hooks/check-preset-update.mjs +4 -3
  226. package/presets/opencode/java/rules/agent-team-intake.md +1 -0
  227. package/presets/opencode/java/rules/agent-team-orchestrator.md +5 -2
  228. package/presets/opencode/java/rules/preset-pr-checklist.md +4 -4
  229. package/presets/opencode/java/rules/preset-twin-sync.md +1 -1
  230. package/presets/opencode/mcp-ts/adapter-map.json +1 -1
  231. package/presets/opencode/mcp-ts/hooks/check-preset-update.mjs +4 -3
  232. package/presets/opencode/mcp-ts/rules/agent-team-intake.md +1 -0
  233. package/presets/opencode/mcp-ts/rules/agent-team-orchestrator.md +5 -2
  234. package/presets/opencode/mcp-ts/rules/preset-pr-checklist.md +4 -4
  235. package/presets/opencode/mcp-ts/rules/preset-twin-sync.md +1 -1
  236. package/presets/opencode/mol/adapter-map.json +1 -1
  237. package/presets/opencode/mol/hooks/check-preset-update.mjs +4 -3
  238. package/presets/opencode/mol/rules/agent-team-intake.md +1 -0
  239. package/presets/opencode/mol/rules/agent-team-orchestrator.md +5 -2
  240. package/presets/opencode/mol/rules/preset-pr-checklist.md +4 -4
  241. package/presets/opencode/mol/rules/preset-twin-sync.md +1 -1
  242. package/presets/opencode/next/adapter-map.json +1 -1
  243. package/presets/opencode/next/agents/build-verifier.md +16 -3
  244. package/presets/opencode/next/agents/feature-developer.md +2 -1
  245. package/presets/opencode/next/agents/task-analyst.md +2 -0
  246. package/presets/opencode/next/hooks/check-preset-update.mjs +4 -3
  247. package/presets/opencode/next/rules/agent-team-intake.md +1 -0
  248. package/presets/opencode/next/rules/agent-team-orchestrator.md +5 -2
  249. package/presets/opencode/next/rules/preset-pr-checklist.md +4 -4
  250. package/presets/opencode/next/rules/preset-twin-sync.md +1 -1
  251. package/presets/opencode/nuxt/adapter-map.json +1 -1
  252. package/presets/opencode/nuxt/hooks/check-preset-update.mjs +4 -3
  253. package/presets/opencode/nuxt/rules/agent-team-intake.md +1 -0
  254. package/presets/opencode/nuxt/rules/agent-team-orchestrator.md +5 -2
  255. package/presets/opencode/nuxt/rules/preset-pr-checklist.md +4 -4
  256. package/presets/opencode/nuxt/rules/preset-twin-sync.md +1 -1
  257. package/presets/opencode/php-hexagonal/adapter-map.json +1 -1
  258. package/presets/opencode/php-hexagonal/hooks/check-preset-update.mjs +4 -3
  259. package/presets/opencode/php-hexagonal/rules/agent-team-intake.md +1 -0
  260. package/presets/opencode/php-hexagonal/rules/agent-team-orchestrator.md +5 -2
  261. package/presets/opencode/php-hexagonal/rules/preset-pr-checklist.md +4 -4
  262. package/presets/opencode/php-hexagonal/rules/preset-twin-sync.md +1 -1
  263. package/presets/opencode/php-laravel/adapter-map.json +1 -1
  264. package/presets/opencode/php-laravel/hooks/check-preset-update.mjs +4 -3
  265. package/presets/opencode/php-laravel/rules/agent-team-intake.md +1 -0
  266. package/presets/opencode/php-laravel/rules/agent-team-orchestrator.md +5 -2
  267. package/presets/opencode/php-laravel/rules/preset-pr-checklist.md +4 -4
  268. package/presets/opencode/php-laravel/rules/preset-twin-sync.md +1 -1
  269. package/presets/opencode/svelte/adapter-map.json +1 -1
  270. package/presets/opencode/svelte/hooks/check-preset-update.mjs +4 -3
  271. package/presets/opencode/svelte/rules/agent-team-intake.md +1 -0
  272. package/presets/opencode/svelte/rules/agent-team-orchestrator.md +5 -2
  273. package/presets/opencode/svelte/rules/preset-pr-checklist.md +4 -4
  274. package/presets/opencode/svelte/rules/preset-twin-sync.md +1 -1
  275. package/presets/zcode/android-kotlin/adapter-map.json +1 -1
  276. package/presets/zcode/android-kotlin/hooks/check-preset-update.mjs +4 -3
  277. package/presets/zcode/android-kotlin/rules/agent-team-intake.md +1 -0
  278. package/presets/zcode/android-kotlin/rules/agent-team-orchestrator.md +5 -2
  279. package/presets/zcode/android-kotlin/rules/preset-pr-checklist.md +4 -4
  280. package/presets/zcode/android-kotlin/rules/preset-twin-sync.md +1 -1
  281. package/presets/zcode/go/adapter-map.json +1 -1
  282. package/presets/zcode/go/hooks/check-preset-update.mjs +4 -3
  283. package/presets/zcode/go/rules/agent-team-intake.md +1 -0
  284. package/presets/zcode/go/rules/agent-team-orchestrator.md +5 -2
  285. package/presets/zcode/go/rules/preset-pr-checklist.md +4 -4
  286. package/presets/zcode/go/rules/preset-twin-sync.md +1 -1
  287. package/presets/zcode/ios-swift/adapter-map.json +1 -1
  288. package/presets/zcode/ios-swift/hooks/check-preset-update.mjs +4 -3
  289. package/presets/zcode/ios-swift/rules/agent-team-intake.md +1 -0
  290. package/presets/zcode/ios-swift/rules/agent-team-orchestrator.md +5 -2
  291. package/presets/zcode/ios-swift/rules/preset-pr-checklist.md +4 -4
  292. package/presets/zcode/ios-swift/rules/preset-twin-sync.md +1 -1
  293. package/presets/zcode/java/adapter-map.json +1 -1
  294. package/presets/zcode/java/hooks/check-preset-update.mjs +4 -3
  295. package/presets/zcode/java/rules/agent-team-intake.md +1 -0
  296. package/presets/zcode/java/rules/agent-team-orchestrator.md +5 -2
  297. package/presets/zcode/java/rules/preset-pr-checklist.md +4 -4
  298. package/presets/zcode/java/rules/preset-twin-sync.md +1 -1
  299. package/presets/zcode/mcp-ts/adapter-map.json +1 -1
  300. package/presets/zcode/mcp-ts/hooks/check-preset-update.mjs +4 -3
  301. package/presets/zcode/mcp-ts/rules/agent-team-intake.md +1 -0
  302. package/presets/zcode/mcp-ts/rules/agent-team-orchestrator.md +5 -2
  303. package/presets/zcode/mcp-ts/rules/preset-pr-checklist.md +4 -4
  304. package/presets/zcode/mcp-ts/rules/preset-twin-sync.md +1 -1
  305. package/presets/zcode/mol/adapter-map.json +1 -1
  306. package/presets/zcode/mol/hooks/check-preset-update.mjs +4 -3
  307. package/presets/zcode/mol/rules/agent-team-intake.md +1 -0
  308. package/presets/zcode/mol/rules/agent-team-orchestrator.md +5 -2
  309. package/presets/zcode/mol/rules/preset-pr-checklist.md +4 -4
  310. package/presets/zcode/mol/rules/preset-twin-sync.md +1 -1
  311. package/presets/zcode/next/adapter-map.json +1 -1
  312. package/presets/zcode/next/agents/build-verifier.md +16 -3
  313. package/presets/zcode/next/agents/feature-developer.md +2 -1
  314. package/presets/zcode/next/agents/task-analyst.md +2 -0
  315. package/presets/zcode/next/hooks/check-preset-update.mjs +4 -3
  316. package/presets/zcode/next/rules/agent-team-intake.md +1 -0
  317. package/presets/zcode/next/rules/agent-team-orchestrator.md +5 -2
  318. package/presets/zcode/next/rules/preset-pr-checklist.md +4 -4
  319. package/presets/zcode/next/rules/preset-twin-sync.md +1 -1
  320. package/presets/zcode/nuxt/adapter-map.json +1 -1
  321. package/presets/zcode/nuxt/hooks/check-preset-update.mjs +4 -3
  322. package/presets/zcode/nuxt/rules/agent-team-intake.md +1 -0
  323. package/presets/zcode/nuxt/rules/agent-team-orchestrator.md +5 -2
  324. package/presets/zcode/nuxt/rules/preset-pr-checklist.md +4 -4
  325. package/presets/zcode/nuxt/rules/preset-twin-sync.md +1 -1
  326. package/presets/zcode/php-hexagonal/adapter-map.json +1 -1
  327. package/presets/zcode/php-hexagonal/hooks/check-preset-update.mjs +4 -3
  328. package/presets/zcode/php-hexagonal/rules/agent-team-intake.md +1 -0
  329. package/presets/zcode/php-hexagonal/rules/agent-team-orchestrator.md +5 -2
  330. package/presets/zcode/php-hexagonal/rules/preset-pr-checklist.md +4 -4
  331. package/presets/zcode/php-hexagonal/rules/preset-twin-sync.md +1 -1
  332. package/presets/zcode/php-laravel/adapter-map.json +1 -1
  333. package/presets/zcode/php-laravel/hooks/check-preset-update.mjs +4 -3
  334. package/presets/zcode/php-laravel/rules/agent-team-intake.md +1 -0
  335. package/presets/zcode/php-laravel/rules/agent-team-orchestrator.md +5 -2
  336. package/presets/zcode/php-laravel/rules/preset-pr-checklist.md +4 -4
  337. package/presets/zcode/php-laravel/rules/preset-twin-sync.md +1 -1
  338. package/presets/zcode/svelte/adapter-map.json +1 -1
  339. package/presets/zcode/svelte/hooks/check-preset-update.mjs +4 -3
  340. package/presets/zcode/svelte/rules/agent-team-intake.md +1 -0
  341. package/presets/zcode/svelte/rules/agent-team-orchestrator.md +5 -2
  342. package/presets/zcode/svelte/rules/preset-pr-checklist.md +4 -4
  343. package/presets/zcode/svelte/rules/preset-twin-sync.md +1 -1
@@ -33,7 +33,7 @@ Validate: `check-mavis-adapter-map.mjs`, `check-opencode-adapter-map.mjs`, `chec
33
33
  - **Thin aliases** (`agent-team-intake`, `technical-retro`): may be shorter (soft) if they only point to a command/skill.
34
34
  - **Slim-companion rules** (UI-edit bundle, slim app-cores, slim tooling): may be shorter only if the body is a pointer into shared-core / stack prose. `check-preset-token-budget.sh` enforces this via `SLIM_COMPANION_ALLOWLIST` and the 5-line floor; 6–14-line stems outside the allow-list are slim violations.
35
35
 
36
- ## Severity (`check:preset-structure`)
36
+ ## Severity (structure gates)
37
37
 
38
38
  - Missing or stale generated Claude twin for a changed Cursor rule → **FAIL** (every stack under `presets/cursor/`; mapping table required).
39
39
  - `cursor/<stack>` mapped source changed without mavis / opencode regeneration, or with `adapter-map.json` `sourceRevision` drift → **FAIL**.
@@ -3,7 +3,7 @@
3
3
  "platform": "mavis",
4
4
  "stack": "mol",
5
5
  "semanticSource": "cursor/mol",
6
- "sourceRevision": "50f25ebc4ed5d812a2e1f9f3bee5ff0bc491dbf245f8f9cdb04875a581214b9e",
6
+ "sourceRevision": "b08a36171df0584cc3f910e225fea24286934dfa0ea9f2a013c56ecfa73c1249",
7
7
  "entries": [
8
8
  {
9
9
  "source": "AGENTS.md",
@@ -10,7 +10,7 @@ import { fileURLToPath } from 'node:url';
10
10
  export const PACKAGE_NAME = '@bonesofspring/ai-rules';
11
11
  export const REGISTRY_URL = 'https://registry.npmjs.org/@bonesofspring/ai-rules/latest';
12
12
  export const CACHE_TTL_MS = 60 * 60 * 1000;
13
- export const TOOL_ROOTS = ['.cursor', '.claude', '.mavis', '.opencode'];
13
+ export const TOOL_ROOTS = ['.cursor', '.claude', '.mavis', '.opencode', '.zcode'];
14
14
 
15
15
  const RELEASE_VERSION = /^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/;
16
16
 
@@ -75,9 +75,10 @@ export function buildNotice(installs, latest) {
75
75
  (item) => item.version === null || compareVersions(item.version, latest) < 0,
76
76
  );
77
77
  if (behind.length === 0) return '';
78
+ const installed = formatInstalled(behind);
78
79
  return [
79
80
  `Preset update available for ${PACKAGE_NAME}.`,
80
- `Installed: ${formatInstalled(behind)}. Latest: ${latest}.`,
81
+ `Installed: ${installed}. Latest: ${latest}.`,
81
82
  'The first block of the reply is only this notice, before any task text.',
82
83
  'Use a level-2 heading and one markdown blockquote. Then a blank line. Then the task answer.',
83
84
  'Do not fold the notice into the task text.',
@@ -86,7 +87,7 @@ export function buildNotice(installs, latest) {
86
87
  'Shape:',
87
88
  '## Preset update',
88
89
  '',
89
- `> Installed \`${PACKAGE_NAME}\` **<installed>**. Latest **${latest}**. Run \`/update\`.`,
90
+ `> Installed \`${PACKAGE_NAME}\` **${installed}**. Latest **${latest}**. Run \`/update\`.`,
90
91
  ].join('\n');
91
92
  }
92
93
 
@@ -10,5 +10,6 @@ When the user message looks like a **work request** (implement, add, fix, refact
10
10
  4. A work request now runs the planning workflow — **goal frame → requirements → information-sufficiency → decompose** (dependency graph / epics); see **task-framing** and **plan-graph**.
11
11
  5. Every **work request** — with or without `/task`, and even when the user says “no pipeline” / “just do it” — persists the **verbatim** original prompt at `.ai.local/team/tasks/<slug>/prompt.md`. Prefer `/task` (its **Slug** step writes it). If handling inline without `/task`, first create the slug dir and write `prompt.md` (write-if-absent), then proceed. Pure questions and trivial one-liners are not work requests → no file. On an inline follow-up for an existing slug (no `/task`) where the user authors new text, append it verbatim to `.ai.local/team/tasks/<slug>/prompt-log.md` (`seq` = max + 1; create on first append; exclude machine-generated and empty/argument-less invocations).
12
12
  6. **Reuse the dialogue language already resolved on this turn** (always-on `ai-local-overlay` / **language-policy**). A question and a message without a slash command still resolve before you speak. When this request writes `prompt.md`, persist that tag once in the header (`language: <BCP-47>`) + a `.memlog.md` `event:` line. Development, reasoning, and artifacts stay English. The setting wins over a mid-task prompt switch (surface it once, never ask). See **language-policy**.
13
+ 7. **Project the intake write.** After `prompt.md` is written for an inline (non-`/task`) work request, run `node .ai.local/scripts/team-db.mjs sync --slug <slug> --deadline-ms 4500` once, so the new task row and its prompt reach the database. A projection failure is reported to the user, never blocks the request; the next full sync remains the convergence path. Do not run a full sync from intake.
13
14
 
14
15
  Exceptions: user explicitly says “no pipeline”, “just do it”, or continues an active slug.
@@ -146,6 +146,8 @@ A producer invoked outside `pipeline.json.steps` — a remediation pass after a
146
146
  ## Plan revision (replanning)
147
147
  Replanning is a **named, auditable operation** — never a silent reorder. Trigger it when an evaluation oracle fails twice on the same task, when scope or requirements change, or when a previously unknown dependency/consumer is discovered. Procedure: append `decision: replan rev N → N+1` (with the reason) to `.memlog.md`, update `decomposition.md` (task add/remove or dependency change) and any optional plan fields, then **re-run the affected gate**. Scope-changing revisions return to the human gate.
148
148
 
149
+ - **Rules in flight.** At slug bootstrap, when `.ai.local/rules/**` or `.ai.local/conventions.md` has uncommitted changes, ask once whether a policy change is still in progress before `steps[0]`. A policy that lands mid-task invalidates an approved plan: it is a `planRevision` with a new confirmation, never a silent scope change — stop and re-confirm instead of letting a specialist discover it halfway through.
150
+
149
151
  ## Context budget & checkpoint/resume
150
152
 
151
153
  Work in bounded waves (one artifact class across the target surface). **Checkpoint** each completed wave to `.memlog.md` (`## <date>` + an `event:` line) and record the produced paths on the `implementation` manifest entry (`authoritativePaths`). That checkpoint is the hook `writeStatus` path: it rewrites `.ai.local/team/tasks/<slug>/focus.md`. `focus.md` is a view, not the system of record. It lists slug, pipeline step index, authoritative paths for incomplete manifest ids, the last `.memlog.md` `event:` line, the next gate, one decomposition ready-set line, and one archive index line, and it stays under 100 lines. `status.json`, `metrics.json`, `artifact-manifest.json`, and `.memlog.md` stay the system of record. A resumed run (`/task-continue`) reads `focus.md` first, then `artifact-manifest.json` and `.memlog.md`, and continues at the first stage whose exit criteria are unmet — never re-derive state from the chat. A completed manifest entry keeps id, status, and `authoritativePaths`, and the default resume read omits that entry's markdown body; closing it appends one new `.memlog.md` event: line, moves the bulky body to `.ai.local/team/tasks/<slug>/archive/YYYY-MM-DD/`, and leaves earlier memlog lines, the human-readable slug and artifact ids, and the manifest entry in place, with no Beads hash ids and no Taskmaster tags. Mechanical waves (generation, embed sync) are delegated to repo scripts. An **interrupted producer** (tool abort, killed session) is resumed, not restarted: run the stack's compile gate on the working tree first, and when it is red hand the failing output to the same producer with a `fix and finish` brief instead of starting a second parallel attempt. When the host runtime writes no `status.json` (manual-hook hosts such as OpenCode), the resume checkpoint is `artifact-manifest.json` + `.memlog.md`; never gate a resume on a file the runtime does not produce. See **context-and-iteration** for the budget, checkpoint, resume, and refinement loop.
@@ -228,7 +230,7 @@ On each `subagentStop`, the hook reconciles `status.state` from the completing p
228
230
  | `scope` | e.g. `unit-in-dev`, `e2e-only` — passed to developer/qa |
229
231
  | `model` | `cheap` \| `standard` \| `strong` — optional tier override |
230
232
 
231
- `writeScopes` are reconciled after the step, never in the hook: `node .ai.local/scripts/check-write-scope.mjs --slug <slug> --step <step-id> --json` labels every changed path `declared`, `derived`, or `out-of-scope`. `build-verifier` hard-fails an out-of-scope implementation write; `code-reviewer` reports a reviewer-step path as advisory.
233
+ `writeScopes` are reconciled after the step, never in the hook: `node .ai.local/scripts/check-write-scope.mjs --slug <slug> --step <step-id> --json` labels every changed path `declared`, `derived`, or `out-of-scope`. The orchestrator writes the step baseline (`--step <step-id> --save-baseline`) before the step writes, so the audit sees this step's paths and not the earlier ones. Exit `3` is a skip, not a failure: a pipeline that predates step ids or `writeScopes` is not auditable, and the reason goes under `## Soft notes`. `build-verifier` hard-fails an out-of-scope implementation write; `code-reviewer` reports a reviewer-step path as advisory.
232
234
 
233
235
  ## Rules (strict)
234
236
 
@@ -241,7 +243,7 @@ On each `subagentStop`, the hook reconciles `status.state` from the completing p
241
243
  7. On `validation_failed` from `build-verifier`: hook sets `retryAfterFix: build-verifier` → developer → build-verifier.
242
244
  8. When all steps complete, suggest `/technical-retro <slug>`.
243
245
  9. If `autoChain: false` in pipeline, do not rely on hook — manual step only.
244
- 10. **Persist the verbatim original prompt.** Every `/task` and every routed work request writes the user's raw prompt to `.ai.local/team/tasks/<slug>/prompt.md` during slug bootstrap (write-if-absent; never overwrite on resume). It is not a manifest `artifacts[]` body — register the path on the `routing` entry. See **agent-artifact-contracts** § Prompt artifact. Also append every **subsequent user-authored** prompt for the same slug — a new user message while the slug is active, `/task-continue` arguments, human-gate feedback, a clarification answer — to the append-only `.ai.local/team/tasks/<slug>/prompt-log.md` (`seq` = max + 1; never rewrite or duplicate an entry; never log machine-generated hook `followup_message` or empty/argument-less invocations). Register its path on the `routing` entry. See **agent-artifact-contracts** § Prompt log.
246
+ 10. **Persist the verbatim original prompt.** Every `/task` and every routed work request writes the user's raw prompt to `.ai.local/team/tasks/<slug>/prompt.md` during slug bootstrap (write-if-absent; never overwrite on resume). It is not a manifest `artifacts[]` body — register the path on the `routing` entry. See **agent-artifact-contracts** § Prompt artifact. Also append every **subsequent user-authored** prompt for the same slug — a new user message while the slug is active, `/task-continue` arguments, human-gate feedback, a clarification answer — to the append-only `.ai.local/team/tasks/<slug>/prompt-log.md` (`seq` = max + 1; never rewrite or duplicate an entry; never log machine-generated hook `followup_message` or empty/argument-less invocations). Register its path on the `routing` entry. See **agent-artifact-contracts** § Prompt log. A message that explicitly addresses a **closed** slug follows the same ledger with the `post-terminal` marker — append-only, no reopen, one bounded `sync --slug`; see § Team artifact I/O.
245
247
  11. **Answer the user in the resolved dialogue language for the whole task.** The always-on language rule already resolved it on this turn (`.ai.local` `## Language` → prompt language → English). Pass that tag to every step; `/task-continue` keeps it. Never ask the user to pick a language. Development, reasoning, and artifacts stay English. See **language-policy**.
246
248
  12. **Invoke the ready set, and never advance before reconciliation.** In graph mode the hook computes the ready queue; invoke exactly the handoff's agent list (a wave in one assistant turn, multiple Task calls) and do not start any next step from your own reasoning until the hook records the join and emits the next handoff. The wave is the join unit; `status.joinedSlots` is the satisfaction ledger. The role pipeline and the engineering graph are two linked objects: `pipeline.json` `steps[].dependsOn` still decides which agent runs; the decomposition ready set only chooses rows inside the active step. Reviewer and QA steps stay on the pipeline.
247
249
  13. **Only a proven conflict-free set is `parallel: true`.** Disjoint declared `writeScopes`, distinct agents, distinct `artifactOutputIds`, no shared lifecycle file; `mockup-reviewer` is never parallel (its FAIL gate is serial). See **plan-graph** § Conflict model. Each decomposition task lists the repo paths it may create or modify. That list is a subset of the implementing step's `writeScopes[]` when the step declares `writeScopes`. Tasks with no `dependsOn` path between them keep those lists disjoint; a shared path stays sequential. `docs/specs/**` or `openspec/**` paths and `app/**` paths stay in different lists. `steps[].writeScopes[]` stays the role-level authority. Reviewer steps stay team-artifact only.
@@ -250,6 +252,7 @@ On each `subagentStop`, the hook reconciles `status.state` from the completing p
250
252
 
251
253
  - **Persist the original prompt.** For **every** task — `/task` or a routed work request — write the user's **verbatim** prompt to `.ai.local/team/tasks/<slug>/prompt.md` during slug bootstrap (write-if-absent; never overwrite on resume). The header is additive provenance only; the fenced text block holds the user's words unchanged. It is not a manifest `artifacts[]` body — the path lives on the `routing` entry. See **agent-artifact-contracts** § Prompt artifact.
252
254
  - **Append follow-up prompts.** When a user-authored prompt arrives for an active slug (new message, `/task-continue` args, gate feedback, clarification), append it verbatim to `.ai.local/team/tasks/<slug>/prompt-log.md` — `seq` = current max + 1, create on first append, never rewrite or duplicate an entry, never touch `prompt.md`. Exclude hook `followup_message` and empty/argument-less invocations. Not a manifest `artifacts[]` body — the path lives on the `routing` entry. See **agent-artifact-contracts** § Prompt log.
255
+ - **Post-terminal history.** When a user-authored message explicitly addresses a **closed** slug, append it to that task's `prompt-log.md` (`seq` = max + 1) with `command: post-terminal <trigger>`, then run exactly one `node .ai.local/scripts/team-db.mjs sync --slug <slug> --deadline-ms 4500`. Do not reopen the task and do not touch `status.json`, `artifact-manifest.json`, or `metrics.json`. Attribution is explicit only — never infer the slug from `active-task.json` or a session lease; if the slug is not named, ask once and write nothing until it is. A request that changes work opens a successor slug; the closed task keeps the history. See **agent-artifact-contracts** § Prompt log.
253
256
  - **Answer in the resolved dialogue language.** The always-on language rule already resolved it on this turn (`.ai.local` `## Language` → prompt language → English; mixed → dominant; nearest `.ai.local` wins). Reuse it for every user-facing message and `/task-continue`. Record the tag in the `prompt.md` header (`language: <BCP-47>`) + a `.memlog.md` `event:` line; a later correction is an append-only memlog event. Development, reasoning, and artifacts stay **English**. See **language-policy**.
254
257
  - Create/update team task dirs with the **Write** tool (parents are created automatically). Do **not** bootstrap slug dirs with Shell `mkdir -p` — default sandbox returns `Operation not permitted` (worse on macOS Desktop/Documents with TCC).
255
258
  - If Shell must touch team paths and fails with EPERM, retry with `required_permissions: ["all"]`. Prefer Write for artifacts.
@@ -27,9 +27,9 @@ Checklist for PRs that touch `packages/ai-rules/presets/**` (and dogfood `.curso
27
27
  - [ ] **shared-core drift:** for embed-mode stems, run `packages/ai-rules/scripts/check-shared-core-drift.sh` (or document intentional fork)
28
28
  - [ ] **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
29
29
  - [ ] **UI-only surfaces:** `mockup-reviewer`, `accessibility-reviewer`, `ux-design`, and the stack performance skill ship only on UI stacks (`check-preset-leakage.sh`)
30
- - [ ] **Rule eval (hard):** `node packages/ai-rules/scripts/check-rule-eval.mjs` runs inside `yarn check:preset-structure`; keep every registered golden stem paired
31
- - [ ] **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.
32
- - [ ] **Gate:** `yarn check:preset-structure` from `packages/ai-rules/` (twin-map, token-budget, leakage, drift, i18n, local overlay, anti-hallucination coverage)
30
+ - [ ] **Rule eval (hard):** `node packages/ai-rules/scripts/check-rule-eval.mjs` runs inside `yarn release:gate`; keep every registered golden stem paired
31
+ - [ ] **Anti-hallucination:** `check-anti-hallucination-coverage.mjs` is green inside `yarn release:gate`. 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.
32
+ - [ ] **Gate:** `yarn check:fast` in the loop; `yarn release:gate` from `packages/ai-rules/` before a release (full composite: twin-map, token-budget, leakage, drift, i18n, local overlay, anti-hallucination coverage)
33
33
 
34
34
  ## Pointers
35
35
 
@@ -39,7 +39,7 @@ Checklist for PRs that touch `packages/ai-rules/presets/**` (and dogfood `.curso
39
39
  - Sync: `preset-twin-sync`
40
40
  - Budget: `preset-token-budget`
41
41
  - Leakage: `preset-no-cross-stack-leakage`
42
- - Validation: `yarn check:preset-structure` (`packages/ai-rules/scripts/check-preset-structure.sh`)
42
+ - Validation: `yarn check:fast` in the loop (`packages/ai-rules/scripts/check-preset-fast.sh`); `yarn release:gate` before a release (`packages/ai-rules/scripts/release-gate.sh`)
43
43
  - Dogfood scripts: `packages/ai-rules/scripts/sync-dogfood-cursor.sh`, `sync-dogfood-claude.sh`, `sync-dogfood-mavis.sh`, `sync-dogfood-opencode.sh`
44
44
  - Drift script: `packages/ai-rules/scripts/check-shared-core-drift.sh`
45
45
  - Orchestrator: when editing presets, load this checklist + twin-sync
@@ -33,7 +33,7 @@ Validate: `check-mavis-adapter-map.mjs`, `check-opencode-adapter-map.mjs`, `chec
33
33
  - **Thin aliases** (`agent-team-intake`, `technical-retro`): may be shorter (soft) if they only point to a command/skill.
34
34
  - **Slim-companion rules** (UI-edit bundle, slim app-cores, slim tooling): may be shorter only if the body is a pointer into shared-core / stack prose. `check-preset-token-budget.sh` enforces this via `SLIM_COMPANION_ALLOWLIST` and the 5-line floor; 6–14-line stems outside the allow-list are slim violations.
35
35
 
36
- ## Severity (`check:preset-structure`)
36
+ ## Severity (structure gates)
37
37
 
38
38
  - Missing or stale generated Claude twin for a changed Cursor rule → **FAIL** (every stack under `presets/cursor/`; mapping table required).
39
39
  - `cursor/<stack>` mapped source changed without mavis / opencode regeneration, or with `adapter-map.json` `sourceRevision` drift → **FAIL**.
@@ -3,7 +3,7 @@
3
3
  "platform": "mavis",
4
4
  "stack": "next",
5
5
  "semanticSource": "cursor/next",
6
- "sourceRevision": "873500e3aa883cd59ad5eb3fbbfa5e099fa7d9f01a53ba4467e2f8bb782b5fe9",
6
+ "sourceRevision": "749717b51937a819972a9b7f0da941c6d7cde2268e217d80687d5849c8e706a5",
7
7
  "entries": [
8
8
  {
9
9
  "source": "AGENTS.md",
@@ -43,7 +43,7 @@ Use **`package-manager.md`** for the repo package manager.
43
43
 
44
44
  Prefer **`lint`** (= js + css + type-check) before handoff on large changes.
45
45
 
46
- - **Preset twin/golden DoD.** When the change-set edits Cursor next agents and/or `presets/_shared/hooks/**` (or other generated twin surfaces), require `node scripts/fix-generated.mjs` then `yarn check:preset-structure` from `packages/ai-rules` with exit 0 before validation PASS.
46
+ - **Preset twin/golden DoD (preset source repo only).** When the change-set edits Cursor next agents and/or `presets/_shared/hooks/**` (or other generated twin surfaces), require `node scripts/fix-generated.mjs` then `yarn check:changed` and the gates it names from `packages/ai-rules` with exit 0 before validation PASS. The full `yarn release:gate` is release-only.
47
47
 
48
48
  ## Delta gate policy (retry / carry-forward)
49
49
 
@@ -56,17 +56,30 @@ node scripts/check-preset-delta.mjs --base <last-green-ref> --json
56
56
 
57
57
  - A gate whose domain the classifier reports as **changed** MUST be re-run.
58
58
  - A gate whose domain is **unchanged** MAY be carried forward only when `validation-report.md` records the base ref, the classifier output, and the last green command + exit code.
59
- - Never carry `check:preset-structure` when `presets/**` or `scripts/**` changed; never carry the app gates when `apps/team-tasks-ui/**` changed; never carry the team-db suites when the `team-db` domain changed.
59
+ - Never carry a targeted gate for a changed domain; the full structure composite is release-only (`yarn release:gate`); never carry the app gates when `apps/team-tasks-ui/**` changed; never carry the team-db suites when the `team-db` domain changed.
60
60
  - A test-only app retry may carry the preset and team-db gates, but must still re-run the affected app lint, type-check, unit, and e2e suites.
61
61
  - Carry-forward is evidence, not a skip: the final report still quotes every command (carried or fresh).
62
62
 
63
+ ### Consumer app (any repo with `app/src/**`)
64
+
65
+ The preset classifier above targets this repository. In a consumer app the base is the last green validation of the same slug, not `t0`:
66
+
67
+ ```bash
68
+ git diff --stat <last-green-ref> -- app storybook
69
+ ```
70
+
71
+ - Re-run a gate only when the retry touched its domain: `lint:js` for `**/*.{ts,tsx,js,jsx}`, `lint:css` for `**/*.styles.ts` / `**/*.css`, `type-check` for any `app/**` change, unit tests for the modules whose paths changed.
72
+ - A gate may be carried forward only when `validation-report.md` records the base ref, the changed-path list, and the earlier green command + exit code.
73
+ - `code-reviewer` findings that touch only docs or artifacts never re-open a green code gate; a production edit always does.
74
+ - Never carry a gate across a rebase, a dependency bump, or a config change (`eslint`, `stylelint`, `tsconfig`, `jest`/`vitest`).
75
+
63
76
  ## Verification before completion
64
77
 
65
78
  <!-- shared-core: quality/verification-before-completion.md -->
66
79
 
67
80
  Before writing `validation-report.md` or claiming PASS: IDENTIFY the commands, RUN them, READ exit codes, VERIFY they match the verdict, THEN claim. Do not mark PASS from memory of a prior developer run.
68
81
 
69
- **Write-scope audit.** When `.ai.local/team/tasks/<slug>/pipeline.json` exists, run `node .ai.local/scripts/check-write-scope.mjs --slug <slug> --step <implementation-step> --json` before the verdict (in the package repo without a seeded engine copy, use `node packages/ai-rules/presets/_shared/ai-local/scripts/check-write-scope.mjs`). An `out-of-scope` path on an implementation step is a **FAIL**; quote the labelled report and name each path's source. A reviewer-step advisory goes under `## Soft notes`. Never substitute a hand-made path list for the labelled report.
82
+ **Write-scope audit.** When `.ai.local/team/tasks/<slug>/pipeline.json` exists, run `node .ai.local/scripts/check-write-scope.mjs --slug <slug> --step <implementation-step> --json` before the verdict (in the package repo without a seeded engine copy, use `node packages/ai-rules/presets/_shared/ai-local/scripts/check-write-scope.mjs`). Exit `3` is a **skip, not a failure**: the pipeline predates step ids or `writeScopes`, so quote the printed reason and hint under `## Soft notes` and continue. On exit `0`/`1`, an `out-of-scope` path on an implementation step is a **FAIL**; quote the labelled report and name each path's source. A reviewer-step advisory goes under `## Soft notes`. Never substitute a hand-made path list for the labelled report. The orchestrator writes the step baseline (`--step <id> --save-baseline`) before the step writes, because agents never commit and a bare `HEAD` diff would attribute earlier steps to this one.
70
83
 
71
84
  ## Self-review & context hygiene
72
85
 
@@ -55,6 +55,7 @@ You are a senior frontend developer working in a Next.js monorepo with strict la
55
55
  ## Task execution rules
56
56
 
57
57
  - Do **not** start blocked tasks or tasks with incomplete dependencies.
58
+ - **Reuse means reuse.** When the brief says to reuse an existing component, do not widen the change into extracting or relocating a shared primitive. If extraction is genuinely required, stop and hand back to the orchestrator: it is a separate task that needs its own gate, because every other call site inherits the blast radius.
58
59
  - **Unit tests must run before handoff** for mappers, store logic, and non-trivial pure functions.
59
60
  - When the strict implementation rail is off or unset, that test-before-handoff rule is the implementation handoff text.
60
61
  - When `pipeline.json` `implementationRail` is `on`:
@@ -66,7 +67,7 @@ You are a senior frontend developer working in a Next.js monorepo with strict la
66
67
  - L0, docs-only, research, and preset-only tasks do not take the rail. `build-verifier` and `code-reviewer` stay.
67
68
  - Mark completed tasks in `decomposition.md`.
68
69
  - Validation: **`post-change-lint.md`**. If pipeline next step is **`build-verifier`**, scoped lint/type-check on **changed files** is enough; full project lint is build-verifier's job.
69
- - **Preset twin/golden DoD.** When the change-set edits Cursor next agents and/or `presets/_shared/hooks/**` (or other surfaces that require generated twins), from `packages/ai-rules` run `node scripts/fix-generated.mjs` then `yarn check:preset-structure` (exit 0) before implementation handoff.
70
+ - **Preset twin/golden DoD (preset source repo only).** When the change-set edits Cursor next agents and/or `presets/_shared/hooks/**` (or other surfaces that require generated twins), from `packages/ai-rules` run `node scripts/fix-generated.mjs` then `yarn check:changed` and the gates it names (exit 0) before implementation handoff. The full `yarn release:gate` is release-only.
70
71
 
71
72
  ## Zero improvisation
72
73
 
@@ -47,6 +47,8 @@ Before decomposing: state the **goal frame** (goal, user value, success criteria
47
47
 
48
48
  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.
49
49
 
50
+ **Reuse means reuse.** When the request says to reuse an existing component, do not decompose it into extracting or relocating a shared primitive. An extraction that serves other call sites is a separate task with its own risk: raise it as an open question at the gate and list the affected call sites instead of folding it into the change.
51
+
50
52
  ## Claude next hand-agent parity (sync-in-change-set)
51
53
 
52
54
  Whenever decomposition Files cover edits to Cursor next `openspec-author` / `task-router` / `task-analyst`, also list the matching `presets/claude/next/agents/` paths. Cursor next is SoT; the same change-set applies equivalent substantive bullets to Claude. Do not treat documented exclusion as the default for this trio.
@@ -10,7 +10,7 @@ import { fileURLToPath } from 'node:url';
10
10
  export const PACKAGE_NAME = '@bonesofspring/ai-rules';
11
11
  export const REGISTRY_URL = 'https://registry.npmjs.org/@bonesofspring/ai-rules/latest';
12
12
  export const CACHE_TTL_MS = 60 * 60 * 1000;
13
- export const TOOL_ROOTS = ['.cursor', '.claude', '.mavis', '.opencode'];
13
+ export const TOOL_ROOTS = ['.cursor', '.claude', '.mavis', '.opencode', '.zcode'];
14
14
 
15
15
  const RELEASE_VERSION = /^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/;
16
16
 
@@ -75,9 +75,10 @@ export function buildNotice(installs, latest) {
75
75
  (item) => item.version === null || compareVersions(item.version, latest) < 0,
76
76
  );
77
77
  if (behind.length === 0) return '';
78
+ const installed = formatInstalled(behind);
78
79
  return [
79
80
  `Preset update available for ${PACKAGE_NAME}.`,
80
- `Installed: ${formatInstalled(behind)}. Latest: ${latest}.`,
81
+ `Installed: ${installed}. Latest: ${latest}.`,
81
82
  'The first block of the reply is only this notice, before any task text.',
82
83
  'Use a level-2 heading and one markdown blockquote. Then a blank line. Then the task answer.',
83
84
  'Do not fold the notice into the task text.',
@@ -86,7 +87,7 @@ export function buildNotice(installs, latest) {
86
87
  'Shape:',
87
88
  '## Preset update',
88
89
  '',
89
- `> Installed \`${PACKAGE_NAME}\` **<installed>**. Latest **${latest}**. Run \`/update\`.`,
90
+ `> Installed \`${PACKAGE_NAME}\` **${installed}**. Latest **${latest}**. Run \`/update\`.`,
90
91
  ].join('\n');
91
92
  }
92
93
 
@@ -10,5 +10,6 @@ When the user message looks like a **work request** (implement, add, fix, refact
10
10
  4. A work request now runs the planning workflow — **goal frame → requirements → information-sufficiency → decompose** (dependency graph / epics); see **task-framing** and **plan-graph**.
11
11
  5. Every **work request** — with or without `/task`, and even when the user says “no pipeline” / “just do it” — persists the **verbatim** original prompt at `.ai.local/team/tasks/<slug>/prompt.md`. Prefer `/task` (its **Slug** step writes it). If handling inline without `/task`, first create the slug dir and write `prompt.md` (write-if-absent), then proceed. Pure questions and trivial one-liners are not work requests → no file. On an inline follow-up for an existing slug (no `/task`) where the user authors new text, append it verbatim to `.ai.local/team/tasks/<slug>/prompt-log.md` (`seq` = max + 1; create on first append; exclude machine-generated and empty/argument-less invocations).
12
12
  6. **Reuse the dialogue language already resolved on this turn** (always-on `ai-local-overlay` / **language-policy**). A question and a message without a slash command still resolve before you speak. When this request writes `prompt.md`, persist that tag once in the header (`language: <BCP-47>`) + a `.memlog.md` `event:` line. Development, reasoning, and artifacts stay English. The setting wins over a mid-task prompt switch (surface it once, never ask). See **language-policy**.
13
+ 7. **Project the intake write.** After `prompt.md` is written for an inline (non-`/task`) work request, run `node .ai.local/scripts/team-db.mjs sync --slug <slug> --deadline-ms 4500` once, so the new task row and its prompt reach the database. A projection failure is reported to the user, never blocks the request; the next full sync remains the convergence path. Do not run a full sync from intake.
13
14
 
14
15
  Exceptions: user explicitly says “no pipeline”, “just do it”, or continues an active slug.
@@ -146,6 +146,8 @@ A producer invoked outside `pipeline.json.steps` — a remediation pass after a
146
146
  ## Plan revision (replanning)
147
147
  Replanning is a **named, auditable operation** — never a silent reorder. Trigger it when an evaluation oracle fails twice on the same task, when scope or requirements change, or when a previously unknown dependency/consumer is discovered. Procedure: append `decision: replan rev N → N+1` (with the reason) to `.memlog.md`, update `decomposition.md` (task add/remove or dependency change) and any optional plan fields, then **re-run the affected gate**. Scope-changing revisions return to the human gate.
148
148
 
149
+ - **Rules in flight.** At slug bootstrap, when `.ai.local/rules/**` or `.ai.local/conventions.md` has uncommitted changes, ask once whether a policy change is still in progress before `steps[0]`. A policy that lands mid-task invalidates an approved plan: it is a `planRevision` with a new confirmation, never a silent scope change — stop and re-confirm instead of letting a specialist discover it halfway through.
150
+
149
151
  ## Context budget & checkpoint/resume
150
152
 
151
153
  Work in bounded waves (one artifact class across the target surface). **Checkpoint** each completed wave to `.memlog.md` (`## <date>` + an `event:` line) and record the produced paths on the `implementation` manifest entry (`authoritativePaths`). That checkpoint is the hook `writeStatus` path: it rewrites `.ai.local/team/tasks/<slug>/focus.md`. `focus.md` is a view, not the system of record. It lists slug, pipeline step index, authoritative paths for incomplete manifest ids, the last `.memlog.md` `event:` line, the next gate, one decomposition ready-set line, and one archive index line, and it stays under 100 lines. `status.json`, `metrics.json`, `artifact-manifest.json`, and `.memlog.md` stay the system of record. A resumed run (`/task-continue`) reads `focus.md` first, then `artifact-manifest.json` and `.memlog.md`, and continues at the first stage whose exit criteria are unmet — never re-derive state from the chat. A completed manifest entry keeps id, status, and `authoritativePaths`, and the default resume read omits that entry's markdown body; closing it appends one new `.memlog.md` event: line, moves the bulky body to `.ai.local/team/tasks/<slug>/archive/YYYY-MM-DD/`, and leaves earlier memlog lines, the human-readable slug and artifact ids, and the manifest entry in place, with no Beads hash ids and no Taskmaster tags. Mechanical waves (generation, embed sync) are delegated to repo scripts. An **interrupted producer** (tool abort, killed session) is resumed, not restarted: run the stack's compile gate on the working tree first, and when it is red hand the failing output to the same producer with a `fix and finish` brief instead of starting a second parallel attempt. When the host runtime writes no `status.json` (manual-hook hosts such as OpenCode), the resume checkpoint is `artifact-manifest.json` + `.memlog.md`; never gate a resume on a file the runtime does not produce. See **context-and-iteration** for the budget, checkpoint, resume, and refinement loop.
@@ -228,7 +230,7 @@ On each `subagentStop`, the hook reconciles `status.state` from the completing p
228
230
  | `scope` | e.g. `unit-in-dev`, `e2e-only` — passed to developer/qa |
229
231
  | `model` | `cheap` \| `standard` \| `strong` — optional tier override |
230
232
 
231
- `writeScopes` are reconciled after the step, never in the hook: `node .ai.local/scripts/check-write-scope.mjs --slug <slug> --step <step-id> --json` labels every changed path `declared`, `derived`, or `out-of-scope`. `build-verifier` hard-fails an out-of-scope implementation write; `code-reviewer` reports a reviewer-step path as advisory.
233
+ `writeScopes` are reconciled after the step, never in the hook: `node .ai.local/scripts/check-write-scope.mjs --slug <slug> --step <step-id> --json` labels every changed path `declared`, `derived`, or `out-of-scope`. The orchestrator writes the step baseline (`--step <step-id> --save-baseline`) before the step writes, so the audit sees this step's paths and not the earlier ones. Exit `3` is a skip, not a failure: a pipeline that predates step ids or `writeScopes` is not auditable, and the reason goes under `## Soft notes`. `build-verifier` hard-fails an out-of-scope implementation write; `code-reviewer` reports a reviewer-step path as advisory.
232
234
 
233
235
  ## Rules (strict)
234
236
 
@@ -241,7 +243,7 @@ On each `subagentStop`, the hook reconciles `status.state` from the completing p
241
243
  7. On `validation_failed` from `build-verifier`: hook sets `retryAfterFix: build-verifier` → developer → build-verifier.
242
244
  8. When all steps complete, suggest `/technical-retro <slug>`.
243
245
  9. If `autoChain: false` in pipeline, do not rely on hook — manual step only.
244
- 10. **Persist the verbatim original prompt.** Every `/task` and every routed work request writes the user's raw prompt to `.ai.local/team/tasks/<slug>/prompt.md` during slug bootstrap (write-if-absent; never overwrite on resume). It is not a manifest `artifacts[]` body — register the path on the `routing` entry. See **agent-artifact-contracts** § Prompt artifact. Also append every **subsequent user-authored** prompt for the same slug — a new user message while the slug is active, `/task-continue` arguments, human-gate feedback, a clarification answer — to the append-only `.ai.local/team/tasks/<slug>/prompt-log.md` (`seq` = max + 1; never rewrite or duplicate an entry; never log machine-generated hook `followup_message` or empty/argument-less invocations). Register its path on the `routing` entry. See **agent-artifact-contracts** § Prompt log.
246
+ 10. **Persist the verbatim original prompt.** Every `/task` and every routed work request writes the user's raw prompt to `.ai.local/team/tasks/<slug>/prompt.md` during slug bootstrap (write-if-absent; never overwrite on resume). It is not a manifest `artifacts[]` body — register the path on the `routing` entry. See **agent-artifact-contracts** § Prompt artifact. Also append every **subsequent user-authored** prompt for the same slug — a new user message while the slug is active, `/task-continue` arguments, human-gate feedback, a clarification answer — to the append-only `.ai.local/team/tasks/<slug>/prompt-log.md` (`seq` = max + 1; never rewrite or duplicate an entry; never log machine-generated hook `followup_message` or empty/argument-less invocations). Register its path on the `routing` entry. See **agent-artifact-contracts** § Prompt log. A message that explicitly addresses a **closed** slug follows the same ledger with the `post-terminal` marker — append-only, no reopen, one bounded `sync --slug`; see § Team artifact I/O.
245
247
  11. **Answer the user in the resolved dialogue language for the whole task.** The always-on language rule already resolved it on this turn (`.ai.local` `## Language` → prompt language → English). Pass that tag to every step; `/task-continue` keeps it. Never ask the user to pick a language. Development, reasoning, and artifacts stay English. See **language-policy**.
246
248
  12. **Invoke the ready set, and never advance before reconciliation.** In graph mode the hook computes the ready queue; invoke exactly the handoff's agent list (a wave in one assistant turn, multiple Task calls) and do not start any next step from your own reasoning until the hook records the join and emits the next handoff. The wave is the join unit; `status.joinedSlots` is the satisfaction ledger. The role pipeline and the engineering graph are two linked objects: `pipeline.json` `steps[].dependsOn` still decides which agent runs; the decomposition ready set only chooses rows inside the active step. Reviewer and QA steps stay on the pipeline.
247
249
  13. **Only a proven conflict-free set is `parallel: true`.** Disjoint declared `writeScopes`, distinct agents, distinct `artifactOutputIds`, no shared lifecycle file; `mockup-reviewer` is never parallel (its FAIL gate is serial). See **plan-graph** § Conflict model. Each decomposition task lists the repo paths it may create or modify. That list is a subset of the implementing step's `writeScopes[]` when the step declares `writeScopes`. Tasks with no `dependsOn` path between them keep those lists disjoint; a shared path stays sequential. `docs/specs/**` or `openspec/**` paths and `app/**` paths stay in different lists. `steps[].writeScopes[]` stays the role-level authority. Reviewer steps stay team-artifact only.
@@ -250,6 +252,7 @@ On each `subagentStop`, the hook reconciles `status.state` from the completing p
250
252
 
251
253
  - **Persist the original prompt.** For **every** task — `/task` or a routed work request — write the user's **verbatim** prompt to `.ai.local/team/tasks/<slug>/prompt.md` during slug bootstrap (write-if-absent; never overwrite on resume). The header is additive provenance only; the fenced text block holds the user's words unchanged. It is not a manifest `artifacts[]` body — the path lives on the `routing` entry. See **agent-artifact-contracts** § Prompt artifact.
252
254
  - **Append follow-up prompts.** When a user-authored prompt arrives for an active slug (new message, `/task-continue` args, gate feedback, clarification), append it verbatim to `.ai.local/team/tasks/<slug>/prompt-log.md` — `seq` = current max + 1, create on first append, never rewrite or duplicate an entry, never touch `prompt.md`. Exclude hook `followup_message` and empty/argument-less invocations. Not a manifest `artifacts[]` body — the path lives on the `routing` entry. See **agent-artifact-contracts** § Prompt log.
255
+ - **Post-terminal history.** When a user-authored message explicitly addresses a **closed** slug, append it to that task's `prompt-log.md` (`seq` = max + 1) with `command: post-terminal <trigger>`, then run exactly one `node .ai.local/scripts/team-db.mjs sync --slug <slug> --deadline-ms 4500`. Do not reopen the task and do not touch `status.json`, `artifact-manifest.json`, or `metrics.json`. Attribution is explicit only — never infer the slug from `active-task.json` or a session lease; if the slug is not named, ask once and write nothing until it is. A request that changes work opens a successor slug; the closed task keeps the history. See **agent-artifact-contracts** § Prompt log.
253
256
  - **Answer in the resolved dialogue language.** The always-on language rule already resolved it on this turn (`.ai.local` `## Language` → prompt language → English; mixed → dominant; nearest `.ai.local` wins). Reuse it for every user-facing message and `/task-continue`. Record the tag in the `prompt.md` header (`language: <BCP-47>`) + a `.memlog.md` `event:` line; a later correction is an append-only memlog event. Development, reasoning, and artifacts stay **English**. See **language-policy**.
254
257
  - Create/update team task dirs with the **Write** tool (parents are created automatically). Do **not** bootstrap slug dirs with Shell `mkdir -p` — default sandbox returns `Operation not permitted` (worse on macOS Desktop/Documents with TCC).
255
258
  - If Shell must touch team paths and fails with EPERM, retry with `required_permissions: ["all"]`. Prefer Write for artifacts.
@@ -27,9 +27,9 @@ Checklist for PRs that touch `packages/ai-rules/presets/**` (and dogfood `.curso
27
27
  - [ ] **shared-core drift:** for embed-mode stems, run `packages/ai-rules/scripts/check-shared-core-drift.sh` (or document intentional fork)
28
28
  - [ ] **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
29
29
  - [ ] **UI-only surfaces:** `mockup-reviewer`, `accessibility-reviewer`, `ux-design`, and the stack performance skill ship only on UI stacks (`check-preset-leakage.sh`)
30
- - [ ] **Rule eval (hard):** `node packages/ai-rules/scripts/check-rule-eval.mjs` runs inside `yarn check:preset-structure`; keep every registered golden stem paired
31
- - [ ] **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.
32
- - [ ] **Gate:** `yarn check:preset-structure` from `packages/ai-rules/` (twin-map, token-budget, leakage, drift, i18n, local overlay, anti-hallucination coverage)
30
+ - [ ] **Rule eval (hard):** `node packages/ai-rules/scripts/check-rule-eval.mjs` runs inside `yarn release:gate`; keep every registered golden stem paired
31
+ - [ ] **Anti-hallucination:** `check-anti-hallucination-coverage.mjs` is green inside `yarn release:gate`. 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.
32
+ - [ ] **Gate:** `yarn check:fast` in the loop; `yarn release:gate` from `packages/ai-rules/` before a release (full composite: twin-map, token-budget, leakage, drift, i18n, local overlay, anti-hallucination coverage)
33
33
 
34
34
  ## Pointers
35
35
 
@@ -39,7 +39,7 @@ Checklist for PRs that touch `packages/ai-rules/presets/**` (and dogfood `.curso
39
39
  - Sync: `preset-twin-sync`
40
40
  - Budget: `preset-token-budget`
41
41
  - Leakage: `preset-no-cross-stack-leakage`
42
- - Validation: `yarn check:preset-structure` (`packages/ai-rules/scripts/check-preset-structure.sh`)
42
+ - Validation: `yarn check:fast` in the loop (`packages/ai-rules/scripts/check-preset-fast.sh`); `yarn release:gate` before a release (`packages/ai-rules/scripts/release-gate.sh`)
43
43
  - Dogfood scripts: `packages/ai-rules/scripts/sync-dogfood-cursor.sh`, `sync-dogfood-claude.sh`, `sync-dogfood-mavis.sh`, `sync-dogfood-opencode.sh`
44
44
  - Drift script: `packages/ai-rules/scripts/check-shared-core-drift.sh`
45
45
  - Orchestrator: when editing presets, load this checklist + twin-sync
@@ -33,7 +33,7 @@ Validate: `check-mavis-adapter-map.mjs`, `check-opencode-adapter-map.mjs`, `chec
33
33
  - **Thin aliases** (`agent-team-intake`, `technical-retro`): may be shorter (soft) if they only point to a command/skill.
34
34
  - **Slim-companion rules** (UI-edit bundle, slim app-cores, slim tooling): may be shorter only if the body is a pointer into shared-core / stack prose. `check-preset-token-budget.sh` enforces this via `SLIM_COMPANION_ALLOWLIST` and the 5-line floor; 6–14-line stems outside the allow-list are slim violations.
35
35
 
36
- ## Severity (`check:preset-structure`)
36
+ ## Severity (structure gates)
37
37
 
38
38
  - Missing or stale generated Claude twin for a changed Cursor rule → **FAIL** (every stack under `presets/cursor/`; mapping table required).
39
39
  - `cursor/<stack>` mapped source changed without mavis / opencode regeneration, or with `adapter-map.json` `sourceRevision` drift → **FAIL**.
@@ -3,7 +3,7 @@
3
3
  "platform": "mavis",
4
4
  "stack": "nuxt",
5
5
  "semanticSource": "cursor/nuxt",
6
- "sourceRevision": "fb51a9f14e73add85f111e651f1c19280c85576be3be80d0d82289443d3fcfea",
6
+ "sourceRevision": "c7e8110d51adad820aaa9196adb58a92f10024464de3e9fbee0cc78a27476fcb",
7
7
  "entries": [
8
8
  {
9
9
  "source": "AGENTS.md",
@@ -10,7 +10,7 @@ import { fileURLToPath } from 'node:url';
10
10
  export const PACKAGE_NAME = '@bonesofspring/ai-rules';
11
11
  export const REGISTRY_URL = 'https://registry.npmjs.org/@bonesofspring/ai-rules/latest';
12
12
  export const CACHE_TTL_MS = 60 * 60 * 1000;
13
- export const TOOL_ROOTS = ['.cursor', '.claude', '.mavis', '.opencode'];
13
+ export const TOOL_ROOTS = ['.cursor', '.claude', '.mavis', '.opencode', '.zcode'];
14
14
 
15
15
  const RELEASE_VERSION = /^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/;
16
16
 
@@ -75,9 +75,10 @@ export function buildNotice(installs, latest) {
75
75
  (item) => item.version === null || compareVersions(item.version, latest) < 0,
76
76
  );
77
77
  if (behind.length === 0) return '';
78
+ const installed = formatInstalled(behind);
78
79
  return [
79
80
  `Preset update available for ${PACKAGE_NAME}.`,
80
- `Installed: ${formatInstalled(behind)}. Latest: ${latest}.`,
81
+ `Installed: ${installed}. Latest: ${latest}.`,
81
82
  'The first block of the reply is only this notice, before any task text.',
82
83
  'Use a level-2 heading and one markdown blockquote. Then a blank line. Then the task answer.',
83
84
  'Do not fold the notice into the task text.',
@@ -86,7 +87,7 @@ export function buildNotice(installs, latest) {
86
87
  'Shape:',
87
88
  '## Preset update',
88
89
  '',
89
- `> Installed \`${PACKAGE_NAME}\` **<installed>**. Latest **${latest}**. Run \`/update\`.`,
90
+ `> Installed \`${PACKAGE_NAME}\` **${installed}**. Latest **${latest}**. Run \`/update\`.`,
90
91
  ].join('\n');
91
92
  }
92
93
 
@@ -10,5 +10,6 @@ When the user message looks like a **work request** (implement, add, fix, refact
10
10
  4. A work request now runs the planning workflow — **goal frame → requirements → information-sufficiency → decompose** (dependency graph / epics); see **task-framing** and **plan-graph**.
11
11
  5. Every **work request** — with or without `/task`, and even when the user says “no pipeline” / “just do it” — persists the **verbatim** original prompt at `.ai.local/team/tasks/<slug>/prompt.md`. Prefer `/task` (its **Slug** step writes it). If handling inline without `/task`, first create the slug dir and write `prompt.md` (write-if-absent), then proceed. Pure questions and trivial one-liners are not work requests → no file. On an inline follow-up for an existing slug (no `/task`) where the user authors new text, append it verbatim to `.ai.local/team/tasks/<slug>/prompt-log.md` (`seq` = max + 1; create on first append; exclude machine-generated and empty/argument-less invocations).
12
12
  6. **Reuse the dialogue language already resolved on this turn** (always-on `ai-local-overlay` / **language-policy**). A question and a message without a slash command still resolve before you speak. When this request writes `prompt.md`, persist that tag once in the header (`language: <BCP-47>`) + a `.memlog.md` `event:` line. Development, reasoning, and artifacts stay English. The setting wins over a mid-task prompt switch (surface it once, never ask). See **language-policy**.
13
+ 7. **Project the intake write.** After `prompt.md` is written for an inline (non-`/task`) work request, run `node .ai.local/scripts/team-db.mjs sync --slug <slug> --deadline-ms 4500` once, so the new task row and its prompt reach the database. A projection failure is reported to the user, never blocks the request; the next full sync remains the convergence path. Do not run a full sync from intake.
13
14
 
14
15
  Exceptions: user explicitly says “no pipeline”, “just do it”, or continues an active slug.
@@ -146,6 +146,8 @@ A producer invoked outside `pipeline.json.steps` — a remediation pass after a
146
146
  ## Plan revision (replanning)
147
147
  Replanning is a **named, auditable operation** — never a silent reorder. Trigger it when an evaluation oracle fails twice on the same task, when scope or requirements change, or when a previously unknown dependency/consumer is discovered. Procedure: append `decision: replan rev N → N+1` (with the reason) to `.memlog.md`, update `decomposition.md` (task add/remove or dependency change) and any optional plan fields, then **re-run the affected gate**. Scope-changing revisions return to the human gate.
148
148
 
149
+ - **Rules in flight.** At slug bootstrap, when `.ai.local/rules/**` or `.ai.local/conventions.md` has uncommitted changes, ask once whether a policy change is still in progress before `steps[0]`. A policy that lands mid-task invalidates an approved plan: it is a `planRevision` with a new confirmation, never a silent scope change — stop and re-confirm instead of letting a specialist discover it halfway through.
150
+
149
151
  ## Context budget & checkpoint/resume
150
152
 
151
153
  Work in bounded waves (one artifact class across the target surface). **Checkpoint** each completed wave to `.memlog.md` (`## <date>` + an `event:` line) and record the produced paths on the `implementation` manifest entry (`authoritativePaths`). That checkpoint is the hook `writeStatus` path: it rewrites `.ai.local/team/tasks/<slug>/focus.md`. `focus.md` is a view, not the system of record. It lists slug, pipeline step index, authoritative paths for incomplete manifest ids, the last `.memlog.md` `event:` line, the next gate, one decomposition ready-set line, and one archive index line, and it stays under 100 lines. `status.json`, `metrics.json`, `artifact-manifest.json`, and `.memlog.md` stay the system of record. A resumed run (`/task-continue`) reads `focus.md` first, then `artifact-manifest.json` and `.memlog.md`, and continues at the first stage whose exit criteria are unmet — never re-derive state from the chat. A completed manifest entry keeps id, status, and `authoritativePaths`, and the default resume read omits that entry's markdown body; closing it appends one new `.memlog.md` event: line, moves the bulky body to `.ai.local/team/tasks/<slug>/archive/YYYY-MM-DD/`, and leaves earlier memlog lines, the human-readable slug and artifact ids, and the manifest entry in place, with no Beads hash ids and no Taskmaster tags. Mechanical waves (generation, embed sync) are delegated to repo scripts. An **interrupted producer** (tool abort, killed session) is resumed, not restarted: run the stack's compile gate on the working tree first, and when it is red hand the failing output to the same producer with a `fix and finish` brief instead of starting a second parallel attempt. When the host runtime writes no `status.json` (manual-hook hosts such as OpenCode), the resume checkpoint is `artifact-manifest.json` + `.memlog.md`; never gate a resume on a file the runtime does not produce. See **context-and-iteration** for the budget, checkpoint, resume, and refinement loop.
@@ -228,7 +230,7 @@ On each `subagentStop`, the hook reconciles `status.state` from the completing p
228
230
  | `scope` | e.g. `unit-in-dev`, `e2e-only` — passed to developer/qa |
229
231
  | `model` | `cheap` \| `standard` \| `strong` — optional tier override |
230
232
 
231
- `writeScopes` are reconciled after the step, never in the hook: `node .ai.local/scripts/check-write-scope.mjs --slug <slug> --step <step-id> --json` labels every changed path `declared`, `derived`, or `out-of-scope`. `build-verifier` hard-fails an out-of-scope implementation write; `code-reviewer` reports a reviewer-step path as advisory.
233
+ `writeScopes` are reconciled after the step, never in the hook: `node .ai.local/scripts/check-write-scope.mjs --slug <slug> --step <step-id> --json` labels every changed path `declared`, `derived`, or `out-of-scope`. The orchestrator writes the step baseline (`--step <step-id> --save-baseline`) before the step writes, so the audit sees this step's paths and not the earlier ones. Exit `3` is a skip, not a failure: a pipeline that predates step ids or `writeScopes` is not auditable, and the reason goes under `## Soft notes`. `build-verifier` hard-fails an out-of-scope implementation write; `code-reviewer` reports a reviewer-step path as advisory.
232
234
 
233
235
  ## Rules (strict)
234
236
 
@@ -241,7 +243,7 @@ On each `subagentStop`, the hook reconciles `status.state` from the completing p
241
243
  7. On `validation_failed` from `build-verifier`: hook sets `retryAfterFix: build-verifier` → developer → build-verifier.
242
244
  8. When all steps complete, suggest `/technical-retro <slug>`.
243
245
  9. If `autoChain: false` in pipeline, do not rely on hook — manual step only.
244
- 10. **Persist the verbatim original prompt.** Every `/task` and every routed work request writes the user's raw prompt to `.ai.local/team/tasks/<slug>/prompt.md` during slug bootstrap (write-if-absent; never overwrite on resume). It is not a manifest `artifacts[]` body — register the path on the `routing` entry. See **agent-artifact-contracts** § Prompt artifact. Also append every **subsequent user-authored** prompt for the same slug — a new user message while the slug is active, `/task-continue` arguments, human-gate feedback, a clarification answer — to the append-only `.ai.local/team/tasks/<slug>/prompt-log.md` (`seq` = max + 1; never rewrite or duplicate an entry; never log machine-generated hook `followup_message` or empty/argument-less invocations). Register its path on the `routing` entry. See **agent-artifact-contracts** § Prompt log.
246
+ 10. **Persist the verbatim original prompt.** Every `/task` and every routed work request writes the user's raw prompt to `.ai.local/team/tasks/<slug>/prompt.md` during slug bootstrap (write-if-absent; never overwrite on resume). It is not a manifest `artifacts[]` body — register the path on the `routing` entry. See **agent-artifact-contracts** § Prompt artifact. Also append every **subsequent user-authored** prompt for the same slug — a new user message while the slug is active, `/task-continue` arguments, human-gate feedback, a clarification answer — to the append-only `.ai.local/team/tasks/<slug>/prompt-log.md` (`seq` = max + 1; never rewrite or duplicate an entry; never log machine-generated hook `followup_message` or empty/argument-less invocations). Register its path on the `routing` entry. See **agent-artifact-contracts** § Prompt log. A message that explicitly addresses a **closed** slug follows the same ledger with the `post-terminal` marker — append-only, no reopen, one bounded `sync --slug`; see § Team artifact I/O.
245
247
  11. **Answer the user in the resolved dialogue language for the whole task.** The always-on language rule already resolved it on this turn (`.ai.local` `## Language` → prompt language → English). Pass that tag to every step; `/task-continue` keeps it. Never ask the user to pick a language. Development, reasoning, and artifacts stay English. See **language-policy**.
246
248
  12. **Invoke the ready set, and never advance before reconciliation.** In graph mode the hook computes the ready queue; invoke exactly the handoff's agent list (a wave in one assistant turn, multiple Task calls) and do not start any next step from your own reasoning until the hook records the join and emits the next handoff. The wave is the join unit; `status.joinedSlots` is the satisfaction ledger. The role pipeline and the engineering graph are two linked objects: `pipeline.json` `steps[].dependsOn` still decides which agent runs; the decomposition ready set only chooses rows inside the active step. Reviewer and QA steps stay on the pipeline.
247
249
  13. **Only a proven conflict-free set is `parallel: true`.** Disjoint declared `writeScopes`, distinct agents, distinct `artifactOutputIds`, no shared lifecycle file; `mockup-reviewer` is never parallel (its FAIL gate is serial). See **plan-graph** § Conflict model. Each decomposition task lists the repo paths it may create or modify. That list is a subset of the implementing step's `writeScopes[]` when the step declares `writeScopes`. Tasks with no `dependsOn` path between them keep those lists disjoint; a shared path stays sequential. `docs/specs/**` or `openspec/**` paths and `app/**` paths stay in different lists. `steps[].writeScopes[]` stays the role-level authority. Reviewer steps stay team-artifact only.
@@ -250,6 +252,7 @@ On each `subagentStop`, the hook reconciles `status.state` from the completing p
250
252
 
251
253
  - **Persist the original prompt.** For **every** task — `/task` or a routed work request — write the user's **verbatim** prompt to `.ai.local/team/tasks/<slug>/prompt.md` during slug bootstrap (write-if-absent; never overwrite on resume). The header is additive provenance only; the fenced text block holds the user's words unchanged. It is not a manifest `artifacts[]` body — the path lives on the `routing` entry. See **agent-artifact-contracts** § Prompt artifact.
252
254
  - **Append follow-up prompts.** When a user-authored prompt arrives for an active slug (new message, `/task-continue` args, gate feedback, clarification), append it verbatim to `.ai.local/team/tasks/<slug>/prompt-log.md` — `seq` = current max + 1, create on first append, never rewrite or duplicate an entry, never touch `prompt.md`. Exclude hook `followup_message` and empty/argument-less invocations. Not a manifest `artifacts[]` body — the path lives on the `routing` entry. See **agent-artifact-contracts** § Prompt log.
255
+ - **Post-terminal history.** When a user-authored message explicitly addresses a **closed** slug, append it to that task's `prompt-log.md` (`seq` = max + 1) with `command: post-terminal <trigger>`, then run exactly one `node .ai.local/scripts/team-db.mjs sync --slug <slug> --deadline-ms 4500`. Do not reopen the task and do not touch `status.json`, `artifact-manifest.json`, or `metrics.json`. Attribution is explicit only — never infer the slug from `active-task.json` or a session lease; if the slug is not named, ask once and write nothing until it is. A request that changes work opens a successor slug; the closed task keeps the history. See **agent-artifact-contracts** § Prompt log.
253
256
  - **Answer in the resolved dialogue language.** The always-on language rule already resolved it on this turn (`.ai.local` `## Language` → prompt language → English; mixed → dominant; nearest `.ai.local` wins). Reuse it for every user-facing message and `/task-continue`. Record the tag in the `prompt.md` header (`language: <BCP-47>`) + a `.memlog.md` `event:` line; a later correction is an append-only memlog event. Development, reasoning, and artifacts stay **English**. See **language-policy**.
254
257
  - Create/update team task dirs with the **Write** tool (parents are created automatically). Do **not** bootstrap slug dirs with Shell `mkdir -p` — default sandbox returns `Operation not permitted` (worse on macOS Desktop/Documents with TCC).
255
258
  - If Shell must touch team paths and fails with EPERM, retry with `required_permissions: ["all"]`. Prefer Write for artifacts.
@@ -27,9 +27,9 @@ Checklist for PRs that touch `packages/ai-rules/presets/**` (and dogfood `.curso
27
27
  - [ ] **shared-core drift:** for embed-mode stems, run `packages/ai-rules/scripts/check-shared-core-drift.sh` (or document intentional fork)
28
28
  - [ ] **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
29
29
  - [ ] **UI-only surfaces:** `mockup-reviewer`, `accessibility-reviewer`, `ux-design`, and the stack performance skill ship only on UI stacks (`check-preset-leakage.sh`)
30
- - [ ] **Rule eval (hard):** `node packages/ai-rules/scripts/check-rule-eval.mjs` runs inside `yarn check:preset-structure`; keep every registered golden stem paired
31
- - [ ] **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.
32
- - [ ] **Gate:** `yarn check:preset-structure` from `packages/ai-rules/` (twin-map, token-budget, leakage, drift, i18n, local overlay, anti-hallucination coverage)
30
+ - [ ] **Rule eval (hard):** `node packages/ai-rules/scripts/check-rule-eval.mjs` runs inside `yarn release:gate`; keep every registered golden stem paired
31
+ - [ ] **Anti-hallucination:** `check-anti-hallucination-coverage.mjs` is green inside `yarn release:gate`. 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.
32
+ - [ ] **Gate:** `yarn check:fast` in the loop; `yarn release:gate` from `packages/ai-rules/` before a release (full composite: twin-map, token-budget, leakage, drift, i18n, local overlay, anti-hallucination coverage)
33
33
 
34
34
  ## Pointers
35
35
 
@@ -39,7 +39,7 @@ Checklist for PRs that touch `packages/ai-rules/presets/**` (and dogfood `.curso
39
39
  - Sync: `preset-twin-sync`
40
40
  - Budget: `preset-token-budget`
41
41
  - Leakage: `preset-no-cross-stack-leakage`
42
- - Validation: `yarn check:preset-structure` (`packages/ai-rules/scripts/check-preset-structure.sh`)
42
+ - Validation: `yarn check:fast` in the loop (`packages/ai-rules/scripts/check-preset-fast.sh`); `yarn release:gate` before a release (`packages/ai-rules/scripts/release-gate.sh`)
43
43
  - Dogfood scripts: `packages/ai-rules/scripts/sync-dogfood-cursor.sh`, `sync-dogfood-claude.sh`, `sync-dogfood-mavis.sh`, `sync-dogfood-opencode.sh`
44
44
  - Drift script: `packages/ai-rules/scripts/check-shared-core-drift.sh`
45
45
  - Orchestrator: when editing presets, load this checklist + twin-sync
@@ -33,7 +33,7 @@ Validate: `check-mavis-adapter-map.mjs`, `check-opencode-adapter-map.mjs`, `chec
33
33
  - **Thin aliases** (`agent-team-intake`, `technical-retro`): may be shorter (soft) if they only point to a command/skill.
34
34
  - **Slim-companion rules** (UI-edit bundle, slim app-cores, slim tooling): may be shorter only if the body is a pointer into shared-core / stack prose. `check-preset-token-budget.sh` enforces this via `SLIM_COMPANION_ALLOWLIST` and the 5-line floor; 6–14-line stems outside the allow-list are slim violations.
35
35
 
36
- ## Severity (`check:preset-structure`)
36
+ ## Severity (structure gates)
37
37
 
38
38
  - Missing or stale generated Claude twin for a changed Cursor rule → **FAIL** (every stack under `presets/cursor/`; mapping table required).
39
39
  - `cursor/<stack>` mapped source changed without mavis / opencode regeneration, or with `adapter-map.json` `sourceRevision` drift → **FAIL**.
@@ -3,7 +3,7 @@
3
3
  "platform": "mavis",
4
4
  "stack": "php-hexagonal",
5
5
  "semanticSource": "cursor/php-hexagonal",
6
- "sourceRevision": "c790997d923dce85be82b143410bacf77fb86608dc7969a2c3c703e804bb9319",
6
+ "sourceRevision": "f14f028926e9274eb18d56d90534fdafd873f900a9395c5feb5d3249a1f1e336",
7
7
  "entries": [
8
8
  {
9
9
  "source": "AGENTS.md",
@@ -10,7 +10,7 @@ import { fileURLToPath } from 'node:url';
10
10
  export const PACKAGE_NAME = '@bonesofspring/ai-rules';
11
11
  export const REGISTRY_URL = 'https://registry.npmjs.org/@bonesofspring/ai-rules/latest';
12
12
  export const CACHE_TTL_MS = 60 * 60 * 1000;
13
- export const TOOL_ROOTS = ['.cursor', '.claude', '.mavis', '.opencode'];
13
+ export const TOOL_ROOTS = ['.cursor', '.claude', '.mavis', '.opencode', '.zcode'];
14
14
 
15
15
  const RELEASE_VERSION = /^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/;
16
16
 
@@ -75,9 +75,10 @@ export function buildNotice(installs, latest) {
75
75
  (item) => item.version === null || compareVersions(item.version, latest) < 0,
76
76
  );
77
77
  if (behind.length === 0) return '';
78
+ const installed = formatInstalled(behind);
78
79
  return [
79
80
  `Preset update available for ${PACKAGE_NAME}.`,
80
- `Installed: ${formatInstalled(behind)}. Latest: ${latest}.`,
81
+ `Installed: ${installed}. Latest: ${latest}.`,
81
82
  'The first block of the reply is only this notice, before any task text.',
82
83
  'Use a level-2 heading and one markdown blockquote. Then a blank line. Then the task answer.',
83
84
  'Do not fold the notice into the task text.',
@@ -86,7 +87,7 @@ export function buildNotice(installs, latest) {
86
87
  'Shape:',
87
88
  '## Preset update',
88
89
  '',
89
- `> Installed \`${PACKAGE_NAME}\` **<installed>**. Latest **${latest}**. Run \`/update\`.`,
90
+ `> Installed \`${PACKAGE_NAME}\` **${installed}**. Latest **${latest}**. Run \`/update\`.`,
90
91
  ].join('\n');
91
92
  }
92
93
 
@@ -10,6 +10,7 @@ When the user message looks like a **work request** (implement, add, fix, refact
10
10
  4. A work request now runs the planning workflow — **goal frame → requirements → information-sufficiency → decompose** (dependency graph / epics); see **task-framing** and **plan-graph**.
11
11
  5. Every **work request** — with or without `/task`, and even when the user says “no pipeline” / “just do it” — persists the **verbatim** original prompt at `.ai.local/team/tasks/<slug>/prompt.md`. Prefer `/task` (its **Slug** step writes it). If handling inline without `/task`, first create the slug dir and write `prompt.md` (write-if-absent), then proceed. Pure questions and trivial one-liners are not work requests → no file. On an inline follow-up for an existing slug (no `/task`) where the user authors new text, append it verbatim to `.ai.local/team/tasks/<slug>/prompt-log.md` (`seq` = max + 1; create on first append; exclude machine-generated and empty/argument-less invocations).
12
12
  6. **Reuse the dialogue language already resolved on this turn** (always-on `ai-local-overlay` / **language-policy**). A question and a message without a slash command still resolve before you speak. When this request writes `prompt.md`, persist that tag once in the header (`language: <BCP-47>`) + a `.memlog.md` `event:` line. Development, reasoning, and artifacts stay English. The setting wins over a mid-task prompt switch (surface it once, never ask). See **language-policy**.
13
+ 7. **Project the intake write.** After `prompt.md` is written for an inline (non-`/task`) work request, run `node .ai.local/scripts/team-db.mjs sync --slug <slug> --deadline-ms 4500` once, so the new task row and its prompt reach the database. A projection failure is reported to the user, never blocks the request; the next full sync remains the convergence path. Do not run a full sync from intake.
13
14
 
14
15
  Exceptions: user explicitly says “no pipeline”, “just do it”, or continues an active slug.
15
16