@bonesofspring/ai-rules 0.2.19 → 0.2.21

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 (541) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/README.md +17 -2
  3. package/bin/cli.js +83 -6
  4. package/package.json +5 -2
  5. package/presets/_shared/README.md +4 -3
  6. package/presets/_shared/assets/docs-specs/INDEX.md +4 -1
  7. package/presets/_shared/core/agent-team/agent-artifact-contracts.md +13 -0
  8. package/presets/_shared/core/agent-team/agent-task-metrics.md +1 -1
  9. package/presets/_shared/core/agent-team/agent-team-orchestrator.md +1 -3
  10. package/presets/_shared/core/agent-team/task-classification.md +21 -0
  11. package/presets/_shared/core/meta/preset-pr-checklist.md +5 -1
  12. package/presets/_shared/core/meta/preset-token-budget.md +7 -3
  13. package/presets/_shared/core/meta/preset-twin-sync.md +2 -0
  14. package/presets/_shared/core/quality/debug-investigation.md +24 -0
  15. package/presets/_shared/core/quality/verification-before-completion.md +25 -0
  16. package/presets/_shared/core/review/receiving-code-review.md +24 -0
  17. package/presets/_shared/core/testing/testing-principles.md +70 -0
  18. package/presets/claude/android-kotlin/agents/README.md +2 -1
  19. package/presets/claude/android-kotlin/agents/build-verifier.md +6 -0
  20. package/presets/claude/android-kotlin/agents/ci-investigator.md +1 -0
  21. package/presets/claude/android-kotlin/agents/code-reviewer.md +2 -0
  22. package/presets/claude/android-kotlin/agents/debugger.md +5 -0
  23. package/presets/claude/android-kotlin/agents/feature-developer.md +8 -1
  24. package/presets/claude/android-kotlin/agents/openspec-author.md +163 -0
  25. package/presets/claude/android-kotlin/agents/task-analyst.md +11 -1
  26. package/presets/claude/android-kotlin/agents/task-router.md +19 -1
  27. package/presets/claude/android-kotlin/agents/tech-writer.md +4 -0
  28. package/presets/claude/android-kotlin/commands/README.md +0 -2
  29. package/presets/claude/android-kotlin/commands/task-continue.md +1 -1
  30. package/presets/claude/android-kotlin/commands/task.md +1 -5
  31. package/presets/claude/android-kotlin/commands/technical-retro.md +2 -2
  32. package/presets/claude/android-kotlin/hooks/chain-team-phases.sh +54 -2
  33. package/presets/claude/android-kotlin/rules/README.md +1 -0
  34. package/presets/claude/android-kotlin/rules/tooling-and-review/agent-team-orchestrator.md +7 -4
  35. package/presets/claude/android-kotlin/rules/tooling-and-review/ai-local-overlay.md +48 -0
  36. package/presets/claude/android-kotlin/rules/tooling-and-review/preset-pr-checklist.md +5 -1
  37. package/presets/claude/android-kotlin/rules/tooling-and-review/preset-token-budget.md +7 -3
  38. package/presets/claude/android-kotlin/rules/tooling-and-review/preset-twin-sync.md +2 -0
  39. package/presets/claude/android-kotlin/skills/code-review/SKILL.md +6 -0
  40. package/presets/claude/android-kotlin/skills/debug-investigation/SKILL.md +33 -5
  41. package/presets/claude/go/README.md +1 -1
  42. package/presets/claude/go/agents/README.md +3 -2
  43. package/presets/claude/go/agents/build-verifier.md +6 -0
  44. package/presets/claude/go/agents/ci-investigator.md +1 -0
  45. package/presets/claude/go/agents/code-reviewer.md +2 -0
  46. package/presets/claude/go/agents/debugger.md +7 -0
  47. package/presets/claude/go/agents/feature-developer.md +7 -0
  48. package/presets/claude/go/agents/openspec-author.md +163 -0
  49. package/presets/claude/go/agents/task-analyst.md +10 -0
  50. package/presets/claude/go/agents/task-router.md +19 -1
  51. package/presets/claude/go/agents/tech-writer.md +4 -0
  52. package/presets/claude/go/commands/README.md +0 -2
  53. package/presets/claude/go/commands/task-continue.md +1 -1
  54. package/presets/claude/go/commands/task.md +1 -4
  55. package/presets/claude/go/hooks/chain-team-phases.sh +54 -3
  56. package/presets/claude/go/rules/README.md +1 -0
  57. package/presets/claude/go/rules/tooling-and-review/agent-team-orchestrator.md +2 -4
  58. package/presets/claude/go/rules/tooling-and-review/ai-local-overlay.md +48 -0
  59. package/presets/claude/go/rules/tooling-and-review/preset-pr-checklist.md +5 -1
  60. package/presets/claude/go/rules/tooling-and-review/preset-token-budget.md +7 -3
  61. package/presets/claude/go/rules/tooling-and-review/preset-twin-sync.md +2 -0
  62. package/presets/claude/go/skills/code-review/SKILL.md +6 -0
  63. package/presets/claude/go/skills/debug-investigation/SKILL.md +32 -4
  64. package/presets/claude/ios-swift/agents/README.md +3 -2
  65. package/presets/claude/ios-swift/agents/build-verifier.md +6 -0
  66. package/presets/claude/ios-swift/agents/ci-investigator.md +1 -0
  67. package/presets/claude/ios-swift/agents/code-reviewer.md +2 -0
  68. package/presets/claude/ios-swift/agents/debugger.md +5 -0
  69. package/presets/claude/ios-swift/agents/feature-developer.md +8 -1
  70. package/presets/claude/ios-swift/agents/openspec-author.md +163 -0
  71. package/presets/claude/ios-swift/agents/task-analyst.md +11 -1
  72. package/presets/claude/ios-swift/agents/task-router.md +19 -1
  73. package/presets/claude/ios-swift/agents/tech-writer.md +4 -0
  74. package/presets/claude/ios-swift/commands/README.md +0 -2
  75. package/presets/claude/ios-swift/commands/task-continue.md +1 -1
  76. package/presets/claude/ios-swift/commands/task.md +1 -5
  77. package/presets/claude/ios-swift/commands/technical-retro.md +2 -2
  78. package/presets/claude/ios-swift/hooks/chain-team-phases.sh +54 -2
  79. package/presets/claude/ios-swift/rules/README.md +1 -0
  80. package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-orchestrator.md +7 -4
  81. package/presets/claude/ios-swift/rules/tooling-and-review/ai-local-overlay.md +48 -0
  82. package/presets/claude/ios-swift/rules/tooling-and-review/preset-pr-checklist.md +5 -1
  83. package/presets/claude/ios-swift/rules/tooling-and-review/preset-token-budget.md +7 -3
  84. package/presets/claude/ios-swift/rules/tooling-and-review/preset-twin-sync.md +2 -0
  85. package/presets/claude/ios-swift/skills/code-review/SKILL.md +6 -0
  86. package/presets/claude/ios-swift/skills/debug-investigation/SKILL.md +33 -5
  87. package/presets/claude/java/CLAUDE.md +1 -1
  88. package/presets/claude/java/agents/README.md +3 -2
  89. package/presets/claude/java/agents/build-verifier.md +6 -0
  90. package/presets/claude/java/agents/ci-investigator.md +1 -0
  91. package/presets/claude/java/agents/code-reviewer.md +2 -0
  92. package/presets/claude/java/agents/debugger.md +7 -0
  93. package/presets/claude/java/agents/feature-developer.md +7 -0
  94. package/presets/claude/java/agents/openspec-author.md +163 -0
  95. package/presets/claude/java/agents/task-analyst.md +10 -0
  96. package/presets/claude/java/agents/task-router.md +19 -1
  97. package/presets/claude/java/agents/tech-writer.md +4 -0
  98. package/presets/claude/java/commands/README.md +0 -2
  99. package/presets/claude/java/commands/task-continue.md +1 -1
  100. package/presets/claude/java/commands/task.md +1 -4
  101. package/presets/claude/java/hooks/chain-team-phases.sh +54 -3
  102. package/presets/claude/java/rules/README.md +1 -0
  103. package/presets/claude/java/rules/tooling-and-review/agent-team-orchestrator.md +2 -4
  104. package/presets/claude/java/rules/tooling-and-review/ai-local-overlay.md +48 -0
  105. package/presets/claude/java/rules/tooling-and-review/preset-pr-checklist.md +5 -1
  106. package/presets/claude/java/rules/tooling-and-review/preset-token-budget.md +7 -3
  107. package/presets/claude/java/rules/tooling-and-review/preset-twin-sync.md +2 -0
  108. package/presets/claude/java/skills/code-review/SKILL.md +6 -0
  109. package/presets/claude/java/skills/debug-investigation/SKILL.md +32 -4
  110. package/presets/claude/mcp-ts/agents/build-verifier.md +6 -0
  111. package/presets/claude/mcp-ts/agents/feature-developer.md +7 -0
  112. package/presets/claude/mcp-ts/agents/task-analyst.md +11 -1
  113. package/presets/claude/mcp-ts/agents/task-router.md +14 -0
  114. package/presets/claude/mcp-ts/commands/README.md +0 -2
  115. package/presets/claude/mcp-ts/commands/task-continue.md +1 -1
  116. package/presets/claude/mcp-ts/commands/task.md +1 -4
  117. package/presets/claude/mcp-ts/commands/technical-retro.md +2 -2
  118. package/presets/claude/mcp-ts/hooks/chain-team-phases.sh +40 -9
  119. package/presets/claude/mcp-ts/rules/README.md +1 -0
  120. package/presets/claude/mcp-ts/rules/tooling-and-review/agent-team-orchestrator.md +2 -4
  121. package/presets/claude/mcp-ts/rules/tooling-and-review/ai-local-overlay.md +48 -0
  122. package/presets/claude/mcp-ts/rules/tooling-and-review/preset-pr-checklist.md +5 -1
  123. package/presets/claude/mcp-ts/rules/tooling-and-review/preset-token-budget.md +7 -3
  124. package/presets/claude/mcp-ts/rules/tooling-and-review/preset-twin-sync.md +2 -0
  125. package/presets/claude/mcp-ts/skills/code-review/SKILL.md +6 -0
  126. package/presets/claude/mcp-ts/skills/debug-investigation/SKILL.md +31 -3
  127. package/presets/claude/next/README.md +1 -0
  128. package/presets/claude/next/agents/README.md +2 -2
  129. package/presets/claude/next/agents/build-verifier.md +17 -1
  130. package/presets/claude/next/agents/ci-investigator.md +1 -0
  131. package/presets/claude/next/agents/code-reviewer.md +2 -0
  132. package/presets/claude/next/agents/debugger.md +5 -0
  133. package/presets/claude/next/agents/feature-developer.md +8 -1
  134. package/presets/claude/next/agents/openspec-author.md +163 -0
  135. package/presets/claude/next/agents/task-analyst.md +12 -2
  136. package/presets/claude/next/agents/task-router.md +19 -1
  137. package/presets/claude/next/agents/tech-writer.md +4 -0
  138. package/presets/claude/next/commands/README.md +0 -2
  139. package/presets/claude/next/commands/task-continue.md +1 -1
  140. package/presets/claude/next/commands/task.md +1 -4
  141. package/presets/claude/next/hooks/chain-team-phases.sh +54 -2
  142. package/presets/claude/next/rules/README.md +1 -0
  143. package/presets/claude/next/rules/testing/README.md +6 -0
  144. package/presets/claude/next/rules/testing/tests-e2e-structure.md +84 -48
  145. package/presets/claude/next/rules/testing/tests-unit.md +79 -50
  146. package/presets/claude/next/rules/tooling-and-review/agent-team-orchestrator.md +3 -4
  147. package/presets/claude/next/rules/tooling-and-review/ai-local-overlay.md +48 -0
  148. package/presets/claude/next/rules/tooling-and-review/preset-pr-checklist.md +5 -1
  149. package/presets/claude/next/rules/tooling-and-review/preset-token-budget.md +7 -3
  150. package/presets/claude/next/rules/tooling-and-review/preset-twin-sync.md +2 -0
  151. package/presets/claude/next/skills/code-review/SKILL.md +6 -0
  152. package/presets/claude/next/skills/debug-investigation/SKILL.md +29 -14
  153. package/presets/claude/next/team/README.md +0 -3
  154. package/presets/claude/nuxt/agents/README.md +1 -1
  155. package/presets/claude/nuxt/agents/build-verifier.md +6 -0
  156. package/presets/claude/nuxt/agents/ci-investigator.md +1 -0
  157. package/presets/claude/nuxt/agents/code-reviewer.md +2 -0
  158. package/presets/claude/nuxt/agents/debugger.md +5 -0
  159. package/presets/claude/nuxt/agents/feature-developer.md +8 -1
  160. package/presets/claude/nuxt/agents/openspec-author.md +163 -0
  161. package/presets/claude/nuxt/agents/task-analyst.md +12 -2
  162. package/presets/claude/nuxt/agents/task-router.md +19 -1
  163. package/presets/claude/nuxt/agents/tech-writer.md +4 -0
  164. package/presets/claude/nuxt/commands/README.md +0 -2
  165. package/presets/claude/nuxt/commands/task-continue.md +1 -1
  166. package/presets/claude/nuxt/commands/task.md +1 -5
  167. package/presets/claude/nuxt/commands/technical-retro.md +2 -2
  168. package/presets/claude/nuxt/hooks/chain-team-phases.sh +54 -2
  169. package/presets/claude/nuxt/rules/README.md +1 -0
  170. package/presets/claude/nuxt/rules/testing/README.md +6 -0
  171. package/presets/claude/nuxt/rules/testing/tests-e2e-structure.md +86 -43
  172. package/presets/claude/nuxt/rules/testing/tests-unit.md +58 -45
  173. package/presets/claude/nuxt/rules/tooling-and-review/agent-team-orchestrator.md +8 -5
  174. package/presets/claude/nuxt/rules/tooling-and-review/ai-local-overlay.md +48 -0
  175. package/presets/claude/nuxt/rules/tooling-and-review/preset-pr-checklist.md +5 -1
  176. package/presets/claude/nuxt/rules/tooling-and-review/preset-token-budget.md +7 -3
  177. package/presets/claude/nuxt/rules/tooling-and-review/preset-twin-sync.md +2 -0
  178. package/presets/claude/nuxt/skills/code-review/SKILL.md +6 -0
  179. package/presets/claude/nuxt/skills/debug-investigation/SKILL.md +29 -12
  180. package/presets/claude/nuxt/team/README.md +0 -3
  181. package/presets/claude/php-hexagonal/CLAUDE.md +1 -1
  182. package/presets/claude/php-hexagonal/agents/README.md +3 -2
  183. package/presets/claude/php-hexagonal/agents/build-verifier.md +6 -0
  184. package/presets/claude/php-hexagonal/agents/ci-investigator.md +1 -0
  185. package/presets/claude/php-hexagonal/agents/code-reviewer.md +2 -0
  186. package/presets/claude/php-hexagonal/agents/debugger.md +7 -0
  187. package/presets/claude/php-hexagonal/agents/feature-developer.md +7 -0
  188. package/presets/claude/php-hexagonal/agents/openspec-author.md +163 -0
  189. package/presets/claude/php-hexagonal/agents/task-analyst.md +10 -0
  190. package/presets/claude/php-hexagonal/agents/task-router.md +19 -1
  191. package/presets/claude/php-hexagonal/agents/tech-writer.md +4 -0
  192. package/presets/claude/php-hexagonal/commands/README.md +0 -2
  193. package/presets/claude/php-hexagonal/commands/task-continue.md +1 -1
  194. package/presets/claude/php-hexagonal/commands/task.md +1 -4
  195. package/presets/claude/php-hexagonal/hooks/chain-team-phases.sh +54 -3
  196. package/presets/claude/php-hexagonal/rules/README.md +1 -0
  197. package/presets/claude/php-hexagonal/rules/tooling-and-review/agent-team-orchestrator.md +2 -4
  198. package/presets/claude/php-hexagonal/rules/tooling-and-review/ai-local-overlay.md +48 -0
  199. package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-pr-checklist.md +5 -1
  200. package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-token-budget.md +7 -3
  201. package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-twin-sync.md +2 -0
  202. package/presets/claude/php-hexagonal/skills/code-review/SKILL.md +6 -0
  203. package/presets/claude/php-hexagonal/skills/debug-investigation/SKILL.md +32 -4
  204. package/presets/claude/php-laravel/agents/README.md +3 -2
  205. package/presets/claude/php-laravel/agents/build-verifier.md +6 -0
  206. package/presets/claude/php-laravel/agents/ci-investigator.md +1 -0
  207. package/presets/claude/php-laravel/agents/code-reviewer.md +2 -0
  208. package/presets/claude/php-laravel/agents/debugger.md +7 -0
  209. package/presets/claude/php-laravel/agents/feature-developer.md +7 -0
  210. package/presets/claude/php-laravel/agents/openspec-author.md +163 -0
  211. package/presets/claude/php-laravel/agents/task-analyst.md +10 -0
  212. package/presets/claude/php-laravel/agents/task-router.md +19 -1
  213. package/presets/claude/php-laravel/agents/tech-writer.md +4 -0
  214. package/presets/claude/php-laravel/commands/README.md +0 -2
  215. package/presets/claude/php-laravel/commands/task-continue.md +1 -1
  216. package/presets/claude/php-laravel/commands/task.md +1 -4
  217. package/presets/claude/php-laravel/hooks/chain-team-phases.sh +54 -3
  218. package/presets/claude/php-laravel/rules/README.md +1 -0
  219. package/presets/claude/php-laravel/rules/tooling-and-review/agent-team-orchestrator.md +2 -4
  220. package/presets/claude/php-laravel/rules/tooling-and-review/ai-local-overlay.md +48 -0
  221. package/presets/claude/php-laravel/rules/tooling-and-review/preset-pr-checklist.md +5 -1
  222. package/presets/claude/php-laravel/rules/tooling-and-review/preset-token-budget.md +7 -3
  223. package/presets/claude/php-laravel/rules/tooling-and-review/preset-twin-sync.md +2 -0
  224. package/presets/claude/php-laravel/skills/code-review/SKILL.md +6 -0
  225. package/presets/claude/php-laravel/skills/debug-investigation/SKILL.md +32 -4
  226. package/presets/claude/svelte/agents/README.md +1 -1
  227. package/presets/claude/svelte/agents/build-verifier.md +6 -0
  228. package/presets/claude/svelte/agents/ci-investigator.md +1 -0
  229. package/presets/claude/svelte/agents/code-reviewer.md +2 -0
  230. package/presets/claude/svelte/agents/debugger.md +5 -0
  231. package/presets/claude/svelte/agents/feature-developer.md +8 -1
  232. package/presets/claude/svelte/agents/openspec-author.md +163 -0
  233. package/presets/claude/svelte/agents/task-analyst.md +12 -2
  234. package/presets/claude/svelte/agents/task-router.md +19 -1
  235. package/presets/claude/svelte/agents/tech-writer.md +4 -0
  236. package/presets/claude/svelte/commands/README.md +0 -2
  237. package/presets/claude/svelte/commands/task-continue.md +1 -1
  238. package/presets/claude/svelte/commands/task.md +1 -5
  239. package/presets/claude/svelte/commands/technical-retro.md +2 -2
  240. package/presets/claude/svelte/hooks/chain-team-phases.sh +54 -2
  241. package/presets/claude/svelte/rules/README.md +1 -0
  242. package/presets/claude/svelte/rules/testing/README.md +6 -0
  243. package/presets/claude/svelte/rules/testing/tests-e2e-structure.md +87 -45
  244. package/presets/claude/svelte/rules/testing/tests-unit.md +70 -23
  245. package/presets/claude/svelte/rules/tooling-and-review/agent-team-orchestrator.md +8 -5
  246. package/presets/claude/svelte/rules/tooling-and-review/ai-local-overlay.md +48 -0
  247. package/presets/claude/svelte/rules/tooling-and-review/preset-pr-checklist.md +5 -1
  248. package/presets/claude/svelte/rules/tooling-and-review/preset-token-budget.md +7 -3
  249. package/presets/claude/svelte/rules/tooling-and-review/preset-twin-sync.md +2 -0
  250. package/presets/claude/svelte/skills/code-review/SKILL.md +6 -0
  251. package/presets/claude/svelte/skills/debug-investigation/SKILL.md +29 -12
  252. package/presets/claude/svelte/team/README.md +0 -3
  253. package/presets/cursor/android-kotlin/agents/README.md +2 -1
  254. package/presets/cursor/android-kotlin/agents/build-verifier.md +6 -0
  255. package/presets/cursor/android-kotlin/agents/ci-investigator.md +1 -0
  256. package/presets/cursor/android-kotlin/agents/code-reviewer.md +2 -0
  257. package/presets/cursor/android-kotlin/agents/debugger.md +5 -0
  258. package/presets/cursor/android-kotlin/agents/feature-developer.md +8 -1
  259. package/presets/cursor/android-kotlin/agents/openspec-author.md +164 -0
  260. package/presets/cursor/android-kotlin/agents/task-analyst.md +11 -1
  261. package/presets/cursor/android-kotlin/agents/task-router.md +19 -1
  262. package/presets/cursor/android-kotlin/agents/tech-writer.md +4 -0
  263. package/presets/cursor/android-kotlin/commands/README.md +0 -2
  264. package/presets/cursor/android-kotlin/commands/task-continue.md +1 -1
  265. package/presets/cursor/android-kotlin/commands/task.md +1 -5
  266. package/presets/cursor/android-kotlin/commands/technical-retro.md +2 -2
  267. package/presets/cursor/android-kotlin/hooks/chain-team-phases.sh +54 -2
  268. package/presets/cursor/android-kotlin/rules/agent-team-orchestrator.mdc +7 -4
  269. package/presets/cursor/android-kotlin/rules/ai-local-overlay.mdc +43 -0
  270. package/presets/cursor/android-kotlin/rules/preset-pr-checklist.mdc +5 -1
  271. package/presets/cursor/android-kotlin/rules/preset-token-budget.mdc +7 -3
  272. package/presets/cursor/android-kotlin/rules/preset-twin-sync.mdc +2 -0
  273. package/presets/cursor/android-kotlin/skills/code-review/SKILL.md +6 -0
  274. package/presets/cursor/android-kotlin/skills/debug-investigation/SKILL.md +33 -5
  275. package/presets/cursor/go/README.md +6 -6
  276. package/presets/cursor/go/agents/README.md +3 -2
  277. package/presets/cursor/go/agents/build-verifier.md +6 -0
  278. package/presets/cursor/go/agents/ci-investigator.md +1 -0
  279. package/presets/cursor/go/agents/code-reviewer.md +2 -0
  280. package/presets/cursor/go/agents/debugger.md +7 -0
  281. package/presets/cursor/go/agents/feature-developer.md +7 -0
  282. package/presets/cursor/go/agents/openspec-author.md +164 -0
  283. package/presets/cursor/go/agents/task-analyst.md +10 -0
  284. package/presets/cursor/go/agents/task-router.md +19 -1
  285. package/presets/cursor/go/agents/tech-writer.md +4 -0
  286. package/presets/cursor/go/commands/README.md +0 -2
  287. package/presets/cursor/go/commands/task-continue.md +1 -1
  288. package/presets/cursor/go/commands/task.md +1 -4
  289. package/presets/cursor/go/commands/technical-retro.md +2 -2
  290. package/presets/cursor/go/hooks/chain-team-phases.sh +54 -3
  291. package/presets/cursor/go/rules/agent-team-orchestrator.mdc +2 -4
  292. package/presets/cursor/go/rules/ai-local-overlay.mdc +43 -0
  293. package/presets/cursor/go/rules/preset-pr-checklist.mdc +5 -1
  294. package/presets/cursor/go/rules/preset-token-budget.mdc +7 -3
  295. package/presets/cursor/go/rules/preset-twin-sync.mdc +2 -0
  296. package/presets/cursor/go/skills/code-review/SKILL.md +6 -0
  297. package/presets/cursor/go/skills/debug-investigation/SKILL.md +32 -4
  298. package/presets/cursor/ios-swift/README.md +6 -6
  299. package/presets/cursor/ios-swift/agents/README.md +3 -2
  300. package/presets/cursor/ios-swift/agents/build-verifier.md +6 -0
  301. package/presets/cursor/ios-swift/agents/ci-investigator.md +1 -0
  302. package/presets/cursor/ios-swift/agents/code-reviewer.md +2 -0
  303. package/presets/cursor/ios-swift/agents/debugger.md +5 -0
  304. package/presets/cursor/ios-swift/agents/feature-developer.md +8 -1
  305. package/presets/cursor/ios-swift/agents/openspec-author.md +164 -0
  306. package/presets/cursor/ios-swift/agents/task-analyst.md +11 -1
  307. package/presets/cursor/ios-swift/agents/task-router.md +19 -1
  308. package/presets/cursor/ios-swift/agents/tech-writer.md +4 -0
  309. package/presets/cursor/ios-swift/commands/README.md +1 -3
  310. package/presets/cursor/ios-swift/commands/task-continue.md +1 -1
  311. package/presets/cursor/ios-swift/commands/task.md +1 -5
  312. package/presets/cursor/ios-swift/commands/technical-retro.md +2 -2
  313. package/presets/cursor/ios-swift/hooks/chain-team-phases.sh +54 -2
  314. package/presets/cursor/ios-swift/rules/agent-team-orchestrator.mdc +7 -4
  315. package/presets/cursor/ios-swift/rules/ai-local-overlay.mdc +43 -0
  316. package/presets/cursor/ios-swift/rules/preset-pr-checklist.mdc +5 -1
  317. package/presets/cursor/ios-swift/rules/preset-token-budget.mdc +7 -3
  318. package/presets/cursor/ios-swift/rules/preset-twin-sync.mdc +2 -0
  319. package/presets/cursor/ios-swift/skills/code-review/SKILL.md +6 -0
  320. package/presets/cursor/ios-swift/skills/debug-investigation/SKILL.md +33 -5
  321. package/presets/cursor/java/AGENTS.md +1 -1
  322. package/presets/cursor/java/agents/README.md +3 -2
  323. package/presets/cursor/java/agents/build-verifier.md +6 -0
  324. package/presets/cursor/java/agents/ci-investigator.md +1 -0
  325. package/presets/cursor/java/agents/code-reviewer.md +2 -0
  326. package/presets/cursor/java/agents/debugger.md +7 -0
  327. package/presets/cursor/java/agents/feature-developer.md +7 -0
  328. package/presets/cursor/java/agents/openspec-author.md +164 -0
  329. package/presets/cursor/java/agents/task-analyst.md +10 -0
  330. package/presets/cursor/java/agents/task-router.md +19 -1
  331. package/presets/cursor/java/agents/tech-writer.md +4 -0
  332. package/presets/cursor/java/commands/README.md +0 -2
  333. package/presets/cursor/java/commands/task-continue.md +1 -1
  334. package/presets/cursor/java/commands/task.md +1 -4
  335. package/presets/cursor/java/commands/technical-retro.md +2 -2
  336. package/presets/cursor/java/hooks/chain-team-phases.sh +54 -3
  337. package/presets/cursor/java/rules/agent-team-orchestrator.mdc +2 -4
  338. package/presets/cursor/java/rules/ai-local-overlay.mdc +43 -0
  339. package/presets/cursor/java/rules/preset-pr-checklist.mdc +5 -1
  340. package/presets/cursor/java/rules/preset-token-budget.mdc +7 -3
  341. package/presets/cursor/java/rules/preset-twin-sync.mdc +2 -0
  342. package/presets/cursor/java/skills/code-review/SKILL.md +6 -0
  343. package/presets/cursor/java/skills/debug-investigation/SKILL.md +32 -4
  344. package/presets/cursor/mcp-ts/agents/build-verifier.md +6 -0
  345. package/presets/cursor/mcp-ts/agents/feature-developer.md +7 -0
  346. package/presets/cursor/mcp-ts/agents/task-analyst.md +11 -1
  347. package/presets/cursor/mcp-ts/agents/task-router.md +14 -0
  348. package/presets/cursor/mcp-ts/commands/README.md +0 -2
  349. package/presets/cursor/mcp-ts/commands/task-continue.md +1 -1
  350. package/presets/cursor/mcp-ts/commands/task.md +1 -4
  351. package/presets/cursor/mcp-ts/commands/technical-retro.md +2 -2
  352. package/presets/cursor/mcp-ts/hooks/chain-team-phases.sh +40 -9
  353. package/presets/cursor/mcp-ts/rules/agent-team-orchestrator.mdc +2 -4
  354. package/presets/cursor/mcp-ts/rules/ai-local-overlay.mdc +43 -0
  355. package/presets/cursor/mcp-ts/rules/preset-pr-checklist.mdc +5 -1
  356. package/presets/cursor/mcp-ts/rules/preset-token-budget.mdc +7 -3
  357. package/presets/cursor/mcp-ts/rules/preset-twin-sync.mdc +2 -0
  358. package/presets/cursor/mcp-ts/skills/code-review/SKILL.md +6 -0
  359. package/presets/cursor/mcp-ts/skills/debug-investigation/SKILL.md +31 -3
  360. package/presets/cursor/next/README.md +8 -6
  361. package/presets/cursor/next/REPO_AGENTS.md +8 -0
  362. package/presets/cursor/next/agents/README.md +2 -2
  363. package/presets/cursor/next/agents/build-verifier.md +17 -1
  364. package/presets/cursor/next/agents/ci-investigator.md +1 -0
  365. package/presets/cursor/next/agents/code-reviewer.md +2 -0
  366. package/presets/cursor/next/agents/debugger.md +5 -0
  367. package/presets/cursor/next/agents/feature-developer.md +8 -1
  368. package/presets/cursor/next/agents/openspec-author.md +164 -0
  369. package/presets/cursor/next/agents/task-analyst.md +12 -2
  370. package/presets/cursor/next/agents/task-router.md +19 -1
  371. package/presets/cursor/next/agents/tech-writer.md +4 -0
  372. package/presets/cursor/next/commands/README.md +0 -2
  373. package/presets/cursor/next/commands/task-continue.md +1 -1
  374. package/presets/cursor/next/commands/task.md +1 -4
  375. package/presets/cursor/next/commands/technical-retro.md +2 -2
  376. package/presets/cursor/next/hooks/chain-team-phases.sh +54 -2
  377. package/presets/cursor/next/rules/README.md +6 -3
  378. package/presets/cursor/next/rules/agent-team-orchestrator.mdc +7 -5
  379. package/presets/cursor/next/rules/ai-local-overlay.mdc +43 -0
  380. package/presets/cursor/next/rules/preset-pr-checklist.mdc +5 -1
  381. package/presets/cursor/next/rules/preset-token-budget.mdc +7 -3
  382. package/presets/cursor/next/rules/preset-twin-sync.mdc +2 -0
  383. package/presets/cursor/next/rules/tests-e2e-structure.mdc +83 -43
  384. package/presets/cursor/next/rules/tests-unit.mdc +78 -45
  385. package/presets/cursor/next/skills/code-review/SKILL.md +6 -0
  386. package/presets/cursor/next/skills/debug-investigation/SKILL.md +29 -14
  387. package/presets/cursor/next/team/README.md +0 -3
  388. package/presets/cursor/nuxt/README.md +6 -6
  389. package/presets/cursor/nuxt/agents/README.md +1 -1
  390. package/presets/cursor/nuxt/agents/build-verifier.md +6 -0
  391. package/presets/cursor/nuxt/agents/ci-investigator.md +1 -0
  392. package/presets/cursor/nuxt/agents/code-reviewer.md +2 -0
  393. package/presets/cursor/nuxt/agents/debugger.md +5 -0
  394. package/presets/cursor/nuxt/agents/feature-developer.md +8 -1
  395. package/presets/cursor/nuxt/agents/openspec-author.md +164 -0
  396. package/presets/cursor/nuxt/agents/task-analyst.md +12 -2
  397. package/presets/cursor/nuxt/agents/task-router.md +19 -1
  398. package/presets/cursor/nuxt/agents/tech-writer.md +4 -0
  399. package/presets/cursor/nuxt/commands/README.md +0 -2
  400. package/presets/cursor/nuxt/commands/task-continue.md +1 -1
  401. package/presets/cursor/nuxt/commands/task.md +1 -5
  402. package/presets/cursor/nuxt/commands/technical-retro.md +2 -2
  403. package/presets/cursor/nuxt/hooks/chain-team-phases.sh +54 -2
  404. package/presets/cursor/nuxt/rules/README.md +3 -1
  405. package/presets/cursor/nuxt/rules/agent-team-orchestrator.mdc +8 -5
  406. package/presets/cursor/nuxt/rules/ai-local-overlay.mdc +43 -0
  407. package/presets/cursor/nuxt/rules/preset-pr-checklist.mdc +5 -1
  408. package/presets/cursor/nuxt/rules/preset-token-budget.mdc +7 -3
  409. package/presets/cursor/nuxt/rules/preset-twin-sync.mdc +2 -0
  410. package/presets/cursor/nuxt/rules/tests-e2e-structure.mdc +87 -43
  411. package/presets/cursor/nuxt/rules/tests-unit.mdc +62 -47
  412. package/presets/cursor/nuxt/skills/code-review/SKILL.md +6 -0
  413. package/presets/cursor/nuxt/skills/debug-investigation/SKILL.md +29 -12
  414. package/presets/cursor/nuxt/team/README.md +0 -3
  415. package/presets/cursor/php-hexagonal/AGENTS.md +1 -1
  416. package/presets/cursor/php-hexagonal/agents/README.md +3 -2
  417. package/presets/cursor/php-hexagonal/agents/build-verifier.md +6 -0
  418. package/presets/cursor/php-hexagonal/agents/ci-investigator.md +1 -0
  419. package/presets/cursor/php-hexagonal/agents/code-reviewer.md +2 -0
  420. package/presets/cursor/php-hexagonal/agents/debugger.md +7 -0
  421. package/presets/cursor/php-hexagonal/agents/feature-developer.md +7 -0
  422. package/presets/cursor/php-hexagonal/agents/openspec-author.md +164 -0
  423. package/presets/cursor/php-hexagonal/agents/task-analyst.md +10 -0
  424. package/presets/cursor/php-hexagonal/agents/task-router.md +19 -1
  425. package/presets/cursor/php-hexagonal/agents/tech-writer.md +4 -0
  426. package/presets/cursor/php-hexagonal/commands/README.md +0 -2
  427. package/presets/cursor/php-hexagonal/commands/task-continue.md +1 -1
  428. package/presets/cursor/php-hexagonal/commands/task.md +1 -4
  429. package/presets/cursor/php-hexagonal/commands/technical-retro.md +2 -2
  430. package/presets/cursor/php-hexagonal/hooks/chain-team-phases.sh +54 -3
  431. package/presets/cursor/php-hexagonal/rules/agent-team-orchestrator.mdc +2 -4
  432. package/presets/cursor/php-hexagonal/rules/ai-local-overlay.mdc +43 -0
  433. package/presets/cursor/php-hexagonal/rules/preset-pr-checklist.mdc +5 -1
  434. package/presets/cursor/php-hexagonal/rules/preset-token-budget.mdc +7 -3
  435. package/presets/cursor/php-hexagonal/rules/preset-twin-sync.mdc +2 -0
  436. package/presets/cursor/php-hexagonal/skills/code-review/SKILL.md +6 -0
  437. package/presets/cursor/php-hexagonal/skills/debug-investigation/SKILL.md +32 -4
  438. package/presets/cursor/php-laravel/AGENTS.md +1 -1
  439. package/presets/cursor/php-laravel/agents/README.md +3 -2
  440. package/presets/cursor/php-laravel/agents/build-verifier.md +6 -0
  441. package/presets/cursor/php-laravel/agents/ci-investigator.md +1 -0
  442. package/presets/cursor/php-laravel/agents/code-reviewer.md +2 -0
  443. package/presets/cursor/php-laravel/agents/debugger.md +7 -0
  444. package/presets/cursor/php-laravel/agents/feature-developer.md +7 -0
  445. package/presets/cursor/php-laravel/agents/openspec-author.md +164 -0
  446. package/presets/cursor/php-laravel/agents/task-analyst.md +10 -0
  447. package/presets/cursor/php-laravel/agents/task-router.md +19 -1
  448. package/presets/cursor/php-laravel/agents/tech-writer.md +4 -0
  449. package/presets/cursor/php-laravel/commands/README.md +0 -2
  450. package/presets/cursor/php-laravel/commands/task-continue.md +1 -1
  451. package/presets/cursor/php-laravel/commands/task.md +1 -4
  452. package/presets/cursor/php-laravel/commands/technical-retro.md +2 -2
  453. package/presets/cursor/php-laravel/hooks/chain-team-phases.sh +54 -3
  454. package/presets/cursor/php-laravel/rules/agent-team-orchestrator.mdc +2 -4
  455. package/presets/cursor/php-laravel/rules/ai-local-overlay.mdc +43 -0
  456. package/presets/cursor/php-laravel/rules/preset-pr-checklist.mdc +5 -1
  457. package/presets/cursor/php-laravel/rules/preset-token-budget.mdc +7 -3
  458. package/presets/cursor/php-laravel/rules/preset-twin-sync.mdc +2 -0
  459. package/presets/cursor/php-laravel/skills/code-review/SKILL.md +6 -0
  460. package/presets/cursor/php-laravel/skills/debug-investigation/SKILL.md +32 -4
  461. package/presets/cursor/svelte/README.md +6 -6
  462. package/presets/cursor/svelte/agents/README.md +1 -1
  463. package/presets/cursor/svelte/agents/build-verifier.md +6 -0
  464. package/presets/cursor/svelte/agents/ci-investigator.md +1 -0
  465. package/presets/cursor/svelte/agents/code-reviewer.md +2 -0
  466. package/presets/cursor/svelte/agents/debugger.md +5 -0
  467. package/presets/cursor/svelte/agents/feature-developer.md +8 -1
  468. package/presets/cursor/svelte/agents/openspec-author.md +164 -0
  469. package/presets/cursor/svelte/agents/task-analyst.md +12 -2
  470. package/presets/cursor/svelte/agents/task-router.md +19 -1
  471. package/presets/cursor/svelte/agents/tech-writer.md +4 -0
  472. package/presets/cursor/svelte/commands/README.md +0 -2
  473. package/presets/cursor/svelte/commands/task-continue.md +1 -1
  474. package/presets/cursor/svelte/commands/task.md +1 -5
  475. package/presets/cursor/svelte/commands/technical-retro.md +2 -2
  476. package/presets/cursor/svelte/hooks/chain-team-phases.sh +54 -2
  477. package/presets/cursor/svelte/rules/README.md +3 -1
  478. package/presets/cursor/svelte/rules/agent-team-orchestrator.mdc +8 -5
  479. package/presets/cursor/svelte/rules/ai-local-overlay.mdc +43 -0
  480. package/presets/cursor/svelte/rules/preset-pr-checklist.mdc +5 -1
  481. package/presets/cursor/svelte/rules/preset-token-budget.mdc +7 -3
  482. package/presets/cursor/svelte/rules/preset-twin-sync.mdc +2 -0
  483. package/presets/cursor/svelte/rules/tests-e2e-structure.mdc +87 -43
  484. package/presets/cursor/svelte/rules/tests-unit.mdc +72 -23
  485. package/presets/cursor/svelte/skills/code-review/SKILL.md +6 -0
  486. package/presets/cursor/svelte/skills/debug-investigation/SKILL.md +29 -12
  487. package/presets/cursor/svelte/team/README.md +0 -3
  488. package/scripts/_lib/embed-stems.json +31 -0
  489. package/scripts/aggregate-agent-task-metrics.mjs +23 -0
  490. package/scripts/check-chain-hook-coverage.sh +109 -0
  491. package/scripts/check-local-overlay.sh +136 -0
  492. package/scripts/check-preset-i18n.sh +2 -2
  493. package/scripts/check-preset-leakage.sh +4 -1
  494. package/scripts/check-preset-structure.sh +21 -1
  495. package/scripts/check-preset-token-budget.sh +20 -10
  496. package/scripts/check-rule-eval.mjs +16 -0
  497. package/scripts/check-shared-core-drift.sh +10 -26
  498. package/scripts/close-agent-task-human-gate.mjs +22 -5
  499. package/scripts/sync-shared-core-embeds.sh +9 -20
  500. package/scripts/test-agent-task-metrics-hooks.mjs +1 -1
  501. package/scripts/test-chain-team-phases-coverage.mjs +411 -0
  502. package/presets/claude/android-kotlin/commands/feature-continue.md +0 -23
  503. package/presets/claude/android-kotlin/commands/feature-start.md +0 -41
  504. package/presets/claude/go/commands/feature-continue.md +0 -23
  505. package/presets/claude/go/commands/feature-start.md +0 -38
  506. package/presets/claude/ios-swift/commands/feature-continue.md +0 -23
  507. package/presets/claude/ios-swift/commands/feature-start.md +0 -41
  508. package/presets/claude/java/commands/feature-continue.md +0 -23
  509. package/presets/claude/java/commands/feature-start.md +0 -38
  510. package/presets/claude/mcp-ts/commands/feature-continue.md +0 -23
  511. package/presets/claude/mcp-ts/commands/feature-start.md +0 -41
  512. package/presets/claude/next/commands/feature-continue.md +0 -23
  513. package/presets/claude/next/commands/feature-start.md +0 -38
  514. package/presets/claude/nuxt/commands/feature-continue.md +0 -23
  515. package/presets/claude/nuxt/commands/feature-start.md +0 -41
  516. package/presets/claude/php-hexagonal/commands/feature-continue.md +0 -23
  517. package/presets/claude/php-hexagonal/commands/feature-start.md +0 -38
  518. package/presets/claude/php-laravel/commands/feature-continue.md +0 -23
  519. package/presets/claude/php-laravel/commands/feature-start.md +0 -38
  520. package/presets/claude/svelte/commands/feature-continue.md +0 -23
  521. package/presets/claude/svelte/commands/feature-start.md +0 -41
  522. package/presets/cursor/android-kotlin/commands/feature-continue.md +0 -23
  523. package/presets/cursor/android-kotlin/commands/feature-start.md +0 -41
  524. package/presets/cursor/go/commands/feature-continue.md +0 -23
  525. package/presets/cursor/go/commands/feature-start.md +0 -41
  526. package/presets/cursor/ios-swift/commands/feature-continue.md +0 -23
  527. package/presets/cursor/ios-swift/commands/feature-start.md +0 -41
  528. package/presets/cursor/java/commands/feature-continue.md +0 -23
  529. package/presets/cursor/java/commands/feature-start.md +0 -41
  530. package/presets/cursor/mcp-ts/commands/feature-continue.md +0 -23
  531. package/presets/cursor/mcp-ts/commands/feature-start.md +0 -41
  532. package/presets/cursor/next/commands/feature-continue.md +0 -23
  533. package/presets/cursor/next/commands/feature-start.md +0 -41
  534. package/presets/cursor/nuxt/commands/feature-continue.md +0 -23
  535. package/presets/cursor/nuxt/commands/feature-start.md +0 -41
  536. package/presets/cursor/php-hexagonal/commands/feature-continue.md +0 -23
  537. package/presets/cursor/php-hexagonal/commands/feature-start.md +0 -41
  538. package/presets/cursor/php-laravel/commands/feature-continue.md +0 -23
  539. package/presets/cursor/php-laravel/commands/feature-start.md +0 -41
  540. package/presets/cursor/svelte/commands/feature-continue.md +0 -23
  541. package/presets/cursor/svelte/commands/feature-start.md +0 -41
@@ -0,0 +1,411 @@
1
+ #!/usr/bin/env node
2
+ // Targeted tests for chain-team-phases.sh fixes that prevent `/task` pipelines
3
+ // from silently skipping or stalling on modern roles.
4
+ //
5
+ // Coverage:
6
+ // 1. openspec-author handoff path: the AGENT_HANDOFF['openspec-author']
7
+ // entry must be emitted so the orchestrator invokes the agent; the
8
+ // DEFAULT_ARTIFACT_OUTPUT_IDS['openspec-author'] entry must match the
9
+ // manifest's `openspec-change` receipt so the hook advances instead of
10
+ // stalling in `awaiting_artifact_receipt`.
11
+ // 2. QA / unit / playwright / instrumentation / integration / xcuitest
12
+ // agents must have both AGENT_HANDOFF and DEFAULT_ARTIFACT_OUTPUT_IDS
13
+ // entries (the symmetric check is in check-chain-hook-coverage.sh; here
14
+ // we drive a full pipeline step to make sure receipts reconcile).
15
+ // 3. Pipeline.json parse error: a malformed pipeline.json that still
16
+ // carries an `intent` field must NOT fall through to legacyFlow; the
17
+ // hook must write `state: blocked` and emit a followup_message that
18
+ // mentions `pipeline.json` so the orchestrator surfaces the error.
19
+ // 4. Legacy flow fallback: a missing pipeline.json must still invoke
20
+ // legacyFlow() (analysis → development → review → testing chain).
21
+ // 5. writeStatus durability: status.json must be durable (fsync) before the
22
+ // hook returns. We assert that a second reader immediately after the
23
+ // hook returns sees the new state.
24
+
25
+ import assert from 'node:assert/strict';
26
+ import { execFileSync, spawn } from 'node:child_process';
27
+ import fs from 'node:fs';
28
+ import path from 'node:path';
29
+ import { fileURLToPath } from 'node:url';
30
+
31
+ const scriptDirectory = path.dirname(fileURLToPath(import.meta.url));
32
+ const packageDirectory = path.resolve(scriptDirectory, '..');
33
+ const presetsDirectory = path.join(packageDirectory, 'presets');
34
+
35
+ const hooks = [
36
+ ...fs.readdirSync(path.join(presetsDirectory, 'cursor')).map((stack) => path.join(presetsDirectory, 'cursor', stack, 'hooks', 'chain-team-phases.sh')),
37
+ ...fs.readdirSync(path.join(presetsDirectory, 'claude')).map((stack) => path.join(presetsDirectory, 'claude', stack, 'hooks', 'chain-team-phases.sh')),
38
+ ];
39
+
40
+ assert.equal(hooks.length, 20, `expected 20 packaged hooks (10 stacks × 2 platforms), got ${hooks.length}`);
41
+
42
+ // mcp-ts does not ship openspec-author (per preset-no-cross-stack-leakage).
43
+ const HOOKS_WITH_OPENSPEC = hooks.filter((hook) => !hook.includes(`${path.sep}mcp-ts${path.sep}`));
44
+ assert.equal(HOOKS_WITH_OPENSPEC.length, 18, 'expected 18 hooks to cover openspec-author');
45
+
46
+ function readJson(filePath) {
47
+ return JSON.parse(fs.readFileSync(filePath, 'utf8'));
48
+ }
49
+
50
+ function writeJson(filePath, value) {
51
+ fs.writeFileSync(filePath, `${JSON.stringify(value, null, 2)}\n`);
52
+ }
53
+
54
+ function invokeHook(hook, workingDirectory, attemptId, payload = {}) {
55
+ return execFileSync('bash', [hook], {
56
+ cwd: workingDirectory,
57
+ encoding: 'utf8',
58
+ input: JSON.stringify({ status: 'completed', attemptId, ...payload }),
59
+ });
60
+ }
61
+
62
+ function platformFor(hook) {
63
+ return hook.includes(`${path.sep}cursor${path.sep}`) ? 'cursor' : 'claude';
64
+ }
65
+
66
+ function writeTask(root, hook, slug, pipeline, status, metrics, artifacts = {}) {
67
+ const platform = platformFor(hook);
68
+ const teamRoot = path.join(root, `.${platform}`, 'team');
69
+ const taskDirectory = path.join(teamRoot, 'tasks', slug);
70
+ fs.mkdirSync(taskDirectory, { recursive: true });
71
+ writeJson(path.join(teamRoot, 'active-task.json'), { slug });
72
+ writeJson(path.join(taskDirectory, 'pipeline.json'), pipeline);
73
+ writeJson(path.join(taskDirectory, 'status.json'), status);
74
+ writeJson(path.join(taskDirectory, 'metrics.json'), metrics);
75
+ for (const [name, content] of Object.entries(artifacts)) {
76
+ fs.writeFileSync(path.join(taskDirectory, name), content);
77
+ }
78
+ return { taskDirectory, platform };
79
+ }
80
+
81
+ const todayIso = '2026-08-21T00:00:00.000Z';
82
+ const earlierIso = '2026-08-21T00:00:01.000Z';
83
+
84
+ // ---------------------------------------------------------------------------
85
+ // Test 1 — openspec-author handoff: the hook must emit a followup_message that
86
+ // references openspec-author and the openspec-change scope, and the default
87
+ // artifact id must match the manifest receipt for `state` to advance.
88
+ // ---------------------------------------------------------------------------
89
+ for (const hook of HOOKS_WITH_OPENSPEC) {
90
+ const root = fs.mkdtempSync(path.join(packageDirectory, '.openspec-handoff-'));
91
+ try {
92
+ const runId = 'openspec-handoff-run';
93
+ const platform = platformFor(hook);
94
+ const analystAttemptId = `${runId}:step-0:task-analyst:attempt-1`;
95
+ const { taskDirectory } = writeTask(
96
+ root,
97
+ hook,
98
+ 'openspec-handoff',
99
+ {
100
+ intent: 'openspec-change',
101
+ profile: 'standard',
102
+ steps: [
103
+ { agent: 'task-analyst', label: 'Analyze' },
104
+ { agent: 'openspec-author', label: 'Author spec change', scope: 'openspec:MEDCARD-11762' },
105
+ ],
106
+ humanGates: [],
107
+ },
108
+ {
109
+ slug: 'openspec-handoff',
110
+ intent: 'openspec-change',
111
+ pipelineIndex: 0,
112
+ currentAgent: 'task-analyst',
113
+ phase: 'executing',
114
+ state: 'completed',
115
+ activeAttempts: {
116
+ [analystAttemptId]: {
117
+ agent: 'task-analyst',
118
+ stepIndex: 0,
119
+ attempt: 1,
120
+ startedAt: todayIso,
121
+ parallelGroupId: null,
122
+ },
123
+ },
124
+ metricsRunId: runId,
125
+ },
126
+ {
127
+ schemaVersion: 1,
128
+ task: { runId, slug: 'openspec-handoff', preset: 'ai-rules', stack: 'test', platform, intent: 'openspec-change', profile: 'standard' },
129
+ events: [
130
+ { eventId: `${runId}:task_started`, type: 'task_started', at: todayIso },
131
+ { eventId: `${runId}:analyst-start`, type: 'attempt_started', attemptId: analystAttemptId, agent: 'task-analyst', stepIndex: 0, attempt: 1, at: todayIso },
132
+ ],
133
+ },
134
+ );
135
+
136
+ const handoffRaw = invokeHook(hook, root, analystAttemptId);
137
+ const handoff = JSON.parse(handoffRaw).followup_message;
138
+ assert.match(handoff, /openspec-author/, `${hook}: handoff did not mention openspec-author`);
139
+ assert.match(handoff, /openspec:MEDCARD-11762/, `${hook}: handoff did not echo the openspec scope`);
140
+
141
+ const statusAfter = readJson(path.join(taskDirectory, 'status.json'));
142
+ assert.equal(statusAfter.pipelineIndex, 1, `${hook}: hook did not advance past the analyst step`);
143
+ assert.equal(statusAfter.currentAgent, 'openspec-author', `${hook}: next agent was not openspec-author`);
144
+ const activeAttempts = Object.values(statusAfter.activeAttempts || {});
145
+ assert.ok(activeAttempts.some((entry) => entry.agent === 'openspec-author'), `${hook}: openspec-author attempt was not activated`);
146
+
147
+ // Now finish the openspec-author attempt with a properly bound receipt
148
+ // (id: openspec-change) and assert the hook advances to the next step.
149
+ const openspecAttempt = Object.entries(statusAfter.activeAttempts).find(([, entry]) => entry.agent === 'openspec-author');
150
+ const openspecAttemptId = openspecAttempt[0];
151
+ // Use a timestamp after the attempt's actual startedAt — the hook filters
152
+ // out manifest receipts whose completedAt predates the attempt's start.
153
+ const freshIso = new Date().toISOString();
154
+ fs.writeFileSync(
155
+ path.join(taskDirectory, 'artifact-manifest.json'),
156
+ JSON.stringify(
157
+ {
158
+ schemaVersion: 1,
159
+ slug: 'openspec-handoff',
160
+ updatedAt: freshIso,
161
+ artifacts: [
162
+ {
163
+ id: 'openspec-change',
164
+ producer: 'openspec-author',
165
+ status: 'completed',
166
+ authoritativePaths: ['openspec/changes/MEDCARD-11762/proposal.md'],
167
+ acceptanceCriteriaIds: ['AC-1'],
168
+ taskIds: ['T1'],
169
+ timestamps: { createdAt: freshIso, updatedAt: freshIso, completedAt: freshIso },
170
+ receipt: {
171
+ outcome: 'completed',
172
+ attemptId: openspecAttemptId,
173
+ summary: 'Proposal + design + tasks emitted; openspec validate --strict PASS',
174
+ evidencePaths: ['openspec/changes/MEDCARD-11762/proposal.md'],
175
+ },
176
+ },
177
+ ],
178
+ },
179
+ null,
180
+ 2,
181
+ ) + '\n',
182
+ );
183
+ writeJson(path.join(taskDirectory, 'status.json'), { ...statusAfter, state: 'completed' });
184
+ const finishRaw = invokeHook(hook, root, openspecAttemptId);
185
+ const finishHandoff = JSON.parse(finishRaw).followup_message;
186
+ assert.match(finishHandoff, /Pipeline complete/, `${hook}: pipeline should complete after openspec-author finishes`);
187
+ const finalStatus = readJson(path.join(taskDirectory, 'status.json'));
188
+ assert.equal(finalStatus.phase, 'done', `${hook}: phase did not transition to done`);
189
+ assert.equal(finalStatus.state, 'completed', `${hook}: state did not reach completed after openspec-author`);
190
+ } finally {
191
+ fs.rmSync(root, { recursive: true, force: true });
192
+ }
193
+ }
194
+
195
+ // ---------------------------------------------------------------------------
196
+ // Test 2 — qa-tester + unit-test-* handoff: a QA step in a pipeline must
197
+ // advance. Before the fix, DEFAULT_ARTIFACT_OUTPUT_IDS lacked the QA entries
198
+ // so `artifactOutputIdFor` returned the agent name itself; manifest receipts
199
+ // landed under the right id (qa / unit-test-spec) and the hook stalled in
200
+ // awaiting_artifact_receipt.
201
+ // ---------------------------------------------------------------------------
202
+ for (const hook of hooks) {
203
+ const root = fs.mkdtempSync(path.join(packageDirectory, '.qa-tester-handoff-'));
204
+ try {
205
+ const platform = platformFor(hook);
206
+ const runId = 'qa-tester-run';
207
+ const devAttemptId = `${runId}:step-0:feature-developer:attempt-1`;
208
+ const { taskDirectory } = writeTask(
209
+ root,
210
+ hook,
211
+ 'qa-tester-handoff',
212
+ {
213
+ intent: 'test-only',
214
+ profile: 'standard',
215
+ steps: [
216
+ { agent: 'feature-developer', label: 'Implement' },
217
+ { agent: 'qa-tester', label: 'QA' },
218
+ ],
219
+ humanGates: [],
220
+ },
221
+ {
222
+ slug: 'qa-tester-handoff',
223
+ intent: 'test-only',
224
+ pipelineIndex: 0,
225
+ currentAgent: 'feature-developer',
226
+ phase: 'executing',
227
+ state: 'completed',
228
+ activeAttempts: {
229
+ [devAttemptId]: {
230
+ agent: 'feature-developer',
231
+ stepIndex: 0,
232
+ attempt: 1,
233
+ startedAt: todayIso,
234
+ parallelGroupId: null,
235
+ },
236
+ },
237
+ metricsRunId: runId,
238
+ },
239
+ {
240
+ schemaVersion: 1,
241
+ task: { runId, slug: 'qa-tester-handoff', preset: 'ai-rules', stack: 'test', platform, intent: 'test-only', profile: 'standard' },
242
+ events: [
243
+ { eventId: `${runId}:task_started`, type: 'task_started', at: todayIso },
244
+ { eventId: `${runId}:dev-start`, type: 'attempt_started', attemptId: devAttemptId, agent: 'feature-developer', stepIndex: 0, attempt: 1, at: todayIso },
245
+ ],
246
+ },
247
+ );
248
+ const handoff = JSON.parse(invokeHook(hook, root, devAttemptId)).followup_message;
249
+ assert.match(handoff, /qa-tester/, `${hook}: handoff did not mention qa-tester`);
250
+ const statusAfter = readJson(path.join(taskDirectory, 'status.json'));
251
+ assert.equal(statusAfter.pipelineIndex, 1, `${hook}: hook did not advance to qa-tester step`);
252
+ assert.equal(statusAfter.currentAgent, 'qa-tester', `${hook}: currentAgent was not qa-tester`);
253
+ } finally {
254
+ fs.rmSync(root, { recursive: true, force: true });
255
+ }
256
+ }
257
+
258
+ // ---------------------------------------------------------------------------
259
+ // Test 3 — pipeline.json parse error with intent: the hook must surface the
260
+ // error and write state: blocked; legacyFlow must NOT be silently used.
261
+ // ---------------------------------------------------------------------------
262
+ for (const hook of hooks) {
263
+ const root = fs.mkdtempSync(path.join(packageDirectory, '.pipeline-misparse-'));
264
+ try {
265
+ const platform = platformFor(hook);
266
+ const runId = 'misparse-run';
267
+ const devAttemptId = `${runId}:step-0:feature-developer:attempt-1`;
268
+ const taskDirectory = path.join(root, `.${platform}`, 'team', 'tasks', 'misparse');
269
+ fs.mkdirSync(taskDirectory, { recursive: true });
270
+ fs.writeFileSync(path.join(root, `.${platform}`, 'team', 'active-task.json'), JSON.stringify({ slug: 'misparse' }));
271
+ // Malformed pipeline.json with `intent` field — must NOT fall back to legacy.
272
+ fs.writeFileSync(
273
+ path.join(taskDirectory, 'pipeline.json'),
274
+ '{ "intent": "openspec-change", "steps": [\n { "agent": "openspec-author" }\n', // truncated JSON
275
+ );
276
+ writeJson(path.join(taskDirectory, 'status.json'), {
277
+ slug: 'misparse',
278
+ intent: 'openspec-change',
279
+ pipelineIndex: 0,
280
+ currentAgent: 'feature-developer',
281
+ phase: 'executing',
282
+ state: 'completed',
283
+ activeAttempts: {
284
+ [devAttemptId]: {
285
+ agent: 'feature-developer',
286
+ stepIndex: 0,
287
+ attempt: 1,
288
+ startedAt: todayIso,
289
+ parallelGroupId: null,
290
+ },
291
+ },
292
+ metricsRunId: runId,
293
+ });
294
+ writeJson(path.join(taskDirectory, 'metrics.json'), {
295
+ schemaVersion: 1,
296
+ task: { runId, slug: 'misparse', preset: 'ai-rules', stack: 'test', platform, intent: 'openspec-change', profile: 'standard' },
297
+ events: [
298
+ { eventId: `${runId}:task_started`, type: 'task_started', at: todayIso },
299
+ { eventId: `${runId}:start`, type: 'attempt_started', attemptId: devAttemptId, agent: 'feature-developer', stepIndex: 0, attempt: 1, at: todayIso },
300
+ ],
301
+ });
302
+
303
+ const raw = invokeHook(hook, root, devAttemptId);
304
+ const parsed = JSON.parse(raw);
305
+ const followup = parsed.followup_message || '';
306
+ assert.match(followup, /pipeline\.json is malformed/, `${hook}: hook did not surface parse error in followup_message (got: ${followup})`);
307
+ const status = readJson(path.join(taskDirectory, 'status.json'));
308
+ assert.equal(status.state, 'blocked', `${hook}: malformed pipeline with intent did not block the pipeline (got: ${status.state})`);
309
+ assert.equal(status.phase, 'blocked', `${hook}: phase did not transition to blocked`);
310
+ const metrics = readJson(path.join(taskDirectory, 'metrics.json'));
311
+ assert.ok(
312
+ metrics.events.some((event) => event.type === 'pipeline_parse_error'),
313
+ `${hook}: pipeline_parse_error metric event was not emitted`,
314
+ );
315
+ } finally {
316
+ fs.rmSync(root, { recursive: true, force: true });
317
+ }
318
+ }
319
+
320
+ // ---------------------------------------------------------------------------
321
+ // Test 4 — legacyFlow fallback: when pipeline.json is absent, the hook must
322
+ // continue to use legacyFlow (analysis → development → review → testing).
323
+ // ---------------------------------------------------------------------------
324
+ for (const hook of hooks) {
325
+ const root = fs.mkdtempSync(path.join(packageDirectory, '.legacy-fallback-'));
326
+ try {
327
+ const platform = platformFor(hook);
328
+ const taskDirectory = path.join(root, `.${platform}`, 'team', 'tasks', 'legacy-slug');
329
+ fs.mkdirSync(taskDirectory, { recursive: true });
330
+ fs.writeFileSync(path.join(root, `.${platform}`, 'team', 'active-task.json'), JSON.stringify({ slug: 'legacy-slug' }));
331
+ // No pipeline.json — legacy flow triggers.
332
+ writeJson(path.join(taskDirectory, 'status.json'), {
333
+ slug: 'legacy-slug',
334
+ intent: 'feature',
335
+ phase: 'development',
336
+ state: 'completed',
337
+ currentAgent: 'feature-developer',
338
+ pipelineIndex: 0,
339
+ });
340
+ const raw = invokeHook(hook, root, null);
341
+ const parsed = JSON.parse(raw);
342
+ const followup = parsed.followup_message || '';
343
+ assert.match(followup, /build-verifier/, `${hook}: legacy fallback did not invoke build-verifier (got: ${followup})`);
344
+ } finally {
345
+ fs.rmSync(root, { recursive: true, force: true });
346
+ }
347
+ }
348
+
349
+ // ---------------------------------------------------------------------------
350
+ // Test 5 — writeStatus durability: after the hook returns, the new
351
+ // status.json must already be on disk and reflect the post-step state. This
352
+ // is the property that lets the orchestrator's next read see the human-gate
353
+ // transition (no stale-read race).
354
+ // ---------------------------------------------------------------------------
355
+ for (const hook of HOOKS_WITH_OPENSPEC) {
356
+ const root = fs.mkdtempSync(path.join(packageDirectory, '.write-status-durability-'));
357
+ try {
358
+ const runId = 'durability-run';
359
+ const platform = platformFor(hook);
360
+ const analystAttemptId = `${runId}:step-0:task-analyst:attempt-1`;
361
+ const { taskDirectory } = writeTask(
362
+ root,
363
+ hook,
364
+ 'durability-slug',
365
+ {
366
+ intent: 'feature',
367
+ profile: 'standard',
368
+ steps: [
369
+ { agent: 'task-analyst', label: 'Analyze' },
370
+ { agent: 'openspec-author', label: 'Spec change' },
371
+ ],
372
+ humanGates: ['after:task-analyst'],
373
+ },
374
+ {
375
+ slug: 'durability-slug',
376
+ intent: 'feature',
377
+ pipelineIndex: 0,
378
+ currentAgent: 'task-analyst',
379
+ phase: 'executing',
380
+ state: 'completed',
381
+ activeAttempts: {
382
+ [analystAttemptId]: {
383
+ agent: 'task-analyst',
384
+ stepIndex: 0,
385
+ attempt: 1,
386
+ startedAt: todayIso,
387
+ parallelGroupId: null,
388
+ },
389
+ },
390
+ metricsRunId: runId,
391
+ },
392
+ {
393
+ schemaVersion: 1,
394
+ task: { runId, slug: 'durability-slug', preset: 'ai-rules', stack: 'test', platform, intent: 'feature', profile: 'standard' },
395
+ events: [
396
+ { eventId: `${runId}:task_started`, type: 'task_started', at: todayIso },
397
+ { eventId: `${runId}:start`, type: 'attempt_started', attemptId: analystAttemptId, agent: 'task-analyst', stepIndex: 0, attempt: 1, at: todayIso },
398
+ ],
399
+ },
400
+ );
401
+ // Sync + invoke hook; immediately read status.json without fsync of our own.
402
+ invokeHook(hook, root, analystAttemptId);
403
+ const onDisk = JSON.parse(fs.readFileSync(path.join(taskDirectory, 'status.json'), 'utf8'));
404
+ assert.equal(onDisk.awaitingHumanGate, true, `${hook}: human gate was not durably written to status.json`);
405
+ assert.equal(onDisk.state, 'awaiting_approval', `${hook}: state did not durably transition to awaiting_approval`);
406
+ } finally {
407
+ fs.rmSync(root, { recursive: true, force: true });
408
+ }
409
+ }
410
+
411
+ console.log(`Verified openspec-author handoff, qa-tester handoff, pipeline misparse blocking, legacy fallback, and writeStatus durability in ${hooks.length} hooks.`);
@@ -1,23 +0,0 @@
1
- ---
2
- name: feature-continue
3
- description: Legacy alias for /task-continue that resumes a feature pipeline after human approval or pause.
4
- ---
5
-
6
- # Feature continue — legacy alias
7
-
8
- > **Prefer:** `/task-continue <slug>` — same behavior, respects `pipeline.json`.
9
-
10
- Continue after a human gate. Full logic is in **`task-continue.md`**.
11
-
12
- ## Short version
13
-
14
- 1. Read `pipeline.json` (if present) and `status.json`.
15
- 2. Clear `awaitingHumanGate`; determine the next step from `pipelineIndex`.
16
- 3. Invoke the subagent for `currentAgent`.
17
- 4. The hook continues the chain when `autoChain: true`.
18
-
19
- See `task-continue.md` for details and the handoff table.
20
-
21
- ## Product specs (docs/specs)
22
-
23
- When the next agent is **feature-developer** (or other implementer): if `docs/specs/INDEX.md` exists, instruct them to load **`product-specs`** and honor **Related specs** from `brief.md` (behavior SoT). Soft-fail on miss; never invent product behavior. No-op if INDEX is absent.
@@ -1,41 +0,0 @@
1
- ---
2
- name: feature-start
3
- description: Legacy analyst-only feature intake. Prefer /task for new work because it uses router and dynamic pipeline.
4
- ---
5
-
6
- # Feature start — legacy (analyst only)
7
-
8
- > **Prefer:** `/task <description>` — the router chooses roles and order automatically.
9
-
10
- Starts the **analysis phase** without the router. The parent agent acts as orchestrator (see `tooling-and-review/agent-team-orchestrator.md`).
11
-
12
- ## What to do
13
-
14
- 1. Extract the task description from the command arguments (everything after `/feature-start`).
15
- 2. Generate a **slug** (kebab-case, up to 48 characters) from the task title.
16
- 3. Create `.claude/team/tasks/<slug>/` if it does not exist yet — via **Write** of an artifact (not Shell `mkdir`).
17
- 4. Write `.claude/team/active-task.json` → `{ "slug": "<slug>" }`.
18
- 5. Optional: minimal `pipeline.json` with fixed steps (analyst → developer → reviewer → qa-tester).
19
- 6. Invoke subagent **task-analyst** (Task tool) with the full task description and artifact paths.
20
- 7. Wait for the analyst to finish. **Do not invoke developer** at this stage.
21
-
22
- ## Product specs (docs/specs)
23
-
24
- When invoking **task-analyst**: if `docs/specs/INDEX.md` exists, instruct consume via **`product-specs`** and cite **Related specs**. Soft-fail on miss; never invent behavior.
25
-
26
- If the user/AC requests generation or bootstrap, or INDEX is missing **with** bootstrap AC / `/spec-start` intent: instruct **author mode** inside the same analyst step — load **`product-specs-authoring`** + skill **`spec-authoring`**. Authoring is **not** a separate pipeline agent. Handoff must list created paths + INDEX diff; human gate must approve generated specs before feature-developer.
27
-
28
-
29
- ## Human gate
30
-
31
- After the analyst:
32
-
33
- - Show the user links to `brief.md` and `decomposition.md`.
34
- - Also ask them to check **Related specs** in `brief.md` when `docs/specs/INDEX.md` exists.
35
- - Ask them to review and approve or send edits.
36
- - To continue: `/task-continue <slug>` or `/feature-continue <slug>`.
37
-
38
- ## If the slug already exists
39
-
40
- - If `status.json` is `awaiting_approval` — offer review or continue.
41
- - If the task is in progress — ask whether to continue or start a new slug.
@@ -1,23 +0,0 @@
1
- ---
2
- name: feature-continue
3
- description: Legacy alias for /task-continue that resumes a feature pipeline after human approval or pause.
4
- ---
5
-
6
- # Feature continue — legacy alias
7
-
8
- > **Prefer:** `/task-continue <slug>` — same behavior, respects `pipeline.json`.
9
-
10
- Continue after a human gate. Full logic — in **`task-continue.md`**.
11
-
12
- ## Short form
13
-
14
- 1. Read `pipeline.json` (if present) and `status.json`.
15
- 2. Clear `awaitingHumanGate`; determine the next step from `pipelineIndex`.
16
- 3. Invoke the subagent for `currentAgent`.
17
- 4. The hook continues the chain when `autoChain: true`.
18
-
19
- See `task-continue.md` for details and the handoff table.
20
-
21
- ## Product specs (docs/specs)
22
-
23
- When the next agent is **feature-developer** (or other implementer): if `docs/specs/INDEX.md` exists, instruct them to load **`product-specs`** and honor **Related specs** from `brief.md` (behavior SoT). Soft-fail on miss; never invent product behavior. No-op if INDEX is absent.
@@ -1,38 +0,0 @@
1
- ---
2
- name: feature-start
3
- description: Legacy analyst-only feature intake. Prefer /task for new work because it uses router and dynamic pipeline.
4
- ---
5
-
6
- # Feature start — legacy agent command
7
-
8
- Starts the **analysis phase** for a new task. For new work, prefer `/task` because it builds a dynamic pipeline via `task-router` first.
9
-
10
- ## What to do
11
-
12
- 1. Extract the task description from command arguments (everything after `/feature-start`).
13
- 2. Generate a **slug** (kebab-case, up to 48 characters) from the task title.
14
- 3. Create `.claude/team/tasks/<slug>/` if it does not exist — via Write / Edit, not Shell `mkdir`.
15
- 4. Write `.claude/team/active-task.json` → `{ "slug": "<slug>" }`.
16
- 5. Invoke subagent **task-analyst** with the full task description and artifact paths.
17
- 6. Wait for the analyst to finish. **Do not invoke developer** at this stage.
18
-
19
- ## Product specs (docs/specs)
20
-
21
- When invoking **task-analyst**: if `docs/specs/INDEX.md` exists, instruct consume via **`product-specs`** and cite **Related specs**. Soft-fail on miss; never invent behavior.
22
-
23
- If the user/AC requests generation or bootstrap, or INDEX is missing **with** bootstrap AC / `/spec-start` intent: instruct **author mode** inside the same analyst step — load **`product-specs-authoring`** + skill **`spec-authoring`**. Authoring is **not** a separate pipeline agent. Handoff must list created paths + INDEX diff; human gate must approve generated specs before feature-developer.
24
-
25
-
26
- ## Human gate
27
-
28
- After the analyst:
29
-
30
- - Show the user links to `brief.md` and `decomposition.md`.
31
- - Also ask them to check **Related specs** in `brief.md` when `docs/specs/INDEX.md` exists.
32
- - Ask them to review and approve or send edits.
33
- - To continue: `/feature-continue <slug>` or `/task-continue <slug>`.
34
-
35
- ## If slug already exists
36
-
37
- - If `status.json` is `awaiting_approval` — offer review or `/feature-continue`.
38
- - If the task is in progress — ask whether to continue or start a new slug.
@@ -1,23 +0,0 @@
1
- ---
2
- name: feature-continue
3
- description: Legacy alias for /task-continue that resumes a feature pipeline after human approval or pause.
4
- ---
5
-
6
- # Feature continue — legacy alias
7
-
8
- > **Prefer:** `/task-continue <slug>` — same behavior, respects `pipeline.json`.
9
-
10
- Continue after a human gate. Full logic is in **`task-continue.md`**.
11
-
12
- ## Short version
13
-
14
- 1. Read `pipeline.json` (if present) and `status.json`.
15
- 2. Clear `awaitingHumanGate`; determine the next step from `pipelineIndex`.
16
- 3. Invoke the subagent for `currentAgent`.
17
- 4. The hook continues the chain when `autoChain: true`.
18
-
19
- See `task-continue.md` for details and the handoff table.
20
-
21
- ## Product specs (docs/specs)
22
-
23
- When the next agent is **feature-developer** (or other implementer): if `docs/specs/INDEX.md` exists, instruct them to load **`product-specs`** and honor **Related specs** from `brief.md` (behavior SoT). Soft-fail on miss; never invent product behavior. No-op if INDEX is absent.
@@ -1,41 +0,0 @@
1
- ---
2
- name: feature-start
3
- description: Legacy analyst-only feature intake. Prefer /task for new work because it uses router and dynamic pipeline.
4
- ---
5
-
6
- # Feature start — legacy (analyst only)
7
-
8
- > **Prefer:** `/task <description>` — the router chooses roles and order automatically.
9
-
10
- Starts the **analysis phase** without the router. The parent agent acts as orchestrator (see `tooling-and-review/agent-team-orchestrator.md`).
11
-
12
- ## What to do
13
-
14
- 1. Extract the task description from the command arguments (everything after `/feature-start`).
15
- 2. Generate a **slug** (kebab-case, up to 48 characters) from the task title.
16
- 3. Create `.claude/team/tasks/<slug>/` if it does not exist yet — via **Write** of an artifact (not Shell `mkdir`).
17
- 4. Write `.claude/team/active-task.json` → `{ "slug": "<slug>" }`.
18
- 5. Optional: minimal `pipeline.json` with fixed steps (analyst → developer → reviewer → qa-tester).
19
- 6. Invoke subagent **task-analyst** (Task tool) with the full task description and artifact paths.
20
- 7. Wait for the analyst to finish. **Do not invoke developer** at this stage.
21
-
22
- ## Product specs (docs/specs)
23
-
24
- When invoking **task-analyst**: if `docs/specs/INDEX.md` exists, instruct consume via **`product-specs`** and cite **Related specs**. Soft-fail on miss; never invent behavior.
25
-
26
- If the user/AC requests generation or bootstrap, or INDEX is missing **with** bootstrap AC / `/spec-start` intent: instruct **author mode** inside the same analyst step — load **`product-specs-authoring`** + skill **`spec-authoring`**. Authoring is **not** a separate pipeline agent. Handoff must list created paths + INDEX diff; human gate must approve generated specs before feature-developer.
27
-
28
-
29
- ## Human gate
30
-
31
- After the analyst:
32
-
33
- - Show the user links to `brief.md` and `decomposition.md`.
34
- - Also ask them to check **Related specs** in `brief.md` when `docs/specs/INDEX.md` exists.
35
- - Ask them to review and approve or send edits.
36
- - To continue: `/task-continue <slug>` or `/feature-continue <slug>`.
37
-
38
- ## If the slug already exists
39
-
40
- - If `status.json` is `awaiting_approval` — offer review or continue.
41
- - If the task is in progress — ask whether to continue or start a new slug.
@@ -1,23 +0,0 @@
1
- ---
2
- name: feature-continue
3
- description: Legacy alias for /task-continue that resumes a feature pipeline after human approval or pause.
4
- ---
5
-
6
- # Feature continue — legacy alias
7
-
8
- > **Prefer:** `/task-continue <slug>` — same behavior, respects `pipeline.json`.
9
-
10
- Continue after a human gate. Full logic — in **`task-continue.md`**.
11
-
12
- ## Short form
13
-
14
- 1. Read `pipeline.json` (if present) and `status.json`.
15
- 2. Clear `awaitingHumanGate`; determine the next step from `pipelineIndex`.
16
- 3. Invoke the subagent for `currentAgent`.
17
- 4. The hook continues the chain when `autoChain: true`.
18
-
19
- See `task-continue.md` for details and the handoff table.
20
-
21
- ## Product specs (docs/specs)
22
-
23
- When the next agent is **feature-developer** (or other implementer): if `docs/specs/INDEX.md` exists, instruct them to load **`product-specs`** and honor **Related specs** from `brief.md` (behavior SoT). Soft-fail on miss; never invent product behavior. No-op if INDEX is absent.
@@ -1,38 +0,0 @@
1
- ---
2
- name: feature-start
3
- description: Legacy analyst-only feature intake. Prefer /task for new work because it uses router and dynamic pipeline.
4
- ---
5
-
6
- # Feature start — legacy agent command
7
-
8
- Starts the **analysis phase** for a new task. For new work, prefer `/task` because it builds a dynamic pipeline via `task-router` first.
9
-
10
- ## What to do
11
-
12
- 1. Extract the task description from command arguments (everything after `/feature-start`).
13
- 2. Generate a **slug** (kebab-case, up to 48 characters) from the task title.
14
- 3. Create `.claude/team/tasks/<slug>/` if it does not exist — via Write / Edit, not Shell `mkdir`.
15
- 4. Write `.claude/team/active-task.json` → `{ "slug": "<slug>" }`.
16
- 5. Invoke subagent **task-analyst** with the full task description and artifact paths.
17
- 6. Wait for the analyst to finish. **Do not invoke developer** at this stage.
18
-
19
- ## Product specs (docs/specs)
20
-
21
- When invoking **task-analyst**: if `docs/specs/INDEX.md` exists, instruct consume via **`product-specs`** and cite **Related specs**. Soft-fail on miss; never invent behavior.
22
-
23
- If the user/AC requests generation or bootstrap, or INDEX is missing **with** bootstrap AC / `/spec-start` intent: instruct **author mode** inside the same analyst step — load **`product-specs-authoring`** + skill **`spec-authoring`**. Authoring is **not** a separate pipeline agent. Handoff must list created paths + INDEX diff; human gate must approve generated specs before feature-developer.
24
-
25
-
26
- ## Human gate
27
-
28
- After the analyst:
29
-
30
- - Show the user links to `brief.md` and `decomposition.md`.
31
- - Also ask them to check **Related specs** in `brief.md` when `docs/specs/INDEX.md` exists.
32
- - Ask them to review and approve or send edits.
33
- - To continue: `/feature-continue <slug>` or `/task-continue <slug>`.
34
-
35
- ## If slug already exists
36
-
37
- - If `status.json` is `awaiting_approval` — offer review or `/feature-continue`.
38
- - If the task is in progress — ask whether to continue or start a new slug.