@bonesofspring/ai-rules 0.2.77 → 0.2.80

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 (908) hide show
  1. package/CHANGELOG.md +89 -0
  2. package/README.md +4 -2
  3. package/bin/lib/engine-scripts.js +9 -0
  4. package/bin/lib/seed-ai-local-team.js +2 -0
  5. package/docs/LOCAL-OVERLAY.md +4 -4
  6. package/docs/PRESET-CONTRIBUTION.md +9 -8
  7. package/docs/TEAM-DB.md +160 -22
  8. package/docs/openapi/team-db.v1.json +2879 -1858
  9. package/package.json +6 -1
  10. package/presets/_shared/ai-local/scripts/aggregate-agent-task-metrics.mjs +23 -0
  11. package/presets/_shared/ai-local/scripts/check-task-repositories.mjs +264 -0
  12. package/presets/_shared/ai-local/scripts/check-verification.mjs +275 -0
  13. package/presets/_shared/ai-local/scripts/check-write-scope.mjs +72 -18
  14. package/presets/_shared/ai-local/scripts/manifest.mjs +78 -4
  15. package/presets/_shared/ai-local/scripts/rr-migrate-repositories.mjs +481 -0
  16. package/presets/_shared/ai-local/scripts/rule-improver.mjs +366 -13
  17. package/presets/_shared/ai-local/scripts/run.mjs +29 -6
  18. package/presets/_shared/ai-local/scripts/team-db-api.mjs +211 -12
  19. package/presets/_shared/ai-local/scripts/team-db-openapi.mjs +289 -3
  20. package/presets/_shared/ai-local/scripts/team-db-project.mjs +1065 -4
  21. package/presets/_shared/ai-local/scripts/team-db-schema.mjs +144 -15
  22. package/presets/_shared/ai-local/scripts/team-db-tracker.mjs +29 -10
  23. package/presets/_shared/ai-local/scripts/team-db.mjs +65 -5
  24. package/presets/_shared/core/agent-team/agent-artifact-contracts.md +9 -4
  25. package/presets/_shared/core/agent-team/task-framing.md +1 -0
  26. package/presets/_shared/core/meta/preset-layering.md +4 -4
  27. package/presets/_shared/core/meta/preset-pr-checklist.md +2 -1
  28. package/presets/_shared/core/meta/preset-twin-sync.md +12 -5
  29. package/presets/_shared/core/quality/self-review-and-context-hygiene.md +1 -1
  30. package/presets/_shared/core/quality/verification-before-completion.md +28 -4
  31. package/presets/_shared/core/review/code-review-mr.md +1 -0
  32. package/presets/_shared/core/review/receiving-code-review.md +1 -0
  33. package/presets/_shared/hooks/chain-team-phases.sh.tmpl +382 -27
  34. package/presets/claude/android-kotlin/CLAUDE.md +1 -1
  35. package/presets/claude/android-kotlin/agents/build-verifier.md +1 -1
  36. package/presets/claude/android-kotlin/agents/code-reviewer.md +1 -1
  37. package/presets/claude/android-kotlin/agents/debugger.md +1 -1
  38. package/presets/claude/android-kotlin/agents/feature-developer.md +1 -1
  39. package/presets/claude/android-kotlin/agents/task-analyst.md +1 -1
  40. package/presets/claude/android-kotlin/agents/task-router.md +2 -0
  41. package/presets/claude/android-kotlin/commands/README.md +1 -0
  42. package/presets/claude/android-kotlin/commands/rr-migrate-repositories.md +59 -0
  43. package/presets/claude/android-kotlin/commands/task.md +4 -0
  44. package/presets/claude/android-kotlin/hooks/chain-team-phases.sh +382 -27
  45. package/presets/claude/android-kotlin/rules/tooling-and-review/ai-local-overlay.md +1 -1
  46. package/presets/claude/android-kotlin/rules/tooling-and-review/code-review.md +1 -0
  47. package/presets/claude/android-kotlin/rules/tooling-and-review/preset-layering.md +4 -4
  48. package/presets/claude/android-kotlin/rules/tooling-and-review/preset-pr-checklist.md +2 -1
  49. package/presets/claude/android-kotlin/rules/tooling-and-review/preset-twin-sync.md +12 -5
  50. package/presets/claude/go/CLAUDE.md +1 -1
  51. package/presets/claude/go/agents/build-verifier.md +1 -1
  52. package/presets/claude/go/agents/code-reviewer.md +1 -1
  53. package/presets/claude/go/agents/debugger.md +1 -1
  54. package/presets/claude/go/agents/feature-developer.md +1 -1
  55. package/presets/claude/go/agents/task-analyst.md +1 -1
  56. package/presets/claude/go/agents/task-router.md +2 -0
  57. package/presets/claude/go/commands/README.md +1 -0
  58. package/presets/claude/go/commands/rr-migrate-repositories.md +59 -0
  59. package/presets/claude/go/commands/task.md +4 -0
  60. package/presets/claude/go/hooks/chain-team-phases.sh +382 -27
  61. package/presets/claude/go/rules/tooling-and-review/ai-local-overlay.md +1 -1
  62. package/presets/claude/go/rules/tooling-and-review/code-review.md +1 -0
  63. package/presets/claude/go/rules/tooling-and-review/preset-layering.md +4 -4
  64. package/presets/claude/go/rules/tooling-and-review/preset-pr-checklist.md +2 -1
  65. package/presets/claude/go/rules/tooling-and-review/preset-twin-sync.md +12 -5
  66. package/presets/claude/ios-swift/CLAUDE.md +1 -1
  67. package/presets/claude/ios-swift/agents/build-verifier.md +4 -1
  68. package/presets/claude/ios-swift/agents/code-reviewer.md +1 -1
  69. package/presets/claude/ios-swift/agents/debugger.md +1 -1
  70. package/presets/claude/ios-swift/agents/feature-developer.md +1 -1
  71. package/presets/claude/ios-swift/agents/task-analyst.md +1 -1
  72. package/presets/claude/ios-swift/agents/task-router.md +2 -0
  73. package/presets/claude/ios-swift/commands/README.md +1 -0
  74. package/presets/claude/ios-swift/commands/rr-migrate-repositories.md +59 -0
  75. package/presets/claude/ios-swift/commands/task.md +4 -0
  76. package/presets/claude/ios-swift/hooks/chain-team-phases.sh +382 -27
  77. package/presets/claude/ios-swift/rules/tooling-and-review/ai-local-overlay.md +1 -1
  78. package/presets/claude/ios-swift/rules/tooling-and-review/code-review.md +1 -0
  79. package/presets/claude/ios-swift/rules/tooling-and-review/preset-layering.md +4 -4
  80. package/presets/claude/ios-swift/rules/tooling-and-review/preset-pr-checklist.md +2 -1
  81. package/presets/claude/ios-swift/rules/tooling-and-review/preset-twin-sync.md +12 -5
  82. package/presets/claude/java/CLAUDE.md +1 -1
  83. package/presets/claude/java/agents/build-verifier.md +1 -1
  84. package/presets/claude/java/agents/code-reviewer.md +1 -1
  85. package/presets/claude/java/agents/debugger.md +1 -1
  86. package/presets/claude/java/agents/feature-developer.md +1 -1
  87. package/presets/claude/java/agents/task-analyst.md +1 -1
  88. package/presets/claude/java/agents/task-router.md +2 -0
  89. package/presets/claude/java/commands/README.md +1 -0
  90. package/presets/claude/java/commands/rr-migrate-repositories.md +59 -0
  91. package/presets/claude/java/commands/task.md +4 -0
  92. package/presets/claude/java/hooks/chain-team-phases.sh +382 -27
  93. package/presets/claude/java/rules/tooling-and-review/ai-local-overlay.md +1 -1
  94. package/presets/claude/java/rules/tooling-and-review/code-review.md +1 -0
  95. package/presets/claude/java/rules/tooling-and-review/preset-layering.md +4 -4
  96. package/presets/claude/java/rules/tooling-and-review/preset-pr-checklist.md +2 -1
  97. package/presets/claude/java/rules/tooling-and-review/preset-twin-sync.md +12 -5
  98. package/presets/claude/mcp-ts/CLAUDE.md +1 -1
  99. package/presets/claude/mcp-ts/agents/build-verifier.md +1 -1
  100. package/presets/claude/mcp-ts/agents/feature-developer.md +1 -1
  101. package/presets/claude/mcp-ts/agents/task-analyst.md +1 -1
  102. package/presets/claude/mcp-ts/agents/task-router.md +2 -0
  103. package/presets/claude/mcp-ts/commands/README.md +1 -0
  104. package/presets/claude/mcp-ts/commands/rr-migrate-repositories.md +59 -0
  105. package/presets/claude/mcp-ts/commands/task.md +4 -0
  106. package/presets/claude/mcp-ts/hooks/chain-team-phases.sh +382 -27
  107. package/presets/claude/mcp-ts/rules/tooling-and-review/ai-local-overlay.md +1 -1
  108. package/presets/claude/mcp-ts/rules/tooling-and-review/code-review.md +1 -0
  109. package/presets/claude/mcp-ts/rules/tooling-and-review/preset-layering.md +4 -4
  110. package/presets/claude/mcp-ts/rules/tooling-and-review/preset-pr-checklist.md +2 -1
  111. package/presets/claude/mcp-ts/rules/tooling-and-review/preset-twin-sync.md +12 -5
  112. package/presets/claude/mol/CLAUDE.md +1 -1
  113. package/presets/claude/mol/agents/build-verifier.md +4 -1
  114. package/presets/claude/mol/agents/code-reviewer.md +1 -1
  115. package/presets/claude/mol/agents/debugger.md +1 -1
  116. package/presets/claude/mol/agents/feature-developer.md +1 -1
  117. package/presets/claude/mol/agents/task-analyst.md +1 -1
  118. package/presets/claude/mol/agents/task-router.md +2 -0
  119. package/presets/claude/mol/commands/README.md +1 -0
  120. package/presets/claude/mol/commands/rr-migrate-repositories.md +59 -0
  121. package/presets/claude/mol/commands/task.md +4 -0
  122. package/presets/claude/mol/hooks/chain-team-phases.sh +382 -27
  123. package/presets/claude/mol/rules/tooling-and-review/ai-local-overlay.md +1 -1
  124. package/presets/claude/mol/rules/tooling-and-review/code-review-mr.md +1 -0
  125. package/presets/claude/mol/rules/tooling-and-review/preset-layering.md +4 -4
  126. package/presets/claude/mol/rules/tooling-and-review/preset-pr-checklist.md +2 -1
  127. package/presets/claude/mol/rules/tooling-and-review/preset-twin-sync.md +12 -5
  128. package/presets/claude/next/CLAUDE.md +1 -1
  129. package/presets/claude/next/agents/build-verifier.md +6 -1
  130. package/presets/claude/next/agents/code-reviewer.md +1 -1
  131. package/presets/claude/next/agents/debugger.md +1 -1
  132. package/presets/claude/next/agents/feature-developer.md +1 -1
  133. package/presets/claude/next/agents/task-analyst.md +1 -1
  134. package/presets/claude/next/agents/task-router.md +2 -0
  135. package/presets/claude/next/commands/README.md +1 -0
  136. package/presets/claude/next/commands/rr-migrate-repositories.md +59 -0
  137. package/presets/claude/next/commands/task.md +4 -0
  138. package/presets/claude/next/commands/ui-start.md +12 -4
  139. package/presets/claude/next/commands/ui-stop.md +5 -2
  140. package/presets/claude/next/hooks/chain-team-phases.sh +382 -27
  141. package/presets/claude/next/rules/tooling-and-review/ai-local-overlay.md +2 -1
  142. package/presets/claude/next/rules/tooling-and-review/code-review-mr.md +1 -0
  143. package/presets/claude/next/rules/tooling-and-review/preset-layering.md +4 -4
  144. package/presets/claude/next/rules/tooling-and-review/preset-pr-checklist.md +2 -1
  145. package/presets/claude/next/rules/tooling-and-review/preset-twin-sync.md +12 -5
  146. package/presets/claude/nuxt/CLAUDE.md +1 -1
  147. package/presets/claude/nuxt/agents/build-verifier.md +4 -1
  148. package/presets/claude/nuxt/agents/code-reviewer.md +1 -1
  149. package/presets/claude/nuxt/agents/debugger.md +1 -1
  150. package/presets/claude/nuxt/agents/feature-developer.md +1 -1
  151. package/presets/claude/nuxt/agents/task-analyst.md +1 -1
  152. package/presets/claude/nuxt/agents/task-router.md +2 -0
  153. package/presets/claude/nuxt/commands/README.md +1 -0
  154. package/presets/claude/nuxt/commands/rr-migrate-repositories.md +59 -0
  155. package/presets/claude/nuxt/commands/task.md +4 -0
  156. package/presets/claude/nuxt/hooks/chain-team-phases.sh +382 -27
  157. package/presets/claude/nuxt/rules/tooling-and-review/ai-local-overlay.md +1 -1
  158. package/presets/claude/nuxt/rules/tooling-and-review/code-review-mr.md +1 -0
  159. package/presets/claude/nuxt/rules/tooling-and-review/preset-layering.md +4 -4
  160. package/presets/claude/nuxt/rules/tooling-and-review/preset-pr-checklist.md +2 -1
  161. package/presets/claude/nuxt/rules/tooling-and-review/preset-twin-sync.md +12 -5
  162. package/presets/claude/php-hexagonal/CLAUDE.md +1 -1
  163. package/presets/claude/php-hexagonal/agents/build-verifier.md +1 -1
  164. package/presets/claude/php-hexagonal/agents/code-reviewer.md +1 -1
  165. package/presets/claude/php-hexagonal/agents/debugger.md +1 -1
  166. package/presets/claude/php-hexagonal/agents/feature-developer.md +1 -1
  167. package/presets/claude/php-hexagonal/agents/task-analyst.md +1 -1
  168. package/presets/claude/php-hexagonal/agents/task-router.md +2 -0
  169. package/presets/claude/php-hexagonal/commands/README.md +1 -0
  170. package/presets/claude/php-hexagonal/commands/rr-migrate-repositories.md +59 -0
  171. package/presets/claude/php-hexagonal/commands/task.md +4 -0
  172. package/presets/claude/php-hexagonal/hooks/chain-team-phases.sh +382 -27
  173. package/presets/claude/php-hexagonal/rules/tooling-and-review/ai-local-overlay.md +1 -1
  174. package/presets/claude/php-hexagonal/rules/tooling-and-review/code-review.md +1 -0
  175. package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-layering.md +4 -4
  176. package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-pr-checklist.md +2 -1
  177. package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-twin-sync.md +12 -5
  178. package/presets/claude/php-laravel/CLAUDE.md +1 -1
  179. package/presets/claude/php-laravel/agents/build-verifier.md +1 -1
  180. package/presets/claude/php-laravel/agents/code-reviewer.md +1 -1
  181. package/presets/claude/php-laravel/agents/debugger.md +1 -1
  182. package/presets/claude/php-laravel/agents/feature-developer.md +1 -1
  183. package/presets/claude/php-laravel/agents/task-analyst.md +1 -1
  184. package/presets/claude/php-laravel/agents/task-router.md +2 -0
  185. package/presets/claude/php-laravel/commands/README.md +1 -0
  186. package/presets/claude/php-laravel/commands/rr-migrate-repositories.md +59 -0
  187. package/presets/claude/php-laravel/commands/task.md +4 -0
  188. package/presets/claude/php-laravel/hooks/chain-team-phases.sh +382 -27
  189. package/presets/claude/php-laravel/rules/tooling-and-review/ai-local-overlay.md +1 -1
  190. package/presets/claude/php-laravel/rules/tooling-and-review/code-review.md +1 -0
  191. package/presets/claude/php-laravel/rules/tooling-and-review/preset-layering.md +4 -4
  192. package/presets/claude/php-laravel/rules/tooling-and-review/preset-pr-checklist.md +2 -1
  193. package/presets/claude/php-laravel/rules/tooling-and-review/preset-twin-sync.md +12 -5
  194. package/presets/claude/svelte/CLAUDE.md +1 -1
  195. package/presets/claude/svelte/agents/build-verifier.md +4 -1
  196. package/presets/claude/svelte/agents/code-reviewer.md +1 -1
  197. package/presets/claude/svelte/agents/debugger.md +1 -1
  198. package/presets/claude/svelte/agents/feature-developer.md +1 -1
  199. package/presets/claude/svelte/agents/task-analyst.md +1 -1
  200. package/presets/claude/svelte/agents/task-router.md +2 -0
  201. package/presets/claude/svelte/commands/README.md +1 -0
  202. package/presets/claude/svelte/commands/rr-migrate-repositories.md +59 -0
  203. package/presets/claude/svelte/commands/task.md +4 -0
  204. package/presets/claude/svelte/hooks/chain-team-phases.sh +382 -27
  205. package/presets/claude/svelte/rules/tooling-and-review/ai-local-overlay.md +1 -1
  206. package/presets/claude/svelte/rules/tooling-and-review/code-review-mr.md +1 -0
  207. package/presets/claude/svelte/rules/tooling-and-review/preset-layering.md +4 -4
  208. package/presets/claude/svelte/rules/tooling-and-review/preset-pr-checklist.md +2 -1
  209. package/presets/claude/svelte/rules/tooling-and-review/preset-twin-sync.md +12 -5
  210. package/presets/cursor/android-kotlin/agents/build-verifier.md +1 -1
  211. package/presets/cursor/android-kotlin/agents/code-reviewer.md +1 -1
  212. package/presets/cursor/android-kotlin/agents/debugger.md +1 -1
  213. package/presets/cursor/android-kotlin/agents/feature-developer.md +1 -1
  214. package/presets/cursor/android-kotlin/agents/task-analyst.md +1 -1
  215. package/presets/cursor/android-kotlin/agents/task-router.md +2 -0
  216. package/presets/cursor/android-kotlin/commands/README.md +1 -0
  217. package/presets/cursor/android-kotlin/commands/rr-migrate-repositories.md +59 -0
  218. package/presets/cursor/android-kotlin/commands/task.md +4 -0
  219. package/presets/cursor/android-kotlin/hooks/chain-team-phases.sh +382 -27
  220. package/presets/cursor/android-kotlin/rules/ai-local-overlay.mdc +1 -1
  221. package/presets/cursor/android-kotlin/rules/code-review-mr.mdc +1 -0
  222. package/presets/cursor/android-kotlin/rules/preset-layering.mdc +4 -4
  223. package/presets/cursor/android-kotlin/rules/preset-pr-checklist.mdc +2 -1
  224. package/presets/cursor/android-kotlin/rules/preset-twin-sync.mdc +12 -5
  225. package/presets/cursor/go/agents/build-verifier.md +1 -1
  226. package/presets/cursor/go/agents/code-reviewer.md +1 -1
  227. package/presets/cursor/go/agents/debugger.md +1 -1
  228. package/presets/cursor/go/agents/feature-developer.md +1 -1
  229. package/presets/cursor/go/agents/task-analyst.md +1 -1
  230. package/presets/cursor/go/agents/task-router.md +2 -0
  231. package/presets/cursor/go/commands/README.md +1 -0
  232. package/presets/cursor/go/commands/rr-migrate-repositories.md +59 -0
  233. package/presets/cursor/go/commands/task.md +4 -0
  234. package/presets/cursor/go/hooks/chain-team-phases.sh +382 -27
  235. package/presets/cursor/go/rules/ai-local-overlay.mdc +1 -1
  236. package/presets/cursor/go/rules/code-review-mr.mdc +1 -0
  237. package/presets/cursor/go/rules/preset-layering.mdc +4 -4
  238. package/presets/cursor/go/rules/preset-pr-checklist.mdc +2 -1
  239. package/presets/cursor/go/rules/preset-twin-sync.mdc +12 -5
  240. package/presets/cursor/ios-swift/agents/build-verifier.md +4 -1
  241. package/presets/cursor/ios-swift/agents/code-reviewer.md +1 -1
  242. package/presets/cursor/ios-swift/agents/debugger.md +1 -1
  243. package/presets/cursor/ios-swift/agents/feature-developer.md +1 -1
  244. package/presets/cursor/ios-swift/agents/task-analyst.md +1 -1
  245. package/presets/cursor/ios-swift/agents/task-router.md +2 -0
  246. package/presets/cursor/ios-swift/commands/README.md +1 -0
  247. package/presets/cursor/ios-swift/commands/rr-migrate-repositories.md +59 -0
  248. package/presets/cursor/ios-swift/commands/task.md +4 -0
  249. package/presets/cursor/ios-swift/hooks/chain-team-phases.sh +382 -27
  250. package/presets/cursor/ios-swift/rules/ai-local-overlay.mdc +1 -1
  251. package/presets/cursor/ios-swift/rules/code-review-mr.mdc +1 -0
  252. package/presets/cursor/ios-swift/rules/preset-layering.mdc +4 -4
  253. package/presets/cursor/ios-swift/rules/preset-pr-checklist.mdc +2 -1
  254. package/presets/cursor/ios-swift/rules/preset-twin-sync.mdc +12 -5
  255. package/presets/cursor/java/agents/build-verifier.md +1 -1
  256. package/presets/cursor/java/agents/code-reviewer.md +1 -1
  257. package/presets/cursor/java/agents/debugger.md +1 -1
  258. package/presets/cursor/java/agents/feature-developer.md +1 -1
  259. package/presets/cursor/java/agents/task-analyst.md +1 -1
  260. package/presets/cursor/java/agents/task-router.md +2 -0
  261. package/presets/cursor/java/commands/README.md +1 -0
  262. package/presets/cursor/java/commands/rr-migrate-repositories.md +59 -0
  263. package/presets/cursor/java/commands/task.md +4 -0
  264. package/presets/cursor/java/hooks/chain-team-phases.sh +382 -27
  265. package/presets/cursor/java/rules/ai-local-overlay.mdc +1 -1
  266. package/presets/cursor/java/rules/code-review-mr.mdc +1 -0
  267. package/presets/cursor/java/rules/preset-layering.mdc +4 -4
  268. package/presets/cursor/java/rules/preset-pr-checklist.mdc +2 -1
  269. package/presets/cursor/java/rules/preset-twin-sync.mdc +12 -5
  270. package/presets/cursor/mcp-ts/agents/build-verifier.md +1 -1
  271. package/presets/cursor/mcp-ts/agents/feature-developer.md +1 -1
  272. package/presets/cursor/mcp-ts/agents/task-analyst.md +1 -1
  273. package/presets/cursor/mcp-ts/agents/task-router.md +2 -0
  274. package/presets/cursor/mcp-ts/commands/README.md +1 -0
  275. package/presets/cursor/mcp-ts/commands/rr-migrate-repositories.md +59 -0
  276. package/presets/cursor/mcp-ts/commands/task.md +4 -0
  277. package/presets/cursor/mcp-ts/hooks/chain-team-phases.sh +382 -27
  278. package/presets/cursor/mcp-ts/rules/ai-local-overlay.mdc +1 -1
  279. package/presets/cursor/mcp-ts/rules/code-review-mr.mdc +1 -0
  280. package/presets/cursor/mcp-ts/rules/preset-layering.mdc +4 -4
  281. package/presets/cursor/mcp-ts/rules/preset-pr-checklist.mdc +2 -1
  282. package/presets/cursor/mcp-ts/rules/preset-twin-sync.mdc +12 -5
  283. package/presets/cursor/mol/agents/build-verifier.md +4 -1
  284. package/presets/cursor/mol/agents/code-reviewer.md +1 -1
  285. package/presets/cursor/mol/agents/debugger.md +1 -1
  286. package/presets/cursor/mol/agents/feature-developer.md +1 -1
  287. package/presets/cursor/mol/agents/task-analyst.md +1 -1
  288. package/presets/cursor/mol/agents/task-router.md +2 -0
  289. package/presets/cursor/mol/commands/README.md +1 -0
  290. package/presets/cursor/mol/commands/rr-migrate-repositories.md +59 -0
  291. package/presets/cursor/mol/commands/task.md +4 -0
  292. package/presets/cursor/mol/hooks/chain-team-phases.sh +382 -27
  293. package/presets/cursor/mol/rules/ai-local-overlay.mdc +1 -1
  294. package/presets/cursor/mol/rules/code-review-mr.mdc +1 -0
  295. package/presets/cursor/mol/rules/preset-layering.mdc +4 -4
  296. package/presets/cursor/mol/rules/preset-pr-checklist.mdc +2 -1
  297. package/presets/cursor/mol/rules/preset-twin-sync.mdc +12 -5
  298. package/presets/cursor/next/agents/build-verifier.md +6 -1
  299. package/presets/cursor/next/agents/code-reviewer.md +1 -1
  300. package/presets/cursor/next/agents/debugger.md +1 -1
  301. package/presets/cursor/next/agents/feature-developer.md +1 -1
  302. package/presets/cursor/next/agents/task-analyst.md +1 -1
  303. package/presets/cursor/next/agents/task-router.md +2 -0
  304. package/presets/cursor/next/commands/README.md +1 -0
  305. package/presets/cursor/next/commands/rr-migrate-repositories.md +59 -0
  306. package/presets/cursor/next/commands/task.md +4 -0
  307. package/presets/cursor/next/commands/ui-start.md +12 -4
  308. package/presets/cursor/next/commands/ui-stop.md +5 -2
  309. package/presets/cursor/next/hooks/chain-team-phases.sh +382 -27
  310. package/presets/cursor/next/rules/ai-local-overlay.mdc +2 -1
  311. package/presets/cursor/next/rules/code-review-mr.mdc +1 -0
  312. package/presets/cursor/next/rules/preset-layering.mdc +4 -4
  313. package/presets/cursor/next/rules/preset-pr-checklist.mdc +2 -1
  314. package/presets/cursor/next/rules/preset-twin-sync.mdc +12 -5
  315. package/presets/cursor/nuxt/agents/build-verifier.md +4 -1
  316. package/presets/cursor/nuxt/agents/code-reviewer.md +1 -1
  317. package/presets/cursor/nuxt/agents/debugger.md +1 -1
  318. package/presets/cursor/nuxt/agents/feature-developer.md +1 -1
  319. package/presets/cursor/nuxt/agents/task-analyst.md +1 -1
  320. package/presets/cursor/nuxt/agents/task-router.md +2 -0
  321. package/presets/cursor/nuxt/commands/README.md +1 -0
  322. package/presets/cursor/nuxt/commands/rr-migrate-repositories.md +59 -0
  323. package/presets/cursor/nuxt/commands/task.md +4 -0
  324. package/presets/cursor/nuxt/hooks/chain-team-phases.sh +382 -27
  325. package/presets/cursor/nuxt/rules/ai-local-overlay.mdc +1 -1
  326. package/presets/cursor/nuxt/rules/code-review-mr.mdc +1 -0
  327. package/presets/cursor/nuxt/rules/preset-layering.mdc +4 -4
  328. package/presets/cursor/nuxt/rules/preset-pr-checklist.mdc +2 -1
  329. package/presets/cursor/nuxt/rules/preset-twin-sync.mdc +12 -5
  330. package/presets/cursor/php-hexagonal/agents/build-verifier.md +1 -1
  331. package/presets/cursor/php-hexagonal/agents/code-reviewer.md +1 -1
  332. package/presets/cursor/php-hexagonal/agents/debugger.md +1 -1
  333. package/presets/cursor/php-hexagonal/agents/feature-developer.md +1 -1
  334. package/presets/cursor/php-hexagonal/agents/task-analyst.md +1 -1
  335. package/presets/cursor/php-hexagonal/agents/task-router.md +2 -0
  336. package/presets/cursor/php-hexagonal/commands/README.md +1 -0
  337. package/presets/cursor/php-hexagonal/commands/rr-migrate-repositories.md +59 -0
  338. package/presets/cursor/php-hexagonal/commands/task.md +4 -0
  339. package/presets/cursor/php-hexagonal/hooks/chain-team-phases.sh +382 -27
  340. package/presets/cursor/php-hexagonal/rules/ai-local-overlay.mdc +1 -1
  341. package/presets/cursor/php-hexagonal/rules/code-review-mr.mdc +1 -0
  342. package/presets/cursor/php-hexagonal/rules/preset-layering.mdc +4 -4
  343. package/presets/cursor/php-hexagonal/rules/preset-pr-checklist.mdc +2 -1
  344. package/presets/cursor/php-hexagonal/rules/preset-twin-sync.mdc +12 -5
  345. package/presets/cursor/php-laravel/agents/build-verifier.md +1 -1
  346. package/presets/cursor/php-laravel/agents/code-reviewer.md +1 -1
  347. package/presets/cursor/php-laravel/agents/debugger.md +1 -1
  348. package/presets/cursor/php-laravel/agents/feature-developer.md +1 -1
  349. package/presets/cursor/php-laravel/agents/task-analyst.md +1 -1
  350. package/presets/cursor/php-laravel/agents/task-router.md +2 -0
  351. package/presets/cursor/php-laravel/commands/README.md +1 -0
  352. package/presets/cursor/php-laravel/commands/rr-migrate-repositories.md +59 -0
  353. package/presets/cursor/php-laravel/commands/task.md +4 -0
  354. package/presets/cursor/php-laravel/hooks/chain-team-phases.sh +382 -27
  355. package/presets/cursor/php-laravel/rules/ai-local-overlay.mdc +1 -1
  356. package/presets/cursor/php-laravel/rules/code-review-mr.mdc +1 -0
  357. package/presets/cursor/php-laravel/rules/preset-layering.mdc +4 -4
  358. package/presets/cursor/php-laravel/rules/preset-pr-checklist.mdc +2 -1
  359. package/presets/cursor/php-laravel/rules/preset-twin-sync.mdc +12 -5
  360. package/presets/cursor/svelte/agents/build-verifier.md +4 -1
  361. package/presets/cursor/svelte/agents/code-reviewer.md +1 -1
  362. package/presets/cursor/svelte/agents/debugger.md +1 -1
  363. package/presets/cursor/svelte/agents/feature-developer.md +1 -1
  364. package/presets/cursor/svelte/agents/task-analyst.md +1 -1
  365. package/presets/cursor/svelte/agents/task-router.md +2 -0
  366. package/presets/cursor/svelte/commands/README.md +1 -0
  367. package/presets/cursor/svelte/commands/rr-migrate-repositories.md +59 -0
  368. package/presets/cursor/svelte/commands/task.md +4 -0
  369. package/presets/cursor/svelte/hooks/chain-team-phases.sh +382 -27
  370. package/presets/cursor/svelte/rules/ai-local-overlay.mdc +1 -1
  371. package/presets/cursor/svelte/rules/code-review-mr.mdc +1 -0
  372. package/presets/cursor/svelte/rules/preset-layering.mdc +4 -4
  373. package/presets/cursor/svelte/rules/preset-pr-checklist.mdc +2 -1
  374. package/presets/cursor/svelte/rules/preset-twin-sync.mdc +12 -5
  375. package/presets/mavis/android-kotlin/adapter-map.json +9 -1
  376. package/presets/mavis/android-kotlin/agents/build-verifier.md +1 -1
  377. package/presets/mavis/android-kotlin/agents/code-reviewer.md +1 -1
  378. package/presets/mavis/android-kotlin/agents/debugger.md +1 -1
  379. package/presets/mavis/android-kotlin/agents/feature-developer.md +1 -1
  380. package/presets/mavis/android-kotlin/agents/task-analyst.md +1 -1
  381. package/presets/mavis/android-kotlin/agents/task-router.md +2 -0
  382. package/presets/mavis/android-kotlin/commands/README.md +1 -0
  383. package/presets/mavis/android-kotlin/commands/rr-migrate-repositories.md +54 -0
  384. package/presets/mavis/android-kotlin/commands/task.md +4 -0
  385. package/presets/mavis/android-kotlin/hooks/chain-team-phases.sh +382 -27
  386. package/presets/mavis/android-kotlin/rules/ai-local-overlay.md +1 -1
  387. package/presets/mavis/android-kotlin/rules/code-review-mr.md +1 -0
  388. package/presets/mavis/android-kotlin/rules/preset-layering.md +4 -4
  389. package/presets/mavis/android-kotlin/rules/preset-pr-checklist.md +2 -1
  390. package/presets/mavis/android-kotlin/rules/preset-twin-sync.md +12 -5
  391. package/presets/mavis/go/adapter-map.json +9 -1
  392. package/presets/mavis/go/agents/build-verifier.md +1 -1
  393. package/presets/mavis/go/agents/code-reviewer.md +1 -1
  394. package/presets/mavis/go/agents/debugger.md +1 -1
  395. package/presets/mavis/go/agents/feature-developer.md +1 -1
  396. package/presets/mavis/go/agents/task-analyst.md +1 -1
  397. package/presets/mavis/go/agents/task-router.md +2 -0
  398. package/presets/mavis/go/commands/README.md +1 -0
  399. package/presets/mavis/go/commands/rr-migrate-repositories.md +54 -0
  400. package/presets/mavis/go/commands/task.md +4 -0
  401. package/presets/mavis/go/hooks/chain-team-phases.sh +382 -27
  402. package/presets/mavis/go/rules/ai-local-overlay.md +1 -1
  403. package/presets/mavis/go/rules/code-review-mr.md +1 -0
  404. package/presets/mavis/go/rules/preset-layering.md +4 -4
  405. package/presets/mavis/go/rules/preset-pr-checklist.md +2 -1
  406. package/presets/mavis/go/rules/preset-twin-sync.md +12 -5
  407. package/presets/mavis/ios-swift/adapter-map.json +9 -1
  408. package/presets/mavis/ios-swift/agents/build-verifier.md +4 -1
  409. package/presets/mavis/ios-swift/agents/code-reviewer.md +1 -1
  410. package/presets/mavis/ios-swift/agents/debugger.md +1 -1
  411. package/presets/mavis/ios-swift/agents/feature-developer.md +1 -1
  412. package/presets/mavis/ios-swift/agents/task-analyst.md +1 -1
  413. package/presets/mavis/ios-swift/agents/task-router.md +2 -0
  414. package/presets/mavis/ios-swift/commands/README.md +1 -0
  415. package/presets/mavis/ios-swift/commands/rr-migrate-repositories.md +54 -0
  416. package/presets/mavis/ios-swift/commands/task.md +4 -0
  417. package/presets/mavis/ios-swift/hooks/chain-team-phases.sh +382 -27
  418. package/presets/mavis/ios-swift/rules/ai-local-overlay.md +1 -1
  419. package/presets/mavis/ios-swift/rules/code-review-mr.md +1 -0
  420. package/presets/mavis/ios-swift/rules/preset-layering.md +4 -4
  421. package/presets/mavis/ios-swift/rules/preset-pr-checklist.md +2 -1
  422. package/presets/mavis/ios-swift/rules/preset-twin-sync.md +12 -5
  423. package/presets/mavis/java/adapter-map.json +9 -1
  424. package/presets/mavis/java/agents/build-verifier.md +1 -1
  425. package/presets/mavis/java/agents/code-reviewer.md +1 -1
  426. package/presets/mavis/java/agents/debugger.md +1 -1
  427. package/presets/mavis/java/agents/feature-developer.md +1 -1
  428. package/presets/mavis/java/agents/task-analyst.md +1 -1
  429. package/presets/mavis/java/agents/task-router.md +2 -0
  430. package/presets/mavis/java/commands/README.md +1 -0
  431. package/presets/mavis/java/commands/rr-migrate-repositories.md +54 -0
  432. package/presets/mavis/java/commands/task.md +4 -0
  433. package/presets/mavis/java/hooks/chain-team-phases.sh +382 -27
  434. package/presets/mavis/java/rules/ai-local-overlay.md +1 -1
  435. package/presets/mavis/java/rules/code-review-mr.md +1 -0
  436. package/presets/mavis/java/rules/preset-layering.md +4 -4
  437. package/presets/mavis/java/rules/preset-pr-checklist.md +2 -1
  438. package/presets/mavis/java/rules/preset-twin-sync.md +12 -5
  439. package/presets/mavis/mcp-ts/adapter-map.json +9 -1
  440. package/presets/mavis/mcp-ts/agents/build-verifier.md +1 -1
  441. package/presets/mavis/mcp-ts/agents/feature-developer.md +1 -1
  442. package/presets/mavis/mcp-ts/agents/task-analyst.md +1 -1
  443. package/presets/mavis/mcp-ts/agents/task-router.md +2 -0
  444. package/presets/mavis/mcp-ts/commands/README.md +1 -0
  445. package/presets/mavis/mcp-ts/commands/rr-migrate-repositories.md +54 -0
  446. package/presets/mavis/mcp-ts/commands/task.md +4 -0
  447. package/presets/mavis/mcp-ts/hooks/chain-team-phases.sh +382 -27
  448. package/presets/mavis/mcp-ts/rules/ai-local-overlay.md +1 -1
  449. package/presets/mavis/mcp-ts/rules/code-review-mr.md +1 -0
  450. package/presets/mavis/mcp-ts/rules/preset-layering.md +4 -4
  451. package/presets/mavis/mcp-ts/rules/preset-pr-checklist.md +2 -1
  452. package/presets/mavis/mcp-ts/rules/preset-twin-sync.md +12 -5
  453. package/presets/mavis/mol/adapter-map.json +9 -1
  454. package/presets/mavis/mol/agents/build-verifier.md +4 -1
  455. package/presets/mavis/mol/agents/code-reviewer.md +1 -1
  456. package/presets/mavis/mol/agents/debugger.md +1 -1
  457. package/presets/mavis/mol/agents/feature-developer.md +1 -1
  458. package/presets/mavis/mol/agents/task-analyst.md +1 -1
  459. package/presets/mavis/mol/agents/task-router.md +2 -0
  460. package/presets/mavis/mol/commands/README.md +1 -0
  461. package/presets/mavis/mol/commands/rr-migrate-repositories.md +54 -0
  462. package/presets/mavis/mol/commands/task.md +4 -0
  463. package/presets/mavis/mol/hooks/chain-team-phases.sh +382 -27
  464. package/presets/mavis/mol/rules/ai-local-overlay.md +1 -1
  465. package/presets/mavis/mol/rules/code-review-mr.md +1 -0
  466. package/presets/mavis/mol/rules/preset-layering.md +4 -4
  467. package/presets/mavis/mol/rules/preset-pr-checklist.md +2 -1
  468. package/presets/mavis/mol/rules/preset-twin-sync.md +12 -5
  469. package/presets/mavis/next/adapter-map.json +9 -1
  470. package/presets/mavis/next/agents/build-verifier.md +6 -1
  471. package/presets/mavis/next/agents/code-reviewer.md +1 -1
  472. package/presets/mavis/next/agents/debugger.md +1 -1
  473. package/presets/mavis/next/agents/feature-developer.md +1 -1
  474. package/presets/mavis/next/agents/task-analyst.md +1 -1
  475. package/presets/mavis/next/agents/task-router.md +2 -0
  476. package/presets/mavis/next/commands/README.md +1 -0
  477. package/presets/mavis/next/commands/rr-migrate-repositories.md +54 -0
  478. package/presets/mavis/next/commands/task.md +4 -0
  479. package/presets/mavis/next/commands/ui-start.md +12 -4
  480. package/presets/mavis/next/commands/ui-stop.md +5 -2
  481. package/presets/mavis/next/hooks/chain-team-phases.sh +382 -27
  482. package/presets/mavis/next/rules/ai-local-overlay.md +2 -1
  483. package/presets/mavis/next/rules/code-review-mr.md +1 -0
  484. package/presets/mavis/next/rules/preset-layering.md +4 -4
  485. package/presets/mavis/next/rules/preset-pr-checklist.md +2 -1
  486. package/presets/mavis/next/rules/preset-twin-sync.md +12 -5
  487. package/presets/mavis/nuxt/adapter-map.json +9 -1
  488. package/presets/mavis/nuxt/agents/build-verifier.md +4 -1
  489. package/presets/mavis/nuxt/agents/code-reviewer.md +1 -1
  490. package/presets/mavis/nuxt/agents/debugger.md +1 -1
  491. package/presets/mavis/nuxt/agents/feature-developer.md +1 -1
  492. package/presets/mavis/nuxt/agents/task-analyst.md +1 -1
  493. package/presets/mavis/nuxt/agents/task-router.md +2 -0
  494. package/presets/mavis/nuxt/commands/README.md +1 -0
  495. package/presets/mavis/nuxt/commands/rr-migrate-repositories.md +54 -0
  496. package/presets/mavis/nuxt/commands/task.md +4 -0
  497. package/presets/mavis/nuxt/hooks/chain-team-phases.sh +382 -27
  498. package/presets/mavis/nuxt/rules/ai-local-overlay.md +1 -1
  499. package/presets/mavis/nuxt/rules/code-review-mr.md +1 -0
  500. package/presets/mavis/nuxt/rules/preset-layering.md +4 -4
  501. package/presets/mavis/nuxt/rules/preset-pr-checklist.md +2 -1
  502. package/presets/mavis/nuxt/rules/preset-twin-sync.md +12 -5
  503. package/presets/mavis/php-hexagonal/adapter-map.json +9 -1
  504. package/presets/mavis/php-hexagonal/agents/build-verifier.md +1 -1
  505. package/presets/mavis/php-hexagonal/agents/code-reviewer.md +1 -1
  506. package/presets/mavis/php-hexagonal/agents/debugger.md +1 -1
  507. package/presets/mavis/php-hexagonal/agents/feature-developer.md +1 -1
  508. package/presets/mavis/php-hexagonal/agents/task-analyst.md +1 -1
  509. package/presets/mavis/php-hexagonal/agents/task-router.md +2 -0
  510. package/presets/mavis/php-hexagonal/commands/README.md +1 -0
  511. package/presets/mavis/php-hexagonal/commands/rr-migrate-repositories.md +54 -0
  512. package/presets/mavis/php-hexagonal/commands/task.md +4 -0
  513. package/presets/mavis/php-hexagonal/hooks/chain-team-phases.sh +382 -27
  514. package/presets/mavis/php-hexagonal/rules/ai-local-overlay.md +1 -1
  515. package/presets/mavis/php-hexagonal/rules/code-review-mr.md +1 -0
  516. package/presets/mavis/php-hexagonal/rules/preset-layering.md +4 -4
  517. package/presets/mavis/php-hexagonal/rules/preset-pr-checklist.md +2 -1
  518. package/presets/mavis/php-hexagonal/rules/preset-twin-sync.md +12 -5
  519. package/presets/mavis/php-laravel/adapter-map.json +9 -1
  520. package/presets/mavis/php-laravel/agents/build-verifier.md +1 -1
  521. package/presets/mavis/php-laravel/agents/code-reviewer.md +1 -1
  522. package/presets/mavis/php-laravel/agents/debugger.md +1 -1
  523. package/presets/mavis/php-laravel/agents/feature-developer.md +1 -1
  524. package/presets/mavis/php-laravel/agents/task-analyst.md +1 -1
  525. package/presets/mavis/php-laravel/agents/task-router.md +2 -0
  526. package/presets/mavis/php-laravel/commands/README.md +1 -0
  527. package/presets/mavis/php-laravel/commands/rr-migrate-repositories.md +54 -0
  528. package/presets/mavis/php-laravel/commands/task.md +4 -0
  529. package/presets/mavis/php-laravel/hooks/chain-team-phases.sh +382 -27
  530. package/presets/mavis/php-laravel/rules/ai-local-overlay.md +1 -1
  531. package/presets/mavis/php-laravel/rules/code-review-mr.md +1 -0
  532. package/presets/mavis/php-laravel/rules/preset-layering.md +4 -4
  533. package/presets/mavis/php-laravel/rules/preset-pr-checklist.md +2 -1
  534. package/presets/mavis/php-laravel/rules/preset-twin-sync.md +12 -5
  535. package/presets/mavis/svelte/adapter-map.json +9 -1
  536. package/presets/mavis/svelte/agents/build-verifier.md +4 -1
  537. package/presets/mavis/svelte/agents/code-reviewer.md +1 -1
  538. package/presets/mavis/svelte/agents/debugger.md +1 -1
  539. package/presets/mavis/svelte/agents/feature-developer.md +1 -1
  540. package/presets/mavis/svelte/agents/task-analyst.md +1 -1
  541. package/presets/mavis/svelte/agents/task-router.md +2 -0
  542. package/presets/mavis/svelte/commands/README.md +1 -0
  543. package/presets/mavis/svelte/commands/rr-migrate-repositories.md +54 -0
  544. package/presets/mavis/svelte/commands/task.md +4 -0
  545. package/presets/mavis/svelte/hooks/chain-team-phases.sh +382 -27
  546. package/presets/mavis/svelte/rules/ai-local-overlay.md +1 -1
  547. package/presets/mavis/svelte/rules/code-review-mr.md +1 -0
  548. package/presets/mavis/svelte/rules/preset-layering.md +4 -4
  549. package/presets/mavis/svelte/rules/preset-pr-checklist.md +2 -1
  550. package/presets/mavis/svelte/rules/preset-twin-sync.md +12 -5
  551. package/presets/opencode/android-kotlin/adapter-map.json +9 -1
  552. package/presets/opencode/android-kotlin/agents/build-verifier.md +1 -1
  553. package/presets/opencode/android-kotlin/agents/code-reviewer.md +1 -1
  554. package/presets/opencode/android-kotlin/agents/debugger.md +1 -1
  555. package/presets/opencode/android-kotlin/agents/feature-developer.md +1 -1
  556. package/presets/opencode/android-kotlin/agents/task-analyst.md +1 -1
  557. package/presets/opencode/android-kotlin/agents/task-router.md +2 -0
  558. package/presets/opencode/android-kotlin/commands/README.md +1 -0
  559. package/presets/opencode/android-kotlin/commands/rr-migrate-repositories.md +62 -0
  560. package/presets/opencode/android-kotlin/commands/task.md +4 -0
  561. package/presets/opencode/android-kotlin/hooks/chain-team-phases.sh +382 -27
  562. package/presets/opencode/android-kotlin/rules/ai-local-overlay.md +1 -1
  563. package/presets/opencode/android-kotlin/rules/code-review-mr.md +1 -0
  564. package/presets/opencode/android-kotlin/rules/preset-layering.md +4 -4
  565. package/presets/opencode/android-kotlin/rules/preset-pr-checklist.md +2 -1
  566. package/presets/opencode/android-kotlin/rules/preset-twin-sync.md +12 -5
  567. package/presets/opencode/go/adapter-map.json +9 -1
  568. package/presets/opencode/go/agents/build-verifier.md +1 -1
  569. package/presets/opencode/go/agents/code-reviewer.md +1 -1
  570. package/presets/opencode/go/agents/debugger.md +1 -1
  571. package/presets/opencode/go/agents/feature-developer.md +1 -1
  572. package/presets/opencode/go/agents/task-analyst.md +1 -1
  573. package/presets/opencode/go/agents/task-router.md +2 -0
  574. package/presets/opencode/go/commands/README.md +1 -0
  575. package/presets/opencode/go/commands/rr-migrate-repositories.md +62 -0
  576. package/presets/opencode/go/commands/task.md +4 -0
  577. package/presets/opencode/go/hooks/chain-team-phases.sh +382 -27
  578. package/presets/opencode/go/rules/ai-local-overlay.md +1 -1
  579. package/presets/opencode/go/rules/code-review-mr.md +1 -0
  580. package/presets/opencode/go/rules/preset-layering.md +4 -4
  581. package/presets/opencode/go/rules/preset-pr-checklist.md +2 -1
  582. package/presets/opencode/go/rules/preset-twin-sync.md +12 -5
  583. package/presets/opencode/ios-swift/adapter-map.json +9 -1
  584. package/presets/opencode/ios-swift/agents/build-verifier.md +4 -1
  585. package/presets/opencode/ios-swift/agents/code-reviewer.md +1 -1
  586. package/presets/opencode/ios-swift/agents/debugger.md +1 -1
  587. package/presets/opencode/ios-swift/agents/feature-developer.md +1 -1
  588. package/presets/opencode/ios-swift/agents/task-analyst.md +1 -1
  589. package/presets/opencode/ios-swift/agents/task-router.md +2 -0
  590. package/presets/opencode/ios-swift/commands/README.md +1 -0
  591. package/presets/opencode/ios-swift/commands/rr-migrate-repositories.md +62 -0
  592. package/presets/opencode/ios-swift/commands/task.md +4 -0
  593. package/presets/opencode/ios-swift/hooks/chain-team-phases.sh +382 -27
  594. package/presets/opencode/ios-swift/rules/ai-local-overlay.md +1 -1
  595. package/presets/opencode/ios-swift/rules/code-review-mr.md +1 -0
  596. package/presets/opencode/ios-swift/rules/preset-layering.md +4 -4
  597. package/presets/opencode/ios-swift/rules/preset-pr-checklist.md +2 -1
  598. package/presets/opencode/ios-swift/rules/preset-twin-sync.md +12 -5
  599. package/presets/opencode/java/adapter-map.json +9 -1
  600. package/presets/opencode/java/agents/build-verifier.md +1 -1
  601. package/presets/opencode/java/agents/code-reviewer.md +1 -1
  602. package/presets/opencode/java/agents/debugger.md +1 -1
  603. package/presets/opencode/java/agents/feature-developer.md +1 -1
  604. package/presets/opencode/java/agents/task-analyst.md +1 -1
  605. package/presets/opencode/java/agents/task-router.md +2 -0
  606. package/presets/opencode/java/commands/README.md +1 -0
  607. package/presets/opencode/java/commands/rr-migrate-repositories.md +62 -0
  608. package/presets/opencode/java/commands/task.md +4 -0
  609. package/presets/opencode/java/hooks/chain-team-phases.sh +382 -27
  610. package/presets/opencode/java/rules/ai-local-overlay.md +1 -1
  611. package/presets/opencode/java/rules/code-review-mr.md +1 -0
  612. package/presets/opencode/java/rules/preset-layering.md +4 -4
  613. package/presets/opencode/java/rules/preset-pr-checklist.md +2 -1
  614. package/presets/opencode/java/rules/preset-twin-sync.md +12 -5
  615. package/presets/opencode/mcp-ts/adapter-map.json +9 -1
  616. package/presets/opencode/mcp-ts/agents/build-verifier.md +1 -1
  617. package/presets/opencode/mcp-ts/agents/feature-developer.md +1 -1
  618. package/presets/opencode/mcp-ts/agents/task-analyst.md +1 -1
  619. package/presets/opencode/mcp-ts/agents/task-router.md +2 -0
  620. package/presets/opencode/mcp-ts/commands/README.md +1 -0
  621. package/presets/opencode/mcp-ts/commands/rr-migrate-repositories.md +62 -0
  622. package/presets/opencode/mcp-ts/commands/task.md +4 -0
  623. package/presets/opencode/mcp-ts/hooks/chain-team-phases.sh +382 -27
  624. package/presets/opencode/mcp-ts/rules/ai-local-overlay.md +1 -1
  625. package/presets/opencode/mcp-ts/rules/code-review-mr.md +1 -0
  626. package/presets/opencode/mcp-ts/rules/preset-layering.md +4 -4
  627. package/presets/opencode/mcp-ts/rules/preset-pr-checklist.md +2 -1
  628. package/presets/opencode/mcp-ts/rules/preset-twin-sync.md +12 -5
  629. package/presets/opencode/mol/adapter-map.json +9 -1
  630. package/presets/opencode/mol/agents/build-verifier.md +4 -1
  631. package/presets/opencode/mol/agents/code-reviewer.md +1 -1
  632. package/presets/opencode/mol/agents/debugger.md +1 -1
  633. package/presets/opencode/mol/agents/feature-developer.md +1 -1
  634. package/presets/opencode/mol/agents/task-analyst.md +1 -1
  635. package/presets/opencode/mol/agents/task-router.md +2 -0
  636. package/presets/opencode/mol/commands/README.md +1 -0
  637. package/presets/opencode/mol/commands/rr-migrate-repositories.md +62 -0
  638. package/presets/opencode/mol/commands/task.md +4 -0
  639. package/presets/opencode/mol/hooks/chain-team-phases.sh +382 -27
  640. package/presets/opencode/mol/rules/ai-local-overlay.md +1 -1
  641. package/presets/opencode/mol/rules/code-review-mr.md +1 -0
  642. package/presets/opencode/mol/rules/preset-layering.md +4 -4
  643. package/presets/opencode/mol/rules/preset-pr-checklist.md +2 -1
  644. package/presets/opencode/mol/rules/preset-twin-sync.md +12 -5
  645. package/presets/opencode/next/adapter-map.json +9 -1
  646. package/presets/opencode/next/agents/build-verifier.md +6 -1
  647. package/presets/opencode/next/agents/code-reviewer.md +1 -1
  648. package/presets/opencode/next/agents/debugger.md +1 -1
  649. package/presets/opencode/next/agents/feature-developer.md +1 -1
  650. package/presets/opencode/next/agents/task-analyst.md +1 -1
  651. package/presets/opencode/next/agents/task-router.md +2 -0
  652. package/presets/opencode/next/commands/README.md +1 -0
  653. package/presets/opencode/next/commands/rr-migrate-repositories.md +62 -0
  654. package/presets/opencode/next/commands/task.md +4 -0
  655. package/presets/opencode/next/commands/ui-start.md +12 -4
  656. package/presets/opencode/next/commands/ui-stop.md +5 -2
  657. package/presets/opencode/next/hooks/chain-team-phases.sh +382 -27
  658. package/presets/opencode/next/rules/ai-local-overlay.md +2 -1
  659. package/presets/opencode/next/rules/code-review-mr.md +1 -0
  660. package/presets/opencode/next/rules/preset-layering.md +4 -4
  661. package/presets/opencode/next/rules/preset-pr-checklist.md +2 -1
  662. package/presets/opencode/next/rules/preset-twin-sync.md +12 -5
  663. package/presets/opencode/nuxt/adapter-map.json +9 -1
  664. package/presets/opencode/nuxt/agents/build-verifier.md +4 -1
  665. package/presets/opencode/nuxt/agents/code-reviewer.md +1 -1
  666. package/presets/opencode/nuxt/agents/debugger.md +1 -1
  667. package/presets/opencode/nuxt/agents/feature-developer.md +1 -1
  668. package/presets/opencode/nuxt/agents/task-analyst.md +1 -1
  669. package/presets/opencode/nuxt/agents/task-router.md +2 -0
  670. package/presets/opencode/nuxt/commands/README.md +1 -0
  671. package/presets/opencode/nuxt/commands/rr-migrate-repositories.md +62 -0
  672. package/presets/opencode/nuxt/commands/task.md +4 -0
  673. package/presets/opencode/nuxt/hooks/chain-team-phases.sh +382 -27
  674. package/presets/opencode/nuxt/rules/ai-local-overlay.md +1 -1
  675. package/presets/opencode/nuxt/rules/code-review-mr.md +1 -0
  676. package/presets/opencode/nuxt/rules/preset-layering.md +4 -4
  677. package/presets/opencode/nuxt/rules/preset-pr-checklist.md +2 -1
  678. package/presets/opencode/nuxt/rules/preset-twin-sync.md +12 -5
  679. package/presets/opencode/php-hexagonal/adapter-map.json +9 -1
  680. package/presets/opencode/php-hexagonal/agents/build-verifier.md +1 -1
  681. package/presets/opencode/php-hexagonal/agents/code-reviewer.md +1 -1
  682. package/presets/opencode/php-hexagonal/agents/debugger.md +1 -1
  683. package/presets/opencode/php-hexagonal/agents/feature-developer.md +1 -1
  684. package/presets/opencode/php-hexagonal/agents/task-analyst.md +1 -1
  685. package/presets/opencode/php-hexagonal/agents/task-router.md +2 -0
  686. package/presets/opencode/php-hexagonal/commands/README.md +1 -0
  687. package/presets/opencode/php-hexagonal/commands/rr-migrate-repositories.md +62 -0
  688. package/presets/opencode/php-hexagonal/commands/task.md +4 -0
  689. package/presets/opencode/php-hexagonal/hooks/chain-team-phases.sh +382 -27
  690. package/presets/opencode/php-hexagonal/rules/ai-local-overlay.md +1 -1
  691. package/presets/opencode/php-hexagonal/rules/code-review-mr.md +1 -0
  692. package/presets/opencode/php-hexagonal/rules/preset-layering.md +4 -4
  693. package/presets/opencode/php-hexagonal/rules/preset-pr-checklist.md +2 -1
  694. package/presets/opencode/php-hexagonal/rules/preset-twin-sync.md +12 -5
  695. package/presets/opencode/php-laravel/adapter-map.json +9 -1
  696. package/presets/opencode/php-laravel/agents/build-verifier.md +1 -1
  697. package/presets/opencode/php-laravel/agents/code-reviewer.md +1 -1
  698. package/presets/opencode/php-laravel/agents/debugger.md +1 -1
  699. package/presets/opencode/php-laravel/agents/feature-developer.md +1 -1
  700. package/presets/opencode/php-laravel/agents/task-analyst.md +1 -1
  701. package/presets/opencode/php-laravel/agents/task-router.md +2 -0
  702. package/presets/opencode/php-laravel/commands/README.md +1 -0
  703. package/presets/opencode/php-laravel/commands/rr-migrate-repositories.md +62 -0
  704. package/presets/opencode/php-laravel/commands/task.md +4 -0
  705. package/presets/opencode/php-laravel/hooks/chain-team-phases.sh +382 -27
  706. package/presets/opencode/php-laravel/rules/ai-local-overlay.md +1 -1
  707. package/presets/opencode/php-laravel/rules/code-review-mr.md +1 -0
  708. package/presets/opencode/php-laravel/rules/preset-layering.md +4 -4
  709. package/presets/opencode/php-laravel/rules/preset-pr-checklist.md +2 -1
  710. package/presets/opencode/php-laravel/rules/preset-twin-sync.md +12 -5
  711. package/presets/opencode/plugins/task-status/README.md +15 -7
  712. package/presets/opencode/plugins/task-status/deepseek.ts +193 -0
  713. package/presets/opencode/plugins/task-status/details-data.ts +39 -2
  714. package/presets/opencode/plugins/task-status/prompt-text.ts +18 -8
  715. package/presets/opencode/plugins/task-status/task-view.ts +253 -63
  716. package/presets/opencode/plugins/task-status/tui.tsx +48 -11
  717. package/presets/opencode/svelte/adapter-map.json +9 -1
  718. package/presets/opencode/svelte/agents/build-verifier.md +4 -1
  719. package/presets/opencode/svelte/agents/code-reviewer.md +1 -1
  720. package/presets/opencode/svelte/agents/debugger.md +1 -1
  721. package/presets/opencode/svelte/agents/feature-developer.md +1 -1
  722. package/presets/opencode/svelte/agents/task-analyst.md +1 -1
  723. package/presets/opencode/svelte/agents/task-router.md +2 -0
  724. package/presets/opencode/svelte/commands/README.md +1 -0
  725. package/presets/opencode/svelte/commands/rr-migrate-repositories.md +62 -0
  726. package/presets/opencode/svelte/commands/task.md +4 -0
  727. package/presets/opencode/svelte/hooks/chain-team-phases.sh +382 -27
  728. package/presets/opencode/svelte/rules/ai-local-overlay.md +1 -1
  729. package/presets/opencode/svelte/rules/code-review-mr.md +1 -0
  730. package/presets/opencode/svelte/rules/preset-layering.md +4 -4
  731. package/presets/opencode/svelte/rules/preset-pr-checklist.md +2 -1
  732. package/presets/opencode/svelte/rules/preset-twin-sync.md +12 -5
  733. package/presets/zcode/android-kotlin/adapter-map.json +9 -1
  734. package/presets/zcode/android-kotlin/agents/build-verifier.md +1 -1
  735. package/presets/zcode/android-kotlin/agents/code-reviewer.md +1 -1
  736. package/presets/zcode/android-kotlin/agents/debugger.md +1 -1
  737. package/presets/zcode/android-kotlin/agents/feature-developer.md +1 -1
  738. package/presets/zcode/android-kotlin/agents/task-analyst.md +1 -1
  739. package/presets/zcode/android-kotlin/agents/task-router.md +2 -0
  740. package/presets/zcode/android-kotlin/commands/README.md +1 -0
  741. package/presets/zcode/android-kotlin/commands/rr-migrate-repositories.md +62 -0
  742. package/presets/zcode/android-kotlin/commands/task.md +4 -0
  743. package/presets/zcode/android-kotlin/hooks/chain-team-phases.sh +382 -27
  744. package/presets/zcode/android-kotlin/rules/ai-local-overlay.md +1 -1
  745. package/presets/zcode/android-kotlin/rules/code-review-mr.md +1 -0
  746. package/presets/zcode/android-kotlin/rules/preset-layering.md +4 -4
  747. package/presets/zcode/android-kotlin/rules/preset-pr-checklist.md +2 -1
  748. package/presets/zcode/android-kotlin/rules/preset-twin-sync.md +12 -5
  749. package/presets/zcode/go/adapter-map.json +9 -1
  750. package/presets/zcode/go/agents/build-verifier.md +1 -1
  751. package/presets/zcode/go/agents/code-reviewer.md +1 -1
  752. package/presets/zcode/go/agents/debugger.md +1 -1
  753. package/presets/zcode/go/agents/feature-developer.md +1 -1
  754. package/presets/zcode/go/agents/task-analyst.md +1 -1
  755. package/presets/zcode/go/agents/task-router.md +2 -0
  756. package/presets/zcode/go/commands/README.md +1 -0
  757. package/presets/zcode/go/commands/rr-migrate-repositories.md +62 -0
  758. package/presets/zcode/go/commands/task.md +4 -0
  759. package/presets/zcode/go/hooks/chain-team-phases.sh +382 -27
  760. package/presets/zcode/go/rules/ai-local-overlay.md +1 -1
  761. package/presets/zcode/go/rules/code-review-mr.md +1 -0
  762. package/presets/zcode/go/rules/preset-layering.md +4 -4
  763. package/presets/zcode/go/rules/preset-pr-checklist.md +2 -1
  764. package/presets/zcode/go/rules/preset-twin-sync.md +12 -5
  765. package/presets/zcode/ios-swift/adapter-map.json +9 -1
  766. package/presets/zcode/ios-swift/agents/build-verifier.md +4 -1
  767. package/presets/zcode/ios-swift/agents/code-reviewer.md +1 -1
  768. package/presets/zcode/ios-swift/agents/debugger.md +1 -1
  769. package/presets/zcode/ios-swift/agents/feature-developer.md +1 -1
  770. package/presets/zcode/ios-swift/agents/task-analyst.md +1 -1
  771. package/presets/zcode/ios-swift/agents/task-router.md +2 -0
  772. package/presets/zcode/ios-swift/commands/README.md +1 -0
  773. package/presets/zcode/ios-swift/commands/rr-migrate-repositories.md +62 -0
  774. package/presets/zcode/ios-swift/commands/task.md +4 -0
  775. package/presets/zcode/ios-swift/hooks/chain-team-phases.sh +382 -27
  776. package/presets/zcode/ios-swift/rules/ai-local-overlay.md +1 -1
  777. package/presets/zcode/ios-swift/rules/code-review-mr.md +1 -0
  778. package/presets/zcode/ios-swift/rules/preset-layering.md +4 -4
  779. package/presets/zcode/ios-swift/rules/preset-pr-checklist.md +2 -1
  780. package/presets/zcode/ios-swift/rules/preset-twin-sync.md +12 -5
  781. package/presets/zcode/java/adapter-map.json +9 -1
  782. package/presets/zcode/java/agents/build-verifier.md +1 -1
  783. package/presets/zcode/java/agents/code-reviewer.md +1 -1
  784. package/presets/zcode/java/agents/debugger.md +1 -1
  785. package/presets/zcode/java/agents/feature-developer.md +1 -1
  786. package/presets/zcode/java/agents/task-analyst.md +1 -1
  787. package/presets/zcode/java/agents/task-router.md +2 -0
  788. package/presets/zcode/java/commands/README.md +1 -0
  789. package/presets/zcode/java/commands/rr-migrate-repositories.md +62 -0
  790. package/presets/zcode/java/commands/task.md +4 -0
  791. package/presets/zcode/java/hooks/chain-team-phases.sh +382 -27
  792. package/presets/zcode/java/rules/ai-local-overlay.md +1 -1
  793. package/presets/zcode/java/rules/code-review-mr.md +1 -0
  794. package/presets/zcode/java/rules/preset-layering.md +4 -4
  795. package/presets/zcode/java/rules/preset-pr-checklist.md +2 -1
  796. package/presets/zcode/java/rules/preset-twin-sync.md +12 -5
  797. package/presets/zcode/mcp-ts/adapter-map.json +9 -1
  798. package/presets/zcode/mcp-ts/agents/build-verifier.md +1 -1
  799. package/presets/zcode/mcp-ts/agents/feature-developer.md +1 -1
  800. package/presets/zcode/mcp-ts/agents/task-analyst.md +1 -1
  801. package/presets/zcode/mcp-ts/agents/task-router.md +2 -0
  802. package/presets/zcode/mcp-ts/commands/README.md +1 -0
  803. package/presets/zcode/mcp-ts/commands/rr-migrate-repositories.md +62 -0
  804. package/presets/zcode/mcp-ts/commands/task.md +4 -0
  805. package/presets/zcode/mcp-ts/hooks/chain-team-phases.sh +382 -27
  806. package/presets/zcode/mcp-ts/rules/ai-local-overlay.md +1 -1
  807. package/presets/zcode/mcp-ts/rules/code-review-mr.md +1 -0
  808. package/presets/zcode/mcp-ts/rules/preset-layering.md +4 -4
  809. package/presets/zcode/mcp-ts/rules/preset-pr-checklist.md +2 -1
  810. package/presets/zcode/mcp-ts/rules/preset-twin-sync.md +12 -5
  811. package/presets/zcode/mol/adapter-map.json +9 -1
  812. package/presets/zcode/mol/agents/build-verifier.md +4 -1
  813. package/presets/zcode/mol/agents/code-reviewer.md +1 -1
  814. package/presets/zcode/mol/agents/debugger.md +1 -1
  815. package/presets/zcode/mol/agents/feature-developer.md +1 -1
  816. package/presets/zcode/mol/agents/task-analyst.md +1 -1
  817. package/presets/zcode/mol/agents/task-router.md +2 -0
  818. package/presets/zcode/mol/commands/README.md +1 -0
  819. package/presets/zcode/mol/commands/rr-migrate-repositories.md +62 -0
  820. package/presets/zcode/mol/commands/task.md +4 -0
  821. package/presets/zcode/mol/hooks/chain-team-phases.sh +382 -27
  822. package/presets/zcode/mol/rules/ai-local-overlay.md +1 -1
  823. package/presets/zcode/mol/rules/code-review-mr.md +1 -0
  824. package/presets/zcode/mol/rules/preset-layering.md +4 -4
  825. package/presets/zcode/mol/rules/preset-pr-checklist.md +2 -1
  826. package/presets/zcode/mol/rules/preset-twin-sync.md +12 -5
  827. package/presets/zcode/next/adapter-map.json +9 -1
  828. package/presets/zcode/next/agents/build-verifier.md +6 -1
  829. package/presets/zcode/next/agents/code-reviewer.md +1 -1
  830. package/presets/zcode/next/agents/debugger.md +1 -1
  831. package/presets/zcode/next/agents/feature-developer.md +1 -1
  832. package/presets/zcode/next/agents/task-analyst.md +1 -1
  833. package/presets/zcode/next/agents/task-router.md +2 -0
  834. package/presets/zcode/next/commands/README.md +1 -0
  835. package/presets/zcode/next/commands/rr-migrate-repositories.md +62 -0
  836. package/presets/zcode/next/commands/task.md +4 -0
  837. package/presets/zcode/next/commands/ui-start.md +12 -4
  838. package/presets/zcode/next/commands/ui-stop.md +5 -2
  839. package/presets/zcode/next/hooks/chain-team-phases.sh +382 -27
  840. package/presets/zcode/next/rules/ai-local-overlay.md +2 -1
  841. package/presets/zcode/next/rules/code-review-mr.md +1 -0
  842. package/presets/zcode/next/rules/preset-layering.md +4 -4
  843. package/presets/zcode/next/rules/preset-pr-checklist.md +2 -1
  844. package/presets/zcode/next/rules/preset-twin-sync.md +12 -5
  845. package/presets/zcode/nuxt/adapter-map.json +9 -1
  846. package/presets/zcode/nuxt/agents/build-verifier.md +4 -1
  847. package/presets/zcode/nuxt/agents/code-reviewer.md +1 -1
  848. package/presets/zcode/nuxt/agents/debugger.md +1 -1
  849. package/presets/zcode/nuxt/agents/feature-developer.md +1 -1
  850. package/presets/zcode/nuxt/agents/task-analyst.md +1 -1
  851. package/presets/zcode/nuxt/agents/task-router.md +2 -0
  852. package/presets/zcode/nuxt/commands/README.md +1 -0
  853. package/presets/zcode/nuxt/commands/rr-migrate-repositories.md +62 -0
  854. package/presets/zcode/nuxt/commands/task.md +4 -0
  855. package/presets/zcode/nuxt/hooks/chain-team-phases.sh +382 -27
  856. package/presets/zcode/nuxt/rules/ai-local-overlay.md +1 -1
  857. package/presets/zcode/nuxt/rules/code-review-mr.md +1 -0
  858. package/presets/zcode/nuxt/rules/preset-layering.md +4 -4
  859. package/presets/zcode/nuxt/rules/preset-pr-checklist.md +2 -1
  860. package/presets/zcode/nuxt/rules/preset-twin-sync.md +12 -5
  861. package/presets/zcode/php-hexagonal/adapter-map.json +9 -1
  862. package/presets/zcode/php-hexagonal/agents/build-verifier.md +1 -1
  863. package/presets/zcode/php-hexagonal/agents/code-reviewer.md +1 -1
  864. package/presets/zcode/php-hexagonal/agents/debugger.md +1 -1
  865. package/presets/zcode/php-hexagonal/agents/feature-developer.md +1 -1
  866. package/presets/zcode/php-hexagonal/agents/task-analyst.md +1 -1
  867. package/presets/zcode/php-hexagonal/agents/task-router.md +2 -0
  868. package/presets/zcode/php-hexagonal/commands/README.md +1 -0
  869. package/presets/zcode/php-hexagonal/commands/rr-migrate-repositories.md +62 -0
  870. package/presets/zcode/php-hexagonal/commands/task.md +4 -0
  871. package/presets/zcode/php-hexagonal/hooks/chain-team-phases.sh +382 -27
  872. package/presets/zcode/php-hexagonal/rules/ai-local-overlay.md +1 -1
  873. package/presets/zcode/php-hexagonal/rules/code-review-mr.md +1 -0
  874. package/presets/zcode/php-hexagonal/rules/preset-layering.md +4 -4
  875. package/presets/zcode/php-hexagonal/rules/preset-pr-checklist.md +2 -1
  876. package/presets/zcode/php-hexagonal/rules/preset-twin-sync.md +12 -5
  877. package/presets/zcode/php-laravel/adapter-map.json +9 -1
  878. package/presets/zcode/php-laravel/agents/build-verifier.md +1 -1
  879. package/presets/zcode/php-laravel/agents/code-reviewer.md +1 -1
  880. package/presets/zcode/php-laravel/agents/debugger.md +1 -1
  881. package/presets/zcode/php-laravel/agents/feature-developer.md +1 -1
  882. package/presets/zcode/php-laravel/agents/task-analyst.md +1 -1
  883. package/presets/zcode/php-laravel/agents/task-router.md +2 -0
  884. package/presets/zcode/php-laravel/commands/README.md +1 -0
  885. package/presets/zcode/php-laravel/commands/rr-migrate-repositories.md +62 -0
  886. package/presets/zcode/php-laravel/commands/task.md +4 -0
  887. package/presets/zcode/php-laravel/hooks/chain-team-phases.sh +382 -27
  888. package/presets/zcode/php-laravel/rules/ai-local-overlay.md +1 -1
  889. package/presets/zcode/php-laravel/rules/code-review-mr.md +1 -0
  890. package/presets/zcode/php-laravel/rules/preset-layering.md +4 -4
  891. package/presets/zcode/php-laravel/rules/preset-pr-checklist.md +2 -1
  892. package/presets/zcode/php-laravel/rules/preset-twin-sync.md +12 -5
  893. package/presets/zcode/svelte/adapter-map.json +9 -1
  894. package/presets/zcode/svelte/agents/build-verifier.md +4 -1
  895. package/presets/zcode/svelte/agents/code-reviewer.md +1 -1
  896. package/presets/zcode/svelte/agents/debugger.md +1 -1
  897. package/presets/zcode/svelte/agents/feature-developer.md +1 -1
  898. package/presets/zcode/svelte/agents/task-analyst.md +1 -1
  899. package/presets/zcode/svelte/agents/task-router.md +2 -0
  900. package/presets/zcode/svelte/commands/README.md +1 -0
  901. package/presets/zcode/svelte/commands/rr-migrate-repositories.md +62 -0
  902. package/presets/zcode/svelte/commands/task.md +4 -0
  903. package/presets/zcode/svelte/hooks/chain-team-phases.sh +382 -27
  904. package/presets/zcode/svelte/rules/ai-local-overlay.md +1 -1
  905. package/presets/zcode/svelte/rules/code-review-mr.md +1 -0
  906. package/presets/zcode/svelte/rules/preset-layering.md +4 -4
  907. package/presets/zcode/svelte/rules/preset-pr-checklist.md +2 -1
  908. package/presets/zcode/svelte/rules/preset-twin-sync.md +12 -5
package/CHANGELOG.md CHANGED
@@ -1,7 +1,88 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.80
4
+
5
+ ### `opencode` — the task sidebar shows the session's own task
6
+
7
+ - **Match anchor.** The sidebar no longer matches by any user message: the index is `prompt.md` only (a `prompt-log.md` holds confirmations, not prompts) and the match anchors on the session's opening prompt. A later `делай` / `продолжай` / `подтверждаю` cannot map a tab to a newer task, and a confirmation-only session resolves to `no task`.
8
+ - **Tiers and binding.** An exact prompt match wins; the fallback substring tier is 40 characters and ignores confirmation words. A `/task-continue <slug>` resolves case-insensitively and an unknown slug falls back to the prompt match instead of hiding the task. The first successful mapping is pinned for the session, so a new message cannot flip the tab; only another explicit `/task-continue` re-binds it.
9
+ - **Prompt parser.** `prompt-text.ts` reads the legacy `# Original prompt` heading, list-style meta lines (`- source: ...`), a bare body, and fences, so `prompt.md` variants match exactly and the details excerpt no longer includes the meta block.
10
+ - **Resume authority.** A resume word clears only the pinned task's `STOP`; a repository-wide `.ai.local/STOP` needs an explicit `/task-continue <slug>`. A text match no longer carries that authority.
11
+ - **Tick cost.** The economy block parses only the appended bytes of `output-guard/results*.jsonl` and memoizes its totals (a 10 MB ledger cost ~44 ms per second before); the details dialog reuses its ETA index and its build until a task file changes; the prompt index no longer re-reads `prompt-log.md`.
12
+ - **Robustness.** A throw inside the tick keeps the last view instead of freezing it, an unreadable sentinel is absent rather than a phantom pause, a stale slot input stops following a closed tab, and parallel waves display the highest active step.
13
+ - **Fixtures.** `test-task-status-view` grows from 18 to 27 cases: confirmation words, prompt-log noise, the legacy prompt format, case-insensitive and unknown `/task-continue`, the pinned binding, the `/task` prefix, a re-used session, and details reuse. The `cli-golden` opencode fixtures carry the new plugin hashes.
14
+
15
+ ## 0.2.79
16
+
17
+ ### `engine` — a repository registry with task links and honest verdicts
18
+
19
+ - **File of record.** `.ai.local/team/repositories.json` holds `{ version, repositories[], links[], attributions[] }`, local-only and git-ignored, deterministically serialized (declared key order, records by `id`, links by `(taskSlug, repositoryId)`, attributions by `taskSlug`); an unchanged rewrite performs no write. An absent file is a valid empty store, so `init` seeds nothing. `/rr-migrate-repositories` scans the clones on disk (default: the parent of the repository root), creates the missing records, updates a changed name/locator/status with the stored revision, and projects the file, so a new machine is one command away.
20
+ - **One lock-guarded verb.** `team-db.mjs repositories apply|put|delete|list|project` holds `.repositories.lock` across the read-modify-write-projection, writes the file by temp file plus rename, then projects the touched rows; a projection throw is caught, logged once, and still answers `ok: true`. Record-level `revision` is the CAS token — a stale or missing one is `409 E_CONFLICT` — and `delete` on a linked record answers `409 E_REPOSITORY_IN_USE` with `linkedTasks`, while `--force` removes the record and its links in the same write.
21
+ - **Migrations `0009-repositories` and `0010-repository-attributions`.** `repositories` + `task_repositories` (`PRIMARY KEY (task_slug, repository_id)`, `ON DELETE CASCADE`, no foreign key on `task_slug`) and `task_repository_attributions` (the verdict only); schema v10, applied from v0 and from a v8 store, links and verdicts replaced together in one transaction.
22
+ - **Five operations over two paths.** `GET|POST /api/v1/repositories` and `GET|PUT|DELETE /api/v1/repositories/{id}`, the write body carrying its own required `id` (a duplicate is 409, a `PUT` body id that differs from the path is 409), plus `?repository=<id>` on the task list and a required `repositories`/`repositoriesInference` pair on the task detail where links outrank the attribution. Five contract counters move together (53 operations, 42 paths, 84 schemas, 53 served routes, 17 mutating routes).
23
+ - **Intake.** `/task` records `repositories` in `pipeline.json` — the array is mandatory — and an empty array is legal only beside `repositoriesInference: "unknown"`, which a non-empty list refuses. The field reaches all 55 preset carriers and the five host trees, and the router never defaults it. The chain hook gates the first receipt of every task — the router's, or the first step's when a pipeline runs without one, graph mode included: no `repositories` array, `[]` without `"unknown"`, `"unknown"` beside a non-empty list, an `repositoriesInference` outside the four verdicts, or an id the registry lacks answers `state: blocked` with the repair text, and the task does not advance. A task that already completed a step is never re-judged; `intakeExemption: { approvedBy, reason, at }` is the only escape hatch — a bare boolean is refused, and every exemption leaves an `intake_repositories_exempted` metric naming its approver. `check-task-repositories.mjs` ships to `<repo>/.ai.local/scripts/` and audits the store after the fact (a folder that omits the field, names an id the registry lacks, or disagrees with its `links[]`), dating the pre-invariant era from `2026-11-22`.
24
+ - **Backfill.** `backfill-repositories.mjs` (dry-run default, idempotent) walks the 227 folders that predate the field down the evidence ladder — 150 `evidence-paths`, 4 `repo-scope-only`, 68 `unknown`, 5 `ambiguous` — and prints each row's rung and evidence, an ambiguous row quoting the excerpt that made it so.
25
+ - **Fixtures.** `test-team-db-schema` pins the two migrations and their checksums plus the v8 → v10 path, `-project` the three-table rebuild from the file alone and a malformed file that tombstones nothing, `-api` the CRUD, both 409s, the delete guard and the verdict ladder, and `-concurrency` two registry writers serializing on the lock. `test-task-repositories` covers the intake presence rule and its cutoff, `test-backfill-repositories` the evidence ladder and a second idempotent run, and `test-rr-migrate-repositories` the remote normalisation, id reuse by locator, one-remote dedupe and the kill switch that leaves the file absent.
26
+ - **Docs.** `docs/TEAM-DB.md` gains § Repository registry and moves the mutation count to seventeen; ADR `0006-repository-registry.md` and `0007-repository-registry-local-only.md`.
27
+
28
+ ### `team-tasks-ui` — a repository surface with task links
29
+
30
+ - **Pages.** `/repositories`, `/repositories/new`, `/repositories/[id]`, and `/repositories/[id]/edit`, plus a nav entry after Catalog. The list pages over `total`/`nextOffset`, the detail page pages its linked tasks over the same pair, the create/edit form requires `id` (read-only on edit), and delete runs a two-step dialog that names the N links before any request.
31
+ - **Task detail.** The link block renders each repository with its status badge and keeps `unknown` and `ambiguous` as different empty sentences, so a missing inference is never read as "no repository" — the ambiguous one names the backfill report in text, because no route serves it.
32
+
33
+ ### `engine` — a closed tracker item leaves the launch queue
34
+
35
+ - **Queue.** `setTrackerItem` expires the item's open requests in the same transaction for every terminal status — `cancelled` → `item-cancelled`, `superseded` → `item-superseded`, now `completed` → `item-completed` — and only when the status actually changed, so a re-save cannot re-expire. `done` stays derived from the task row and is never stored.
36
+ - **Prune.** `pruneTrackerEntries` retires stored `cancelled`/`expired` and derived `done` alike; a derived-done entry ages from `finishedAt`, else `claimedAt`, else `requestedAt`, so a completed item's `claimed` entry can finally be pruned instead of lingering in the launch queue.
37
+ - **Docs and fixture.** `docs/TEAM-DB.md` § tracker queue states the lifecycle; `test-team-db-tracker-queue.mjs` pins the terminal transitions and the aged-entry prune.
38
+
39
+ ### `engine` — a rejected tracker payload burns no id
40
+
41
+ - **Reserve, then commit.** `team-db-tracker.mjs` splits the sequence step: `peekItemId` computes the next id without writing, and `commitItemId` advances `tracker/sequence.json` only after `validateItemIdentity`, `validateItemGraph`, and `validateTransition` pass. A rejected `tracker add` leaves the sequence untouched and the next accepted item reuses the id, so the observed 23/24 gap cannot recur.
42
+ - **The contract is written down.** `docs/TEAM-DB.md` § tracker states the bounds the validator already enforced: `title` one trimmed line of 1–120 characters, `description` at most 2000, `labels` at most 8 of 1–32, `sourceRefs` at most 16 of 1–40, `priority` 0–9, and the `status`/`type` enumerations.
43
+ - **Fixture.** `test-team-db-tracker.mjs` adds "a rejected add never burns an id": a 41-character `sourceRef` exits `1` with `E_SCHEMA`, `sequence.json.nextId` is unchanged, and the next valid add takes that id.
44
+
45
+ ### `team-tasks-ui` — `/ui-start` guarantees the process view
46
+
47
+ - **Stack script.** `apps/team-tasks-ui/scripts/stack.mjs` probes `http://127.0.0.1:4179/api/v1/processes` and, when nothing answers, starts `processes.mjs serve` through the process manager (`processes.mjs start --name process-view --port 4179`), so `/processes` no longer opens on `E_DISABLED: The process view is unreachable`. The manager's lease (`.ai.local/.processes/leases/process-view.json`) is the ownership record: an owned view that answers a non-200 is stopped and started once, a foreign listener is reported and left running, and `stop` calls `processes.mjs stop --name process-view` instead of signalling a pid. A missing `processes.mjs` is reported and does not block the UI.
48
+ - **Commands and docs.** `ui-start` quotes the new `processes:` line next to `ui:` and `api:`; `ui-stop` reports the view it stopped. The `apps/team-tasks-ui` README start/stop section and lifecycle matrix rows 1–3 carry the `:4179` expectations.
49
+
50
+ ## 0.2.78
51
+
52
+ ### `engine` — a follow-up must name a different task
53
+
54
+ - **Validator.** `validateLedgerRows(rows, { taskSlug })` refuses a `followUp` equal to the filing task's own slug: the self-reference resolves to a real directory while closing nothing. The message names the row, the slug and the repair — create the follow-up task, or close the row as `fixed`/`rejected`. `team-db.mjs ledger-check --slug` passes `taskSlug`, and the chain hook still relays `failures[].reason` verbatim, so the text keeps one source.
55
+ - **Fixtures.** `ledger-followup-self-reference-red` pins the red for a bare slug and for `blocked-on: <slug>`, and the green for a follow-up that names another real task; `yarn test:team-db:project` is 53 checks.
56
+
57
+ ### `engine` — a multi-hour attempt is a human-wait suspect, not agent time
58
+
59
+ - **Aggregator.** `aggregate-agent-task-metrics.mjs` flags every attempt longer than `LONG_ATTEMPT_MS` (3 h) in `longAttempts`, and each task report gains `longestAttemptMs` and `longAttemptCount`. The hint carries the reading rule: an attempt stays open while the owner answers and no `human_gate` event covers that wait, so `activeMs` is an upper bound. `gateWaitMs` and `outOfBandMs` stay separate and are never added to attempt duration.
60
+ - **Fixture.** `a multi-hour attempt is flagged, not counted as agent time` pins the threshold, the per-task counters and the hint.
61
+
62
+ ### `engine` — the write-scope audit knows engine telemetry
63
+
64
+ - **Derived class.** `DERIVED_RULES` gains `engine-telemetry` for `.ai.local/signals.jsonl` and `.ai.local/rule-changes.jsonl` (and their `.lock` files): the self-learning loop writes them between steps, so no step's `writeScopes` can own them and an implementation step stops reporting them as `outOfScope`.
65
+ - **Fixture.** `test-write-scope.mjs` asserts the `derived: engine-telemetry` label and the new `derived: 6` count.
66
+
67
+ ### `preset` — a green gate set is not an AC verdict
68
+
69
+ - **Agent contract.** `build-verifier` (Cursor source plus the hand-maintained Claude twin) reads the AC **sentences**, not only the IDs: when the shipped behaviour diverges from an AC sentence the verdict is `FAIL` with that AC named as a blocker, however green every gate is, and "acceptable and tracked elsewhere" is a question for the gate, never a PASS.
70
+ - **Framing rule.** `task-framing` gains **Oracle on real data**: when the oracle is a shipped validator over existing data, the brief states its expected output on the real corpus — the counters, not only "it passes" — and the current predicate runs before the gate, so a semantics drift surfaces at intake rather than in review.
71
+
72
+ ### `preset` — the report-header grammar is stated where it is enforced
73
+
74
+ - **Prose.** `verification-before-completion` names the anchor: nothing follows the closing `)` on the `tree:` line. A clarification such as `(+511 dirty excluding .ai.local)` obeys "opens with these two lines" and still stalls the receipt, so every qualification belongs under `## Notes`.
75
+ - **Hook.** The stall message repeats the grammar, so the repair is readable from the receipt that failed; `gate-tree-clarification-red` pins a header that matches `HEAD` and the dirty count but carries a trailing clarification, and `gate-tree-missing-red` asserts the rule literal so no adapter can drop it again.
76
+
3
77
  ## 0.2.77
4
78
 
79
+ ### `preset` + `engine` — verification evidence names its tree
80
+
81
+ - **Rule.** `verification-before-completion` gains three Gate clauses — name the tree, prove the gate can fail, re-run when the tree moved — plus the `validation-report.md` header grammar (`tree: <sha> (+N dirty)`, `run-at: <ISO>`) and the zero-input clause. `agent-artifact-contracts.md` names that header in the `validation-report.md` budget row. The rule stays requestable.
82
+ - **Hook.** Inside `validateCompletedArtifact`, a `build-verifier` receipt is rejected when `validation-report.md` is missing or headerless, when the named `HEAD` or dirty count no longer matches the worktree (the existing `gitSnapshot()`), or when the report carries an unallowlisted `checked: 0` row. Each message names the repair: re-run the named gate on the current tree, then `/task-continue <slug>`. The allowlist is data — `zeroInputAllowlist[{gate, reason, owner}]` in `.ai.local/pipeline-gates.json` — and an entry without a reason allowlists nothing.
83
+ - **Audit.** `check-verification.mjs` joins `ENGINE_SCRIPTS` (thirty entries, twenty-nine published): read-only buckets for missing tree, stale tree, and zero-input, with tasks last touched before `2026-11-01` reported as `legacy`. A scan over zero tasks prints `checked: 0` and exits 1 unless `check-verification` is allowlisted.
84
+ - **Fixtures.** `yarn test:hooks` gains ten cases: `gate-tree-missing-red`, `gate-tree-fresh-green`, `gate-tree-stale-red`, `gate-zero-input-red`, `gate-zero-input-allowlisted`, and `audit-{missing-tree,stale-tree,zero-input,legacy-precutoff,empty-root-red}`.
85
+
5
86
  ### `preset` — one stack means one document on every platform
6
87
 
7
88
  - **Entry text restored on all five platforms.** Every `REPO_AGENTS.md` regains the `## ZCode host` block (`node .zcode/hooks/list-ai-local.mjs`) and the `ai-local-overlay` closing sentence — additive only, 753 B and 227 B — and the 44 derived copies carry it byte for byte. `check-zcode-local-overlay`, `check-opencode-local-overlay` and `check-mavis-local-overlay` go from 22 / 11 / 11 findings to zero.
@@ -44,6 +125,14 @@ The `0.2.77` release gate ran phase 1 on `ddb234bf` and found five sub-checks re
44
125
  - **`hook-body-parity fixtures`.** `makeTree()` copies the whole `presets/_shared/hooks/` directory and stages the Cursor `compact-shell-output.mjs`, so a shared hook added later can no longer turn the clean-tree case into an `ENOENT`.
45
126
  - **`test-write-scope` teardown.** The seven temp-repo teardowns retry `ENOTEMPTY`/`EBUSY` (`maxRetries: 5`); no assertion changed, so a real verdict failure still surfaces as itself.
46
127
 
128
+ ### `preset` + `engine` — three hook facts stop being reconstructed by hand
129
+
130
+ - **Bootstrap hands over the advance payload.** `bootstrap` now prints the `followup_message` the advance path builds (`handoffForAgent`): the agent, the step-owned output id, the `attemptId` it just armed, and the artifact-input line. A parallel first step uses the advance path's `handoffForParallelStep` instead, so the payload names every agent it armed and every owned id. A step that declares no resolvable agent — including `agent: []` — is refused (`ok: false` + reason, nothing armed) instead of handing over an `undefined` id. One ownership clause in the template, two call sites.
131
+ - **`manifest.mjs upsert` refuses a foreign id.** When `pipeline.json`'s active step declares `artifactOutputId` / `artifactOutputIds[producer]`, an `--id` it does not name exits 2 with the expected id and the repair; `--attempt` equal to that step's active attempt is the deliberate re-bind. The scalar `artifactOutputId` binds only to the step's own agent(s), and a bound attempt resolves its own step — so the second step of a parallel wave writes its own id while the wave's first unit still cannot. An attempt armed for another agent does not authorise the producer. A missing `pipeline.json`, a step that declares no id, and a legacy producer keep the earlier behaviour.
132
+ - **The verification snapshot refreshes on every verifier receipt.** The `existsSync` early return is gone: `snapshot`, the `validation-report.md` hash and `gate.checkedAt` follow the tree the commands ran on, and the recorded `commands[]` are preserved. Report lookup is the gate's live-then-archived one, so a post-close refresh records the archived body instead of erasing the hash. The freshness warn compares the report's `tree:` header — the same `REPORT_TREE_RE` the report gate parses — so a retried verifier no longer warns `verification_stale` about the report it just wrote.
133
+ - **The write-scope baseline is saved at activation.** `activateAttempts` runs `check-write-scope --slug <slug> --step <id> --save-baseline --paths <the step's writeScopes>` when the step declares `writeScopes`, so the audit no longer skips every step as `no-baseline`; the declared surface is seeded into the baseline, so a step armed on a clean tree still attributes its own writes instead of relying on `--allow-empty` (which the hook no longer passes). The save is create-once (`wx`, a second save keeps the first file) and a failure is a stderr note, never a failed receipt. A step with no `writeScopes` keeps the shipped `no-write-scopes` skip.
134
+ - **Fixtures.** `yarn test:hooks` gains nine cases — `bootstrap-carries-output-id`, `bootstrap-carries-parallel-payload`, `bootstrap-refuses-no-id`, `manifest-rejects-foreign-id`, `manifest-wave-owns-each-step-id`, `verification-refresh-on-retry`, `verification-reads-archived-report`, `write-scope-baseline-at-activation`, `write-scope-clean-activation-baseline` — all red on the previous tree. No new always-on rule; `package.json` unchanged.
135
+
47
136
  ## 0.2.76
48
137
 
49
138
  ### `preset` — guard accounting reads every ledger generation
package/README.md CHANGED
@@ -25,7 +25,7 @@ Run `init` from the **app root** (`--cwd` if needed). Default `--preset` is `nex
25
25
  | Root agents | `REPO_AGENTS.md` → `AGENTS.md` (same file on all five; ZCode loads it natively) | | | | |
26
26
  | `/task` artifacts | **`.ai.local/team/`** (shared; templates refreshed; `tasks/<slug>/` never overwritten) | | | |
27
27
  | Template drift | **`.ai.local/.template-base.json`** (shared; one record per tree of files that hold a shipped template byte; `update` prints one drift line, `update --merge-ai-local` fast-forwards a file only when its recorded base still matches and reports the rest) | | | |
28
- | Self-learning engine | **`.ai.local/scripts/`** (shared; twenty-eight published scripts — the six self-learning engine modules, `manifest.mjs`, `dump-output.mjs`, `run-compact.mjs`, the eight `team-db*.mjs` modules, `action-signals.mjs`, `actions-report.mjs`, `check-write-scope.mjs`, `aggregate-agent-task-metrics.mjs`, `record-usage.mjs`, `verification.mjs`, `incidents.mjs`, `processes.mjs`, `process-lease.mjs`, `rr-scheduler-start.mjs`, and `tracker-planned-drain.mjs`; existing files never overwritten. The repository-only `upstream-research.mjs` is not published) | | | |
28
+ | Self-learning engine | **`.ai.local/scripts/`** (shared; thirty published scripts — the six self-learning engine modules, `manifest.mjs`, `dump-output.mjs`, `run-compact.mjs`, the eight `team-db*.mjs` modules, `action-signals.mjs`, `actions-report.mjs`, `check-write-scope.mjs`, `aggregate-agent-task-metrics.mjs`, `record-usage.mjs`, `verification.mjs`, `check-verification.mjs`, `incidents.mjs`, `processes.mjs`, `process-lease.mjs`, `rr-scheduler-start.mjs`, `rr-migrate-repositories.mjs`, and `tracker-planned-drain.mjs`; existing files never overwritten. The repository-only `upstream-research.mjs` is not published) | | | |
29
29
  | Specs seed | `docs/specs/` copied only if the directory is **absent** | | | |
30
30
 
31
31
  OpenCode also ships **`.opencode/plugins/task-status/`**, a TUI sidebar for the active `/task` run (slug, state, elapsed time, step, remaining-time estimate, soft-stop). OpenCode auto-loads it; it needs no `opencode.json` entry, is refreshed by `update`, and is a viewer only — the chain hook stays manual.
@@ -62,7 +62,8 @@ node .ai.local/scripts/run.mjs --dry-run # read-only preview: decision, target,
62
62
  `--force`. The seeded tree is byte-identical to `presets/_shared/ai-local/scripts/`, and `.ai.local/.gitignore` (created
63
63
  when absent, missing required lines appended to an existing file) ignores `*.lock`, `*.tmp`, `.rollback/`, `STOP`,
64
64
  `ESTOP`, `team.db`, `team.db-wal`, `team.db-shm`, `team-db-errors.log`, `team.db.corrupt-*`,
65
- `team.db.mismatch-*`, `team/scheduler/runs/`, and `team/scheduler/state.json`; the root `.gitignore` is never edited.
65
+ `team.db.mismatch-*`, `team/scheduler/runs/`, `team/scheduler/state.json`, and
66
+ `team/repositories.json`; the root `.gitignore` is never edited.
66
67
 
67
68
  Upgrade a seeded module with `update --fix`: it writes a module only when its current bytes still match the shipped digest
68
69
  recorded in `.ai.local/.template-base.json`. A module you edited is reported `kept modified` and stays byte-identical; a
@@ -134,6 +135,7 @@ failure is written to `team-db-errors.log` and never fails a file write.
134
135
  ```bash
135
136
  node .ai.local/scripts/team-db.mjs init # create/migrate the database
136
137
  node .ai.local/scripts/team-db.mjs migrate-tasks # create when absent, then write only the delta
138
+ node .ai.local/scripts/rr-migrate-repositories.mjs # scan local clones into the registry, then project
137
139
  node .ai.local/scripts/team-db.mjs sync # full backfill + reconciliation
138
140
  node .ai.local/scripts/team-db.mjs sync --slug <slug> # the bounded hook-shaped projection
139
141
  node .ai.local/scripts/team-db.mjs check # schema, fingerprint, integrity
@@ -66,6 +66,9 @@ const ENGINE_SCRIPTS = [
66
66
  // Read-only post-step write-scope audit used by build-verifier and code-reviewer.
67
67
  // Shells out to git, so it is not part of the self-learning loop module set.
68
68
  'check-write-scope.mjs',
69
+ // Retrospective audit of `pipeline.json.repositories` across the task store.
70
+ // The chain hook gates intake; this one judges the folders that already exist.
71
+ 'check-task-repositories.mjs',
69
72
  // Process leases and the one view over them (`start|acquire|run|list|watch|
70
73
  // scan|doctor|stop|serve`). `processes.mjs` owns a detached dev-server start
71
74
  // and reuses `process-lease.mjs` for the protocol; both spawn `ps`/`lsof` and
@@ -76,6 +79,9 @@ const ENGINE_SCRIPTS = [
76
79
  // `/rr-scheduler-start`: stop a recorded scheduler, then start
77
80
  // `team-db.mjs schedule` through the process manager.
78
81
  'rr-scheduler-start.mjs',
82
+ // `/rr-migrate-repositories`: scan local clones and sync the repository
83
+ // registry through the lock-guarded `repositories apply|put|project` verbs.
84
+ 'rr-migrate-repositories.mjs',
79
85
  // Role/task metrics aggregation used by technical-retro; ships with the engine
80
86
  // so a consumer can run it from `.ai.local/scripts/` without the package.
81
87
  'aggregate-agent-task-metrics.mjs',
@@ -86,6 +92,9 @@ const ENGINE_SCRIPTS = [
86
92
  // Persisted verification evidence: command + exit + capped log tail bound to a
87
93
  // git snapshot, with a freshness check closure can read.
88
94
  'verification.mjs',
95
+ // Read-only audit of the reports `verification.mjs` sits beside: which ones
96
+ // name no tree, a stale tree, or a zero-input gate row. Never writes.
97
+ 'check-verification.mjs',
89
98
  // Append-only incident registry: recurrence threshold, promotion gate, advice.
90
99
  'incidents.mjs',
91
100
  ];
@@ -44,6 +44,8 @@ const AI_LOCAL_GITIGNORE = [
44
44
  '# Tracker launch queue and opt-in runner runtime state; items and links stay tracked.',
45
45
  'team/tracker/queue/',
46
46
  'team/task-runs/',
47
+ '# Local-only repository registry: generated from this machine, never commit.',
48
+ 'team/repositories.json',
47
49
  '# Per-step write-scope baselines; derived from git, never a project input.',
48
50
  'team/.write-scope/',
49
51
  'team/upstream/cursor.json',
@@ -21,12 +21,12 @@ Put a `.ai.local/` directory in your repo. Write rules as plain markdown. The `a
21
21
 
22
22
  `init` and `update` write `.ai.local/.template-base.json` — the digest of every `.ai.local/` file that holds a shipped template byte — so `update` can tell a file you edited from a file the preset moved. Your own bytes never become a base. See [Template drift](#template-drift).
23
23
 
24
- No IDE config, no `@include`, no codegen. Same files work in Cursor, Claude Code, Mavis, and OpenCode.
24
+ No IDE config, no `@include`, no codegen. Same files work in Cursor, Claude Code, Mavis, OpenCode, and ZCode.
25
25
 
26
26
  ## How it works
27
27
 
28
- 1. `init cursor|claude|mavis|opencode --preset <stack>` (or `init multi`) installs `ai-local-overlay`. Cursor: `alwaysApply: true`. Claude: session-start (no `paths:`). Mavis/OpenCode: listed as a root-entry rule in `AGENTS.md` / `.mavis/AGENTS.md` / `.opencode/AGENTS.md`.
29
- 2. On every turn the rule runs `list-ai-local.mjs` from the host hooks directory (`.cursor`, `.claude`, `.mavis`, or `.opencode`) with the paths that step will touch. The script prints `rules/*.md` and `conventions.md` for the ancestor chain. Do **not** load `team/**` or `rules-library/**` as rules. `team/` lives only at the **repo root** `.ai.local/team/`, not in nested package overlays.
28
+ 1. `init cursor|claude|mavis|opencode|zcode --preset <stack>` (or `init multi`) installs `ai-local-overlay`. Cursor: `alwaysApply: true`. Claude: session-start (no `paths:`). Mavis/OpenCode: listed as a root-entry rule in `AGENTS.md` / `.mavis/AGENTS.md` / `.opencode/AGENTS.md`. ZCode reads the root `AGENTS.md`.
29
+ 2. On every turn the rule runs `list-ai-local.mjs` from the host hooks directory (`.cursor`, `.claude`, `.mavis`, `.opencode`, or `.zcode`, current host first) with the paths that step will touch. The script prints `rules/*.md` and `conventions.md` for the ancestor chain. Do **not** load `team/**` or `rules-library/**` as rules. `team/` lives only at the **repo root** `.ai.local/team/`, not in nested package overlays.
30
30
  3. If a local rule conflicts with a preset rule, **the local rule wins**.
31
31
  4. **Deeper wins on one chain.** The root `.ai.local` applies to every path. A nested `.ai.local` applies only under its directory. The same rule file name on that chain: the deeper file wins (`shadowed` is not read). A sibling package does not inherit the other package's overlay.
32
32
  5. When the path set grows, run the script again with the new paths. If `.ai.local/team/tasks/<slug>/` already exists, pass `--record <slug>`. The script writes `overlay-scope.json` there and appends one `.memlog.md` `event:` per newly entered overlay directory. Read files listed under `new:` before editing. Cursor and Claude also print a prefix index at session start; that index is not the apply set.
@@ -297,7 +297,7 @@ A nested overlay does not contain `team/`. If the same rule name appears on one
297
297
 
298
298
  ## Limitations
299
299
 
300
- - Cursor, Claude, Mavis, and OpenCode do **not** natively read `.ai.local/`. `list-ai-local.mjs` prints the chain; the model still reads the listed files. Cursor and Claude inject the prefix index once per session. Mavis and OpenCode have no session hook, so the rule runs the same script.
300
+ - Cursor, Claude, Mavis, OpenCode, and ZCode do **not** natively read `.ai.local/`. `list-ai-local.mjs` prints the chain; the model still reads the listed files. Cursor and Claude inject the prefix index once per session. Mavis, OpenCode, and ZCode have no session hook, so the rule runs the same script.
301
301
  - A file added under an overlay the task has already entered is picked up the next time the script runs with a path on that chain. A brand-new `.ai.local` directory is picked up the same way; it does not wait for a new session.
302
302
  - "Priority" is **contextual**, not enforced. If the model already internalized a preset rule, the local rule may not fully override it.
303
303
  - Local rules consume your context window. Keep them tight.
@@ -19,13 +19,13 @@ Every preset artifact belongs to one of these layers. Do not mix semantics acros
19
19
  | Layer | Path | What belongs here |
20
20
  |-------|------|-------------------|
21
21
  | **Core** | `presets/_shared/core/**` | Stack-agnostic prose and checklists. No Cursor/Claude frontmatter. No stack paths (`app/src/**`, `Features/**`, Playwright, `xcodebuild`). |
22
- | **Stack** | `presets/{cursor\|claude}/<stack>/` | Domain rules, stack always-on set, stack tooling, stack examples in a delimited `## Stack notes` section. |
22
+ | **Stack** | `presets/{cursor\|claude\|mavis\|opencode\|zcode}/<stack>/` | Domain rules, stack always-on set, stack tooling, stack examples in a delimited `## Stack notes` section. |
23
23
  | **Platform** | Same stack tree | Adapter packaging: Cursor `.mdc` (`alwaysApply` / `globs`) vs Claude `.md` (`paths:`). Platform-only files (`BUGBOT.md`, `AGENTS.md`, `CLAUDE.md`, `hooks.json`). |
24
24
 
25
25
  ```text
26
26
  Core (_shared/core) → shared principles
27
27
  ↓ embed / copy + marker
28
- Stack (cursor|claude/<stack>) → domain + stack deltas
28
+ Stack (cursor/<stack>, then derived platforms) → domain + stack deltas
29
29
  ↓ frontmatter / layout
30
30
  Platform adapter → .mdc | .md + platform-only artifacts
31
31
  ```
@@ -34,7 +34,7 @@ Platform adapter → .mdc | .md + platform-only artifacts
34
34
 
35
35
  - Applies to all stacks with only example differences → **core** + stack adapters.
36
36
  - Only one installable stack (`next` / `nuxt` / `svelte` / `mol` / `ios-swift` / `android-kotlin` / `go` / `java` / `mcp-ts` / `php-hexagonal` / `php-laravel`) → **stack-specific** (never in `_shared`).
37
- - Only Cursor or only Claude file shape → **platform** (do not duplicate semantics in the other platform).
37
+ - Only one platform's file shape → **platform** (do not duplicate semantics on the other platforms).
38
38
 
39
39
  Meta-rules for **preset authors** live in `core/meta/` and are packaged into each stack with globs limited to `packages/ai-rules/presets/**` (never `alwaysApply` / session-start in consumer installs).
40
40
 
@@ -46,7 +46,8 @@ Meta-rules for **preset authors** live in `core/meta/` and are packaged into eac
46
46
  |---------|-----|-------|
47
47
  | Preset content | `packages/ai-rules/presets/**` | **Not** repo root `.cursor/` — dogfood is a synced working copy. |
48
48
  | Per stack | `presets/cursor/<stack>/` | Cursor `.mdc` is SoT for that stack. |
49
- | Claude twins | `presets/claude/<stack>/` | Derived in the **same PR** as Cursor changes. |
49
+ | Claude twins | `presets/claude/<stack>/` | Rules derived in the **same PR**. Agents, commands, skills, `CLAUDE.md`, and `settings.json` stay hand-maintained twins. |
50
+ | Mavis, OpenCode, ZCode | `presets/<platform>/<stack>/` | Derived from Cursor in the **same PR** (`generate-mavis.mjs`, `generate-opencode.mjs`, `generate-zcode.mjs`). Never hand-edit. |
50
51
  | Shared core | `presets/_shared/core/**` | Edit core first; update all `<!-- shared-core: … -->` consumers in the same PR. |
51
52
  | Monorepo dogfood | Root `.cursor/` | Sync **from** packages on release / dogfood PR (typically `cursor/next` + author meta globs). |
52
53
 
@@ -74,7 +75,7 @@ Claude topic folders (all stacks): `architecture/`, `stack/`, `api-and-data/`, `
74
75
 
75
76
  1. Change prose under `presets/_shared/core/<area>/<stem>.md`.
76
77
  2. Find consumers: `rg 'shared-core: <path>' packages/ai-rules/presets`.
77
- 3. Update every adapter (**all adapters**: stacks × 2 platforms, when the rule is shared) in the **same PR** — see **sync modes** below.
78
+ 3. Update the Cursor adapter in the **same PR**, then regenerate Claude, Mavis, OpenCode, and ZCode — see **sync modes** below. Do not hand-edit a derived tree.
78
79
  4. Keep stack-specific content only in adapters (embed: `## Stack notes`; lineage: full stack body).
79
80
  5. Update stack `rules/README.md` core→stack mapping if stems or paths changed.
80
81
  6. Sync dogfood: `packages/ai-rules/scripts/sync-dogfood-cursor.sh` when maintaining this monorepo.
@@ -171,7 +172,7 @@ Summary:
171
172
  - [ ] Anti-hallucination: `check-anti-hallucination-coverage.mjs` passes. New skill families are registered in `SKILL_CONTRACT_CLASS` (`writer` loads the stack floor; `reader` loads the contract only). `code-review` is `writer`.
172
173
  - [ ] Structure gates: `yarn check:task <slug>` (or `yarn check:changed` on a clean tree) and the gates it names; `yarn release:gate` before a release (the full `bash scripts/check-preset-structure.sh` composite)
173
174
  - [ ] Twin drift: after editing a Claude `commands/**` or `skills/**` file, `node scripts/check-preset-twin-drift.mjs` passes — mirror the change in the Cursor twin (delta and divergence unchanged) or record a deliberate divergence with `--update`. A deliberate divergence that **raises** an allowance needs `--update --widen`; dropping a baseline row needs `--update --prune`. A plain `--update` refuses both.
174
- - [ ] Generated trees regenerated (`generate-mavis.mjs` + `generate-opencode.mjs`) and CLI goldens recaptured (`capture-cli-golden.mjs`) after any preset-installed file changes
175
+ - [ ] Generated trees regenerated (`generate-claude.mjs` + `generate-mavis.mjs` + `generate-opencode.mjs` + `generate-zcode.mjs`, or `yarn fix:generated`) and CLI goldens recaptured (`capture-cli-golden.mjs`) after any preset-installed file changes
175
176
 
176
177
  Validation: `yarn check:task <slug>` (or `yarn check:changed` on a clean tree) + the `preset-pr-checklist` rule; the full composite runs in `yarn release:gate`. CI workflows: `preset-structure.yml` (`check`, `hooks`, `ai-local-engine-tests`), `platform-smoke.yml` (3-OS smoke: `init multi`/`update`/`doctor`, platform suites, script gate), `rule-eval.yml` (opt-in next rule-eval), and `release-gate.yml` (manual `yarn release:gate` run + report artifact).
177
178
 
@@ -407,7 +408,7 @@ Load these when editing files under `packages/ai-rules/presets/**`, `.cursor/**`
407
408
 
408
409
  | Script / npm | Purpose |
409
410
  |--------------|---------|
410
- | `yarn fix:generated` | Regenerate every released generated platform and recapture the CLI goldens it owns (`cursor/next`, `claude/next`, and every Mavis/OpenCode stack). Run after changing Cursor SoT, before fail-only checks. Capture a non-`next` Cursor/Claude golden explicitly with `node scripts/capture-cli-golden.mjs <cursor|claude> <stack>`; never hand-edit one. Dogfood sync remains separate. |
411
+ | `yarn fix:generated` | Regenerate every released generated platform and recapture the CLI goldens it owns (`cursor/next`, `claude/next`, and every Mavis/OpenCode/ZCode stack). Claude's stack set is the Cursor stack directories, not the OpenCode contract. Run after changing Cursor SoT, before fail-only checks. Capture a non-`next` Cursor/Claude golden explicitly with `node scripts/capture-cli-golden.mjs <cursor|claude> <stack>`; never hand-edit one. Dogfood sync remains separate. |
411
412
  | `scripts/sync-dogfood-cursor.sh` | Copy `presets/cursor/<preset>/` → root `.cursor/` (`AI_RULES_DOGFOOD_PRESET`, default `next`). Also copies `REPO_AGENTS.md` → repo-root `AGENTS.md`. Seeds `.ai.local/team` templates; preserves `.ai.local/team/tasks/`. |
412
413
  | `scripts/check-shared-core-drift.sh` / `yarn check:shared-core-drift` | Check embed-mode adapters vs core; lists lineage consumers. **Always hard:** every `_shared/core/**` file must be classified `embed | lineage | internal` in `_lib/embed-stems.json` (unclassified → exit 1). Drift is soft by default; set `AI_RULES_DRIFT_FAIL=1` (or use `release:gate`) to exit non-zero. A stem listed in `requiredSentences` is checked in the core **and in every adapter of that stem, whatever the lineage class** — the body comparison cannot cover a platform whose adapter is not a byte-embed of the core (the Cursor family reorders, omits and adds sections), so the normative fragments of that stem are pinned separately. |
413
414
  | `scripts/check-preset-twin-map.sh` / `yarn check:preset-twin-map` | **FAIL** if Cursor `.mdc` missing from Claude mapping table, twin file missing, or orphan topic `.md` (excl. `**/README.md`). Stacks: `next`, `nuxt`, `svelte`, `mol`, `ios-swift`, `android-kotlin`, `go`, `java`, `mcp-ts`, `php-hexagonal`, `php-laravel`. **Rules only** — commands and skills are guarded by `check-preset-twin-drift.mjs`. |
@@ -425,7 +426,7 @@ Load these when editing files under `packages/ai-rules/presets/**`, `.cursor/**`
425
426
  | `scripts/check-preset-language-policy.sh` / `yarn check:preset-structure` | **FAIL** if the native-language policy is absent: the core `_shared/core/agent-team/language-policy.md` tokens, the `language-policy` consumer + `<!-- shared-core -->` marker, the Cursor `globs:`/`alwaysApply: false` + Claude `paths:` shape, the `## Language` setting home (with a BCP-47 marker) in `ai-local/conventions.md`, the always-on anchors (`ai-local-overlay` + `<app-core>` + `REPO_AGENTS.md` must contain `native language` and `every user message`), or the `language:` persistence token in `commands/task.md`; **refuses vacuous PASS** when the iteration set is empty. Wired into `check-preset-structure.sh` next to `goal-contract` / `prompt-persistence`; fixture `test-preset-language-policy-fixtures.mjs`. |
426
427
  | `scripts/check-preset-self-review-contract.sh` / `yarn check:preset-structure` | **FAIL** if the producer-side self-review / context-hygiene contract is absent: the core `_shared/core/quality/self-review-and-context-hygiene.md` tokens (G0 non-vacuous guard), the `<!-- shared-core: quality/self-review-and-context-hygiene.md -->` marker on `task-analyst` / `feature-developer` / `build-verifier` (×10) and on `debugger` / `code-reviewer` where present (skip-if-absent → `mcp-ts`), the `Self-review` + `re-anchor` tokens on every orchestrator rule, `Self-review` in `team/README.md` + `commands/task.md`, and leakage-free core + docs; **refuses vacuous PASS** when the iteration set is empty. Also holds two prose contracts: the canonical self-learning-loop sentence must not be followed by unsanctioned prose (an allowlist of sanctioned clauses; the tail is bounded by the carrier's **section**, not by a blank line, so prose moved one paragraph down still fails — a tail in a later `## ` section is out of scope), and every retro carrier (command, skill, rule) must state `finding_category`. Wired into `check-preset-structure.sh` next to `goal-contract`; fixture `test-preset-self-review-contract-fixtures.mjs`. |
427
428
  | `scripts/check-anti-hallucination-coverage.mjs` | **FAIL** when the shared contract, a Cursor load-line embed, a writer stack floor, or a generated Rules-to-load stem is missing. Writer roles are `implementer`, `unit-test`, `e2e`, `qa`, and `reviewer` (`code-reviewer` loads `STACK_FLOOR_STEMS` plus the contract). `/task` and the orchestrator must not name a floor stem. Does not scan consumer `app/**` and does not call Context7. Fixture `test-anti-hallucination-coverage.mjs` deletes `anti-hallucination-contract` from `next.reviewer` in memory and expects FAIL mentioning `next` and `reviewer`. Wired into `check-preset-structure.sh` immediately after `check-claude-agent-blocks.mjs`. |
428
- | `presets/_shared/ai-local/scripts/check-write-scope.mjs` | Read-only post-step audit: compares the actual changed paths with the current `pipeline.json` step's `writeScopes` and labels each path `declared`, `derived` (task folder, engine mirror, generated platform tree/golden/hook, dogfood tree, adapter map), or `out-of-scope`, with the source named. Shipped to consumers as `.ai.local/scripts/check-write-scope.mjs` (`ENGINE_SCRIPTS`). `--slug <slug> [--step <id>] [--base <ref>] [--root <project>] [--paths a,b] [--save-baseline] [--json]`. Baseline resolution: `--paths`, then `--base <ref>`, then the step baseline written by `--step <id> --save-baseline` (every dirty path with its content hash, so an earlier step's path is not attributed to this one and an already-dirty path the step edits still is), then `HEAD` (whole uncommitted change-set, reported with a notice). Exit `1` for an out-of-scope path on an implementation step, `0` for a reviewer/verifier step (advisory), `2` on a usage/config error, `3` (SKIP) when the pipeline predates step ids or `writeScopes` and is therefore not auditable. Fixture `test-write-scope.mjs`; wired into the build-verifier and code-reviewer prompts, never a hook. |
429
+ | `presets/_shared/ai-local/scripts/check-write-scope.mjs` | Read-only post-step audit: compares the actual changed paths with the current `pipeline.json` step's `writeScopes` and labels each path `declared`, `derived` (task folder, engine mirror, generated platform tree/golden/hook, dogfood tree, adapter map), or `out-of-scope`, with the source named. Shipped to consumers as `.ai.local/scripts/check-write-scope.mjs` (`ENGINE_SCRIPTS`). `--slug <slug> [--step <id>] [--base <ref>] [--root <project>] [--paths a,b] [--save-baseline] [--json]`. Baseline resolution: `--paths`, then `--base <ref>`, then the step baseline written by `--step <id> --save-baseline` (every dirty path with its content hash, plus the files its declared `writeScopes` cover — passed as `--paths` — so a step armed on a clean tree still owns its surface), then `HEAD` (whole uncommitted change-set, reported with a notice). Exit `1` for an out-of-scope path on an implementation step, `0` for a reviewer/verifier step (advisory), `2` on a usage/config error, `3` (SKIP) when the pipeline predates step ids or `writeScopes` and is therefore not auditable. Fixture `test-write-scope.mjs`; wired into the build-verifier and code-reviewer prompts, never a hook. |
429
430
  | `scripts/check-preset-structure.sh` / `yarn check:preset-structure` | Low-level orchestrator: twin-map + token-budget + leakage + shared-core drift + anti-hallucination coverage + rule-eval (**all hard**; drift via `AI_RULES_DRIFT_FAIL=1`). Invoked by `yarn release:gate` and CI; not a feature-task gate. |
430
431
  | `scripts/check-product-specs.sh` / `yarn check:product-specs` | Opt-in consumer tree check: frontmatter v1 keys + required body headings on `docs/specs/**` (bash; does **not** run JSON Schema). Ships in the npm package `files` (`scripts/`). **WARN** by default; **`--strict`** exits non-zero. |
431
432
  | `yarn check:product-specs:dogfood` | Same script against monorepo `dogfood/mcp-ts-sample`. Soft WARN inside the composite + CI step (`continue-on-error`); the release gate runs `--strict`; not a hard consumer CI gate. |
package/docs/TEAM-DB.md CHANGED
@@ -20,8 +20,8 @@ The projection is installed by `init` as eight `team-db*.mjs` modules under `.ai
20
20
  The same seeded set is `ENGINE_SCRIPTS` in `bin/lib/engine-scripts.js`: the eight `team-db*.mjs`
21
21
  modules plus the self-learning engine, `manifest.mjs`, `dump-output.mjs`,
22
22
  `check-write-scope.mjs`, `aggregate-agent-task-metrics.mjs`, `record-usage.mjs`,
23
- `verification.mjs`, `incidents.mjs`, `tracker-planned-drain.mjs`, and the `processes.mjs` +
24
- `process-lease.mjs` process manager (twenty-five entries;
23
+ `verification.mjs`, `check-verification.mjs`, `incidents.mjs`, `tracker-planned-drain.mjs`, and the `processes.mjs` +
24
+ `process-lease.mjs` process manager (thirty-one entries;
25
25
  `node -e "require('./bin/lib/engine-scripts.js').ENGINE_SCRIPTS.length"` prints the shipped
26
26
  count). One further module, `upstream-research.mjs`, is declared in
27
27
  `REPO_ONLY_ENGINE_SCRIPTS`: it exists in this repository's preset source and dogfood mirror but
@@ -33,7 +33,11 @@ is excluded from the published tarball, and a consumer install skips it without
33
33
  `artifact-manifest.json`, prompts, memlogs, and review ledgers are read, never written.
34
34
  No agent writes a lifecycle field through the projection.
35
35
  - **The database is rebuildable.** Delete `team.db*` and run `sync`; the next run recreates
36
- the schema and reconverges. A schema fingerprint mismatch rebuilds automatically.
36
+ the schema and reconverges. An older database migrates in place and keeps its rows, and a
37
+ stored fingerprint that lags the DDL the migration chain produces is a stale record: it is
38
+ overwritten in place, no rebuild. A record that disagrees with a DDL the chain does not
39
+ produce is moved aside as `team.db.mismatch-<stamp>` and rebuilt. A file with no fingerprint
40
+ record is stamped with the DDL it opened with, without a comparison.
37
41
  - **Writes are isolated.** A projection or deletion failure never fails a file write or a
38
42
  receipt. The hook and `manifest.mjs` each run a bounded child (5 s, `SIGKILL`) and append
39
43
  one line to `team-db-errors.log` on failure; the confirmed task delete runs its own
@@ -41,16 +45,24 @@ is excluded from the published tarball, and a consumer install skips it without
41
45
  envelope, or one stderr line on the CLI.
42
46
  - **Bounded mutations.** `POST /api/v1/sync` re-runs the projector and `DELETE
43
47
  /api/v1/tasks/{slug}` deletes one confirmed task (the folder first, then the rows); every
44
- other route is `GET`/`HEAD` apart from the four job writes. Each mutation runs as an
45
- asynchronous child process — the server never opens a writable connection, and the kill
46
- switch answers before a child is spawned. Job writes carry `application/json` and at most
47
- 64 KiB, run-now an absent body or `{}`. The rescan and delete children are bounded at 30 s,
48
- a job write or run-now at 10 s. There is no write-back and no outbound call; the efficiency
49
- ledgers are local files read by a full sync.
48
+ other route is `GET`/`HEAD` apart from the four job writes and the three repository writes.
49
+ Each mutation runs as an asynchronous child process — the server never opens a writable
50
+ connection, and the kill switch answers before a child is spawned. Job writes carry
51
+ `application/json` and at most 64 KiB, run-now an absent body or `{}`; repository writes
52
+ carry `application/json` and at most 16 KiB. The rescan and delete children are bounded at
53
+ 30 s, a job write or run-now at 10 s, a repository write at 10 s and a repository delete at
54
+ 30 s. There is no write-back and no outbound call; the efficiency ledgers are local files
55
+ read by a full sync.
50
56
  - **The scheduler writes files before rows.** `scheduler/jobs.json` is the definition of
51
57
  record, `scheduler/runs/**` and `scheduler/state.json` are its runtime state, and the three
52
58
  `scheduled_jobs` / `job_runs` / `job_run_events` tables are projections of those files. The
53
59
  scheduler never writes `status.json`, `metrics.json`, or a receipt.
60
+ - **The repository registry writes files before rows.** `repositories.json` holds the
61
+ records, the resolved task→repository links and the unresolved attribution verdicts; the
62
+ `repositories` / `task_repositories` / `task_repository_attributions` tables are derived
63
+ from it alone and rebuild byte-identically. One lock-guarded verb serves both writers (the
64
+ API and `/task` intake or the backfill), and a projection failure never fails a file
65
+ write.
54
66
  - **Local only.** The server binds loopback by default, checks `Host` and `Origin`, sends no
55
67
  CORS header, and serves raw documents from SQLite by exact `(slug, path)` lookup.
56
68
 
@@ -158,6 +170,13 @@ vocabulary: `0` ok, `1` a validation refusal carrying its named code (`E_TRACKER
158
170
  `E_TRACKER_TRANSITION`, `E_TRACKER_REVISION`, `E_SCHEMA`), `3` usage, `4` the tree lock was
159
171
  contended (`E_TRACKER_BUSY`).
160
172
 
173
+ A tracker item payload is bounded, and a refusal burns no id: `title` is one trimmed line of
174
+ 1–120 characters, `description` at most 2000 characters, `labels` at most 8 of 1–32 characters,
175
+ `sourceRefs` at most 16 of 1–40 characters, `priority` 0–9, `status` ∈ backlog | planned |
176
+ completed | cancelled | superseded, `type` ∈ feature | bugfix | spike | chore | docs | refactor.
177
+ `tracker add` validates the payload before it reserves the sequence: a rejected add leaves
178
+ `tracker/sequence.json` untouched and the next accepted item reuses that id.
179
+
161
180
  A `--rebuild` of `init`, `sync` or `migrate-tasks` takes the team-root rebuild lock
162
181
  (`.ai.local/team/.rebuild.lock.d`, a transient directory) before it touches the database: a
163
182
  second rebuild that meets it fails fast with `E_REBUILD_BUSY` (exit 4) instead of moving
@@ -264,13 +283,16 @@ task in a holding state (`in_progress`, `awaiting_artifact_receipt`, `blocked`)
264
283
  slot, a task at a human gate does not. `GET /api/v1/tracker/queue` includes that holding
265
284
  task even when it has no tracker link and no queue file: the row is derived (`entryId` null,
266
285
  `itemId` null, `status` `active`, reason `current task`) and is not cancellable. A
267
- non-terminal queue entry for the same slug is the row that is shown instead. `GET /api/v1/tracker/queue` includes that holding
268
- task even when it has no tracker link and no queue file: the row is derived (`entryId` null,
269
- `itemId` null, `status` `active`, reason `current task`) and is not cancellable. A
270
- non-terminal queue entry for the same slug is the row that is shown instead. A claim older than 90 s with no task row is released
271
- on the next drain or by `tracker recover`; `tracker prune --older-than <days>` deletes aged
272
- terminal entry files only. The tracker module never writes `status.json`, `metrics.json`,
273
- or `scheduler/jobs.json`.
286
+ non-terminal queue entry for the same slug is the row that is shown instead. A claim older
287
+ than 90 s with no task row is released on the next drain or by `tracker recover`; `tracker
288
+ prune --older-than <days>` deletes aged terminal entry files only — stored
289
+ `cancelled`/`expired` and derived `done` alike, where a derived-done entry ages from its
290
+ `finishedAt`, else `claimedAt`, else `requestedAt`. A terminal item closes its open request
291
+ in the same transaction: `cancelled`/`superseded` write `expired` with
292
+ `item-cancelled`/`item-superseded`, and `completed` writes `expired` with `item-completed`,
293
+ so a `done` row (derived from the task row, never stored) cannot linger in the launch queue
294
+ after the item is closed. The tracker module never writes `status.json`, `metrics.json`, or
295
+ `scheduler/jobs.json`.
274
296
 
275
297
  **Task control.** The tracker item detail can start a new linked task (link + queue
276
298
  request), stop a link (cancel the queued request, write the per-task `tasks/<slug>/STOP`
@@ -367,14 +389,98 @@ reconciles it before the first fire, and `jobs reconcile` does the same on deman
367
389
  manifest and the row become `interrupted` with reason `E_ORPHANED`. `sync --rebuild` and
368
390
  `sync --vacuum` refuse with `E_SCHEDULER_RUNNING` (exit 4) while a fresh lease exists. That
369
391
  guard covers the explicit destructive flags only: a plain `init` or `sync` opens writable, and
370
- a database whose recorded schema fingerprint no longer matches is moved aside as
392
+ a database whose DDL the migration chain does not produce is moved aside as
371
393
  `team.db.mismatch-<stamp>` and rebuilt (see § Schema) even while a scheduler holds the lease.
394
+ A store whose DDL is the chain's own only has its fingerprint refreshed in place.
372
395
  Stop the scheduler before any schema upgrade; the explicit flags are a backstop, not a
373
396
  complete guard. The kill switch drains: no new claim, the in-flight child finishes inside its
374
397
  own timeout, the result is recorded, exit 0. Supervision (launchd, systemd, Task Scheduler) is
375
398
  documented practice, never shipped as a second timer, and Windows process-group termination is
376
399
  not supported in v1.
377
400
 
401
+ ## Repository registry
402
+
403
+ `team/repositories.json` is **local-only and git-ignored**; it is the definition of record for the
404
+ repository records, the resolved task→repository links and the unresolved attribution verdicts:
405
+
406
+ ```json
407
+ {
408
+ "version": 1,
409
+ "repositories": [ { "id": "ai-rules", "name": "…", "locator": "…", "description": null,
410
+ "labels": null, "status": "active", "revision": 1,
411
+ "createdAt": "…", "updatedAt": "…" } ],
412
+ "links": [ { "taskSlug": "…", "repositoryId": "ai-rules", "addedAt": "…",
413
+ "source": "intake", "inference": "evidence-paths", "evidence": "…" } ],
414
+ "attributions": [ { "taskSlug": "…", "verdict": "unknown", "evidence": "",
415
+ "recordedAt": "…", "source": "backfill" } ]
416
+ }
417
+ ```
418
+
419
+ `version` must be `1`, an unknown top-level key or two records with one id is a parse error,
420
+ and an absent file is an empty valid store (the first write creates it — `init` seeds nothing).
421
+ The writer serializes deterministically: declared key order, records sorted by `id`, links by
422
+ `(taskSlug, repositoryId)`, attributions by `taskSlug`, two-space indent, one trailing newline;
423
+ an unchanged rewrite performs no write at all.
424
+
425
+ One lock-guarded verb serves both writers — the CRUD API and `/task` intake or the backfill:
426
+
427
+ ```bash
428
+ node .ai.local/scripts/team-db.mjs repositories apply --file <path|-> [--dry-run]
429
+ node .ai.local/scripts/team-db.mjs repositories put --file <path|-> [--dry-run]
430
+ node .ai.local/scripts/team-db.mjs repositories delete <id> [--force] [--revision <n>]
431
+ node .ai.local/scripts/team-db.mjs repositories list [--json]
432
+ node .ai.local/scripts/team-db.mjs repositories project [--json]
433
+ ```
434
+
435
+ The order is kill switch → `.repositories.lock` (5 s, `E_REPOSITORIES_BUSY` / 503 `E_BUSY`)
436
+ → read → validate and CAS → file write by temp file plus rename → projection of the touched
437
+ rows → release in `finally`. `status` is validated on write (`active | archived`, 422 with
438
+ `parameter: "status"`) and is not a SQL `CHECK`: the projection serves whatever a hand-edited
439
+ file says. Update requires the stored `revision` and advances it by one; create writes `1`;
440
+ delete compares `revision` only when supplied — a stale or missing token is `409 E_CONFLICT`
441
+ and changes no bytes. `DELETE` on a record linked to N tasks answers `409
442
+ E_REPOSITORY_IN_USE` with `details.linkedTasks = N`; `force=true` removes the record and
443
+ every link in the same write and reports `linksRemoved` — the tasks stay.
444
+
445
+ `/rr-migrate-repositories` seeds and refreshes the records from the clones on this machine:
446
+ `node .ai.local/scripts/rr-migrate-repositories.mjs` walks the scan roots (default: the parent of
447
+ the repository root, or the root itself when that parent is `$HOME`), treats a directory with `.git` as one repository and stops descending there,
448
+ skips submodule checkouts and linked worktrees, and collapses several clones of one remote to the
449
+ shallowest path. A scan record whose locator already exists keeps its id; a new id is the slug of
450
+ the directory name, parent-prefixed on a collision. Missing records go through one `repositories
451
+ apply`, a changed `name`/`locator`/`status` through `repositories put` with the stored `revision`,
452
+ and the run finishes with `repositories project`, so the file and the database stay in step. The
453
+ script never deletes a record: a clone outside the scanned roots is not gone. `--dry-run` prints the
454
+ plan, `--scan <dir>` (repeatable) and `--depth <n>` widen or narrow the walk, `--team-root <dir>`
455
+ points at another store, and `AI_RULES_TEAM_DB_DISABLE` leaves the file untouched with exit 0.
456
+
457
+ The projection adds three tables through two migrations: `repositories` and
458
+ `task_repositories` (`0009-repositories`, `PRIMARY KEY (task_slug, repository_id)`,
459
+ `ON DELETE CASCADE` on the repository, **no foreign key on `task_slug`**) and
460
+ `task_repository_attributions` (`0010-repository-attributions`, the verdict only). Links and
461
+ verdicts are replaced together in one transaction, so a task that gains a link loses its
462
+ attribution row and vice versa. A malformed file records its error and tombstones nothing.
463
+ `rm team.db* && node .ai.local/scripts/team-db.mjs init --rebuild` reproduces all three
464
+ tables from the file alone.
465
+
466
+ Five operations, two paths: `GET|POST /api/v1/repositories`, and
467
+ `GET|PUT|DELETE /api/v1/repositories/{id}`; reads answer `RepositorySummary` (the record plus
468
+ `linkedTaskCount`, which the app never counts), writes answer `Repository`. `POST` creates the
469
+ body's `id` (a duplicate is 409) and `PUT` refuses a body id that differs from the path id
470
+ (409); neither route derives an id from `name`. The task list accepts `?repository=<id>` and
471
+ the task detail carries a required `repositories` array plus a required
472
+ `repositoriesInference` (`evidence-paths | repo-scope-only | unknown | ambiguous`), where a
473
+ link always outranks the attribution.
474
+
475
+ `/task` records the repositories a task touched: it sends one `repositories apply` payload
476
+ carrying a link row per touched repository, or — when the task names none — one `attributions`
477
+ row with `verdict: "unknown"`; `pipeline.json` carries the derived `repositories` echo. The
478
+ gate is `yarn check:task-repositories` (cutoff `2026-11-22`): a task folder without the field
479
+ fails, `[]` with `"unknown"` passes, and a folder whose own earliest artifact predates the
480
+ cutoff is counted as legacy — the chain hook rewrites `status.json` on every step, so a
481
+ rewritten status never makes a legacy folder new. The slug named by `active-task.json` is
482
+ excluded and printed, because its intake is still in flight; it is judged once the task closes.
483
+
378
484
  ## Start or restart
379
485
 
380
486
  `/rr-scheduler-start` runs `node .ai.local/scripts/rr-scheduler-start.mjs`. `init` seeds that
@@ -477,10 +583,14 @@ capability created after migration, with an escaped `LIKE` fallback.
477
583
  Migration `0002-scheduler` adds the scheduler's three tables — `scheduled_jobs`, `job_runs`,
478
584
  `job_run_events` — and five indexes, and moves `SCHEMA_VERSION` to 2. It is additive and
479
585
  sha256-pinned like the first one: a tampered literal aborts with `E_MIGRATION_CHECKSUM` before
480
- any DDL. A v1 database is not read forward: its recorded fingerprint no longer describes the
481
- schema, so the next open moves the file aside as `team.db.mismatch-<stamp>`, rebuilds, and
482
- reprojects from the task files — database-only rows are discarded by design, which is why the
483
- files are the source of truth. Run `sync` after an upgrade and the counters reconverge.
586
+ any DDL. A v1 database migrates in place through the chain and keeps its rows; the stored
587
+ fingerprint is a record of the DDL, so a record that lags the chain is a stale record — it is
588
+ rewritten in place and no rows move. A record that disagrees with a DDL the chain does not
589
+ produce — a table or index altered by hand — is moved aside as `team.db.mismatch-<stamp>` and
590
+ rebuilt, which is why the files stay the source of truth; under `--no-rebuild` or a read-only
591
+ open it fails as `E_SCHEMA_MISMATCH` instead. A database with no fingerprint record is stamped
592
+ with the DDL it opened with, without a comparison. Run `sync` after an upgrade and the counters
593
+ reconverge.
484
594
 
485
595
  Migration `0003-backlog` stays immutable; migration `0004-tracker` creates the tracker
486
596
  tables (`tracker_items`, `tracker_item_deps`, `tracker_queue`, `tracker_queue_events`,
@@ -525,6 +635,32 @@ gains ten columns (`intent`, `agent`, `parent_session_id`, `duration_ms`, `gap_m
525
635
  file opens and migrates in place without a row copy; a v6 file is refused by a v5 binary with
526
636
  `E_SCHEMA_NEWER`. There is no downgrade SQL: delete `team.db*` and run `sync`.
527
637
 
638
+ Migration `0008-ledger-owner` moves `SCHEMA_VERSION` to 8. It is additive: `review_ledger`
639
+ gains three nullable `TEXT` columns — `owner`, `due`, `follow_up` — so a version-7 file
640
+ migrates in place and historical rows insert `NULL`. There is no backfill and no row rewrite;
641
+ legacy is a function of the date, never of file mtime, and the header never decides it. A row is
642
+ legacy when it has no usable `at` — the one date git cannot supply — or when its `at` is before
643
+ `2026-11-22`. The header only decides a dated row: a post-cutoff row under a stale header still
644
+ fails, so a table moves to the canonical header rather than relying on width.
645
+ `ledger-check` is the single validator:
646
+ a row dated on or after `2026-11-22` whose disposition is `open`, `accepted` or `deferred`
647
+ needs an `owner` that is not one of the frozen placeholder tokens (`-`, `—`, `?`, `n/a`, `na`,
648
+ `none`, `null`, `tbd`, `tba`, `todo`, `unowned`, `unassigned`, `someone`, `anyone`, `owner`,
649
+ `team`; matching is equality after trim/quotes/one leading `@`/case, so `team-lead` passes)
650
+ and a `due` as `YYYY-MM-DD` on or after the check date (UTC); `accepted` and `deferred` also
651
+ need a `followUp` — `<slug>` or `blocked-on: <slug>`, one slug, resolving under
652
+ `<teamRoot>/tasks/`. Legacy rows are never failed and are counted in `legacyRows`; `undatedRows`
653
+ is their no-date subset. Both counters cover every parsed row, whatever its disposition — they
654
+ describe the ledger's age, not its debt. The output
655
+ carries both counters next to `checked=` / `failed=`, and `--json` adds them to the envelope.
656
+ The command
657
+ is file-only — it needs no `node:sqlite`. The chain hook spawns it on the receipt of the step
658
+ that owns the `review` artifact — `completed` and `changes_requested`, the two receipts a
659
+ review produces — and relays `failures[].reason` verbatim, so the message text lives once, in
660
+ `team-db-project.mjs`; a verifier or implementer receipt is not gated, because it may not
661
+ write a reviewer's row. A tree without the CLI or without a ledger skips the gate and says so
662
+ on stderr.
663
+
528
664
  `serve` and `schedule` keep the schema module they loaded at startup. When `team-db-schema.mjs`
529
665
  on disk is replaced by a higher `SCHEMA_VERSION`, the next request and the next idle scheduler
530
666
  tick re-import that file and open with it. A database newer than the file on disk still fails
@@ -633,7 +769,9 @@ no `Access-Control-*` header, hardened response headers, request bodies bounded
633
769
  document chunks at 1 MiB, exports at 5 MiB, parameterized SQL only, and no outbound call.
634
770
  `--allow-remote` also exposes the four job mutations — `POST /api/v1/jobs`,
635
771
  `PUT /api/v1/jobs/{id}`, `DELETE /api/v1/jobs/{id}`, and `POST /api/v1/jobs/{id}/run` —
636
- the confirmed task delete and the rescan to the named interface without authentication.
772
+ the three repository writes (`POST /api/v1/repositories`, `PUT /api/v1/repositories/{id}`,
773
+ `DELETE /api/v1/repositories/{id}`), the confirmed task delete and the rescan to the named
774
+ interface without authentication.
637
775
  A job definition carries arbitrary `argv` and run-now enqueues it, so that surface
638
776
  executes operator-supplied commands as the API user; see `## Scheduled jobs`.
639
777