@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
@@ -36,9 +36,9 @@ Checklist for PRs that touch `packages/ai-rules/presets/**` (and dogfood `.curso
36
36
  - [ ] **shared-core drift:** for embed-mode stems, run `packages/ai-rules/scripts/check-shared-core-drift.sh` (or document intentional fork)
37
37
  - [ ] **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
38
38
  - [ ] **UI-only surfaces:** `mockup-reviewer`, `accessibility-reviewer`, `ux-design`, and the stack performance skill ship only on UI stacks (`check-preset-leakage.sh`)
39
- - [ ] **Rule eval (hard):** `node packages/ai-rules/scripts/check-rule-eval.mjs` runs inside `yarn check:preset-structure`; keep every registered golden stem paired
40
- - [ ] **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.
41
- - [ ] **Gate:** `yarn check:preset-structure` from `packages/ai-rules/` (twin-map, token-budget, leakage, drift, i18n, local overlay, anti-hallucination coverage)
39
+ - [ ] **Rule eval (hard):** `node packages/ai-rules/scripts/check-rule-eval.mjs` runs inside `yarn release:gate`; keep every registered golden stem paired
40
+ - [ ] **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.
41
+ - [ ] **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)
42
42
 
43
43
  ## Pointers
44
44
 
@@ -48,7 +48,7 @@ Checklist for PRs that touch `packages/ai-rules/presets/**` (and dogfood `.curso
48
48
  - Sync: `preset-twin-sync`
49
49
  - Budget: `preset-token-budget`
50
50
  - Leakage: `preset-no-cross-stack-leakage`
51
- - Validation: `yarn check:preset-structure` (`packages/ai-rules/scripts/check-preset-structure.sh`)
51
+ - 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`)
52
52
  - Dogfood scripts: `packages/ai-rules/scripts/sync-dogfood-cursor.sh`, `sync-dogfood-claude.sh`, `sync-dogfood-mavis.sh`, `sync-dogfood-opencode.sh`
53
53
  - Drift script: `packages/ai-rules/scripts/check-shared-core-drift.sh`
54
54
  - Orchestrator: when editing presets, load this checklist + twin-sync
@@ -42,7 +42,7 @@ Validate: `check-mavis-adapter-map.mjs`, `check-opencode-adapter-map.mjs`, `chec
42
42
  - **Thin aliases** (`agent-team-intake`, `technical-retro`): may be shorter (soft) if they only point to a command/skill.
43
43
  - **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.
44
44
 
45
- ## Severity (`check:preset-structure`)
45
+ ## Severity (structure gates)
46
46
 
47
47
  - Missing or stale generated Claude twin for a changed Cursor rule → **FAIL** (every stack under `presets/cursor/`; mapping table required).
48
48
  - `cursor/<stack>` mapped source changed without mavis / opencode regeneration, or with `adapter-map.json` `sourceRevision` drift → **FAIL**.
@@ -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
 
@@ -15,5 +15,6 @@ When the user message looks like a **work request** (implement, add, fix, refact
15
15
  4. A work request now runs the planning workflow — **goal frame → requirements → information-sufficiency → decompose** (dependency graph / epics); see **task-framing** and **plan-graph**.
16
16
  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).
17
17
  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**.
18
+ 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.
18
19
 
19
20
  Exceptions: user explicitly says “no pipeline”, “just do it”, or continues an active slug.
@@ -143,7 +143,7 @@ On each `subagentStop`, the hook reconciles `status.state` from the completing p
143
143
  7. On `validation_failed`: developer → build-verifier.
144
144
  8. When all steps complete, suggest `/technical-retro <slug>`.
145
145
  9. If `autoChain: false`, do not rely on hook.
146
- 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). 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.
146
+ 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). 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.
147
147
  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**.
148
148
 
149
149
  ## Model when invoking (Task)
@@ -158,6 +158,7 @@ Honor optional `steps[i].model` (`cheap` \| `standard` \| `strong`); else agent
158
158
 
159
159
  - **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. Not a manifest `artifacts[]` body — the path lives on the `routing` entry. See **agent-artifact-contracts** § Prompt artifact.
160
160
  - **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.
161
+ - **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.
161
162
  - **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**.
162
163
 
163
164
  - Create/update `.ai.local/team/tasks/<slug>/**` with the **Write** tool. Do **not** bootstrap slug dirs with Shell `mkdir -p` — sandbox → `Operation not permitted` (esp. macOS Desktop/Documents + TCC).
@@ -36,9 +36,9 @@ Checklist for PRs that touch `packages/ai-rules/presets/**` (and dogfood `.curso
36
36
  - [ ] **shared-core drift:** for embed-mode stems, run `packages/ai-rules/scripts/check-shared-core-drift.sh` (or document intentional fork)
37
37
  - [ ] **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
38
38
  - [ ] **UI-only surfaces:** `mockup-reviewer`, `accessibility-reviewer`, `ux-design`, and the stack performance skill ship only on UI stacks (`check-preset-leakage.sh`)
39
- - [ ] **Rule eval (hard):** `node packages/ai-rules/scripts/check-rule-eval.mjs` runs inside `yarn check:preset-structure`; keep every registered golden stem paired
40
- - [ ] **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.
41
- - [ ] **Gate:** `yarn check:preset-structure` from `packages/ai-rules/` (twin-map, token-budget, leakage, drift, i18n, local overlay, anti-hallucination coverage)
39
+ - [ ] **Rule eval (hard):** `node packages/ai-rules/scripts/check-rule-eval.mjs` runs inside `yarn release:gate`; keep every registered golden stem paired
40
+ - [ ] **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.
41
+ - [ ] **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)
42
42
 
43
43
  ## Pointers
44
44
 
@@ -48,7 +48,7 @@ Checklist for PRs that touch `packages/ai-rules/presets/**` (and dogfood `.curso
48
48
  - Sync: `preset-twin-sync`
49
49
  - Budget: `preset-token-budget`
50
50
  - Leakage: `preset-no-cross-stack-leakage`
51
- - Validation: `yarn check:preset-structure` (`packages/ai-rules/scripts/check-preset-structure.sh`)
51
+ - 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`)
52
52
  - Dogfood scripts: `packages/ai-rules/scripts/sync-dogfood-cursor.sh`, `sync-dogfood-claude.sh`, `sync-dogfood-mavis.sh`, `sync-dogfood-opencode.sh`
53
53
  - Drift script: `packages/ai-rules/scripts/check-shared-core-drift.sh`
54
54
  - Orchestrator: when editing presets, load this checklist + twin-sync
@@ -42,7 +42,7 @@ Validate: `check-mavis-adapter-map.mjs`, `check-opencode-adapter-map.mjs`, `chec
42
42
  - **Thin aliases** (`agent-team-intake`, `technical-retro`): may be shorter (soft) if they only point to a command/skill.
43
43
  - **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.
44
44
 
45
- ## Severity (`check:preset-structure`)
45
+ ## Severity (structure gates)
46
46
 
47
47
  - Missing or stale generated Claude twin for a changed Cursor rule → **FAIL** (every stack under `presets/cursor/`; mapping table required).
48
48
  - `cursor/<stack>` mapped source changed without mavis / opencode regeneration, or with `adapter-map.json` `sourceRevision` drift → **FAIL**.
@@ -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
 
@@ -15,6 +15,7 @@ When the user message looks like a **work request** (implement, add, fix, refact
15
15
  4. A work request now runs the planning workflow — **goal frame → requirements → information-sufficiency → decompose** (dependency graph / epics); see **task-framing** and **plan-graph**.
16
16
  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).
17
17
  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**.
18
+ 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.
18
19
 
19
20
  Exceptions: user explicitly says “no pipeline”, “just do it”, or continues an active slug.
20
21
 
@@ -168,13 +168,14 @@ On each `subagentStop`, the hook reconciles `status.state` from the completing p
168
168
  7. On `validation_failed` from `build-verifier`: hook sets `retryAfterFix: build-verifier` → developer → build-verifier.
169
169
  8. When all steps complete, suggest `/technical-retro <slug>`.
170
170
  9. If `autoChain: false` in pipeline, do not rely on hook — manual step only.
171
- 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). 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.
171
+ 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). 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.
172
172
  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**.
173
173
 
174
174
  ## Team artifact I/O (Cursor Shell sandbox)
175
175
 
176
176
  - **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. Not a manifest `artifacts[]` body — the path lives on the `routing` entry. See **agent-artifact-contracts** § Prompt artifact.
177
177
  - **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.
178
+ - **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.
178
179
  - **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**.
179
180
 
180
181
  - 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).
@@ -36,9 +36,9 @@ Checklist for PRs that touch `packages/ai-rules/presets/**` (and dogfood `.curso
36
36
  - [ ] **shared-core drift:** for embed-mode stems, run `packages/ai-rules/scripts/check-shared-core-drift.sh` (or document intentional fork)
37
37
  - [ ] **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
38
38
  - [ ] **UI-only surfaces:** `mockup-reviewer`, `accessibility-reviewer`, `ux-design`, and the stack performance skill ship only on UI stacks (`check-preset-leakage.sh`)
39
- - [ ] **Rule eval (hard):** `node packages/ai-rules/scripts/check-rule-eval.mjs` runs inside `yarn check:preset-structure`; keep every registered golden stem paired
40
- - [ ] **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.
41
- - [ ] **Gate:** `yarn check:preset-structure` from `packages/ai-rules/` (twin-map, token-budget, leakage, drift, i18n, local overlay, anti-hallucination coverage)
39
+ - [ ] **Rule eval (hard):** `node packages/ai-rules/scripts/check-rule-eval.mjs` runs inside `yarn release:gate`; keep every registered golden stem paired
40
+ - [ ] **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.
41
+ - [ ] **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)
42
42
 
43
43
  ## Pointers
44
44
 
@@ -48,7 +48,7 @@ Checklist for PRs that touch `packages/ai-rules/presets/**` (and dogfood `.curso
48
48
  - Sync: `preset-twin-sync`
49
49
  - Budget: `preset-token-budget`
50
50
  - Leakage: `preset-no-cross-stack-leakage`
51
- - Validation: `yarn check:preset-structure` (`packages/ai-rules/scripts/check-preset-structure.sh`)
51
+ - 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`)
52
52
  - Dogfood scripts: `packages/ai-rules/scripts/sync-dogfood-cursor.sh`, `sync-dogfood-claude.sh`, `sync-dogfood-mavis.sh`, `sync-dogfood-opencode.sh`
53
53
  - Drift script: `packages/ai-rules/scripts/check-shared-core-drift.sh`
54
54
  - Orchestrator: when editing presets, load this checklist + twin-sync
@@ -42,7 +42,7 @@ Validate: `check-mavis-adapter-map.mjs`, `check-opencode-adapter-map.mjs`, `chec
42
42
  - **Thin aliases** (`agent-team-intake`, `technical-retro`): may be shorter (soft) if they only point to a command/skill.
43
43
  - **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.
44
44
 
45
- ## Severity (`check:preset-structure`)
45
+ ## Severity (structure gates)
46
46
 
47
47
  - Missing or stale generated Claude twin for a changed Cursor rule → **FAIL** (every stack under `presets/cursor/`; mapping table required).
48
48
  - `cursor/<stack>` mapped source changed without mavis / opencode regeneration, or with `adapter-map.json` `sourceRevision` drift → **FAIL**.
@@ -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
 
@@ -15,6 +15,7 @@ When the user message looks like a **work request** (implement, add, fix, refact
15
15
  4. A work request now runs the planning workflow — **goal frame → requirements → information-sufficiency → decompose** (dependency graph / epics); see **task-framing** and **plan-graph**.
16
16
  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).
17
17
  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**.
18
+ 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.
18
19
 
19
20
  Exceptions: user explicitly says “no pipeline”, “just do it”, or continues an active slug.
20
21
 
@@ -168,13 +168,14 @@ On each `subagentStop`, the hook reconciles `status.state` from the completing p
168
168
  7. On `validation_failed` from `build-verifier`: hook sets `retryAfterFix: build-verifier` → developer → build-verifier.
169
169
  8. When all steps complete, suggest `/technical-retro <slug>`.
170
170
  9. If `autoChain: false` in pipeline, do not rely on hook — manual step only.
171
- 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). 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.
171
+ 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). 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.
172
172
  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**.
173
173
 
174
174
  ## Team artifact I/O (Cursor Shell sandbox)
175
175
 
176
176
  - **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. Not a manifest `artifacts[]` body — the path lives on the `routing` entry. See **agent-artifact-contracts** § Prompt artifact.
177
177
  - **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.
178
+ - **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.
178
179
  - **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**.
179
180
 
180
181
  - 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).
@@ -36,9 +36,9 @@ Checklist for PRs that touch `packages/ai-rules/presets/**` (and dogfood `.curso
36
36
  - [ ] **shared-core drift:** for embed-mode stems, run `packages/ai-rules/scripts/check-shared-core-drift.sh` (or document intentional fork)
37
37
  - [ ] **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
38
38
  - [ ] **UI-only surfaces:** `mockup-reviewer`, `accessibility-reviewer`, `ux-design`, and the stack performance skill ship only on UI stacks (`check-preset-leakage.sh`)
39
- - [ ] **Rule eval (hard):** `node packages/ai-rules/scripts/check-rule-eval.mjs` runs inside `yarn check:preset-structure`; keep every registered golden stem paired
40
- - [ ] **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.
41
- - [ ] **Gate:** `yarn check:preset-structure` from `packages/ai-rules/` (twin-map, token-budget, leakage, drift, i18n, local overlay, anti-hallucination coverage)
39
+ - [ ] **Rule eval (hard):** `node packages/ai-rules/scripts/check-rule-eval.mjs` runs inside `yarn release:gate`; keep every registered golden stem paired
40
+ - [ ] **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.
41
+ - [ ] **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)
42
42
 
43
43
  ## Pointers
44
44
 
@@ -48,7 +48,7 @@ Checklist for PRs that touch `packages/ai-rules/presets/**` (and dogfood `.curso
48
48
  - Sync: `preset-twin-sync`
49
49
  - Budget: `preset-token-budget`
50
50
  - Leakage: `preset-no-cross-stack-leakage`
51
- - Validation: `yarn check:preset-structure` (`packages/ai-rules/scripts/check-preset-structure.sh`)
51
+ - 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`)
52
52
  - Dogfood scripts: `packages/ai-rules/scripts/sync-dogfood-cursor.sh`, `sync-dogfood-claude.sh`, `sync-dogfood-mavis.sh`, `sync-dogfood-opencode.sh`
53
53
  - Drift script: `packages/ai-rules/scripts/check-shared-core-drift.sh`
54
54
  - Orchestrator: when editing presets, load this checklist + twin-sync
@@ -42,7 +42,7 @@ Validate: `check-mavis-adapter-map.mjs`, `check-opencode-adapter-map.mjs`, `chec
42
42
  - **Thin aliases** (`agent-team-intake`, `technical-retro`): may be shorter (soft) if they only point to a command/skill.
43
43
  - **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.
44
44
 
45
- ## Severity (`check:preset-structure`)
45
+ ## Severity (structure gates)
46
46
 
47
47
  - Missing or stale generated Claude twin for a changed Cursor rule → **FAIL** (every stack under `presets/cursor/`; mapping table required).
48
48
  - `cursor/<stack>` mapped source changed without mavis / opencode regeneration, or with `adapter-map.json` `sourceRevision` drift → **FAIL**.
@@ -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
 
@@ -15,5 +15,6 @@ When the user message looks like a **work request** (implement, add, fix, refact
15
15
  4. A work request now runs the planning workflow — **goal frame → requirements → information-sufficiency → decompose** (dependency graph / epics); see **task-framing** and **plan-graph**.
16
16
  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).
17
17
  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**.
18
+ 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.
18
19
 
19
20
  Exceptions: user explicitly says “no pipeline”, “just do it”, or continues an active slug.
@@ -211,13 +211,14 @@ On each `subagentStop`, the hook reconciles `status.state` from the completing p
211
211
  7. On `validation_failed` from `build-verifier`: hook sets `retryAfterFix: build-verifier` → developer → build-verifier.
212
212
  8. When all steps complete, suggest `/technical-retro <slug>`.
213
213
  9. If `autoChain: false` in pipeline, do not rely on hook — manual step only.
214
- 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). 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.
214
+ 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). 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.
215
215
  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**.
216
216
 
217
217
  ## Team artifact I/O (Cursor Shell sandbox)
218
218
 
219
219
  - **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. Not a manifest `artifacts[]` body — the path lives on the `routing` entry. See **agent-artifact-contracts** § Prompt artifact.
220
220
  - **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.
221
+ - **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.
221
222
  - **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**.
222
223
 
223
224
  - Create/update `.ai.local/team/tasks/<slug>/**` 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 `com.apple.macl`).
@@ -36,9 +36,9 @@ Checklist for PRs that touch `packages/ai-rules/presets/**` (and dogfood `.curso
36
36
  - [ ] **shared-core drift:** for embed-mode stems, run `packages/ai-rules/scripts/check-shared-core-drift.sh` (or document intentional fork)
37
37
  - [ ] **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
38
38
  - [ ] **UI-only surfaces:** `mockup-reviewer`, `accessibility-reviewer`, `ux-design`, and the stack performance skill ship only on UI stacks (`check-preset-leakage.sh`)
39
- - [ ] **Rule eval (hard):** `node packages/ai-rules/scripts/check-rule-eval.mjs` runs inside `yarn check:preset-structure`; keep every registered golden stem paired
40
- - [ ] **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.
41
- - [ ] **Gate:** `yarn check:preset-structure` from `packages/ai-rules/` (twin-map, token-budget, leakage, drift, i18n, local overlay, anti-hallucination coverage)
39
+ - [ ] **Rule eval (hard):** `node packages/ai-rules/scripts/check-rule-eval.mjs` runs inside `yarn release:gate`; keep every registered golden stem paired
40
+ - [ ] **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.
41
+ - [ ] **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)
42
42
 
43
43
  ## Pointers
44
44
 
@@ -48,7 +48,7 @@ Checklist for PRs that touch `packages/ai-rules/presets/**` (and dogfood `.curso
48
48
  - Sync: `preset-twin-sync`
49
49
  - Budget: `preset-token-budget`
50
50
  - Leakage: `preset-no-cross-stack-leakage`
51
- - Validation: `yarn check:preset-structure` (`packages/ai-rules/scripts/check-preset-structure.sh`)
51
+ - 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`)
52
52
  - Dogfood scripts: `packages/ai-rules/scripts/sync-dogfood-cursor.sh`, `sync-dogfood-claude.sh`, `sync-dogfood-mavis.sh`, `sync-dogfood-opencode.sh`
53
53
  - Drift script: `packages/ai-rules/scripts/check-shared-core-drift.sh`
54
54
  - Orchestrator: when editing presets, load this checklist + twin-sync
@@ -42,7 +42,7 @@ Validate: `check-mavis-adapter-map.mjs`, `check-opencode-adapter-map.mjs`, `chec
42
42
  - **Thin aliases** (`agent-team-intake`, `technical-retro`): may be shorter (soft) if they only point to a command/skill.
43
43
  - **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.
44
44
 
45
- ## Severity (`check:preset-structure`)
45
+ ## Severity (structure gates)
46
46
 
47
47
  - Missing or stale generated Claude twin for a changed Cursor rule → **FAIL** (every stack under `presets/cursor/`; mapping table required).
48
48
  - `cursor/<stack>` mapped source changed without mavis / opencode regeneration, or with `adapter-map.json` `sourceRevision` drift → **FAIL**.
@@ -32,7 +32,7 @@ Use **`package-manager.mdc`** for the repo package manager.
32
32
 
33
33
  Prefer **`lint`** (= js + css + type-check) before handoff on large changes.
34
34
 
35
- - **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.
35
+ - **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.
36
36
 
37
37
  ## Delta gate policy (retry / carry-forward)
38
38
 
@@ -45,17 +45,30 @@ node scripts/check-preset-delta.mjs --base <last-green-ref> --json
45
45
 
46
46
  - A gate whose domain the classifier reports as **changed** MUST be re-run.
47
47
  - 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.
48
- - 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.
48
+ - 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.
49
49
  - 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.
50
50
  - Carry-forward is evidence, not a skip: the final report still quotes every command (carried or fresh).
51
51
 
52
+ ### Consumer app (any repo with `app/src/**`)
53
+
54
+ The preset classifier above targets this repository. In a consumer app the base is the last green validation of the same slug, not `t0`:
55
+
56
+ ```bash
57
+ git diff --stat <last-green-ref> -- app storybook
58
+ ```
59
+
60
+ - 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.
61
+ - 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.
62
+ - `code-reviewer` findings that touch only docs or artifacts never re-open a green code gate; a production edit always does.
63
+ - Never carry a gate across a rebase, a dependency bump, or a config change (`eslint`, `stylelint`, `tsconfig`, `jest`/`vitest`).
64
+
52
65
  ## Verification before completion
53
66
 
54
67
  <!-- shared-core: quality/verification-before-completion.md -->
55
68
 
56
69
  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.
57
70
 
58
- **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.
71
+ **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.
59
72
 
60
73
  ## Self-review & context hygiene
61
74
 
@@ -27,6 +27,7 @@ You are a senior frontend developer working in a Next.js monorepo with strict la
27
27
  ## Task execution rules
28
28
 
29
29
  - Do **not** start blocked tasks or tasks with incomplete dependencies.
30
+ - **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.
30
31
  - **Unit tests must run before handoff** for mappers, store logic, and non-trivial pure functions.
31
32
  - When the strict implementation rail is off or unset, that test-before-handoff rule is the implementation handoff text.
32
33
  - When `pipeline.json` `implementationRail` is `on`:
@@ -38,7 +39,7 @@ You are a senior frontend developer working in a Next.js monorepo with strict la
38
39
  - L0, docs-only, research, and preset-only tasks do not take the rail. `build-verifier` and `code-reviewer` stay.
39
40
  - Mark completed tasks in `decomposition.md`.
40
41
  - Validation: **`post-change-lint.mdc`**. If pipeline next step is **`build-verifier`**, scoped lint/type-check on **changed files** is enough; full project lint is build-verifier's job.
41
- - **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.
42
+ - **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.
42
43
 
43
44
  ## Zero improvisation
44
45
 
@@ -36,6 +36,8 @@ Before decomposing: state the **goal frame** (goal, user value, success criteria
36
36
 
37
37
  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.
38
38
 
39
+ **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.
40
+
39
41
  ## Claude next hand-agent parity (sync-in-change-set)
40
42
 
41
43
  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
 
@@ -15,5 +15,6 @@ When the user message looks like a **work request** (implement, add, fix, refact
15
15
  4. A work request now runs the planning workflow — **goal frame → requirements → information-sufficiency → decompose** (dependency graph / epics); see **task-framing** and **plan-graph**.
16
16
  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).
17
17
  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**.
18
+ 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.
18
19
 
19
20
  Exceptions: user explicitly says “no pipeline”, “just do it”, or continues an active slug.