@bonesofspring/ai-rules 0.2.41 → 0.2.42

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 (381) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/package.json +1 -1
  3. package/presets/_shared/ai-local/scripts/derive-gate-signals.mjs +7 -0
  4. package/presets/_shared/core/agent-team/agent-artifact-contracts.md +1 -0
  5. package/presets/_shared/hooks/chain-team-phases.sh.tmpl +62 -5
  6. package/presets/claude/android-kotlin/agents/ci-investigator.md +1 -1
  7. package/presets/claude/android-kotlin/agents/debugger.md +1 -1
  8. package/presets/claude/android-kotlin/agents/feature-developer.md +1 -1
  9. package/presets/claude/android-kotlin/agents/migration-specialist.md +1 -1
  10. package/presets/claude/android-kotlin/agents/performance-auditor.md +1 -1
  11. package/presets/claude/android-kotlin/agents/qa-tester.md +1 -1
  12. package/presets/claude/android-kotlin/agents/task-analyst.md +1 -1
  13. package/presets/claude/android-kotlin/agents/task-router.md +1 -1
  14. package/presets/claude/android-kotlin/agents/tech-writer.md +1 -1
  15. package/presets/claude/android-kotlin/agents/unit-test-generator.md +1 -1
  16. package/presets/claude/android-kotlin/agents/unit-test-healer.md +1 -1
  17. package/presets/claude/android-kotlin/agents/unit-test-planner.md +1 -1
  18. package/presets/claude/android-kotlin/hooks/chain-team-phases.sh +62 -5
  19. package/presets/claude/android-kotlin/team/README.md +1 -1
  20. package/presets/claude/go/agents/feature-developer.md +1 -1
  21. package/presets/claude/go/agents/task-analyst.md +1 -1
  22. package/presets/claude/go/agents/task-router.md +1 -1
  23. package/presets/claude/go/hooks/chain-team-phases.sh +62 -5
  24. package/presets/claude/go/team/README.md +1 -1
  25. package/presets/claude/ios-swift/agents/feature-developer.md +1 -1
  26. package/presets/claude/ios-swift/agents/task-analyst.md +1 -1
  27. package/presets/claude/ios-swift/agents/task-router.md +1 -1
  28. package/presets/claude/ios-swift/hooks/chain-team-phases.sh +62 -5
  29. package/presets/claude/ios-swift/team/README.md +1 -1
  30. package/presets/claude/java/agents/feature-developer.md +1 -1
  31. package/presets/claude/java/agents/task-analyst.md +1 -1
  32. package/presets/claude/java/agents/task-router.md +1 -1
  33. package/presets/claude/java/hooks/chain-team-phases.sh +62 -5
  34. package/presets/claude/java/team/README.md +1 -1
  35. package/presets/claude/mcp-ts/agents/feature-developer.md +1 -1
  36. package/presets/claude/mcp-ts/agents/task-analyst.md +1 -1
  37. package/presets/claude/mcp-ts/agents/task-router.md +1 -1
  38. package/presets/claude/mcp-ts/hooks/chain-team-phases.sh +62 -5
  39. package/presets/claude/mcp-ts/team/README.md +1 -1
  40. package/presets/claude/next/agents/ci-investigator.md +1 -1
  41. package/presets/claude/next/agents/debugger.md +1 -1
  42. package/presets/claude/next/agents/feature-developer.md +1 -1
  43. package/presets/claude/next/agents/migration-specialist.md +1 -1
  44. package/presets/claude/next/agents/performance-auditor.md +1 -1
  45. package/presets/claude/next/agents/qa-tester.md +1 -1
  46. package/presets/claude/next/agents/solution-architect.md +1 -1
  47. package/presets/claude/next/agents/task-analyst.md +1 -1
  48. package/presets/claude/next/agents/task-router.md +1 -1
  49. package/presets/claude/next/agents/tech-writer.md +1 -1
  50. package/presets/claude/next/agents/unit-test-generator.md +1 -1
  51. package/presets/claude/next/agents/unit-test-healer.md +1 -1
  52. package/presets/claude/next/agents/unit-test-planner.md +1 -1
  53. package/presets/claude/next/hooks/chain-team-phases.sh +62 -5
  54. package/presets/claude/next/team/README.md +1 -1
  55. package/presets/claude/nuxt/agents/ci-investigator.md +1 -1
  56. package/presets/claude/nuxt/agents/debugger.md +1 -1
  57. package/presets/claude/nuxt/agents/feature-developer.md +1 -1
  58. package/presets/claude/nuxt/agents/migration-specialist.md +1 -1
  59. package/presets/claude/nuxt/agents/performance-auditor.md +1 -1
  60. package/presets/claude/nuxt/agents/qa-tester.md +1 -1
  61. package/presets/claude/nuxt/agents/solution-architect.md +1 -1
  62. package/presets/claude/nuxt/agents/task-analyst.md +1 -1
  63. package/presets/claude/nuxt/agents/task-router.md +1 -1
  64. package/presets/claude/nuxt/agents/tech-writer.md +1 -1
  65. package/presets/claude/nuxt/agents/unit-test-generator.md +1 -1
  66. package/presets/claude/nuxt/agents/unit-test-healer.md +1 -1
  67. package/presets/claude/nuxt/agents/unit-test-planner.md +1 -1
  68. package/presets/claude/nuxt/hooks/chain-team-phases.sh +62 -5
  69. package/presets/claude/nuxt/team/README.md +1 -1
  70. package/presets/claude/php-hexagonal/agents/feature-developer.md +1 -1
  71. package/presets/claude/php-hexagonal/agents/task-analyst.md +1 -1
  72. package/presets/claude/php-hexagonal/agents/task-router.md +1 -1
  73. package/presets/claude/php-hexagonal/hooks/chain-team-phases.sh +62 -5
  74. package/presets/claude/php-hexagonal/team/README.md +1 -1
  75. package/presets/claude/php-laravel/agents/feature-developer.md +1 -1
  76. package/presets/claude/php-laravel/agents/task-analyst.md +1 -1
  77. package/presets/claude/php-laravel/agents/task-router.md +1 -1
  78. package/presets/claude/php-laravel/hooks/chain-team-phases.sh +62 -5
  79. package/presets/claude/php-laravel/team/README.md +1 -1
  80. package/presets/claude/svelte/agents/ci-investigator.md +1 -1
  81. package/presets/claude/svelte/agents/debugger.md +1 -1
  82. package/presets/claude/svelte/agents/feature-developer.md +1 -1
  83. package/presets/claude/svelte/agents/migration-specialist.md +1 -1
  84. package/presets/claude/svelte/agents/performance-auditor.md +1 -1
  85. package/presets/claude/svelte/agents/qa-tester.md +1 -1
  86. package/presets/claude/svelte/agents/solution-architect.md +1 -1
  87. package/presets/claude/svelte/agents/task-analyst.md +1 -1
  88. package/presets/claude/svelte/agents/task-router.md +1 -1
  89. package/presets/claude/svelte/agents/tech-writer.md +1 -1
  90. package/presets/claude/svelte/agents/unit-test-generator.md +1 -1
  91. package/presets/claude/svelte/agents/unit-test-healer.md +1 -1
  92. package/presets/claude/svelte/agents/unit-test-planner.md +1 -1
  93. package/presets/claude/svelte/hooks/chain-team-phases.sh +62 -5
  94. package/presets/claude/svelte/team/README.md +1 -1
  95. package/presets/cursor/android-kotlin/agents/ci-investigator.md +1 -1
  96. package/presets/cursor/android-kotlin/agents/debugger.md +1 -1
  97. package/presets/cursor/android-kotlin/agents/feature-developer.md +1 -1
  98. package/presets/cursor/android-kotlin/agents/migration-specialist.md +1 -1
  99. package/presets/cursor/android-kotlin/agents/performance-auditor.md +1 -1
  100. package/presets/cursor/android-kotlin/agents/qa-tester.md +1 -1
  101. package/presets/cursor/android-kotlin/agents/task-analyst.md +1 -1
  102. package/presets/cursor/android-kotlin/agents/task-router.md +1 -1
  103. package/presets/cursor/android-kotlin/agents/tech-writer.md +1 -1
  104. package/presets/cursor/android-kotlin/agents/unit-test-generator.md +1 -1
  105. package/presets/cursor/android-kotlin/agents/unit-test-healer.md +1 -1
  106. package/presets/cursor/android-kotlin/agents/unit-test-planner.md +1 -1
  107. package/presets/cursor/android-kotlin/hooks/chain-team-phases.sh +62 -5
  108. package/presets/cursor/android-kotlin/team/README.md +1 -1
  109. package/presets/cursor/go/agents/feature-developer.md +1 -1
  110. package/presets/cursor/go/agents/task-analyst.md +1 -1
  111. package/presets/cursor/go/agents/task-router.md +1 -1
  112. package/presets/cursor/go/hooks/chain-team-phases.sh +62 -5
  113. package/presets/cursor/go/team/README.md +1 -1
  114. package/presets/cursor/ios-swift/agents/feature-developer.md +1 -1
  115. package/presets/cursor/ios-swift/agents/task-analyst.md +1 -1
  116. package/presets/cursor/ios-swift/agents/task-router.md +1 -1
  117. package/presets/cursor/ios-swift/hooks/chain-team-phases.sh +62 -5
  118. package/presets/cursor/ios-swift/team/README.md +1 -1
  119. package/presets/cursor/java/agents/feature-developer.md +1 -1
  120. package/presets/cursor/java/agents/task-analyst.md +1 -1
  121. package/presets/cursor/java/agents/task-router.md +1 -1
  122. package/presets/cursor/java/hooks/chain-team-phases.sh +62 -5
  123. package/presets/cursor/java/team/README.md +1 -1
  124. package/presets/cursor/mcp-ts/agents/feature-developer.md +1 -1
  125. package/presets/cursor/mcp-ts/agents/task-analyst.md +1 -1
  126. package/presets/cursor/mcp-ts/agents/task-router.md +1 -1
  127. package/presets/cursor/mcp-ts/hooks/chain-team-phases.sh +62 -5
  128. package/presets/cursor/mcp-ts/team/README.md +1 -1
  129. package/presets/cursor/next/agents/ci-investigator.md +1 -1
  130. package/presets/cursor/next/agents/debugger.md +1 -1
  131. package/presets/cursor/next/agents/feature-developer.md +1 -1
  132. package/presets/cursor/next/agents/migration-specialist.md +1 -1
  133. package/presets/cursor/next/agents/performance-auditor.md +1 -1
  134. package/presets/cursor/next/agents/qa-tester.md +1 -1
  135. package/presets/cursor/next/agents/solution-architect.md +1 -1
  136. package/presets/cursor/next/agents/task-analyst.md +1 -1
  137. package/presets/cursor/next/agents/task-router.md +1 -1
  138. package/presets/cursor/next/agents/tech-writer.md +1 -1
  139. package/presets/cursor/next/agents/unit-test-generator.md +1 -1
  140. package/presets/cursor/next/agents/unit-test-healer.md +1 -1
  141. package/presets/cursor/next/agents/unit-test-planner.md +1 -1
  142. package/presets/cursor/next/hooks/chain-team-phases.sh +62 -5
  143. package/presets/cursor/next/team/README.md +1 -1
  144. package/presets/cursor/nuxt/agents/ci-investigator.md +1 -1
  145. package/presets/cursor/nuxt/agents/debugger.md +1 -1
  146. package/presets/cursor/nuxt/agents/feature-developer.md +1 -1
  147. package/presets/cursor/nuxt/agents/migration-specialist.md +1 -1
  148. package/presets/cursor/nuxt/agents/performance-auditor.md +1 -1
  149. package/presets/cursor/nuxt/agents/qa-tester.md +1 -1
  150. package/presets/cursor/nuxt/agents/solution-architect.md +1 -1
  151. package/presets/cursor/nuxt/agents/task-analyst.md +1 -1
  152. package/presets/cursor/nuxt/agents/task-router.md +1 -1
  153. package/presets/cursor/nuxt/agents/tech-writer.md +1 -1
  154. package/presets/cursor/nuxt/agents/unit-test-generator.md +1 -1
  155. package/presets/cursor/nuxt/agents/unit-test-healer.md +1 -1
  156. package/presets/cursor/nuxt/agents/unit-test-planner.md +1 -1
  157. package/presets/cursor/nuxt/hooks/chain-team-phases.sh +62 -5
  158. package/presets/cursor/nuxt/team/README.md +1 -1
  159. package/presets/cursor/php-hexagonal/agents/feature-developer.md +1 -1
  160. package/presets/cursor/php-hexagonal/agents/task-analyst.md +1 -1
  161. package/presets/cursor/php-hexagonal/agents/task-router.md +1 -1
  162. package/presets/cursor/php-hexagonal/hooks/chain-team-phases.sh +62 -5
  163. package/presets/cursor/php-hexagonal/team/README.md +1 -1
  164. package/presets/cursor/php-laravel/agents/feature-developer.md +1 -1
  165. package/presets/cursor/php-laravel/agents/task-analyst.md +1 -1
  166. package/presets/cursor/php-laravel/agents/task-router.md +1 -1
  167. package/presets/cursor/php-laravel/hooks/chain-team-phases.sh +62 -5
  168. package/presets/cursor/php-laravel/team/README.md +1 -1
  169. package/presets/cursor/svelte/agents/ci-investigator.md +1 -1
  170. package/presets/cursor/svelte/agents/debugger.md +1 -1
  171. package/presets/cursor/svelte/agents/feature-developer.md +1 -1
  172. package/presets/cursor/svelte/agents/migration-specialist.md +1 -1
  173. package/presets/cursor/svelte/agents/performance-auditor.md +1 -1
  174. package/presets/cursor/svelte/agents/qa-tester.md +1 -1
  175. package/presets/cursor/svelte/agents/solution-architect.md +1 -1
  176. package/presets/cursor/svelte/agents/task-analyst.md +1 -1
  177. package/presets/cursor/svelte/agents/task-router.md +1 -1
  178. package/presets/cursor/svelte/agents/tech-writer.md +1 -1
  179. package/presets/cursor/svelte/agents/unit-test-generator.md +1 -1
  180. package/presets/cursor/svelte/agents/unit-test-healer.md +1 -1
  181. package/presets/cursor/svelte/agents/unit-test-planner.md +1 -1
  182. package/presets/cursor/svelte/hooks/chain-team-phases.sh +62 -5
  183. package/presets/cursor/svelte/team/README.md +1 -1
  184. package/presets/mavis/android-kotlin/adapter-map.json +1 -1
  185. package/presets/mavis/android-kotlin/agents/ci-investigator.md +1 -1
  186. package/presets/mavis/android-kotlin/agents/debugger.md +1 -1
  187. package/presets/mavis/android-kotlin/agents/feature-developer.md +1 -1
  188. package/presets/mavis/android-kotlin/agents/migration-specialist.md +1 -1
  189. package/presets/mavis/android-kotlin/agents/performance-auditor.md +1 -1
  190. package/presets/mavis/android-kotlin/agents/qa-tester.md +1 -1
  191. package/presets/mavis/android-kotlin/agents/task-analyst.md +1 -1
  192. package/presets/mavis/android-kotlin/agents/task-router.md +1 -1
  193. package/presets/mavis/android-kotlin/agents/tech-writer.md +1 -1
  194. package/presets/mavis/android-kotlin/agents/unit-test-generator.md +1 -1
  195. package/presets/mavis/android-kotlin/agents/unit-test-healer.md +1 -1
  196. package/presets/mavis/android-kotlin/agents/unit-test-planner.md +1 -1
  197. package/presets/mavis/android-kotlin/hooks/chain-team-phases.sh +62 -5
  198. package/presets/mavis/android-kotlin/team/README.md +1 -1
  199. package/presets/mavis/go/adapter-map.json +1 -1
  200. package/presets/mavis/go/agents/feature-developer.md +1 -1
  201. package/presets/mavis/go/agents/task-analyst.md +1 -1
  202. package/presets/mavis/go/agents/task-router.md +1 -1
  203. package/presets/mavis/go/hooks/chain-team-phases.sh +62 -5
  204. package/presets/mavis/go/team/README.md +1 -1
  205. package/presets/mavis/ios-swift/adapter-map.json +1 -1
  206. package/presets/mavis/ios-swift/agents/feature-developer.md +1 -1
  207. package/presets/mavis/ios-swift/agents/task-analyst.md +1 -1
  208. package/presets/mavis/ios-swift/agents/task-router.md +1 -1
  209. package/presets/mavis/ios-swift/hooks/chain-team-phases.sh +62 -5
  210. package/presets/mavis/ios-swift/team/README.md +1 -1
  211. package/presets/mavis/java/adapter-map.json +1 -1
  212. package/presets/mavis/java/agents/feature-developer.md +1 -1
  213. package/presets/mavis/java/agents/task-analyst.md +1 -1
  214. package/presets/mavis/java/agents/task-router.md +1 -1
  215. package/presets/mavis/java/hooks/chain-team-phases.sh +62 -5
  216. package/presets/mavis/java/team/README.md +1 -1
  217. package/presets/mavis/mcp-ts/adapter-map.json +1 -1
  218. package/presets/mavis/mcp-ts/agents/feature-developer.md +1 -1
  219. package/presets/mavis/mcp-ts/agents/task-analyst.md +1 -1
  220. package/presets/mavis/mcp-ts/agents/task-router.md +1 -1
  221. package/presets/mavis/mcp-ts/hooks/chain-team-phases.sh +62 -5
  222. package/presets/mavis/mcp-ts/team/README.md +1 -1
  223. package/presets/mavis/next/adapter-map.json +1 -1
  224. package/presets/mavis/next/agents/ci-investigator.md +1 -1
  225. package/presets/mavis/next/agents/debugger.md +1 -1
  226. package/presets/mavis/next/agents/feature-developer.md +1 -1
  227. package/presets/mavis/next/agents/migration-specialist.md +1 -1
  228. package/presets/mavis/next/agents/performance-auditor.md +1 -1
  229. package/presets/mavis/next/agents/qa-tester.md +1 -1
  230. package/presets/mavis/next/agents/solution-architect.md +1 -1
  231. package/presets/mavis/next/agents/task-analyst.md +1 -1
  232. package/presets/mavis/next/agents/task-router.md +1 -1
  233. package/presets/mavis/next/agents/tech-writer.md +1 -1
  234. package/presets/mavis/next/agents/unit-test-generator.md +1 -1
  235. package/presets/mavis/next/agents/unit-test-healer.md +1 -1
  236. package/presets/mavis/next/agents/unit-test-planner.md +1 -1
  237. package/presets/mavis/next/hooks/chain-team-phases.sh +62 -5
  238. package/presets/mavis/next/team/README.md +1 -1
  239. package/presets/mavis/nuxt/adapter-map.json +1 -1
  240. package/presets/mavis/nuxt/agents/ci-investigator.md +1 -1
  241. package/presets/mavis/nuxt/agents/debugger.md +1 -1
  242. package/presets/mavis/nuxt/agents/feature-developer.md +1 -1
  243. package/presets/mavis/nuxt/agents/migration-specialist.md +1 -1
  244. package/presets/mavis/nuxt/agents/performance-auditor.md +1 -1
  245. package/presets/mavis/nuxt/agents/qa-tester.md +1 -1
  246. package/presets/mavis/nuxt/agents/solution-architect.md +1 -1
  247. package/presets/mavis/nuxt/agents/task-analyst.md +1 -1
  248. package/presets/mavis/nuxt/agents/task-router.md +1 -1
  249. package/presets/mavis/nuxt/agents/tech-writer.md +1 -1
  250. package/presets/mavis/nuxt/agents/unit-test-generator.md +1 -1
  251. package/presets/mavis/nuxt/agents/unit-test-healer.md +1 -1
  252. package/presets/mavis/nuxt/agents/unit-test-planner.md +1 -1
  253. package/presets/mavis/nuxt/hooks/chain-team-phases.sh +62 -5
  254. package/presets/mavis/nuxt/team/README.md +1 -1
  255. package/presets/mavis/php-hexagonal/adapter-map.json +1 -1
  256. package/presets/mavis/php-hexagonal/agents/feature-developer.md +1 -1
  257. package/presets/mavis/php-hexagonal/agents/task-analyst.md +1 -1
  258. package/presets/mavis/php-hexagonal/agents/task-router.md +1 -1
  259. package/presets/mavis/php-hexagonal/hooks/chain-team-phases.sh +62 -5
  260. package/presets/mavis/php-hexagonal/team/README.md +1 -1
  261. package/presets/mavis/php-laravel/adapter-map.json +1 -1
  262. package/presets/mavis/php-laravel/agents/feature-developer.md +1 -1
  263. package/presets/mavis/php-laravel/agents/task-analyst.md +1 -1
  264. package/presets/mavis/php-laravel/agents/task-router.md +1 -1
  265. package/presets/mavis/php-laravel/hooks/chain-team-phases.sh +62 -5
  266. package/presets/mavis/php-laravel/team/README.md +1 -1
  267. package/presets/mavis/svelte/adapter-map.json +1 -1
  268. package/presets/mavis/svelte/agents/ci-investigator.md +1 -1
  269. package/presets/mavis/svelte/agents/debugger.md +1 -1
  270. package/presets/mavis/svelte/agents/feature-developer.md +1 -1
  271. package/presets/mavis/svelte/agents/migration-specialist.md +1 -1
  272. package/presets/mavis/svelte/agents/performance-auditor.md +1 -1
  273. package/presets/mavis/svelte/agents/qa-tester.md +1 -1
  274. package/presets/mavis/svelte/agents/solution-architect.md +1 -1
  275. package/presets/mavis/svelte/agents/task-analyst.md +1 -1
  276. package/presets/mavis/svelte/agents/task-router.md +1 -1
  277. package/presets/mavis/svelte/agents/tech-writer.md +1 -1
  278. package/presets/mavis/svelte/agents/unit-test-generator.md +1 -1
  279. package/presets/mavis/svelte/agents/unit-test-healer.md +1 -1
  280. package/presets/mavis/svelte/agents/unit-test-planner.md +1 -1
  281. package/presets/mavis/svelte/hooks/chain-team-phases.sh +62 -5
  282. package/presets/mavis/svelte/team/README.md +1 -1
  283. package/presets/opencode/android-kotlin/adapter-map.json +1 -1
  284. package/presets/opencode/android-kotlin/agents/ci-investigator.md +1 -1
  285. package/presets/opencode/android-kotlin/agents/debugger.md +1 -1
  286. package/presets/opencode/android-kotlin/agents/feature-developer.md +1 -1
  287. package/presets/opencode/android-kotlin/agents/migration-specialist.md +1 -1
  288. package/presets/opencode/android-kotlin/agents/performance-auditor.md +1 -1
  289. package/presets/opencode/android-kotlin/agents/qa-tester.md +1 -1
  290. package/presets/opencode/android-kotlin/agents/task-analyst.md +1 -1
  291. package/presets/opencode/android-kotlin/agents/task-router.md +1 -1
  292. package/presets/opencode/android-kotlin/agents/tech-writer.md +1 -1
  293. package/presets/opencode/android-kotlin/agents/unit-test-generator.md +1 -1
  294. package/presets/opencode/android-kotlin/agents/unit-test-healer.md +1 -1
  295. package/presets/opencode/android-kotlin/agents/unit-test-planner.md +1 -1
  296. package/presets/opencode/android-kotlin/hooks/chain-team-phases.sh +62 -5
  297. package/presets/opencode/android-kotlin/team/README.md +1 -1
  298. package/presets/opencode/go/adapter-map.json +1 -1
  299. package/presets/opencode/go/agents/feature-developer.md +1 -1
  300. package/presets/opencode/go/agents/task-analyst.md +1 -1
  301. package/presets/opencode/go/agents/task-router.md +1 -1
  302. package/presets/opencode/go/hooks/chain-team-phases.sh +62 -5
  303. package/presets/opencode/go/team/README.md +1 -1
  304. package/presets/opencode/ios-swift/adapter-map.json +1 -1
  305. package/presets/opencode/ios-swift/agents/feature-developer.md +1 -1
  306. package/presets/opencode/ios-swift/agents/task-analyst.md +1 -1
  307. package/presets/opencode/ios-swift/agents/task-router.md +1 -1
  308. package/presets/opencode/ios-swift/hooks/chain-team-phases.sh +62 -5
  309. package/presets/opencode/ios-swift/team/README.md +1 -1
  310. package/presets/opencode/java/adapter-map.json +1 -1
  311. package/presets/opencode/java/agents/feature-developer.md +1 -1
  312. package/presets/opencode/java/agents/task-analyst.md +1 -1
  313. package/presets/opencode/java/agents/task-router.md +1 -1
  314. package/presets/opencode/java/hooks/chain-team-phases.sh +62 -5
  315. package/presets/opencode/java/team/README.md +1 -1
  316. package/presets/opencode/mcp-ts/adapter-map.json +1 -1
  317. package/presets/opencode/mcp-ts/agents/feature-developer.md +1 -1
  318. package/presets/opencode/mcp-ts/agents/task-analyst.md +1 -1
  319. package/presets/opencode/mcp-ts/agents/task-router.md +1 -1
  320. package/presets/opencode/mcp-ts/hooks/chain-team-phases.sh +62 -5
  321. package/presets/opencode/mcp-ts/team/README.md +1 -1
  322. package/presets/opencode/next/adapter-map.json +1 -1
  323. package/presets/opencode/next/agents/ci-investigator.md +1 -1
  324. package/presets/opencode/next/agents/debugger.md +1 -1
  325. package/presets/opencode/next/agents/feature-developer.md +1 -1
  326. package/presets/opencode/next/agents/migration-specialist.md +1 -1
  327. package/presets/opencode/next/agents/performance-auditor.md +1 -1
  328. package/presets/opencode/next/agents/qa-tester.md +1 -1
  329. package/presets/opencode/next/agents/solution-architect.md +1 -1
  330. package/presets/opencode/next/agents/task-analyst.md +1 -1
  331. package/presets/opencode/next/agents/task-router.md +1 -1
  332. package/presets/opencode/next/agents/tech-writer.md +1 -1
  333. package/presets/opencode/next/agents/unit-test-generator.md +1 -1
  334. package/presets/opencode/next/agents/unit-test-healer.md +1 -1
  335. package/presets/opencode/next/agents/unit-test-planner.md +1 -1
  336. package/presets/opencode/next/hooks/chain-team-phases.sh +62 -5
  337. package/presets/opencode/next/team/README.md +1 -1
  338. package/presets/opencode/nuxt/adapter-map.json +1 -1
  339. package/presets/opencode/nuxt/agents/ci-investigator.md +1 -1
  340. package/presets/opencode/nuxt/agents/debugger.md +1 -1
  341. package/presets/opencode/nuxt/agents/feature-developer.md +1 -1
  342. package/presets/opencode/nuxt/agents/migration-specialist.md +1 -1
  343. package/presets/opencode/nuxt/agents/performance-auditor.md +1 -1
  344. package/presets/opencode/nuxt/agents/qa-tester.md +1 -1
  345. package/presets/opencode/nuxt/agents/solution-architect.md +1 -1
  346. package/presets/opencode/nuxt/agents/task-analyst.md +1 -1
  347. package/presets/opencode/nuxt/agents/task-router.md +1 -1
  348. package/presets/opencode/nuxt/agents/tech-writer.md +1 -1
  349. package/presets/opencode/nuxt/agents/unit-test-generator.md +1 -1
  350. package/presets/opencode/nuxt/agents/unit-test-healer.md +1 -1
  351. package/presets/opencode/nuxt/agents/unit-test-planner.md +1 -1
  352. package/presets/opencode/nuxt/hooks/chain-team-phases.sh +62 -5
  353. package/presets/opencode/nuxt/team/README.md +1 -1
  354. package/presets/opencode/php-hexagonal/adapter-map.json +1 -1
  355. package/presets/opencode/php-hexagonal/agents/feature-developer.md +1 -1
  356. package/presets/opencode/php-hexagonal/agents/task-analyst.md +1 -1
  357. package/presets/opencode/php-hexagonal/agents/task-router.md +1 -1
  358. package/presets/opencode/php-hexagonal/hooks/chain-team-phases.sh +62 -5
  359. package/presets/opencode/php-hexagonal/team/README.md +1 -1
  360. package/presets/opencode/php-laravel/adapter-map.json +1 -1
  361. package/presets/opencode/php-laravel/agents/feature-developer.md +1 -1
  362. package/presets/opencode/php-laravel/agents/task-analyst.md +1 -1
  363. package/presets/opencode/php-laravel/agents/task-router.md +1 -1
  364. package/presets/opencode/php-laravel/hooks/chain-team-phases.sh +62 -5
  365. package/presets/opencode/php-laravel/team/README.md +1 -1
  366. package/presets/opencode/svelte/adapter-map.json +1 -1
  367. package/presets/opencode/svelte/agents/ci-investigator.md +1 -1
  368. package/presets/opencode/svelte/agents/debugger.md +1 -1
  369. package/presets/opencode/svelte/agents/feature-developer.md +1 -1
  370. package/presets/opencode/svelte/agents/migration-specialist.md +1 -1
  371. package/presets/opencode/svelte/agents/performance-auditor.md +1 -1
  372. package/presets/opencode/svelte/agents/qa-tester.md +1 -1
  373. package/presets/opencode/svelte/agents/solution-architect.md +1 -1
  374. package/presets/opencode/svelte/agents/task-analyst.md +1 -1
  375. package/presets/opencode/svelte/agents/task-router.md +1 -1
  376. package/presets/opencode/svelte/agents/tech-writer.md +1 -1
  377. package/presets/opencode/svelte/agents/unit-test-generator.md +1 -1
  378. package/presets/opencode/svelte/agents/unit-test-healer.md +1 -1
  379. package/presets/opencode/svelte/agents/unit-test-planner.md +1 -1
  380. package/presets/opencode/svelte/hooks/chain-team-phases.sh +62 -5
  381. package/presets/opencode/svelte/team/README.md +1 -1
@@ -87,7 +87,7 @@ Same JSON on Claude, Mavis, or OpenCode: `bash .<tool>/hooks/chain-team-phases.s
87
87
  ## Contracts
88
88
 
89
89
  - **Manifest field name:** receipts go in `artifacts[]`. Anything written under `entries` is ignored — the hook reads only `artifacts` and prints a dual-read warning naming the file. See `agent-team/agent-artifact-contracts.md` § Schema field name.
90
- - **Evidence paths:** `authoritativePaths[]` must be task-relative (`.ai.local/team/tasks/<slug>/…`). Put anything outside the task directory — e.g. `openspec/changes/**` — in `evidencePaths[]`.
90
+ - **Evidence paths:** `authoritativePaths[]` is relative to the task directory (`brief.md`). A repo-root path (`.ai.local/team/tasks/<slug>/brief.md`) is rejected. Put anything outside the task directory — e.g. `openspec/changes/**` — in `evidencePaths[]`.
91
91
  - Manifest schema: shared core `agent-team/agent-artifact-contracts.md`. Read it first; producers upsert only their IDs.
92
92
  - Metrics: append-only allowlisted events — `agent-team/agent-task-metrics.md`. Aggregate: `node node_modules/@bonesofspring/ai-rules/scripts/aggregate-agent-task-metrics.mjs --team-root .ai.local/team`.
93
93
  - Commit `.ai.local/team/` templates (and slugs if you want them in clones).
@@ -107,7 +107,7 @@ Load requestable rule `mcp-usage` when verifying third-party library APIs (Conte
107
107
 
108
108
  - **Authoritative inputs:** read `.ai.local/team/tasks/<slug>/artifact-manifest.json` first; consume handoff `artifactInputIds` when supplied, otherwise consume the items in `manifest.artifacts[]` for `brief.md`, `decomposition.md`, current scope, and applicable prior findings.
109
109
  - **Owned outputs:** `implementation.md` plus changed implementation/test paths; upsert only the entry in `manifest.artifacts[]` assigned by handoff (`artifactOutputId`; fallback `implementation`) and preserve all foreign items in `manifest.artifacts[]`.
110
- - **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present.
110
+ - **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present. `authoritativePaths` are relative to the task folder (`brief.md`), not the repo root; put external files in `evidencePaths`.
111
111
  - **Shared state:** never create or mutate `status.json` or `metrics.json`; the orchestration runtime/hook owns lifecycle, gates, retries, attempts, and timestamps.
112
112
 
113
113
  ## Receipt binding
@@ -113,5 +113,5 @@ If the prompt/brief has a tracker URL (Linear/Jira/Notion/…) and that MCP is r
113
113
 
114
114
  - **Authoritative inputs:** read `.ai.local/team/tasks/<slug>/artifact-manifest.json` first; consume `pipeline.json`, the manifest routing entry, user-approved decisions, and any authoritative architecture/approval entries.
115
115
  - **Owned outputs:** `brief.md` and `decomposition.md`; upsert only the entry in `manifest.artifacts[]` assigned by handoff (`artifactOutputId`; fallback `analysis`) and preserve all foreign items in `manifest.artifacts[]`.
116
- - **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present.
116
+ - **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present. `authoritativePaths` are relative to the task folder (`brief.md`), not the repo root; put external files in `evidencePaths`.
117
117
  - **Shared state:** never create or mutate `status.json` or `metrics.json`; the orchestration runtime/hook owns lifecycle, gates, retries, attempts, and timestamps.
@@ -155,5 +155,5 @@ Return the routing receipt to the orchestrator. The orchestration runtime/hook e
155
155
 
156
156
  - **Authoritative inputs:** read `.ai.local/team/tasks/<slug>/artifact-manifest.json` first; consume the user request and any existing authoritative task/decision entries.
157
157
  - **Owned outputs:** `pipeline.json` and the routing entry in `manifest.artifacts[]`; upsert only the entry in `manifest.artifacts[]` assigned by handoff (`artifactOutputId`; fallback `routing`) and preserve all foreign items in `manifest.artifacts[]`.
158
- - **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present.
158
+ - **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present. `authoritativePaths` are relative to the task folder (`brief.md`), not the repo root; put external files in `evidencePaths`.
159
159
  - **Shared state:** never create or mutate `status.json` or `metrics.json`; the orchestration runtime/hook owns lifecycle, gates, retries, attempts, and timestamps.
@@ -440,7 +440,21 @@ function endHumanGateIfResumed() {
440
440
  appendMetric({ type: 'human_gate_ended', at: now, gateStartedEventId: status.activeHumanGateEventId, source: 'hook', attributionConfidence: 'high' });
441
441
  delete status.activeHumanGateEventId;
442
442
  }
443
- function completeTaskMetrics() { appendMetric({ type: 'task_completed', at: now, outcome: status.state === 'completed' ? 'completed' : 'unknown', source: 'hook', attributionConfidence: 'high' }); }
443
+ function completeTaskMetrics() {
444
+ // Two hook processes can both enter completion before either writes the
445
+ // event. The metrics lock serializes them; the second sees the first write.
446
+ mutateMetrics((metrics) => {
447
+ if (metrics.events.some((event) => event && event.type === 'task_completed')) return;
448
+ metrics.events.push({
449
+ eventId: `${metrics.task.runId}:${Date.now()}:${Math.random().toString(16).slice(2)}`,
450
+ type: 'task_completed',
451
+ at: now,
452
+ outcome: status.state === 'completed' ? 'completed' : 'unknown',
453
+ source: 'hook',
454
+ attributionConfidence: 'high',
455
+ });
456
+ });
457
+ }
444
458
  function recordSkippedStep(step, stepIndex) {
445
459
  for (const agent of getStepAgents(step)) {
446
460
  const runId = status.metricsRunId || `${slug}-${Date.now()}-${Math.random().toString(16).slice(2)}`;
@@ -628,7 +642,7 @@ function handoffForWave(units, waveId) {
628
642
  `Invoke IN PARALLEL (one message, multiple Task calls): ${labels.join(' AND ')} for slug "${slug}"${waveId ? ` (waveId=${waveId})` : ''}. ` +
629
643
  `Each agent writes its artifact and owned receipt; the hook records slot joins from stops. Do not mutate status.json lifecycle fields. ` +
630
644
  `Artifact inputs: ${inputIds.length > 0 ? inputIds.join(', ') : 'manifest defaults'}; owned output IDs: ${outputIds.join('; ')}. ` +
631
- `Metrics attemptIds: ${attemptIds.join('; ')}. If the hook cannot identify a parallel stop, append a minimal { attemptId, outcome } receipt to .metrics-receipts.json; do not calculate duration.`
645
+ `Metrics attemptIds: ${attemptIds.join('; ')}. If the hook cannot identify a parallel stop, append a minimal { attemptId, outcome } receipt to .metrics-receipts.json; do not calculate duration. ${receiptPathClause()}`
632
646
  );
633
647
  }
634
648
  function blockedNotice(blockedIndex, agent) {
@@ -644,12 +658,22 @@ function noProgressNotice() {
644
658
  const pending = pendingStepIndexes().map((index) => steps[index].id || `step-${index}`);
645
659
  return `No schedulable step remains for slug "${slug}" (unsatisfied: ${pending.join(', ')}). Resume only via /task-continue ${slug}.`;
646
660
  }
661
+ function deferReason(wave, deferred) {
662
+ const sameAgent = deferred.some((index) => wave.some((chosen) => {
663
+ const left = getStepAgents(steps[chosen]);
664
+ return getStepAgents(steps[index]).some((agent) => left.includes(agent));
665
+ }));
666
+ if (sameAgent) return 'same agent already in the wave';
667
+ const missingScope = [...wave, ...deferred].some((index) => declaredScopes(steps[index]).length === 0);
668
+ if (missingScope) return 'writeScopes undeclared';
669
+ return 'writeScopes overlap';
670
+ }
647
671
  function dispatchReadyWave(prefixMessage) {
648
672
  const ready = computeReadySteps();
649
673
  if (ready.length === 0) return false;
650
674
  const { wave, deferred } = selectWave(ready);
651
675
  if (deferred.length > 0) {
652
- appendMetric({ type: 'parallel_conflict_deferred', at: now, stepIndex: wave[0], deferredStepIndexes: deferred, reason: 'ready set not conflict-free or writeScopes undeclared', source: 'hook', attributionConfidence: 'fallback' });
676
+ appendMetric({ type: 'parallel_conflict_deferred', at: now, stepIndex: wave[0], deferredStepIndexes: deferred, reason: deferReason(wave, deferred), source: 'hook', attributionConfidence: 'fallback' });
653
677
  }
654
678
  // Slot-filtered dispatch: only unsatisfied (stepIndex, agent) slots are invoked.
655
679
  const units = wave.flatMap((stepIndex) => unsatisfiedAgents(stepIndex).map((agent) => ({ stepIndex, agent })));
@@ -752,9 +776,12 @@ function metricsHandoff(agent) {
752
776
  return ' Metrics: use the supplied attemptId when available; for a parallel completion, write a minimal { attemptId, outcome } receipt to .metrics-receipts.json rather than relying on currentAgent. Do not calculate duration.';
753
777
  }
754
778
 
779
+ function receiptPathClause() {
780
+ return 'authoritativePaths are relative to the task folder (brief.md), not the repo root; put external files in evidencePaths.';
781
+ }
755
782
  function artifactHandoff(step, agent) {
756
783
  const inputIds = Array.isArray(step?.artifactInputIds) ? step.artifactInputIds.join(', ') : 'manifest defaults';
757
- return ` Artifact inputs: ${inputIds}; owned output ID: ${artifactOutputIdFor(step, agent)}. Bind the terminal receipt to the supplied attemptId.`;
784
+ return ` Artifact inputs: ${inputIds}; owned output ID: ${artifactOutputIdFor(step, agent)}. Bind the terminal receipt to the supplied attemptId. ${receiptPathClause()}`;
758
785
  }
759
786
 
760
787
  function handoffForAgent(agent, scope, step = null) {
@@ -772,7 +799,7 @@ function handoffForParallelStep(step) {
772
799
  `Invoke IN PARALLEL (one message, multiple Task calls): ${agents.join(' AND ')} for slug "${slug}". ` +
773
800
  `Each agent writes its artifact and owned receipt; the hook records parallelCompleted from stops. Do not mutate status.json lifecycle fields. ` +
774
801
  `Artifact inputs: ${Array.isArray(step.artifactInputIds) ? step.artifactInputIds.join(', ') : 'manifest defaults'}; owned output IDs: ${agents.map((agent) => `${agent}=${artifactOutputIdFor(step, agent)}`).join('; ')}. ` +
775
- `Metrics attemptIds: ${attemptIds.join('; ')}. If the hook cannot identify a parallel stop, append a minimal { attemptId, outcome } receipt to .metrics-receipts.json; do not calculate duration.`
802
+ `Metrics attemptIds: ${attemptIds.join('; ')}. If the hook cannot identify a parallel stop, append a minimal { attemptId, outcome } receipt to .metrics-receipts.json; do not calculate duration. ${receiptPathClause()}`
776
803
  );
777
804
  }
778
805
 
@@ -781,9 +808,35 @@ function hasGateAfter(agent, humanGates) {
781
808
  }
782
809
 
783
810
  function hasGateAfterStep(step, humanGates) {
811
+ if (!Array.isArray(humanGates) || !step) return false;
812
+ if (typeof step.id === 'string' && step.id.length > 0 && humanGates.includes(`after:${step.id}`)) return true;
784
813
  return getStepAgents(step).some((a) => hasGateAfter(a, humanGates));
785
814
  }
786
815
 
816
+ // A followup loop of the subagent that just finished arrives with no attemptId
817
+ // and no receipt for the attempt this same transition opened. That stop is not
818
+ // the next agent. A stop more than 15s later, still without a receipt, is a
819
+ // real missing receipt and must stall.
820
+ function isSchedulingEcho() {
821
+ if (typeof hookInput.attemptId === 'string' && hookInput.attemptId.length > 0) return false;
822
+ const entries = Object.entries(status.activeAttempts || {});
823
+ if (entries.length !== 1) return false;
824
+ const [attemptId, entry] = entries[0];
825
+ const previous = status.lastCompletedAttempt;
826
+ if (!previous || previous.completedAt !== entry.startedAt) return false;
827
+ const ageMs = Date.parse(now) - Date.parse(entry.startedAt);
828
+ if (!Number.isFinite(ageMs) || ageMs < 0 || ageMs > 15000) return false;
829
+ const previousJoined = Object.values(status.joinedSlots || {}).some((slot) => slot && slot.attemptId === previous.attemptId);
830
+ const linearAdvance = !isGraphMode() && typeof entry.stepIndex === 'number' && entry.stepIndex > 0;
831
+ if (!previousJoined && !linearAdvance) return false;
832
+ try {
833
+ const manifest = JSON.parse(fs.readFileSync(path.join(taskDir, 'artifact-manifest.json'), 'utf8'));
834
+ const artifacts = Array.isArray(manifest.artifacts) ? manifest.artifacts : [];
835
+ if (artifacts.some((item) => item && item.receipt && item.receipt.attemptId === attemptId)) return false;
836
+ } catch {}
837
+ return true;
838
+ }
839
+
787
840
  function legacyFlow() {
788
841
  if (status.phase === 'analysis') {
789
842
  process.stdout.write('{}');
@@ -1001,6 +1054,10 @@ if (pipelineParseError) {
1001
1054
  }
1002
1055
 
1003
1056
  steps = pipeline.steps || [];
1057
+ if (isSchedulingEcho()) {
1058
+ process.stdout.write('{}');
1059
+ process.exit(0);
1060
+ }
1004
1061
  const initialIdx = typeof status.pipelineIndex === 'number' ? status.pipelineIndex : 0;
1005
1062
  const initialStep = steps[initialIdx];
1006
1063
  const activeAttemptCountBeforeFinish = Object.keys(status.activeAttempts || {}).length;
@@ -87,7 +87,7 @@ Same JSON on Claude, Mavis, or OpenCode: `bash .<tool>/hooks/chain-team-phases.s
87
87
  ## Contracts
88
88
 
89
89
  - **Manifest field name:** receipts go in `artifacts[]`. Anything written under `entries` is ignored — the hook reads only `artifacts` and prints a dual-read warning naming the file. See `agent-team/agent-artifact-contracts.md` § Schema field name.
90
- - **Evidence paths:** `authoritativePaths[]` must be task-relative (`.ai.local/team/tasks/<slug>/…`). Put anything outside the task directory — e.g. `openspec/changes/**` — in `evidencePaths[]`.
90
+ - **Evidence paths:** `authoritativePaths[]` is relative to the task directory (`brief.md`). A repo-root path (`.ai.local/team/tasks/<slug>/brief.md`) is rejected. Put anything outside the task directory — e.g. `openspec/changes/**` — in `evidencePaths[]`.
91
91
  - Manifest schema: shared core `agent-team/agent-artifact-contracts.md`. Read it first; producers upsert only their IDs.
92
92
  - Metrics: append-only allowlisted events — `agent-team/agent-task-metrics.md`. Aggregate: `node node_modules/@bonesofspring/ai-rules/scripts/aggregate-agent-task-metrics.mjs --team-root .ai.local/team`.
93
93
  - Commit `.ai.local/team/` templates (and slugs if you want them in clones).
@@ -65,7 +65,7 @@ If a Sentry/Datadog (or similar) MCP is ready and the task is a production error
65
65
 
66
66
  - **Authoritative inputs:** read `.ai.local/team/tasks/<slug>/artifact-manifest.json` first; consume handoff `artifactInputIds` when supplied, otherwise consume the items in `manifest.artifacts[]` for brief/decomposition when present, failing check context, and prior validation/debug artifacts.
67
67
  - **Owned outputs:** `ci-report.md` plus any minimal fix paths; upsert only the entry in `manifest.artifacts[]` assigned by handoff (`artifactOutputId`; fallback `ci`) and preserve all foreign items in `manifest.artifacts[]`.
68
- - **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present.
68
+ - **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present. `authoritativePaths` are relative to the task folder (`brief.md`), not the repo root; put external files in `evidencePaths`.
69
69
  - **Shared state:** never create or mutate `status.json` or `metrics.json`; the orchestration runtime/hook owns lifecycle, gates, retries, attempts, and timestamps.
70
70
 
71
71
  Provide summary: failed check, root cause, files changed, validation commands run. Keep `fixApplied: true/false` (and verdict) in `ci-report.md` / the owned receipt summary — do not encode them by mutating `status.json`.
@@ -86,7 +86,7 @@ If a Sentry/Datadog (or similar) MCP is ready and the task is a production error
86
86
 
87
87
  - **Authoritative inputs:** read `.ai.local/team/tasks/<slug>/artifact-manifest.json` first; consume handoff `artifactInputIds` when supplied, otherwise consume the items in `manifest.artifacts[]` for brief/decomposition when present, failing evidence, and related prior artifacts.
88
88
  - **Owned outputs:** `debug-report.md` plus any minimal fix paths; upsert only the entry in `manifest.artifacts[]` assigned by handoff (`artifactOutputId`; fallback `debug`) and preserve all foreign items in `manifest.artifacts[]`.
89
- - **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present.
89
+ - **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present. `authoritativePaths` are relative to the task folder (`brief.md`), not the repo root; put external files in `evidencePaths`.
90
90
  - **Shared state:** never create or mutate `status.json` or `metrics.json`; the orchestration runtime/hook owns lifecycle, gates, retries, attempts, and timestamps.
91
91
 
92
92
  Handoff summary: root cause, recommended fix, files touched (if any). Keep `fixApplied: true/false` in `debug-report.md` / the owned receipt — do not mutate `status.json` for that signal.
@@ -142,5 +142,5 @@ Shipped browser split: Playwright MCP for e2e specs/selectors; Chrome DevTools M
142
142
  - **Authoritative inputs:** read `.ai.local/team/tasks/<slug>/artifact-manifest.json` first; consume handoff `artifactInputIds` when supplied, otherwise consume the items in `manifest.artifacts[]` for `brief.md`, `decomposition.md`, current scope, and applicable prior findings.
143
143
  - **Owned outputs:** `implementation.md` plus changed implementation/test paths; upsert only the entry in `manifest.artifacts[]` assigned by handoff (`artifactOutputId`; fallback `implementation`) and preserve all foreign items in `manifest.artifacts[]`.
144
144
  - **Commit hygiene:** never run `git commit` / `git push`. At the end of the turn return a `## Human commits` block: files touched + a proposed commit message, split by area (source / artifacts / docs) with the owning slug/ticket in the subject. See the consumer `commit-hygiene` local rule.
145
- - **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present.
145
+ - **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present. `authoritativePaths` are relative to the task folder (`brief.md`), not the repo root; put external files in `evidencePaths`.
146
146
  - **Shared state:** never create or mutate `status.json` or `metrics.json`; the orchestration runtime/hook owns lifecycle, gates, retries, attempts, and timestamps.
@@ -69,7 +69,7 @@ Load requestable rule `mcp-usage` when verifying third-party library APIs (Conte
69
69
 
70
70
  - **Authoritative inputs:** read `.ai.local/team/tasks/<slug>/artifact-manifest.json` first; consume handoff `artifactInputIds` when supplied, otherwise consume the items in `manifest.artifacts[]` for brief/decomposition and stack/version context from the repo.
71
71
  - **Owned outputs:** `migration-plan.md`; upsert only the entry in `manifest.artifacts[]` assigned by handoff (`artifactOutputId`; fallback `migration-plan`) and preserve all foreign items in `manifest.artifacts[]`.
72
- - **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present.
72
+ - **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present. `authoritativePaths` are relative to the task folder (`brief.md`), not the repo root; put external files in `evidencePaths`.
73
73
  - **Shared state:** never create or mutate `status.json` or `metrics.json`; the orchestration runtime/hook owns lifecycle, gates, retries, attempts, and timestamps.
74
74
 
75
75
  Hand off: orchestrator/hook runs human gate (if configured), then `feature-developer` executes phases from the plan.
@@ -68,7 +68,7 @@ If Chrome DevTools MCP is ready and the app is running, use it for console/netwo
68
68
 
69
69
  - **Authoritative inputs:** read `.ai.local/team/tasks/<slug>/artifact-manifest.json` first; consume handoff `artifactInputIds` when supplied, otherwise consume the items in `manifest.artifacts[]` for brief when present and the scoped git diff / routes under audit.
70
70
  - **Owned outputs:** `perf-report.md`; upsert only the entry in `manifest.artifacts[]` assigned by handoff (`artifactOutputId`; fallback `perf-report`) and preserve all foreign items in `manifest.artifacts[]`.
71
- - **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present.
71
+ - **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present. `authoritativePaths` are relative to the task folder (`brief.md`), not the repo root; put external files in `evidencePaths`.
72
72
  - **Shared state:** never create or mutate `status.json` or `metrics.json`; the orchestration runtime/hook owns lifecycle, gates, retries, attempts, and timestamps.
73
73
 
74
74
  For standalone `perf-audit` intent, suggest `/technical-retro` or a follow-up `/task` to implement fixes.
@@ -46,7 +46,7 @@ When the task is mostly e2e, prefer invoking the dedicated `playwright-test-plan
46
46
 
47
47
  - **Authoritative inputs:** read `.ai.local/team/tasks/<slug>/artifact-manifest.json` first; consume handoff `artifactInputIds` when supplied, otherwise consume the items in `manifest.artifacts[]` for brief/decomposition, reviewer notes when present, and prior implementation/validation artifacts.
48
48
  - **Owned outputs:** changed/added test paths (and any QA notes written under the slug dir); upsert only the entry in `manifest.artifacts[]` assigned by handoff (`artifactOutputId`; fallback `qa-tester`) and preserve all foreign items in `manifest.artifacts[]`.
49
- - **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present.
49
+ - **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present. `authoritativePaths` are relative to the task folder (`brief.md`), not the repo root; put external files in `evidencePaths`.
50
50
  - **Shared state:** never create or mutate `status.json` or `metrics.json`; the orchestration runtime/hook owns lifecycle, gates, retries, attempts, and timestamps.
51
51
 
52
52
  Provide summary:
@@ -68,7 +68,7 @@ Load requestable rule `mcp-usage` when verifying third-party library APIs (Conte
68
68
 
69
69
  - **Authoritative inputs:** read `.ai.local/team/tasks/<slug>/artifact-manifest.json` first; consume handoff `artifactInputIds` when supplied, otherwise consume the items in `manifest.artifacts[]` for brief/decomposition and applicable prior analysis artifacts.
70
70
  - **Owned outputs:** `architecture.md`; upsert only the entry in `manifest.artifacts[]` assigned by handoff (`artifactOutputId`; fallback `architecture`) and preserve all foreign items in `manifest.artifacts[]`.
71
- - **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present.
71
+ - **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present. `authoritativePaths` are relative to the task folder (`brief.md`), not the repo root; put external files in `evidencePaths`.
72
72
  - **Shared state:** never create or mutate `status.json` or `metrics.json`; the orchestration runtime/hook owns lifecycle, gates, retries, attempts, and timestamps.
73
73
 
74
74
  For `spike` intent needing user sign-off: emit receipt outcome `completed` (or `blocked` if design cannot proceed) and state the approval need in the receipt summary — the orchestration runtime/hook owns human-gate lifecycle (`awaiting_approval`), not this agent.
@@ -224,5 +224,5 @@ If the prompt/brief has a tracker URL (Linear/Jira/Notion/…) and that MCP is r
224
224
 
225
225
  - **Authoritative inputs:** read `.ai.local/team/tasks/<slug>/artifact-manifest.json` first; consume `pipeline.json`, the manifest routing entry, user-approved decisions, and any authoritative architecture/approval entries.
226
226
  - **Owned outputs:** `brief.md` and `decomposition.md` (plus `ux-design.md` when produced); upsert only the entry in `manifest.artifacts[]` assigned by handoff (`artifactOutputId`; fallback `analysis`) and preserve all foreign items in `manifest.artifacts[]`.
227
- - **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present.
227
+ - **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present. `authoritativePaths` are relative to the task folder (`brief.md`), not the repo root; put external files in `evidencePaths`.
228
228
  - **Shared state:** never create or mutate `status.json` or `metrics.json`; the orchestration runtime/hook owns lifecycle, gates, retries, attempts, and timestamps.
@@ -205,5 +205,5 @@ Return the routing receipt to the orchestrator. The orchestration runtime/hook e
205
205
 
206
206
  - **Authoritative inputs:** read `.ai.local/team/tasks/<slug>/artifact-manifest.json` first; consume the user request and any existing authoritative task/decision entries.
207
207
  - **Owned outputs:** `pipeline.json` and the routing entry in `manifest.artifacts[]`; upsert only the entry in `manifest.artifacts[]` assigned by handoff (`artifactOutputId`; fallback `routing`) and preserve all foreign items in `manifest.artifacts[]`.
208
- - **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present.
208
+ - **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present. `authoritativePaths` are relative to the task folder (`brief.md`), not the repo root; put external files in `evidencePaths`.
209
209
  - **Shared state:** never create or mutate `status.json` or `metrics.json`; the orchestration runtime/hook owns lifecycle, gates, retries, attempts, and timestamps.
@@ -61,7 +61,7 @@ Post-delivery: when behavior or public docs changed and `docs/specs/` is in play
61
61
 
62
62
  - **Authoritative inputs:** read `.ai.local/team/tasks/<slug>/artifact-manifest.json` first; consume handoff `artifactInputIds` when supplied, otherwise consume the items in `manifest.artifacts[]` for brief/decomposition and available architecture/migration/review artifacts.
63
63
  - **Owned outputs:** `documentation.md` (and any explicitly requested docs paths); upsert only the entry in `manifest.artifacts[]` assigned by handoff (`artifactOutputId`; fallback `documentation`) and preserve all foreign items in `manifest.artifacts[]`.
64
- - **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present.
64
+ - **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present. `authoritativePaths` are relative to the task folder (`brief.md`), not the repo root; put external files in `evidencePaths`.
65
65
  - **Shared state:** never create or mutate `status.json` or `metrics.json`; the orchestration runtime/hook owns lifecycle, gates, retries, attempts, and timestamps.
66
66
 
67
67
  Suggest `/technical-retro <slug>` when this is the final pipeline step.
@@ -36,7 +36,7 @@ Run affected unit tests from `app/` when feasible. Report files changed, command
36
36
 
37
37
  - **Authoritative inputs:** read `.ai.local/team/tasks/<slug>/artifact-manifest.json` first; consume handoff `artifactInputIds` when supplied, otherwise consume the items in `manifest.artifacts[]` for `unit-test-plan.md`, brief/decomposition when present, and target modules.
38
38
  - **Owned outputs:** generated/updated `*.spec.ts` / `*.spec.tsx` paths; upsert only the entry in `manifest.artifacts[]` assigned by handoff (`artifactOutputId`; fallback `unit-test-generator`) and preserve all foreign items in `manifest.artifacts[]`.
39
- - **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present.
39
+ - **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present. `authoritativePaths` are relative to the task folder (`brief.md`), not the repo root; put external files in `evidencePaths`.
40
40
  - **Shared state:** never create or mutate `status.json` or `metrics.json`; the orchestration runtime/hook owns lifecycle, gates, retries, attempts, and timestamps.
41
41
 
42
42
  ## Design guidance
@@ -37,7 +37,7 @@ Report root cause, files changed, validation result, and remaining risk.
37
37
 
38
38
  - **Authoritative inputs:** read `.ai.local/team/tasks/<slug>/artifact-manifest.json` first; consume handoff `artifactInputIds` when supplied, otherwise consume the items in `manifest.artifacts[]` for failing test evidence, `unit-test-plan.md` when present, and recent diff.
39
39
  - **Owned outputs:** healed `*.spec.ts` / `*.spec.tsx` paths (and minimal production fixes only when evidenced); upsert only the entry in `manifest.artifacts[]` assigned by handoff (`artifactOutputId`; fallback `unit-test-healer`) and preserve all foreign items in `manifest.artifacts[]`.
40
- - **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present.
40
+ - **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present. `authoritativePaths` are relative to the task folder (`brief.md`), not the repo root; put external files in `evidencePaths`.
41
41
  - **Shared state:** never create or mutate `status.json` or `metrics.json`; the orchestration runtime/hook owns lifecycle, gates, retries, attempts, and timestamps.
42
42
 
43
43
  ## Design guidance
@@ -57,7 +57,7 @@ Test titles in the plan use the project locale (as enforced by repo lint/convent
57
57
 
58
58
  - **Authoritative inputs:** read `.ai.local/team/tasks/<slug>/artifact-manifest.json` first; consume handoff `artifactInputIds` when supplied, otherwise consume the items in `manifest.artifacts[]` for brief/decomposition and target modules under `app/src/**`.
59
59
  - **Owned outputs:** `unit-test-plan.md`; upsert only the entry in `manifest.artifacts[]` assigned by handoff (`artifactOutputId`; fallback `unit-test-planner`) and preserve all foreign items in `manifest.artifacts[]`.
60
- - **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present.
60
+ - **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present. `authoritativePaths` are relative to the task folder (`brief.md`), not the repo root; put external files in `evidencePaths`.
61
61
  - **Shared state:** never create or mutate `status.json` or `metrics.json`; the orchestration runtime/hook owns lifecycle, gates, retries, attempts, and timestamps.
62
62
 
63
63
  Do not write `*.spec.ts` files — that is `unit-test-generator`'s job.
@@ -453,7 +453,21 @@ function endHumanGateIfResumed() {
453
453
  appendMetric({ type: 'human_gate_ended', at: now, gateStartedEventId: status.activeHumanGateEventId, source: 'hook', attributionConfidence: 'high' });
454
454
  delete status.activeHumanGateEventId;
455
455
  }
456
- function completeTaskMetrics() { appendMetric({ type: 'task_completed', at: now, outcome: status.state === 'completed' ? 'completed' : 'unknown', source: 'hook', attributionConfidence: 'high' }); }
456
+ function completeTaskMetrics() {
457
+ // Two hook processes can both enter completion before either writes the
458
+ // event. The metrics lock serializes them; the second sees the first write.
459
+ mutateMetrics((metrics) => {
460
+ if (metrics.events.some((event) => event && event.type === 'task_completed')) return;
461
+ metrics.events.push({
462
+ eventId: `${metrics.task.runId}:${Date.now()}:${Math.random().toString(16).slice(2)}`,
463
+ type: 'task_completed',
464
+ at: now,
465
+ outcome: status.state === 'completed' ? 'completed' : 'unknown',
466
+ source: 'hook',
467
+ attributionConfidence: 'high',
468
+ });
469
+ });
470
+ }
457
471
  function recordSkippedStep(step, stepIndex) {
458
472
  for (const agent of getStepAgents(step)) {
459
473
  const runId = status.metricsRunId || `${slug}-${Date.now()}-${Math.random().toString(16).slice(2)}`;
@@ -641,7 +655,7 @@ function handoffForWave(units, waveId) {
641
655
  `Invoke IN PARALLEL (one message, multiple Task calls): ${labels.join(' AND ')} for slug "${slug}"${waveId ? ` (waveId=${waveId})` : ''}. ` +
642
656
  `Each agent writes its artifact and owned receipt; the hook records slot joins from stops. Do not mutate status.json lifecycle fields. ` +
643
657
  `Artifact inputs: ${inputIds.length > 0 ? inputIds.join(', ') : 'manifest defaults'}; owned output IDs: ${outputIds.join('; ')}. ` +
644
- `Metrics attemptIds: ${attemptIds.join('; ')}. If the hook cannot identify a parallel stop, append a minimal { attemptId, outcome } receipt to .metrics-receipts.json; do not calculate duration.`
658
+ `Metrics attemptIds: ${attemptIds.join('; ')}. If the hook cannot identify a parallel stop, append a minimal { attemptId, outcome } receipt to .metrics-receipts.json; do not calculate duration. ${receiptPathClause()}`
645
659
  );
646
660
  }
647
661
  function blockedNotice(blockedIndex, agent) {
@@ -657,12 +671,22 @@ function noProgressNotice() {
657
671
  const pending = pendingStepIndexes().map((index) => steps[index].id || `step-${index}`);
658
672
  return `No schedulable step remains for slug "${slug}" (unsatisfied: ${pending.join(', ')}). Resume only via /task-continue ${slug}.`;
659
673
  }
674
+ function deferReason(wave, deferred) {
675
+ const sameAgent = deferred.some((index) => wave.some((chosen) => {
676
+ const left = getStepAgents(steps[chosen]);
677
+ return getStepAgents(steps[index]).some((agent) => left.includes(agent));
678
+ }));
679
+ if (sameAgent) return 'same agent already in the wave';
680
+ const missingScope = [...wave, ...deferred].some((index) => declaredScopes(steps[index]).length === 0);
681
+ if (missingScope) return 'writeScopes undeclared';
682
+ return 'writeScopes overlap';
683
+ }
660
684
  function dispatchReadyWave(prefixMessage) {
661
685
  const ready = computeReadySteps();
662
686
  if (ready.length === 0) return false;
663
687
  const { wave, deferred } = selectWave(ready);
664
688
  if (deferred.length > 0) {
665
- appendMetric({ type: 'parallel_conflict_deferred', at: now, stepIndex: wave[0], deferredStepIndexes: deferred, reason: 'ready set not conflict-free or writeScopes undeclared', source: 'hook', attributionConfidence: 'fallback' });
689
+ appendMetric({ type: 'parallel_conflict_deferred', at: now, stepIndex: wave[0], deferredStepIndexes: deferred, reason: deferReason(wave, deferred), source: 'hook', attributionConfidence: 'fallback' });
666
690
  }
667
691
  // Slot-filtered dispatch: only unsatisfied (stepIndex, agent) slots are invoked.
668
692
  const units = wave.flatMap((stepIndex) => unsatisfiedAgents(stepIndex).map((agent) => ({ stepIndex, agent })));
@@ -808,9 +832,12 @@ function metricsHandoff(agent) {
808
832
  return ' Metrics: use the supplied attemptId when available; for a parallel completion, write a minimal { attemptId, outcome } receipt to .metrics-receipts.json rather than relying on currentAgent. Do not calculate duration.';
809
833
  }
810
834
 
835
+ function receiptPathClause() {
836
+ return 'authoritativePaths are relative to the task folder (brief.md), not the repo root; put external files in evidencePaths.';
837
+ }
811
838
  function artifactHandoff(step, agent) {
812
839
  const inputIds = Array.isArray(step?.artifactInputIds) ? step.artifactInputIds.join(', ') : 'manifest defaults';
813
- return ` Artifact inputs: ${inputIds}; owned output ID: ${artifactOutputIdFor(step, agent)}. Bind the terminal receipt to the supplied attemptId.`;
840
+ return ` Artifact inputs: ${inputIds}; owned output ID: ${artifactOutputIdFor(step, agent)}. Bind the terminal receipt to the supplied attemptId. ${receiptPathClause()}`;
814
841
  }
815
842
 
816
843
  function handoffForAgent(agent, scope, step = null) {
@@ -828,7 +855,7 @@ function handoffForParallelStep(step) {
828
855
  `Invoke IN PARALLEL (one message, multiple Task calls): ${agents.join(' AND ')} for slug "${slug}". ` +
829
856
  `Each agent writes its artifact and owned receipt; the hook records parallelCompleted from stops. Do not mutate status.json lifecycle fields. ` +
830
857
  `Artifact inputs: ${Array.isArray(step.artifactInputIds) ? step.artifactInputIds.join(', ') : 'manifest defaults'}; owned output IDs: ${agents.map((agent) => `${agent}=${artifactOutputIdFor(step, agent)}`).join('; ')}. ` +
831
- `Metrics attemptIds: ${attemptIds.join('; ')}. If the hook cannot identify a parallel stop, append a minimal { attemptId, outcome } receipt to .metrics-receipts.json; do not calculate duration.`
858
+ `Metrics attemptIds: ${attemptIds.join('; ')}. If the hook cannot identify a parallel stop, append a minimal { attemptId, outcome } receipt to .metrics-receipts.json; do not calculate duration. ${receiptPathClause()}`
832
859
  );
833
860
  }
834
861
 
@@ -837,9 +864,35 @@ function hasGateAfter(agent, humanGates) {
837
864
  }
838
865
 
839
866
  function hasGateAfterStep(step, humanGates) {
867
+ if (!Array.isArray(humanGates) || !step) return false;
868
+ if (typeof step.id === 'string' && step.id.length > 0 && humanGates.includes(`after:${step.id}`)) return true;
840
869
  return getStepAgents(step).some((a) => hasGateAfter(a, humanGates));
841
870
  }
842
871
 
872
+ // A followup loop of the subagent that just finished arrives with no attemptId
873
+ // and no receipt for the attempt this same transition opened. That stop is not
874
+ // the next agent. A stop more than 15s later, still without a receipt, is a
875
+ // real missing receipt and must stall.
876
+ function isSchedulingEcho() {
877
+ if (typeof hookInput.attemptId === 'string' && hookInput.attemptId.length > 0) return false;
878
+ const entries = Object.entries(status.activeAttempts || {});
879
+ if (entries.length !== 1) return false;
880
+ const [attemptId, entry] = entries[0];
881
+ const previous = status.lastCompletedAttempt;
882
+ if (!previous || previous.completedAt !== entry.startedAt) return false;
883
+ const ageMs = Date.parse(now) - Date.parse(entry.startedAt);
884
+ if (!Number.isFinite(ageMs) || ageMs < 0 || ageMs > 15000) return false;
885
+ const previousJoined = Object.values(status.joinedSlots || {}).some((slot) => slot && slot.attemptId === previous.attemptId);
886
+ const linearAdvance = !isGraphMode() && typeof entry.stepIndex === 'number' && entry.stepIndex > 0;
887
+ if (!previousJoined && !linearAdvance) return false;
888
+ try {
889
+ const manifest = JSON.parse(fs.readFileSync(path.join(taskDir, 'artifact-manifest.json'), 'utf8'));
890
+ const artifacts = Array.isArray(manifest.artifacts) ? manifest.artifacts : [];
891
+ if (artifacts.some((item) => item && item.receipt && item.receipt.attemptId === attemptId)) return false;
892
+ } catch {}
893
+ return true;
894
+ }
895
+
843
896
  function legacyFlow() {
844
897
  if (status.phase === 'analysis') {
845
898
  process.stdout.write('{}');
@@ -1057,6 +1110,10 @@ if (pipelineParseError) {
1057
1110
  }
1058
1111
 
1059
1112
  steps = pipeline.steps || [];
1113
+ if (isSchedulingEcho()) {
1114
+ process.stdout.write('{}');
1115
+ process.exit(0);
1116
+ }
1060
1117
  const initialIdx = typeof status.pipelineIndex === 'number' ? status.pipelineIndex : 0;
1061
1118
  const initialStep = steps[initialIdx];
1062
1119
  const activeAttemptCountBeforeFinish = Object.keys(status.activeAttempts || {}).length;
@@ -88,7 +88,7 @@ Same JSON on Claude, Mavis, or OpenCode: `bash .<tool>/hooks/chain-team-phases.s
88
88
  ## Contracts
89
89
 
90
90
  - **Manifest field name:** receipts go in `artifacts[]`. Anything written under `entries` is ignored — the hook reads only `artifacts` and prints a dual-read warning naming the file. See `agent-team/agent-artifact-contracts.md` § Schema field name.
91
- - **Evidence paths:** `authoritativePaths[]` must be task-relative (`.ai.local/team/tasks/<slug>/…`). Put anything outside the task directory — e.g. `openspec/changes/**` — in `evidencePaths[]`.
91
+ - **Evidence paths:** `authoritativePaths[]` is relative to the task directory (`brief.md`). A repo-root path (`.ai.local/team/tasks/<slug>/brief.md`) is rejected. Put anything outside the task directory — e.g. `openspec/changes/**` — in `evidencePaths[]`.
92
92
  - Manifest schema: shared core `agent-team/agent-artifact-contracts.md`. Read it first; producers upsert only their IDs.
93
93
  - Metrics: append-only allowlisted events — `agent-team/agent-task-metrics.md`. Aggregate: `node node_modules/@bonesofspring/ai-rules/scripts/aggregate-agent-task-metrics.mjs --team-root .ai.local/team`.
94
94
  - Commit `.ai.local/team/` templates (and slugs if you want them in clones).
@@ -65,7 +65,7 @@ If a Sentry/Datadog (or similar) MCP is ready and the task is a production error
65
65
 
66
66
  - **Authoritative inputs:** read `.ai.local/team/tasks/<slug>/artifact-manifest.json` first; consume handoff `artifactInputIds` when supplied, otherwise consume the items in `manifest.artifacts[]` for brief/decomposition when present, failing check context, and prior validation/debug artifacts.
67
67
  - **Owned outputs:** `ci-report.md` plus any minimal fix paths; upsert only the entry in `manifest.artifacts[]` assigned by handoff (`artifactOutputId`; fallback `ci`) and preserve all foreign items in `manifest.artifacts[]`.
68
- - **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present.
68
+ - **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present. `authoritativePaths` are relative to the task folder (`brief.md`), not the repo root; put external files in `evidencePaths`.
69
69
  - **Shared state:** never create or mutate `status.json` or `metrics.json`; the orchestration runtime/hook owns lifecycle, gates, retries, attempts, and timestamps.
70
70
 
71
71
  Provide summary: failed check, root cause, files changed, validation commands run. Keep `fixApplied: true/false` (and verdict) in `ci-report.md` / the owned receipt summary — do not encode them by mutating `status.json`.
@@ -86,7 +86,7 @@ If a Sentry/Datadog (or similar) MCP is ready and the task is a production error
86
86
 
87
87
  - **Authoritative inputs:** read `.ai.local/team/tasks/<slug>/artifact-manifest.json` first; consume handoff `artifactInputIds` when supplied, otherwise consume the items in `manifest.artifacts[]` for brief/decomposition when present, failing evidence, and related prior artifacts.
88
88
  - **Owned outputs:** `debug-report.md` plus any minimal fix paths; upsert only the entry in `manifest.artifacts[]` assigned by handoff (`artifactOutputId`; fallback `debug`) and preserve all foreign items in `manifest.artifacts[]`.
89
- - **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present.
89
+ - **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present. `authoritativePaths` are relative to the task folder (`brief.md`), not the repo root; put external files in `evidencePaths`.
90
90
  - **Shared state:** never create or mutate `status.json` or `metrics.json`; the orchestration runtime/hook owns lifecycle, gates, retries, attempts, and timestamps.
91
91
 
92
92
  Handoff summary: root cause, recommended fix, files touched (if any). Keep `fixApplied: true/false` in `debug-report.md` / the owned receipt — do not mutate `status.json` for that signal.
@@ -124,5 +124,5 @@ Shipped browser split: Playwright MCP for e2e specs/selectors; Chrome DevTools M
124
124
 
125
125
  - **Authoritative inputs:** read `.ai.local/team/tasks/<slug>/artifact-manifest.json` first; consume handoff `artifactInputIds` when supplied, otherwise consume the items in `manifest.artifacts[]` for `brief.md`, `decomposition.md`, current scope, and applicable prior findings.
126
126
  - **Owned outputs:** `implementation.md` plus changed implementation/test paths; upsert only the entry in `manifest.artifacts[]` assigned by handoff (`artifactOutputId`; fallback `implementation`) and preserve all foreign items in `manifest.artifacts[]`.
127
- - **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present.
127
+ - **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present. `authoritativePaths` are relative to the task folder (`brief.md`), not the repo root; put external files in `evidencePaths`.
128
128
  - **Shared state:** never create or mutate `status.json` or `metrics.json`; the orchestration runtime/hook owns lifecycle, gates, retries, attempts, and timestamps.
@@ -69,7 +69,7 @@ Load requestable rule `mcp-usage` when verifying third-party library APIs (Conte
69
69
 
70
70
  - **Authoritative inputs:** read `.ai.local/team/tasks/<slug>/artifact-manifest.json` first; consume handoff `artifactInputIds` when supplied, otherwise consume the items in `manifest.artifacts[]` for brief/decomposition and stack/version context from the repo.
71
71
  - **Owned outputs:** `migration-plan.md`; upsert only the entry in `manifest.artifacts[]` assigned by handoff (`artifactOutputId`; fallback `migration-plan`) and preserve all foreign items in `manifest.artifacts[]`.
72
- - **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present.
72
+ - **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present. `authoritativePaths` are relative to the task folder (`brief.md`), not the repo root; put external files in `evidencePaths`.
73
73
  - **Shared state:** never create or mutate `status.json` or `metrics.json`; the orchestration runtime/hook owns lifecycle, gates, retries, attempts, and timestamps.
74
74
 
75
75
  Hand off: orchestrator/hook runs human gate (if configured), then `feature-developer` executes phases from the plan.
@@ -68,7 +68,7 @@ If Chrome DevTools MCP is ready and the app is running, use it for console/netwo
68
68
 
69
69
  - **Authoritative inputs:** read `.ai.local/team/tasks/<slug>/artifact-manifest.json` first; consume handoff `artifactInputIds` when supplied, otherwise consume the items in `manifest.artifacts[]` for brief when present and the scoped git diff / routes under audit.
70
70
  - **Owned outputs:** `perf-report.md`; upsert only the entry in `manifest.artifacts[]` assigned by handoff (`artifactOutputId`; fallback `perf-report`) and preserve all foreign items in `manifest.artifacts[]`.
71
- - **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present.
71
+ - **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present. `authoritativePaths` are relative to the task folder (`brief.md`), not the repo root; put external files in `evidencePaths`.
72
72
  - **Shared state:** never create or mutate `status.json` or `metrics.json`; the orchestration runtime/hook owns lifecycle, gates, retries, attempts, and timestamps.
73
73
 
74
74
  For standalone `perf-audit` intent, suggest `/technical-retro` or a follow-up `/task` to implement fixes.
@@ -46,7 +46,7 @@ When the task is mostly e2e, prefer invoking the dedicated `playwright-test-plan
46
46
 
47
47
  - **Authoritative inputs:** read `.ai.local/team/tasks/<slug>/artifact-manifest.json` first; consume handoff `artifactInputIds` when supplied, otherwise consume the items in `manifest.artifacts[]` for brief/decomposition, reviewer notes when present, and prior implementation/validation artifacts.
48
48
  - **Owned outputs:** changed/added test paths (and any QA notes written under the slug dir); upsert only the entry in `manifest.artifacts[]` assigned by handoff (`artifactOutputId`; fallback `qa-tester`) and preserve all foreign items in `manifest.artifacts[]`.
49
- - **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present.
49
+ - **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present. `authoritativePaths` are relative to the task folder (`brief.md`), not the repo root; put external files in `evidencePaths`.
50
50
  - **Shared state:** never create or mutate `status.json` or `metrics.json`; the orchestration runtime/hook owns lifecycle, gates, retries, attempts, and timestamps.
51
51
 
52
52
  Provide summary:
@@ -68,7 +68,7 @@ Load requestable rule `mcp-usage` when verifying third-party library APIs (Conte
68
68
 
69
69
  - **Authoritative inputs:** read `.ai.local/team/tasks/<slug>/artifact-manifest.json` first; consume handoff `artifactInputIds` when supplied, otherwise consume the items in `manifest.artifacts[]` for brief/decomposition and applicable prior analysis artifacts.
70
70
  - **Owned outputs:** `architecture.md`; upsert only the entry in `manifest.artifacts[]` assigned by handoff (`artifactOutputId`; fallback `architecture`) and preserve all foreign items in `manifest.artifacts[]`.
71
- - **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present.
71
+ - **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present. `authoritativePaths` are relative to the task folder (`brief.md`), not the repo root; put external files in `evidencePaths`.
72
72
  - **Shared state:** never create or mutate `status.json` or `metrics.json`; the orchestration runtime/hook owns lifecycle, gates, retries, attempts, and timestamps.
73
73
 
74
74
  For `spike` intent needing user sign-off: emit receipt outcome `completed` (or `blocked` if design cannot proceed) and state the approval need in the receipt summary — the orchestration runtime/hook owns human-gate lifecycle (`awaiting_approval`), not this agent.
@@ -217,5 +217,5 @@ If the prompt/brief has a tracker URL (Linear/Jira/Notion/…) and that MCP is r
217
217
 
218
218
  - **Authoritative inputs:** read `.ai.local/team/tasks/<slug>/artifact-manifest.json` first; consume `pipeline.json`, the manifest routing entry, user-approved decisions, and any authoritative architecture/approval entries.
219
219
  - **Owned outputs:** `brief.md` and `decomposition.md` (plus `ux-design.md` when produced); upsert only the entry in `manifest.artifacts[]` assigned by handoff (`artifactOutputId`; fallback `analysis`) and preserve all foreign items in `manifest.artifacts[]`.
220
- - **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present.
220
+ - **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present. `authoritativePaths` are relative to the task folder (`brief.md`), not the repo root; put external files in `evidencePaths`.
221
221
  - **Shared state:** never create or mutate `status.json` or `metrics.json`; the orchestration runtime/hook owns lifecycle, gates, retries, attempts, and timestamps.
@@ -204,5 +204,5 @@ Return the routing receipt to the orchestrator. The orchestration runtime/hook e
204
204
 
205
205
  - **Authoritative inputs:** read `.ai.local/team/tasks/<slug>/artifact-manifest.json` first; consume the user request and any existing authoritative task/decision entries.
206
206
  - **Owned outputs:** `pipeline.json` and the routing entry in `manifest.artifacts[]`; upsert only the entry in `manifest.artifacts[]` assigned by handoff (`artifactOutputId`; fallback `routing`) and preserve all foreign items in `manifest.artifacts[]`.
207
- - **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present.
207
+ - **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present. `authoritativePaths` are relative to the task folder (`brief.md`), not the repo root; put external files in `evidencePaths`.
208
208
  - **Shared state:** never create or mutate `status.json` or `metrics.json`; the orchestration runtime/hook owns lifecycle, gates, retries, attempts, and timestamps.
@@ -61,7 +61,7 @@ Post-delivery: when behavior or public docs changed and `docs/specs/` is in play
61
61
 
62
62
  - **Authoritative inputs:** read `.ai.local/team/tasks/<slug>/artifact-manifest.json` first; consume handoff `artifactInputIds` when supplied, otherwise consume the items in `manifest.artifacts[]` for brief/decomposition and available architecture/migration/review artifacts.
63
63
  - **Owned outputs:** `documentation.md` (and any explicitly requested docs paths); upsert only the entry in `manifest.artifacts[]` assigned by handoff (`artifactOutputId`; fallback `documentation`) and preserve all foreign items in `manifest.artifacts[]`.
64
- - **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present.
64
+ - **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present. `authoritativePaths` are relative to the task folder (`brief.md`), not the repo root; put external files in `evidencePaths`.
65
65
  - **Shared state:** never create or mutate `status.json` or `metrics.json`; the orchestration runtime/hook owns lifecycle, gates, retries, attempts, and timestamps.
66
66
 
67
67
  Suggest `/technical-retro <slug>` when this is the final pipeline step.
@@ -36,7 +36,7 @@ Run affected unit tests from repository root when feasible. Report files changed
36
36
 
37
37
  - **Authoritative inputs:** read `.ai.local/team/tasks/<slug>/artifact-manifest.json` first; consume handoff `artifactInputIds` when supplied, otherwise consume the items in `manifest.artifacts[]` for `unit-test-plan.md`, brief/decomposition when present, and target modules.
38
38
  - **Owned outputs:** generated/updated `*.spec.ts` / `*.spec.ts` paths; upsert only the entry in `manifest.artifacts[]` assigned by handoff (`artifactOutputId`; fallback `unit-test-generator`) and preserve all foreign items in `manifest.artifacts[]`.
39
- - **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present.
39
+ - **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present. `authoritativePaths` are relative to the task folder (`brief.md`), not the repo root; put external files in `evidencePaths`.
40
40
  - **Shared state:** never create or mutate `status.json` or `metrics.json`; the orchestration runtime/hook owns lifecycle, gates, retries, attempts, and timestamps.
41
41
 
42
42
  ## Design guidance
@@ -37,7 +37,7 @@ Report root cause, files changed, validation result, and remaining risk.
37
37
 
38
38
  - **Authoritative inputs:** read `.ai.local/team/tasks/<slug>/artifact-manifest.json` first; consume handoff `artifactInputIds` when supplied, otherwise consume the items in `manifest.artifacts[]` for failing test evidence, `unit-test-plan.md` when present, and recent diff.
39
39
  - **Owned outputs:** healed `*.spec.ts` / `*.spec.ts` paths (and minimal production fixes only when evidenced); upsert only the entry in `manifest.artifacts[]` assigned by handoff (`artifactOutputId`; fallback `unit-test-healer`) and preserve all foreign items in `manifest.artifacts[]`.
40
- - **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present.
40
+ - **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present. `authoritativePaths` are relative to the task folder (`brief.md`), not the repo root; put external files in `evidencePaths`.
41
41
  - **Shared state:** never create or mutate `status.json` or `metrics.json`; the orchestration runtime/hook owns lifecycle, gates, retries, attempts, and timestamps.
42
42
 
43
43
  ## Design guidance