@bonesofspring/ai-rules 0.2.33 → 0.2.34

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 (396) hide show
  1. package/docs/PRESET-CONTRIBUTION.md +2 -2
  2. package/package.json +4 -1
  3. package/presets/_shared/README.md +1 -1
  4. package/presets/_shared/core/agent-team/agent-artifact-contracts.md +22 -0
  5. package/presets/_shared/core/agent-team/agent-task-metrics.md +12 -1
  6. package/presets/_shared/core/agent-team/agent-team-intake.md +1 -1
  7. package/presets/_shared/core/agent-team/agent-team-orchestrator.md +18 -4
  8. package/presets/_shared/core/agent-team/plan-graph.md +28 -0
  9. package/presets/_shared/core/agent-team/task-classification.md +2 -0
  10. package/presets/claude/android-kotlin/agents/task-analyst.md +1 -1
  11. package/presets/claude/android-kotlin/agents/task-router.md +10 -0
  12. package/presets/claude/android-kotlin/commands/task-continue.md +1 -1
  13. package/presets/claude/android-kotlin/commands/task.md +1 -1
  14. package/presets/claude/android-kotlin/hooks/chain-team-phases.sh +369 -16
  15. package/presets/claude/android-kotlin/rules/tooling-and-review/agent-team-intake.md +1 -1
  16. package/presets/claude/android-kotlin/rules/tooling-and-review/agent-team-orchestrator.md +12 -1
  17. package/presets/claude/android-kotlin/team/README.md +4 -1
  18. package/presets/claude/go/agents/task-analyst.md +1 -1
  19. package/presets/claude/go/agents/task-router.md +10 -0
  20. package/presets/claude/go/commands/task-continue.md +1 -1
  21. package/presets/claude/go/commands/task.md +1 -1
  22. package/presets/claude/go/hooks/chain-team-phases.sh +367 -16
  23. package/presets/claude/go/rules/tooling-and-review/agent-team-intake.md +1 -1
  24. package/presets/claude/go/rules/tooling-and-review/agent-team-orchestrator.md +12 -1
  25. package/presets/claude/go/team/README.md +4 -1
  26. package/presets/claude/ios-swift/agents/task-analyst.md +1 -1
  27. package/presets/claude/ios-swift/agents/task-router.md +10 -0
  28. package/presets/claude/ios-swift/commands/task-continue.md +1 -1
  29. package/presets/claude/ios-swift/commands/task.md +1 -1
  30. package/presets/claude/ios-swift/hooks/chain-team-phases.sh +369 -16
  31. package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-intake.md +1 -1
  32. package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-orchestrator.md +12 -1
  33. package/presets/claude/ios-swift/team/README.md +4 -1
  34. package/presets/claude/java/agents/task-analyst.md +1 -1
  35. package/presets/claude/java/agents/task-router.md +10 -0
  36. package/presets/claude/java/commands/task-continue.md +1 -1
  37. package/presets/claude/java/commands/task.md +1 -1
  38. package/presets/claude/java/hooks/chain-team-phases.sh +367 -16
  39. package/presets/claude/java/rules/tooling-and-review/agent-team-intake.md +1 -1
  40. package/presets/claude/java/rules/tooling-and-review/agent-team-orchestrator.md +12 -1
  41. package/presets/claude/java/team/README.md +4 -1
  42. package/presets/claude/mcp-ts/agents/task-analyst.md +1 -1
  43. package/presets/claude/mcp-ts/agents/task-router.md +10 -0
  44. package/presets/claude/mcp-ts/commands/task-continue.md +1 -1
  45. package/presets/claude/mcp-ts/commands/task.md +1 -1
  46. package/presets/claude/mcp-ts/hooks/chain-team-phases.sh +367 -16
  47. package/presets/claude/mcp-ts/rules/tooling-and-review/agent-team-intake.md +1 -1
  48. package/presets/claude/mcp-ts/rules/tooling-and-review/agent-team-orchestrator.md +12 -1
  49. package/presets/claude/mcp-ts/team/README.md +4 -1
  50. package/presets/claude/next/agents/task-analyst.md +1 -1
  51. package/presets/claude/next/agents/task-router.md +10 -0
  52. package/presets/claude/next/commands/task-continue.md +1 -1
  53. package/presets/claude/next/commands/task.md +1 -1
  54. package/presets/claude/next/hooks/chain-team-phases.sh +369 -16
  55. package/presets/claude/next/rules/tooling-and-review/agent-team-intake.md +1 -1
  56. package/presets/claude/next/rules/tooling-and-review/agent-team-orchestrator.md +12 -1
  57. package/presets/claude/next/team/README.md +4 -1
  58. package/presets/claude/next/team/fixtures/artifact-manifest.example.json +1 -1
  59. package/presets/claude/next/team/fixtures/feature-parallel.json +84 -0
  60. package/presets/claude/nuxt/agents/task-analyst.md +1 -1
  61. package/presets/claude/nuxt/agents/task-router.md +10 -0
  62. package/presets/claude/nuxt/commands/task-continue.md +1 -1
  63. package/presets/claude/nuxt/commands/task.md +1 -1
  64. package/presets/claude/nuxt/hooks/chain-team-phases.sh +369 -16
  65. package/presets/claude/nuxt/rules/tooling-and-review/agent-team-intake.md +1 -1
  66. package/presets/claude/nuxt/rules/tooling-and-review/agent-team-orchestrator.md +12 -1
  67. package/presets/claude/nuxt/team/README.md +4 -1
  68. package/presets/claude/nuxt/team/fixtures/artifact-manifest.example.json +1 -1
  69. package/presets/claude/php-hexagonal/agents/task-analyst.md +1 -1
  70. package/presets/claude/php-hexagonal/agents/task-router.md +10 -0
  71. package/presets/claude/php-hexagonal/commands/task-continue.md +1 -1
  72. package/presets/claude/php-hexagonal/commands/task.md +1 -1
  73. package/presets/claude/php-hexagonal/hooks/chain-team-phases.sh +367 -16
  74. package/presets/claude/php-hexagonal/rules/tooling-and-review/agent-team-intake.md +1 -1
  75. package/presets/claude/php-hexagonal/rules/tooling-and-review/agent-team-orchestrator.md +12 -1
  76. package/presets/claude/php-hexagonal/team/README.md +4 -1
  77. package/presets/claude/php-laravel/agents/task-analyst.md +1 -1
  78. package/presets/claude/php-laravel/agents/task-router.md +10 -0
  79. package/presets/claude/php-laravel/commands/task-continue.md +1 -1
  80. package/presets/claude/php-laravel/commands/task.md +1 -1
  81. package/presets/claude/php-laravel/hooks/chain-team-phases.sh +367 -16
  82. package/presets/claude/php-laravel/rules/tooling-and-review/agent-team-intake.md +1 -1
  83. package/presets/claude/php-laravel/rules/tooling-and-review/agent-team-orchestrator.md +12 -1
  84. package/presets/claude/php-laravel/team/README.md +4 -1
  85. package/presets/claude/svelte/agents/task-analyst.md +1 -1
  86. package/presets/claude/svelte/agents/task-router.md +10 -0
  87. package/presets/claude/svelte/commands/task-continue.md +1 -1
  88. package/presets/claude/svelte/commands/task.md +1 -1
  89. package/presets/claude/svelte/hooks/chain-team-phases.sh +369 -16
  90. package/presets/claude/svelte/rules/tooling-and-review/agent-team-intake.md +1 -1
  91. package/presets/claude/svelte/rules/tooling-and-review/agent-team-orchestrator.md +12 -1
  92. package/presets/claude/svelte/team/README.md +4 -1
  93. package/presets/claude/svelte/team/fixtures/artifact-manifest.example.json +1 -1
  94. package/presets/cursor/android-kotlin/agents/task-analyst.md +1 -1
  95. package/presets/cursor/android-kotlin/agents/task-router.md +10 -0
  96. package/presets/cursor/android-kotlin/commands/task-continue.md +1 -1
  97. package/presets/cursor/android-kotlin/commands/task.md +1 -1
  98. package/presets/cursor/android-kotlin/hooks/chain-team-phases.sh +369 -16
  99. package/presets/cursor/android-kotlin/rules/agent-team-intake.mdc +1 -1
  100. package/presets/cursor/android-kotlin/rules/agent-team-orchestrator.mdc +12 -1
  101. package/presets/cursor/android-kotlin/team/README.md +4 -1
  102. package/presets/cursor/go/agents/task-analyst.md +1 -1
  103. package/presets/cursor/go/agents/task-router.md +10 -0
  104. package/presets/cursor/go/commands/task-continue.md +1 -1
  105. package/presets/cursor/go/commands/task.md +1 -1
  106. package/presets/cursor/go/hooks/chain-team-phases.sh +367 -16
  107. package/presets/cursor/go/rules/agent-team-intake.mdc +1 -1
  108. package/presets/cursor/go/rules/agent-team-orchestrator.mdc +12 -1
  109. package/presets/cursor/go/team/README.md +4 -1
  110. package/presets/cursor/ios-swift/agents/task-analyst.md +1 -1
  111. package/presets/cursor/ios-swift/agents/task-router.md +10 -0
  112. package/presets/cursor/ios-swift/commands/task-continue.md +1 -1
  113. package/presets/cursor/ios-swift/commands/task.md +1 -1
  114. package/presets/cursor/ios-swift/hooks/chain-team-phases.sh +369 -16
  115. package/presets/cursor/ios-swift/rules/agent-team-intake.mdc +1 -1
  116. package/presets/cursor/ios-swift/rules/agent-team-orchestrator.mdc +12 -1
  117. package/presets/cursor/ios-swift/team/README.md +4 -1
  118. package/presets/cursor/java/agents/task-analyst.md +1 -1
  119. package/presets/cursor/java/agents/task-router.md +10 -0
  120. package/presets/cursor/java/commands/task-continue.md +1 -1
  121. package/presets/cursor/java/commands/task.md +1 -1
  122. package/presets/cursor/java/hooks/chain-team-phases.sh +367 -16
  123. package/presets/cursor/java/rules/agent-team-intake.mdc +1 -1
  124. package/presets/cursor/java/rules/agent-team-orchestrator.mdc +12 -1
  125. package/presets/cursor/java/team/README.md +4 -1
  126. package/presets/cursor/mcp-ts/agents/task-analyst.md +1 -1
  127. package/presets/cursor/mcp-ts/agents/task-router.md +10 -0
  128. package/presets/cursor/mcp-ts/commands/task-continue.md +1 -1
  129. package/presets/cursor/mcp-ts/commands/task.md +1 -1
  130. package/presets/cursor/mcp-ts/hooks/chain-team-phases.sh +367 -16
  131. package/presets/cursor/mcp-ts/rules/agent-team-intake.mdc +1 -1
  132. package/presets/cursor/mcp-ts/rules/agent-team-orchestrator.mdc +12 -1
  133. package/presets/cursor/mcp-ts/team/README.md +4 -1
  134. package/presets/cursor/next/agents/task-analyst.md +1 -1
  135. package/presets/cursor/next/agents/task-router.md +10 -0
  136. package/presets/cursor/next/commands/task-continue.md +1 -1
  137. package/presets/cursor/next/commands/task.md +1 -1
  138. package/presets/cursor/next/hooks/chain-team-phases.sh +369 -16
  139. package/presets/cursor/next/rules/agent-team-intake.mdc +1 -1
  140. package/presets/cursor/next/rules/agent-team-orchestrator.mdc +12 -1
  141. package/presets/cursor/next/team/README.md +4 -1
  142. package/presets/cursor/next/team/fixtures/artifact-manifest.example.json +1 -1
  143. package/presets/cursor/next/team/fixtures/feature-parallel.json +84 -0
  144. package/presets/cursor/nuxt/agents/task-analyst.md +1 -1
  145. package/presets/cursor/nuxt/agents/task-router.md +10 -0
  146. package/presets/cursor/nuxt/commands/task-continue.md +1 -1
  147. package/presets/cursor/nuxt/commands/task.md +1 -1
  148. package/presets/cursor/nuxt/hooks/chain-team-phases.sh +369 -16
  149. package/presets/cursor/nuxt/rules/agent-team-intake.mdc +1 -1
  150. package/presets/cursor/nuxt/rules/agent-team-orchestrator.mdc +12 -1
  151. package/presets/cursor/nuxt/team/README.md +4 -1
  152. package/presets/cursor/nuxt/team/fixtures/artifact-manifest.example.json +1 -1
  153. package/presets/cursor/php-hexagonal/agents/task-analyst.md +1 -1
  154. package/presets/cursor/php-hexagonal/agents/task-router.md +10 -0
  155. package/presets/cursor/php-hexagonal/commands/task-continue.md +1 -1
  156. package/presets/cursor/php-hexagonal/commands/task.md +1 -1
  157. package/presets/cursor/php-hexagonal/hooks/chain-team-phases.sh +367 -16
  158. package/presets/cursor/php-hexagonal/rules/agent-team-intake.mdc +1 -1
  159. package/presets/cursor/php-hexagonal/rules/agent-team-orchestrator.mdc +12 -1
  160. package/presets/cursor/php-hexagonal/team/README.md +4 -1
  161. package/presets/cursor/php-laravel/agents/task-analyst.md +1 -1
  162. package/presets/cursor/php-laravel/agents/task-router.md +10 -0
  163. package/presets/cursor/php-laravel/commands/task-continue.md +1 -1
  164. package/presets/cursor/php-laravel/commands/task.md +1 -1
  165. package/presets/cursor/php-laravel/hooks/chain-team-phases.sh +367 -16
  166. package/presets/cursor/php-laravel/rules/agent-team-intake.mdc +1 -1
  167. package/presets/cursor/php-laravel/rules/agent-team-orchestrator.mdc +12 -1
  168. package/presets/cursor/php-laravel/team/README.md +4 -1
  169. package/presets/cursor/svelte/agents/task-analyst.md +1 -1
  170. package/presets/cursor/svelte/agents/task-router.md +10 -0
  171. package/presets/cursor/svelte/commands/task-continue.md +1 -1
  172. package/presets/cursor/svelte/commands/task.md +1 -1
  173. package/presets/cursor/svelte/hooks/chain-team-phases.sh +369 -16
  174. package/presets/cursor/svelte/rules/agent-team-intake.mdc +1 -1
  175. package/presets/cursor/svelte/rules/agent-team-orchestrator.mdc +12 -1
  176. package/presets/cursor/svelte/team/README.md +4 -1
  177. package/presets/cursor/svelte/team/fixtures/artifact-manifest.example.json +1 -1
  178. package/presets/mavis/android-kotlin/adapter-map.json +1 -1
  179. package/presets/mavis/android-kotlin/agents/task-analyst.md +1 -1
  180. package/presets/mavis/android-kotlin/agents/task-router.md +10 -0
  181. package/presets/mavis/android-kotlin/commands/task-continue.md +1 -1
  182. package/presets/mavis/android-kotlin/commands/task.md +1 -1
  183. package/presets/mavis/android-kotlin/hooks/chain-team-phases.sh +369 -16
  184. package/presets/mavis/android-kotlin/rules/agent-team-intake.md +1 -1
  185. package/presets/mavis/android-kotlin/rules/agent-team-orchestrator.md +18 -4
  186. package/presets/mavis/android-kotlin/team/README.md +4 -1
  187. package/presets/mavis/go/adapter-map.json +1 -1
  188. package/presets/mavis/go/agents/task-analyst.md +1 -1
  189. package/presets/mavis/go/agents/task-router.md +10 -0
  190. package/presets/mavis/go/commands/task-continue.md +1 -1
  191. package/presets/mavis/go/commands/task.md +1 -1
  192. package/presets/mavis/go/hooks/chain-team-phases.sh +367 -16
  193. package/presets/mavis/go/rules/agent-team-intake.md +1 -1
  194. package/presets/mavis/go/rules/agent-team-orchestrator.md +18 -4
  195. package/presets/mavis/go/team/README.md +4 -1
  196. package/presets/mavis/ios-swift/adapter-map.json +1 -1
  197. package/presets/mavis/ios-swift/agents/task-analyst.md +1 -1
  198. package/presets/mavis/ios-swift/agents/task-router.md +10 -0
  199. package/presets/mavis/ios-swift/commands/task-continue.md +1 -1
  200. package/presets/mavis/ios-swift/commands/task.md +1 -1
  201. package/presets/mavis/ios-swift/hooks/chain-team-phases.sh +369 -16
  202. package/presets/mavis/ios-swift/rules/agent-team-intake.md +1 -1
  203. package/presets/mavis/ios-swift/rules/agent-team-orchestrator.md +18 -4
  204. package/presets/mavis/ios-swift/team/README.md +4 -1
  205. package/presets/mavis/java/adapter-map.json +1 -1
  206. package/presets/mavis/java/agents/task-analyst.md +1 -1
  207. package/presets/mavis/java/agents/task-router.md +10 -0
  208. package/presets/mavis/java/commands/task-continue.md +1 -1
  209. package/presets/mavis/java/commands/task.md +1 -1
  210. package/presets/mavis/java/hooks/chain-team-phases.sh +367 -16
  211. package/presets/mavis/java/rules/agent-team-intake.md +1 -1
  212. package/presets/mavis/java/rules/agent-team-orchestrator.md +18 -4
  213. package/presets/mavis/java/team/README.md +4 -1
  214. package/presets/mavis/mcp-ts/adapter-map.json +1 -1
  215. package/presets/mavis/mcp-ts/agents/task-analyst.md +1 -1
  216. package/presets/mavis/mcp-ts/agents/task-router.md +10 -0
  217. package/presets/mavis/mcp-ts/commands/task-continue.md +1 -1
  218. package/presets/mavis/mcp-ts/commands/task.md +1 -1
  219. package/presets/mavis/mcp-ts/hooks/chain-team-phases.sh +367 -16
  220. package/presets/mavis/mcp-ts/rules/agent-team-intake.md +1 -1
  221. package/presets/mavis/mcp-ts/rules/agent-team-orchestrator.md +18 -4
  222. package/presets/mavis/mcp-ts/team/README.md +4 -1
  223. package/presets/mavis/next/adapter-map.json +9 -1
  224. package/presets/mavis/next/agents/task-analyst.md +1 -1
  225. package/presets/mavis/next/agents/task-router.md +10 -0
  226. package/presets/mavis/next/commands/task-continue.md +1 -1
  227. package/presets/mavis/next/commands/task.md +1 -1
  228. package/presets/mavis/next/hooks/chain-team-phases.sh +369 -16
  229. package/presets/mavis/next/rules/agent-team-intake.md +1 -1
  230. package/presets/mavis/next/rules/agent-team-orchestrator.md +18 -4
  231. package/presets/mavis/next/team/README.md +4 -1
  232. package/presets/mavis/next/team/fixtures/artifact-manifest.example.json +1 -1
  233. package/presets/mavis/next/team/fixtures/feature-parallel.json +84 -0
  234. package/presets/mavis/nuxt/adapter-map.json +1 -1
  235. package/presets/mavis/nuxt/agents/task-analyst.md +1 -1
  236. package/presets/mavis/nuxt/agents/task-router.md +10 -0
  237. package/presets/mavis/nuxt/commands/task-continue.md +1 -1
  238. package/presets/mavis/nuxt/commands/task.md +1 -1
  239. package/presets/mavis/nuxt/hooks/chain-team-phases.sh +369 -16
  240. package/presets/mavis/nuxt/rules/agent-team-intake.md +1 -1
  241. package/presets/mavis/nuxt/rules/agent-team-orchestrator.md +18 -4
  242. package/presets/mavis/nuxt/team/README.md +4 -1
  243. package/presets/mavis/nuxt/team/fixtures/artifact-manifest.example.json +1 -1
  244. package/presets/mavis/php-hexagonal/adapter-map.json +1 -1
  245. package/presets/mavis/php-hexagonal/agents/task-analyst.md +1 -1
  246. package/presets/mavis/php-hexagonal/agents/task-router.md +10 -0
  247. package/presets/mavis/php-hexagonal/commands/task-continue.md +1 -1
  248. package/presets/mavis/php-hexagonal/commands/task.md +1 -1
  249. package/presets/mavis/php-hexagonal/hooks/chain-team-phases.sh +367 -16
  250. package/presets/mavis/php-hexagonal/rules/agent-team-intake.md +1 -1
  251. package/presets/mavis/php-hexagonal/rules/agent-team-orchestrator.md +18 -4
  252. package/presets/mavis/php-hexagonal/team/README.md +4 -1
  253. package/presets/mavis/php-laravel/adapter-map.json +1 -1
  254. package/presets/mavis/php-laravel/agents/task-analyst.md +1 -1
  255. package/presets/mavis/php-laravel/agents/task-router.md +10 -0
  256. package/presets/mavis/php-laravel/commands/task-continue.md +1 -1
  257. package/presets/mavis/php-laravel/commands/task.md +1 -1
  258. package/presets/mavis/php-laravel/hooks/chain-team-phases.sh +367 -16
  259. package/presets/mavis/php-laravel/rules/agent-team-intake.md +1 -1
  260. package/presets/mavis/php-laravel/rules/agent-team-orchestrator.md +18 -4
  261. package/presets/mavis/php-laravel/team/README.md +4 -1
  262. package/presets/mavis/svelte/adapter-map.json +1 -1
  263. package/presets/mavis/svelte/agents/task-analyst.md +1 -1
  264. package/presets/mavis/svelte/agents/task-router.md +10 -0
  265. package/presets/mavis/svelte/commands/task-continue.md +1 -1
  266. package/presets/mavis/svelte/commands/task.md +1 -1
  267. package/presets/mavis/svelte/hooks/chain-team-phases.sh +369 -16
  268. package/presets/mavis/svelte/rules/agent-team-intake.md +1 -1
  269. package/presets/mavis/svelte/rules/agent-team-orchestrator.md +18 -4
  270. package/presets/mavis/svelte/team/README.md +4 -1
  271. package/presets/mavis/svelte/team/fixtures/artifact-manifest.example.json +1 -1
  272. package/presets/opencode/android-kotlin/adapter-map.json +1 -1
  273. package/presets/opencode/android-kotlin/agents/task-analyst.md +1 -1
  274. package/presets/opencode/android-kotlin/agents/task-router.md +10 -0
  275. package/presets/opencode/android-kotlin/commands/task-continue.md +1 -1
  276. package/presets/opencode/android-kotlin/commands/task.md +1 -1
  277. package/presets/opencode/android-kotlin/hooks/chain-team-phases.sh +369 -16
  278. package/presets/opencode/android-kotlin/rules/agent-team-intake.md +1 -1
  279. package/presets/opencode/android-kotlin/rules/agent-team-orchestrator.md +18 -4
  280. package/presets/opencode/android-kotlin/team/README.md +4 -1
  281. package/presets/opencode/go/adapter-map.json +1 -1
  282. package/presets/opencode/go/agents/task-analyst.md +1 -1
  283. package/presets/opencode/go/agents/task-router.md +10 -0
  284. package/presets/opencode/go/commands/task-continue.md +1 -1
  285. package/presets/opencode/go/commands/task.md +1 -1
  286. package/presets/opencode/go/hooks/chain-team-phases.sh +367 -16
  287. package/presets/opencode/go/rules/agent-team-intake.md +1 -1
  288. package/presets/opencode/go/rules/agent-team-orchestrator.md +18 -4
  289. package/presets/opencode/go/team/README.md +4 -1
  290. package/presets/opencode/ios-swift/adapter-map.json +1 -1
  291. package/presets/opencode/ios-swift/agents/task-analyst.md +1 -1
  292. package/presets/opencode/ios-swift/agents/task-router.md +10 -0
  293. package/presets/opencode/ios-swift/commands/task-continue.md +1 -1
  294. package/presets/opencode/ios-swift/commands/task.md +1 -1
  295. package/presets/opencode/ios-swift/hooks/chain-team-phases.sh +369 -16
  296. package/presets/opencode/ios-swift/rules/agent-team-intake.md +1 -1
  297. package/presets/opencode/ios-swift/rules/agent-team-orchestrator.md +18 -4
  298. package/presets/opencode/ios-swift/team/README.md +4 -1
  299. package/presets/opencode/java/adapter-map.json +1 -1
  300. package/presets/opencode/java/agents/task-analyst.md +1 -1
  301. package/presets/opencode/java/agents/task-router.md +10 -0
  302. package/presets/opencode/java/commands/task-continue.md +1 -1
  303. package/presets/opencode/java/commands/task.md +1 -1
  304. package/presets/opencode/java/hooks/chain-team-phases.sh +367 -16
  305. package/presets/opencode/java/rules/agent-team-intake.md +1 -1
  306. package/presets/opencode/java/rules/agent-team-orchestrator.md +18 -4
  307. package/presets/opencode/java/team/README.md +4 -1
  308. package/presets/opencode/mcp-ts/adapter-map.json +1 -1
  309. package/presets/opencode/mcp-ts/agents/task-analyst.md +1 -1
  310. package/presets/opencode/mcp-ts/agents/task-router.md +10 -0
  311. package/presets/opencode/mcp-ts/commands/task-continue.md +1 -1
  312. package/presets/opencode/mcp-ts/commands/task.md +1 -1
  313. package/presets/opencode/mcp-ts/hooks/chain-team-phases.sh +367 -16
  314. package/presets/opencode/mcp-ts/rules/agent-team-intake.md +1 -1
  315. package/presets/opencode/mcp-ts/rules/agent-team-orchestrator.md +18 -4
  316. package/presets/opencode/mcp-ts/team/README.md +4 -1
  317. package/presets/opencode/next/adapter-map.json +9 -1
  318. package/presets/opencode/next/agents/task-analyst.md +1 -1
  319. package/presets/opencode/next/agents/task-router.md +10 -0
  320. package/presets/opencode/next/commands/task-continue.md +1 -1
  321. package/presets/opencode/next/commands/task.md +1 -1
  322. package/presets/opencode/next/hooks/chain-team-phases.sh +369 -16
  323. package/presets/opencode/next/rules/agent-team-intake.md +1 -1
  324. package/presets/opencode/next/rules/agent-team-orchestrator.md +18 -4
  325. package/presets/opencode/next/team/README.md +4 -1
  326. package/presets/opencode/next/team/fixtures/artifact-manifest.example.json +1 -1
  327. package/presets/opencode/next/team/fixtures/feature-parallel.json +84 -0
  328. package/presets/opencode/nuxt/adapter-map.json +1 -1
  329. package/presets/opencode/nuxt/agents/task-analyst.md +1 -1
  330. package/presets/opencode/nuxt/agents/task-router.md +10 -0
  331. package/presets/opencode/nuxt/commands/task-continue.md +1 -1
  332. package/presets/opencode/nuxt/commands/task.md +1 -1
  333. package/presets/opencode/nuxt/hooks/chain-team-phases.sh +369 -16
  334. package/presets/opencode/nuxt/rules/agent-team-intake.md +1 -1
  335. package/presets/opencode/nuxt/rules/agent-team-orchestrator.md +18 -4
  336. package/presets/opencode/nuxt/team/README.md +4 -1
  337. package/presets/opencode/nuxt/team/fixtures/artifact-manifest.example.json +1 -1
  338. package/presets/opencode/php-hexagonal/adapter-map.json +1 -1
  339. package/presets/opencode/php-hexagonal/agents/task-analyst.md +1 -1
  340. package/presets/opencode/php-hexagonal/agents/task-router.md +10 -0
  341. package/presets/opencode/php-hexagonal/commands/task-continue.md +1 -1
  342. package/presets/opencode/php-hexagonal/commands/task.md +1 -1
  343. package/presets/opencode/php-hexagonal/hooks/chain-team-phases.sh +367 -16
  344. package/presets/opencode/php-hexagonal/rules/agent-team-intake.md +1 -1
  345. package/presets/opencode/php-hexagonal/rules/agent-team-orchestrator.md +18 -4
  346. package/presets/opencode/php-hexagonal/team/README.md +4 -1
  347. package/presets/opencode/php-laravel/adapter-map.json +1 -1
  348. package/presets/opencode/php-laravel/agents/task-analyst.md +1 -1
  349. package/presets/opencode/php-laravel/agents/task-router.md +10 -0
  350. package/presets/opencode/php-laravel/commands/task-continue.md +1 -1
  351. package/presets/opencode/php-laravel/commands/task.md +1 -1
  352. package/presets/opencode/php-laravel/hooks/chain-team-phases.sh +367 -16
  353. package/presets/opencode/php-laravel/rules/agent-team-intake.md +1 -1
  354. package/presets/opencode/php-laravel/rules/agent-team-orchestrator.md +18 -4
  355. package/presets/opencode/php-laravel/team/README.md +4 -1
  356. package/presets/opencode/svelte/adapter-map.json +1 -1
  357. package/presets/opencode/svelte/agents/task-analyst.md +1 -1
  358. package/presets/opencode/svelte/agents/task-router.md +10 -0
  359. package/presets/opencode/svelte/commands/task-continue.md +1 -1
  360. package/presets/opencode/svelte/commands/task.md +1 -1
  361. package/presets/opencode/svelte/hooks/chain-team-phases.sh +369 -16
  362. package/presets/opencode/svelte/rules/agent-team-intake.md +1 -1
  363. package/presets/opencode/svelte/rules/agent-team-orchestrator.md +18 -4
  364. package/presets/opencode/svelte/team/README.md +4 -1
  365. package/presets/opencode/svelte/team/fixtures/artifact-manifest.example.json +1 -1
  366. package/scripts/_lib/agent-write-scopes.json +27 -0
  367. package/scripts/check-parallel-plan.sh +353 -0
  368. package/scripts/check-preset-prompt-persistence.sh +51 -24
  369. package/scripts/check-preset-structure.sh +2 -0
  370. package/scripts/check-step-graph-contract.sh +123 -0
  371. package/scripts/fixtures/cli-golden/claude/next.json +10 -9
  372. package/scripts/fixtures/cli-golden/cursor/next.json +10 -9
  373. package/scripts/fixtures/cli-golden/mavis/android-kotlin.json +8 -8
  374. package/scripts/fixtures/cli-golden/mavis/go.json +8 -8
  375. package/scripts/fixtures/cli-golden/mavis/ios-swift.json +8 -8
  376. package/scripts/fixtures/cli-golden/mavis/java.json +8 -8
  377. package/scripts/fixtures/cli-golden/mavis/mcp-ts.json +8 -8
  378. package/scripts/fixtures/cli-golden/mavis/next.json +10 -9
  379. package/scripts/fixtures/cli-golden/mavis/nuxt.json +9 -9
  380. package/scripts/fixtures/cli-golden/mavis/php-hexagonal.json +8 -8
  381. package/scripts/fixtures/cli-golden/mavis/php-laravel.json +8 -8
  382. package/scripts/fixtures/cli-golden/mavis/svelte.json +9 -9
  383. package/scripts/fixtures/cli-golden/opencode/android-kotlin.json +8 -8
  384. package/scripts/fixtures/cli-golden/opencode/go.json +8 -8
  385. package/scripts/fixtures/cli-golden/opencode/ios-swift.json +8 -8
  386. package/scripts/fixtures/cli-golden/opencode/java.json +8 -8
  387. package/scripts/fixtures/cli-golden/opencode/mcp-ts.json +8 -8
  388. package/scripts/fixtures/cli-golden/opencode/next.json +10 -9
  389. package/scripts/fixtures/cli-golden/opencode/nuxt.json +9 -9
  390. package/scripts/fixtures/cli-golden/opencode/php-hexagonal.json +8 -8
  391. package/scripts/fixtures/cli-golden/opencode/php-laravel.json +8 -8
  392. package/scripts/fixtures/cli-golden/opencode/svelte.json +9 -9
  393. package/scripts/test-agent-task-metrics-hooks.mjs +167 -0
  394. package/scripts/test-chain-team-phases-coverage.mjs +129 -0
  395. package/scripts/test-parallel-plan-fixtures.mjs +173 -0
  396. package/scripts/test-preset-prompt-persistence-fixtures.mjs +58 -1
@@ -1055,4 +1055,171 @@ for (const hook of hooks) {
1055
1055
  }
1056
1056
  }
1057
1057
 
1058
+
1059
+ // ---------------------------------------------------------------------------
1060
+ // Graph-mode failure isolation (AC-6):
1061
+ // (a) unattributable stop -> deterministic fallback binding + repair metric
1062
+ // (b) unattributable stop that cannot be bound -> resume handoff, never {}
1063
+ // (c) blocked producer -> independent ready sibling still dispatches
1064
+ // ---------------------------------------------------------------------------
1065
+ for (const hook of hooks) {
1066
+ // (a) payload agent disambiguates one of two in-flight attempts.
1067
+ const rootA = fs.mkdtempSync(path.join(packageDirectory, '.graph-repair-'));
1068
+ try {
1069
+ const platform = platformFromHook(hook);
1070
+ const runId = 'graph-repair-run';
1071
+ const alphaId = `${runId}:step-0:alpha:attempt-1`;
1072
+ const betaId = `${runId}:step-1:beta:attempt-1`;
1073
+ const taskDirectory = writeTask(
1074
+ rootA,
1075
+ hook,
1076
+ 'graph-repair',
1077
+ {
1078
+ autoChain: true,
1079
+ steps: [
1080
+ { id: 'T1', agent: 'alpha', dependsOn: [], writeScopes: ['.ai.local/team/tasks/<slug>/a.md'], artifactOutputId: 'oa' },
1081
+ { id: 'T2', agent: 'beta', dependsOn: [], writeScopes: ['.ai.local/team/tasks/<slug>/b.md'], artifactOutputId: 'ob' },
1082
+ ],
1083
+ },
1084
+ {
1085
+ slug: 'graph-repair',
1086
+ intent: 'feature',
1087
+ pipelineIndex: 0,
1088
+ currentAgent: 'alpha',
1089
+ phase: 'executing',
1090
+ state: 'completed',
1091
+ activeAttempts: {
1092
+ [alphaId]: { agent: 'alpha', stepIndex: 0, attempt: 1, startedAt: '2026-01-01T00:00:00.000Z' },
1093
+ [betaId]: { agent: 'beta', stepIndex: 1, attempt: 1, startedAt: '2026-01-01T00:00:00.000Z' },
1094
+ },
1095
+ metricsRunId: runId,
1096
+ },
1097
+ {
1098
+ schemaVersion: 1,
1099
+ task: { runId, slug: 'graph-repair', preset: 'ai-rules', stack: 'test', platform, intent: 'feature', profile: 'test' },
1100
+ events: [{ eventId: `${runId}:task_started`, type: 'task_started', at: '2026-01-01T00:00:00.000Z' }],
1101
+ },
1102
+ );
1103
+ execFileSync('bash', [hook], {
1104
+ cwd: rootA,
1105
+ encoding: 'utf8',
1106
+ input: JSON.stringify({ status: 'completed', agentType: 'alpha' }),
1107
+ });
1108
+ const eventsAfter = readJson(path.join(taskDirectory, 'metrics.json')).events;
1109
+ assert.ok(
1110
+ eventsAfter.some((event) => event.type === 'parallel_attribution_repair'),
1111
+ `${hook}: unattributable stop did not emit the repair metric`,
1112
+ );
1113
+ const alphaTerminal = eventsAfter.find((event) => event.type === 'attempt_finished' && event.attemptId === alphaId);
1114
+ assert.ok(alphaTerminal, `${hook}: repaired attempt did not emit attempt_finished`);
1115
+ assert.equal(alphaTerminal.attributionConfidence, 'fallback', `${hook}: repaired attempt must be marked fallback`);
1116
+ const statusA = readJson(path.join(taskDirectory, 'status.json'));
1117
+ assert.ok(!statusA.activeAttempts[alphaId], `${hook}: repaired attempt stayed active`);
1118
+ assert.ok(statusA.activeAttempts[betaId], `${hook}: the sibling attempt was disturbed`);
1119
+ } finally {
1120
+ fs.rmSync(rootA, { recursive: true, force: true });
1121
+ }
1122
+
1123
+ // (b) no payload id and no unique binding -> resume handoff, never bare {}.
1124
+ const rootB = fs.mkdtempSync(path.join(packageDirectory, '.graph-resume-'));
1125
+ try {
1126
+ const platform = platformFromHook(hook);
1127
+ const runId = 'graph-resume-run';
1128
+ const alphaId = `${runId}:step-0:alpha:attempt-1`;
1129
+ const betaId = `${runId}:step-0:beta:attempt-1`;
1130
+ const taskDirectory = writeTask(
1131
+ rootB,
1132
+ hook,
1133
+ 'graph-resume',
1134
+ {
1135
+ autoChain: true,
1136
+ steps: [
1137
+ { id: 'T1', agent: ['alpha', 'beta'], parallel: true, dependsOn: [], writeScopes: ['.ai.local/team/tasks/<slug>/a.md', '.ai.local/team/tasks/<slug>/b.md'], artifactOutputIds: { alpha: 'oa', beta: 'ob' } },
1138
+ ],
1139
+ },
1140
+ {
1141
+ slug: 'graph-resume',
1142
+ intent: 'feature',
1143
+ pipelineIndex: 0,
1144
+ currentAgent: 'nobody',
1145
+ phase: 'executing',
1146
+ state: 'completed',
1147
+ activeAttempts: {
1148
+ [alphaId]: { agent: 'alpha', stepIndex: 0, attempt: 1, startedAt: '2026-01-01T00:00:00.000Z' },
1149
+ [betaId]: { agent: 'beta', stepIndex: 0, attempt: 1, startedAt: '2026-01-01T00:00:00.000Z' },
1150
+ },
1151
+ metricsRunId: runId,
1152
+ },
1153
+ {
1154
+ schemaVersion: 1,
1155
+ task: { runId, slug: 'graph-resume', preset: 'ai-rules', stack: 'test', platform, intent: 'feature', profile: 'test' },
1156
+ events: [{ eventId: `${runId}:task_started`, type: 'task_started', at: '2026-01-01T00:00:00.000Z' }],
1157
+ },
1158
+ );
1159
+ const parsed = JSON.parse(
1160
+ execFileSync('bash', [hook], { cwd: rootB, encoding: 'utf8', input: JSON.stringify({ status: 'completed' }) }),
1161
+ );
1162
+ assert.ok(parsed.followup_message, `${hook}: unattributable stop returned a bare {} (silent stall)`);
1163
+ assert.match(parsed.followup_message, /could not be attributed/, `${hook}: resume handoff missing the deterministic instruction`);
1164
+ const statusB = readJson(path.join(taskDirectory, 'status.json'));
1165
+ assert.ok(statusB.activeAttempts[alphaId] && statusB.activeAttempts[betaId], `${hook}: resume path consumed attempts`);
1166
+ const terminals = readJson(path.join(taskDirectory, 'metrics.json')).events.filter(
1167
+ (event) => event.type === 'attempt_finished' && (event.attemptId === alphaId || event.attemptId === betaId),
1168
+ );
1169
+ assert.equal(terminals.length, 0, `${hook}: resume path emitted a terminal metric`);
1170
+ } finally {
1171
+ fs.rmSync(rootB, { recursive: true, force: true });
1172
+ }
1173
+
1174
+ // (c) blocked step with an independent ready sibling: the sibling still dispatches.
1175
+ const rootC = fs.mkdtempSync(path.join(packageDirectory, '.graph-blocked-'));
1176
+ try {
1177
+ const platform = platformFromHook(hook);
1178
+ const runId = 'graph-blocked-run';
1179
+ const blockerId = `${runId}:step-0:blocker:attempt-1`;
1180
+ const taskDirectory = writeTask(
1181
+ rootC,
1182
+ hook,
1183
+ 'graph-blocked',
1184
+ {
1185
+ autoChain: true,
1186
+ steps: [
1187
+ { id: 'T1', agent: 'blocker', dependsOn: [], writeScopes: ['.ai.local/team/tasks/<slug>/x.md'], artifactOutputId: 'ox' },
1188
+ { id: 'T2', agent: 'sibling', dependsOn: [], writeScopes: ['.ai.local/team/tasks/<slug>/x.md'], artifactOutputId: 'oy' },
1189
+ ],
1190
+ },
1191
+ {
1192
+ slug: 'graph-blocked',
1193
+ intent: 'feature',
1194
+ pipelineIndex: 0,
1195
+ currentAgent: 'blocker',
1196
+ phase: 'executing',
1197
+ state: 'blocked',
1198
+ activeAttempts: {
1199
+ [blockerId]: { agent: 'blocker', stepIndex: 0, attempt: 1, startedAt: '2026-01-01T00:00:00.000Z' },
1200
+ },
1201
+ metricsRunId: runId,
1202
+ },
1203
+ {
1204
+ schemaVersion: 1,
1205
+ task: { runId, slug: 'graph-blocked', preset: 'ai-rules', stack: 'test', platform, intent: 'feature', profile: 'test' },
1206
+ events: [{ eventId: `${runId}:task_started`, type: 'task_started', at: '2026-01-01T00:00:00.000Z' }],
1207
+ },
1208
+ );
1209
+ const parsed = JSON.parse(
1210
+ execFileSync('bash', [hook], { cwd: rootC, encoding: 'utf8', input: JSON.stringify({ status: 'completed', attemptId: blockerId }) }),
1211
+ );
1212
+ assert.match(parsed.followup_message || '', /is blocked; proceeding with independent ready steps/, `${hook}: blocked step did not dispatch independent siblings`);
1213
+ assert.match(parsed.followup_message || '', /sibling/, `${hook}: sibling was not dispatched after the block`);
1214
+ const statusC = readJson(path.join(taskDirectory, 'status.json'));
1215
+ assert.ok(Array.isArray(statusC.blockedSteps) && statusC.blockedSteps.includes(0), `${hook}: blocked step was not recorded in blockedSteps`);
1216
+ assert.ok(
1217
+ Object.values(statusC.activeAttempts).some((entry) => entry.agent === 'sibling'),
1218
+ `${hook}: sibling attempt was not activated`,
1219
+ );
1220
+ } finally {
1221
+ fs.rmSync(rootC, { recursive: true, force: true });
1222
+ }
1223
+ }
1224
+
1058
1225
  console.log(`Verified retry, parallel, skip, gate, manifest-reconcile, lock-race, hook-init platform, and aggregation lifecycle in ${hooks.length} hooks.`);
@@ -690,4 +690,133 @@ for (const hook of hooks) {
690
690
  }
691
691
  }
692
692
 
693
+
694
+ // ---------------------------------------------------------------------------
695
+ // Test 11 — graph-mode ready queue + wave join + advance (AC-2 / AC-3 / AC-5).
696
+ // Without `dependsOn` the hook is in legacy linear mode; this exercises the
697
+ // graph path end to end: ready wave -> slot joins -> join -> advance -> complete.
698
+ // ---------------------------------------------------------------------------
699
+ function setStateValue(taskDirectory, state) {
700
+ const statusPath = path.join(taskDirectory, 'status.json');
701
+ writeJson(statusPath, { ...readJson(statusPath), state });
702
+ }
703
+
704
+ for (const hook of hooks) {
705
+ const root = fs.mkdtempSync(path.join(packageDirectory, '.graph-queue-'));
706
+ try {
707
+ const runId = 'graph-queue-run';
708
+ const slugName = 'graph-queue';
709
+ const platform = platformFor(hook);
710
+ const starterAttemptId = `${runId}:step-0:starter:attempt-1`;
711
+ const { taskDirectory } = writeTask(
712
+ root,
713
+ hook,
714
+ slugName,
715
+ {
716
+ autoChain: true,
717
+ steps: [
718
+ { id: 'T1', taskIds: ['T1'], agent: 'starter', writeScopes: ['.ai.local/team/tasks/<slug>/starter.md'], artifactOutputId: 'starter-out' },
719
+ { id: 'T2', taskIds: ['T2'], agent: 'alpha', dependsOn: ['T1'], writeScopes: ['.ai.local/team/tasks/<slug>/alpha.md'], artifactOutputId: 'alpha-out' },
720
+ { id: 'T3', taskIds: ['T3'], agent: 'beta', dependsOn: ['T1'], writeScopes: ['.ai.local/team/tasks/<slug>/beta.md'], artifactOutputId: 'beta-out' },
721
+ { id: 'T4', taskIds: ['T4'], agent: 'gamma', dependsOn: ['T2', 'T3'], writeScopes: ['.ai.local/team/tasks/<slug>/gamma.md'], artifactOutputId: 'gamma-out' },
722
+ ],
723
+ },
724
+ {
725
+ slug: slugName,
726
+ intent: 'feature',
727
+ pipelineIndex: 0,
728
+ currentAgent: 'starter',
729
+ phase: 'executing',
730
+ state: 'completed',
731
+ activeAttempts: {
732
+ [starterAttemptId]: { agent: 'starter', stepIndex: 0, attempt: 1, startedAt: todayIso, parallelGroupId: null },
733
+ },
734
+ metricsRunId: runId,
735
+ },
736
+ {
737
+ schemaVersion: 1,
738
+ task: { runId, slug: slugName, preset: 'ai-rules', stack: 'test', platform, intent: 'feature', profile: 'test' },
739
+ events: [{ eventId: `${runId}:task_started`, type: 'task_started', at: todayIso }],
740
+ },
741
+ );
742
+
743
+ const waveHandoff = JSON.parse(invokeHook(hook, root, starterAttemptId)).followup_message;
744
+ let status = readJson(path.join(taskDirectory, 'status.json'));
745
+ assert.deepEqual(status.waveSteps, [1, 2], `${hook}: ready wave must schedule both same-level steps`);
746
+ assert.match(waveHandoff, /waveId=/, `${hook}: multi-step wave handoff must carry waveId`);
747
+ assert.ok(status.joinedSlots && status.joinedSlots['0:starter'], `${hook}: finished slot was not recorded`);
748
+ const alphaAttemptId = Object.keys(status.activeAttempts).find((id) => status.activeAttempts[id].agent === 'alpha');
749
+ const betaAttemptId = Object.keys(status.activeAttempts).find((id) => status.activeAttempts[id].agent === 'beta');
750
+ assert.ok(alphaAttemptId && betaAttemptId, `${hook}: wave did not activate both steps`);
751
+ assert.match(waveHandoff, new RegExp(`alpha=${alphaAttemptId}`), `${hook}: alpha attempt id missing from wave handoff`);
752
+ assert.match(waveHandoff, new RegExp(`beta=${betaAttemptId}`), `${hook}: beta attempt id missing from wave handoff`);
753
+
754
+ setStateValue(taskDirectory, 'completed');
755
+ assert.deepEqual(JSON.parse(invokeHook(hook, root, alphaAttemptId)), {}, `${hook}: wave advanced before the join completed`);
756
+ status = readJson(path.join(taskDirectory, 'status.json'));
757
+ assert.ok(status.joinedSlots['1:alpha'], `${hook}: partial wave slot was not recorded`);
758
+
759
+ setStateValue(taskDirectory, 'completed');
760
+ const gammaHandoff = JSON.parse(invokeHook(hook, root, betaAttemptId)).followup_message;
761
+ assert.match(gammaHandoff, /gamma/, `${hook}: joined wave did not dispatch the dependent step`);
762
+ status = readJson(path.join(taskDirectory, 'status.json'));
763
+ const gammaAttemptId = Object.keys(status.activeAttempts).find((id) => status.activeAttempts[id].agent === 'gamma');
764
+ assert.ok(gammaAttemptId, `${hook}: dependent step attempt was not activated`);
765
+
766
+ setStateValue(taskDirectory, 'completed');
767
+ const finalHandoff = JSON.parse(invokeHook(hook, root, gammaAttemptId)).followup_message;
768
+ assert.match(finalHandoff, /Pipeline complete/, `${hook}: graph pipeline did not complete`);
769
+
770
+ const types = readJson(path.join(taskDirectory, 'metrics.json')).events.map((event) => event.type);
771
+ assert.ok(types.includes('parallel_wave_started'), `${hook}: parallel_wave_started metric was not emitted`);
772
+ assert.ok(types.includes('step_joined'), `${hook}: step_joined metric was not emitted`);
773
+ } finally {
774
+ fs.rmSync(root, { recursive: true, force: true });
775
+ }
776
+ }
777
+
778
+ // ---------------------------------------------------------------------------
779
+ // Test 12 — no-`dependsOn` regression guard: a linear pipeline must never enter
780
+ // graph mode (no waveSteps / joinedSlots) and must advance exactly as before.
781
+ // ---------------------------------------------------------------------------
782
+ for (const hook of hooks) {
783
+ const root = fs.mkdtempSync(path.join(packageDirectory, '.linear-guard-'));
784
+ try {
785
+ const runId = 'linear-guard-run';
786
+ const slugName = 'linear-guard';
787
+ const platform = platformFor(hook);
788
+ const attemptId = `${runId}:step-0:task-analyst:attempt-1`;
789
+ const { taskDirectory } = writeTask(
790
+ root,
791
+ hook,
792
+ slugName,
793
+ { autoChain: true, steps: [{ agent: 'task-analyst', label: 'Analyze' }, { agent: 'feature-developer', label: 'Develop' }] },
794
+ {
795
+ slug: slugName,
796
+ intent: 'feature',
797
+ pipelineIndex: 0,
798
+ currentAgent: 'task-analyst',
799
+ phase: 'executing',
800
+ state: 'completed',
801
+ activeAttempts: {
802
+ [attemptId]: { agent: 'task-analyst', stepIndex: 0, attempt: 1, startedAt: todayIso, parallelGroupId: null },
803
+ },
804
+ metricsRunId: runId,
805
+ },
806
+ {
807
+ schemaVersion: 1,
808
+ task: { runId, slug: slugName, preset: 'ai-rules', stack: 'test', platform, intent: 'feature', profile: 'standard' },
809
+ events: [{ eventId: `${runId}:task_started`, type: 'task_started', at: todayIso }],
810
+ },
811
+ );
812
+ const handoff = JSON.parse(invokeHook(hook, root, attemptId)).followup_message;
813
+ assert.match(handoff, /feature-developer/, `${hook}: linear advance broke`);
814
+ const status = readJson(path.join(taskDirectory, 'status.json'));
815
+ assert.equal(status.waveSteps, undefined, `${hook}: linear pipeline must not set waveSteps`);
816
+ assert.equal(status.joinedSlots, undefined, `${hook}: linear pipeline must not set joinedSlots`);
817
+ } finally {
818
+ fs.rmSync(root, { recursive: true, force: true });
819
+ }
820
+ }
821
+
693
822
  console.log(`Verified openspec-author handoff, qa-tester handoff, pipeline misparse blocking, legacy fallback, writeStatus durability, stale attemptId rejection, end_human_gate idempotency, terminal-gate completion, stale-lock recovery, and slug-traversal rejection in ${hooks.length} hooks.`);
@@ -0,0 +1,173 @@
1
+ #!/usr/bin/env node
2
+ // Fixtures for check-parallel-plan.sh (reliable-subagent-parallelism, AC-1 / AC-7).
3
+ //
4
+ // Scenario: copy `presets/` to a temp root, point the check at it via
5
+ // `AI_RULES_PRESETS_ROOT`, then assert:
6
+ // 1. the clean copy PASSes the default scan
7
+ // 2. `--pipeline` PASSes the shipped `feature-parallel.json`
8
+ // 3. mutating that fixture to overlap two same-wave `writeScopes` FAILs (C1)
9
+ // 4. mutating it so two same-wave steps share an agent FAILs (C2)
10
+ // 5. mutating it to carry an unresolved `dependsOn` FAILs (check 1)
11
+ // 6. removing the parallel step + the dependsOn edges FAILs (non-vacuity)
12
+ //
13
+ // A separate fixture file (like `test-plan-contract-fixtures.mjs`) because the
14
+ // check is a shell + Python script; the real preset tree is never mutated.
15
+
16
+ import assert from 'node:assert/strict';
17
+ import { execFileSync } from 'node:child_process';
18
+ import fs from 'node:fs';
19
+ import os from 'node:os';
20
+ import path from 'node:path';
21
+ import { fileURLToPath } from 'node:url';
22
+
23
+ const scriptDirectory = path.dirname(fileURLToPath(import.meta.url));
24
+ const packageDirectory = path.resolve(scriptDirectory, '..');
25
+ const checkScript = path.join(scriptDirectory, 'check-parallel-plan.sh');
26
+
27
+ function runCheck(args, env) {
28
+ try {
29
+ return { exitCode: 0, stdout: execFileSync('bash', [checkScript, ...args], { env, encoding: 'utf8' }) };
30
+ } catch (error) {
31
+ return { exitCode: error.status ?? 1, stdout: `${error.stdout ?? ''}${error.stderr ?? ''}` };
32
+ }
33
+ }
34
+
35
+ function copyPresetsDir() {
36
+ const tempRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'parallel-plan-'));
37
+ const targetPresetsDir = path.join(tempRoot, 'packages', 'ai-rules', 'presets');
38
+ fs.mkdirSync(targetPresetsDir, { recursive: true });
39
+ copyTree(path.join(packageDirectory, 'presets'), targetPresetsDir);
40
+ return tempRoot;
41
+ }
42
+
43
+ function copyTree(source, destination) {
44
+ for (const entry of fs.readdirSync(source, { withFileTypes: true })) {
45
+ const src = path.join(source, entry.name);
46
+ const dest = path.join(destination, entry.name);
47
+ if (entry.isDirectory()) {
48
+ fs.mkdirSync(dest, { recursive: true });
49
+ copyTree(src, dest);
50
+ } else if (entry.isFile()) {
51
+ fs.copyFileSync(src, dest);
52
+ }
53
+ }
54
+ }
55
+
56
+ function setEnvPresetRoot(tempRoot) {
57
+ return { ...process.env, AI_RULES_PRESETS_ROOT: path.join(tempRoot, 'packages', 'ai-rules', 'presets') };
58
+ }
59
+
60
+ function fixturePath(tempRoot) {
61
+ return path.join(tempRoot, 'packages', 'ai-rules', 'presets', 'cursor', 'next', 'team', 'fixtures', 'feature-parallel.json');
62
+ }
63
+
64
+ function allFixturePaths(tempRoot) {
65
+ const presetsDir = path.join(tempRoot, 'packages', 'ai-rules', 'presets');
66
+ const found = [];
67
+ for (const platform of fs.readdirSync(presetsDir)) {
68
+ const candidate = path.join(presetsDir, platform, 'next', 'team', 'fixtures', 'feature-parallel.json');
69
+ if (fs.existsSync(candidate)) found.push(candidate);
70
+ }
71
+ return found;
72
+ }
73
+
74
+ function mutateFixture(tempRoot, mutator) {
75
+ const file = fixturePath(tempRoot);
76
+ const data = JSON.parse(fs.readFileSync(file, 'utf8'));
77
+ mutator(data);
78
+ fs.writeFileSync(file, `${JSON.stringify(data, null, 2)}\n`);
79
+ }
80
+
81
+ // Test 1 — clean copy PASSes the default scan.
82
+ {
83
+ const tempRoot = copyPresetsDir();
84
+ try {
85
+ const result = runCheck([], setEnvPresetRoot(tempRoot));
86
+ assert.strictEqual(result.exitCode, 0, `expected PASS on the clean copy; got exit=${result.exitCode}\n${result.stdout}`);
87
+ } finally {
88
+ fs.rmSync(tempRoot, { recursive: true, force: true });
89
+ }
90
+ }
91
+
92
+ // Test 2 — the shipped parallel fixture PASSes `--pipeline`.
93
+ {
94
+ const tempRoot = copyPresetsDir();
95
+ try {
96
+ const result = runCheck(['--pipeline', fixturePath(tempRoot)], setEnvPresetRoot(tempRoot));
97
+ assert.strictEqual(result.exitCode, 0, `expected PASS for feature-parallel.json; got exit=${result.exitCode}\n${result.stdout}`);
98
+ } finally {
99
+ fs.rmSync(tempRoot, { recursive: true, force: true });
100
+ }
101
+ }
102
+
103
+ // Test 3 — overlapping same-wave writeScopes FAIL (C1).
104
+ {
105
+ const tempRoot = copyPresetsDir();
106
+ try {
107
+ mutateFixture(tempRoot, (data) => {
108
+ const writer = data.steps.find((step) => step.id === 'T5');
109
+ writer.writeScopes = ['.ai.local/team/tasks/<slug>/review.md'];
110
+ });
111
+ const result = runCheck(['--pipeline', fixturePath(tempRoot)], setEnvPresetRoot(tempRoot));
112
+ assert.notStrictEqual(result.exitCode, 0, 'expected FAIL on overlapping writeScopes');
113
+ assert.match(result.stdout, /writeScopes overlap/, 'expected a C1 overlap message');
114
+ } finally {
115
+ fs.rmSync(tempRoot, { recursive: true, force: true });
116
+ }
117
+ }
118
+
119
+ // Test 4 — a shared agent inside one wave FAILs (C2).
120
+ {
121
+ const tempRoot = copyPresetsDir();
122
+ try {
123
+ mutateFixture(tempRoot, (data) => {
124
+ const writer = data.steps.find((step) => step.id === 'T5');
125
+ writer.agent = 'code-reviewer';
126
+ });
127
+ const result = runCheck(['--pipeline', fixturePath(tempRoot)], setEnvPresetRoot(tempRoot));
128
+ assert.notStrictEqual(result.exitCode, 0, 'expected FAIL on a shared agent in one wave');
129
+ assert.match(result.stdout, /same agent in one wave/, 'expected a C2 message');
130
+ } finally {
131
+ fs.rmSync(tempRoot, { recursive: true, force: true });
132
+ }
133
+ }
134
+
135
+ // Test 5 — an unresolved dependsOn FAILs.
136
+ {
137
+ const tempRoot = copyPresetsDir();
138
+ try {
139
+ mutateFixture(tempRoot, (data) => {
140
+ data.steps[1].dependsOn = ['T-unknown'];
141
+ });
142
+ const result = runCheck(['--pipeline', fixturePath(tempRoot)], setEnvPresetRoot(tempRoot));
143
+ assert.notStrictEqual(result.exitCode, 0, 'expected FAIL on an unresolved dependsOn');
144
+ assert.match(result.stdout, /does not resolve/, 'expected an unresolved-dependency message');
145
+ } finally {
146
+ fs.rmSync(tempRoot, { recursive: true, force: true });
147
+ }
148
+ }
149
+
150
+ // Test 6 — non-vacuity: removing the graph edges + parallel step FAILs the scan.
151
+ {
152
+ const tempRoot = copyPresetsDir();
153
+ try {
154
+ for (const file of allFixturePaths(tempRoot)) {
155
+ const data = JSON.parse(fs.readFileSync(file, 'utf8'));
156
+ data.steps = data.steps.map((step) => {
157
+ const next = { ...step };
158
+ delete next.dependsOn;
159
+ delete next.parallel;
160
+ if (Array.isArray(next.agent)) next.agent = next.agent[0];
161
+ return next;
162
+ });
163
+ fs.writeFileSync(file, `${JSON.stringify(data, null, 2)}\n`);
164
+ }
165
+ const result = runCheck([], setEnvPresetRoot(tempRoot));
166
+ assert.notStrictEqual(result.exitCode, 0, 'expected FAIL when no fixture exercises the graph contract');
167
+ assert.match(result.stdout, /vacuous-PASS/, 'expected the non-vacuity refusal message');
168
+ } finally {
169
+ fs.rmSync(tempRoot, { recursive: true, force: true });
170
+ }
171
+ }
172
+
173
+ console.log('OK: check-parallel-plan.sh fixture tests passed');
@@ -7,7 +7,10 @@
7
7
  // `cursor/next/rules/agent-team-intake.mdc` and assert FAIL; (4) drop it from
8
8
  // `cursor/next/rules/agent-team-orchestrator.mdc` and assert FAIL; (5) drop it from
9
9
  // `cursor/next/commands/task-continue.md` and assert FAIL; (6) rename `prompt.md` in the
10
- // core `agent-artifact-contracts.md` and assert FAIL (G0).
10
+ // core `agent-artifact-contracts.md` and assert FAIL (G0); (7) drop `prompt-log.md` from
11
+ // `cursor/next/commands/task-continue.md` and assert FAIL; (8) rename `prompt-log.md` in the
12
+ // core `agent-artifact-contracts.md` and assert FAIL (G0, ledger anchor); (9) drop
13
+ // `prompt-log.md` from `cursor/next/rules/agent-team-orchestrator.mdc` and assert FAIL.
11
14
  //
12
15
  // Why a separate fixture file: the check is a shell + Python script under `scripts/`,
13
16
  // so it is exercised end-to-end via `execFileSync` against a temp copy (mirroring
@@ -172,4 +175,58 @@ function assertFail(result) {
172
175
  }
173
176
  }
174
177
 
178
+ // Test 7 — drop `prompt-log.md` from the Cursor `commands/task-continue.md` and assert FAIL.
179
+ {
180
+ const tempRoot = copyPresetsDir();
181
+ try {
182
+ const file = presetFile(tempRoot, 'cursor', 'next', 'commands', 'task-continue.md');
183
+ const original = fs.readFileSync(file, 'utf8');
184
+ const mutated = original.replaceAll('prompt-log.md', 'prompt-log-md');
185
+ assert.notStrictEqual(mutated, original, 'the `prompt-log.md` token must exist to remove');
186
+ fs.writeFileSync(file, mutated);
187
+
188
+ assertFail(runCheck(setEnvPresetRoot(tempRoot)));
189
+ } finally {
190
+ fs.rmSync(tempRoot, { recursive: true, force: true });
191
+ }
192
+ }
193
+
194
+ // Test 8 — rename `prompt-log.md` in the core contract doc and assert FAIL (G0, core-level).
195
+ {
196
+ const tempRoot = copyPresetsDir();
197
+ try {
198
+ const file = presetFile(tempRoot, '_shared', 'core', 'agent-team', 'agent-artifact-contracts.md');
199
+ const original = fs.readFileSync(file, 'utf8');
200
+ const mutated = original.replaceAll('prompt-log.md', 'prompt-log-md');
201
+ assert.notStrictEqual(mutated, original, 'the `prompt-log.md` token must exist to rename');
202
+ fs.writeFileSync(file, mutated);
203
+
204
+ const result = runCheck(setEnvPresetRoot(tempRoot));
205
+ assert.notStrictEqual(
206
+ result.exitCode,
207
+ 0,
208
+ `expected FAIL when the core contract drops prompt-log.md\n${result.stdout}`,
209
+ );
210
+ assert.match(result.stdout, /prompt-persistence/, 'expected a prompt-persistence failure message in output');
211
+ } finally {
212
+ fs.rmSync(tempRoot, { recursive: true, force: true });
213
+ }
214
+ }
215
+
216
+ // Test 9 — drop `prompt-log.md` from the Cursor orchestrator adapter and assert FAIL.
217
+ {
218
+ const tempRoot = copyPresetsDir();
219
+ try {
220
+ const file = presetFile(tempRoot, 'cursor', 'next', 'rules', 'agent-team-orchestrator.mdc');
221
+ const original = fs.readFileSync(file, 'utf8');
222
+ const mutated = original.replaceAll('prompt-log.md', 'prompt-log-md');
223
+ assert.notStrictEqual(mutated, original, 'the `prompt-log.md` token must exist to remove');
224
+ fs.writeFileSync(file, mutated);
225
+
226
+ assertFail(runCheck(setEnvPresetRoot(tempRoot)));
227
+ } finally {
228
+ fs.rmSync(tempRoot, { recursive: true, force: true });
229
+ }
230
+ }
231
+
175
232
  console.log('OK: check-preset-prompt-persistence.sh fixture tests passed');