@pennixrv/trellis 0.7.0-beta.9 → 0.7.1

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 (483) hide show
  1. package/README.md +1 -1
  2. package/dist/cli/index.d.ts.map +1 -1
  3. package/dist/cli/index.js +14 -26
  4. package/dist/cli/index.js.map +1 -1
  5. package/dist/commands/ablate.js +1 -1
  6. package/dist/commands/ablate.js.map +1 -1
  7. package/dist/commands/init.d.ts.map +1 -1
  8. package/dist/commands/init.js +30 -56
  9. package/dist/commands/init.js.map +1 -1
  10. package/dist/commands/task-progress.d.ts +2 -0
  11. package/dist/commands/task-progress.d.ts.map +1 -1
  12. package/dist/commands/task-progress.js +37 -30
  13. package/dist/commands/task-progress.js.map +1 -1
  14. package/dist/commands/{channel → teamwork}/adapters/claude.d.ts +3 -3
  15. package/dist/commands/teamwork/adapters/claude.d.ts.map +1 -0
  16. package/dist/commands/{channel → teamwork}/adapters/claude.js +3 -3
  17. package/dist/commands/teamwork/adapters/claude.js.map +1 -0
  18. package/dist/commands/{channel → teamwork}/adapters/codex.d.ts +1 -15
  19. package/dist/commands/teamwork/adapters/codex.d.ts.map +1 -0
  20. package/dist/commands/{channel → teamwork}/adapters/codex.js +5 -42
  21. package/dist/commands/teamwork/adapters/codex.js.map +1 -0
  22. package/dist/commands/{channel → teamwork}/adapters/index.d.ts +6 -6
  23. package/dist/commands/teamwork/adapters/index.d.ts.map +1 -0
  24. package/dist/commands/{channel → teamwork}/adapters/index.js +16 -52
  25. package/dist/commands/teamwork/adapters/index.js.map +1 -0
  26. package/dist/commands/{channel → teamwork}/adapters/types.d.ts +2 -2
  27. package/dist/commands/teamwork/adapters/types.d.ts.map +1 -0
  28. package/dist/commands/teamwork/adapters/types.js.map +1 -0
  29. package/dist/commands/{channel → teamwork}/agent-loader.d.ts +2 -4
  30. package/dist/commands/teamwork/agent-loader.d.ts.map +1 -0
  31. package/dist/commands/{channel → teamwork}/agent-loader.js +4 -35
  32. package/dist/commands/teamwork/agent-loader.js.map +1 -0
  33. package/dist/commands/teamwork/artifact.d.ts +177 -0
  34. package/dist/commands/teamwork/artifact.d.ts.map +1 -0
  35. package/dist/commands/teamwork/artifact.js +908 -0
  36. package/dist/commands/teamwork/artifact.js.map +1 -0
  37. package/dist/commands/{channel → teamwork}/context-loader.d.ts +1 -1
  38. package/dist/commands/teamwork/context-loader.d.ts.map +1 -0
  39. package/dist/commands/{channel → teamwork}/context-loader.js +12 -12
  40. package/dist/commands/teamwork/context-loader.js.map +1 -0
  41. package/dist/commands/{channel → teamwork}/context-trust.d.ts +6 -6
  42. package/dist/commands/teamwork/context-trust.d.ts.map +1 -0
  43. package/dist/commands/{channel → teamwork}/context-trust.js +16 -16
  44. package/dist/commands/teamwork/context-trust.js.map +1 -0
  45. package/dist/commands/teamwork/context.d.ts +16 -0
  46. package/dist/commands/teamwork/context.d.ts.map +1 -0
  47. package/dist/commands/{channel → teamwork}/context.js +17 -17
  48. package/dist/commands/teamwork/context.js.map +1 -0
  49. package/dist/commands/teamwork/coordinator.d.ts +89 -0
  50. package/dist/commands/teamwork/coordinator.d.ts.map +1 -0
  51. package/dist/commands/teamwork/coordinator.js +1198 -0
  52. package/dist/commands/teamwork/coordinator.js.map +1 -0
  53. package/dist/commands/teamwork/create.d.ts +23 -0
  54. package/dist/commands/teamwork/create.d.ts.map +1 -0
  55. package/dist/commands/teamwork/create.js +39 -0
  56. package/dist/commands/teamwork/create.js.map +1 -0
  57. package/dist/commands/{channel → teamwork}/dev-parse-trace.d.ts +1 -1
  58. package/dist/commands/teamwork/dev-parse-trace.d.ts.map +1 -0
  59. package/dist/commands/{channel → teamwork}/dev-parse-trace.js +1 -1
  60. package/dist/commands/teamwork/dev-parse-trace.js.map +1 -0
  61. package/dist/commands/{channel → teamwork}/guard.d.ts +27 -46
  62. package/dist/commands/teamwork/guard.d.ts.map +1 -0
  63. package/dist/commands/{channel → teamwork}/guard.js +54 -156
  64. package/dist/commands/teamwork/guard.js.map +1 -0
  65. package/dist/commands/teamwork/index.d.ts +3 -0
  66. package/dist/commands/teamwork/index.d.ts.map +1 -0
  67. package/dist/commands/{channel → teamwork}/index.js +135 -165
  68. package/dist/commands/teamwork/index.js.map +1 -0
  69. package/dist/commands/{channel → teamwork}/interrupt.d.ts +1 -1
  70. package/dist/commands/teamwork/interrupt.d.ts.map +1 -0
  71. package/dist/commands/teamwork/interrupt.js +22 -0
  72. package/dist/commands/teamwork/interrupt.js.map +1 -0
  73. package/dist/commands/teamwork/kill.d.ts +7 -0
  74. package/dist/commands/teamwork/kill.d.ts.map +1 -0
  75. package/dist/commands/{channel → teamwork}/kill.js +21 -21
  76. package/dist/commands/teamwork/kill.js.map +1 -0
  77. package/dist/commands/teamwork/list.d.ts +17 -0
  78. package/dist/commands/teamwork/list.d.ts.map +1 -0
  79. package/dist/commands/{channel → teamwork}/list.js +18 -27
  80. package/dist/commands/teamwork/list.js.map +1 -0
  81. package/dist/commands/{channel → teamwork}/messages.d.ts +1 -1
  82. package/dist/commands/teamwork/messages.d.ts.map +1 -0
  83. package/dist/commands/{channel → teamwork}/messages.js +18 -18
  84. package/dist/commands/teamwork/messages.js.map +1 -0
  85. package/dist/commands/teamwork/profiles.d.ts +25 -0
  86. package/dist/commands/teamwork/profiles.d.ts.map +1 -0
  87. package/dist/commands/teamwork/profiles.js +125 -0
  88. package/dist/commands/teamwork/profiles.js.map +1 -0
  89. package/dist/commands/teamwork/rm.d.ts +27 -0
  90. package/dist/commands/teamwork/rm.d.ts.map +1 -0
  91. package/dist/commands/{channel → teamwork}/rm.js +21 -22
  92. package/dist/commands/teamwork/rm.js.map +1 -0
  93. package/dist/commands/teamwork/run.d.ts +29 -0
  94. package/dist/commands/{channel → teamwork}/run.d.ts.map +1 -1
  95. package/dist/commands/teamwork/run.js +129 -0
  96. package/dist/commands/teamwork/run.js.map +1 -0
  97. package/dist/commands/{channel → teamwork}/send.d.ts +1 -1
  98. package/dist/commands/teamwork/send.d.ts.map +1 -0
  99. package/dist/commands/{channel → teamwork}/send.js +7 -7
  100. package/dist/commands/teamwork/send.js.map +1 -0
  101. package/dist/commands/{channel → teamwork}/spawn.d.ts +8 -12
  102. package/dist/commands/teamwork/spawn.d.ts.map +1 -0
  103. package/dist/commands/{channel → teamwork}/spawn.js +51 -112
  104. package/dist/commands/teamwork/spawn.js.map +1 -0
  105. package/dist/commands/teamwork/store/events.d.ts +22 -0
  106. package/dist/commands/teamwork/store/events.d.ts.map +1 -0
  107. package/dist/commands/{channel → teamwork}/store/events.js +8 -8
  108. package/dist/commands/teamwork/store/events.js.map +1 -0
  109. package/dist/commands/teamwork/store/filter.d.ts +3 -0
  110. package/dist/commands/teamwork/store/filter.d.ts.map +1 -0
  111. package/dist/commands/teamwork/store/filter.js +2 -0
  112. package/dist/commands/teamwork/store/filter.js.map +1 -0
  113. package/dist/commands/{channel → teamwork}/store/lock.d.ts +1 -1
  114. package/dist/commands/teamwork/store/lock.d.ts.map +1 -0
  115. package/dist/commands/{channel → teamwork}/store/lock.js +2 -2
  116. package/dist/commands/teamwork/store/lock.js.map +1 -0
  117. package/dist/commands/{channel → teamwork}/store/paths.d.ts +18 -32
  118. package/dist/commands/teamwork/store/paths.d.ts.map +1 -0
  119. package/dist/commands/{channel → teamwork}/store/paths.js +42 -109
  120. package/dist/commands/teamwork/store/paths.js.map +1 -0
  121. package/dist/commands/teamwork/store/schema.d.ts +18 -0
  122. package/dist/commands/teamwork/store/schema.d.ts.map +1 -0
  123. package/dist/commands/teamwork/store/schema.js +23 -0
  124. package/dist/commands/teamwork/store/schema.js.map +1 -0
  125. package/dist/commands/{channel → teamwork}/store/thread-state.d.ts +3 -3
  126. package/dist/commands/teamwork/store/thread-state.d.ts.map +1 -0
  127. package/dist/commands/{channel → teamwork}/store/thread-state.js +1 -1
  128. package/dist/commands/teamwork/store/thread-state.js.map +1 -0
  129. package/dist/commands/teamwork/store/watch.d.ts +19 -0
  130. package/dist/commands/teamwork/store/watch.d.ts.map +1 -0
  131. package/dist/commands/{channel → teamwork}/store/watch.js +8 -8
  132. package/dist/commands/teamwork/store/watch.js.map +1 -0
  133. package/dist/commands/teamwork/supervisor/idle.d.ts.map +1 -0
  134. package/dist/commands/teamwork/supervisor/idle.js.map +1 -0
  135. package/dist/commands/{channel → teamwork}/supervisor/inbox.d.ts +2 -2
  136. package/dist/commands/teamwork/supervisor/inbox.d.ts.map +1 -0
  137. package/dist/commands/{channel → teamwork}/supervisor/inbox.js +14 -14
  138. package/dist/commands/teamwork/supervisor/inbox.js.map +1 -0
  139. package/dist/commands/{channel → teamwork}/supervisor/shutdown.d.ts +3 -6
  140. package/dist/commands/teamwork/supervisor/shutdown.d.ts.map +1 -0
  141. package/dist/commands/{channel → teamwork}/supervisor/shutdown.js +7 -17
  142. package/dist/commands/teamwork/supervisor/shutdown.js.map +1 -0
  143. package/dist/commands/{channel → teamwork}/supervisor/stdout.d.ts +3 -5
  144. package/dist/commands/teamwork/supervisor/stdout.d.ts.map +1 -0
  145. package/dist/commands/{channel → teamwork}/supervisor/stdout.js +12 -23
  146. package/dist/commands/teamwork/supervisor/stdout.js.map +1 -0
  147. package/dist/commands/teamwork/supervisor/turns.d.ts.map +1 -0
  148. package/dist/commands/teamwork/supervisor/turns.js.map +1 -0
  149. package/dist/commands/{channel → teamwork}/supervisor/warning.d.ts +5 -5
  150. package/dist/commands/teamwork/supervisor/warning.d.ts.map +1 -0
  151. package/dist/commands/{channel → teamwork}/supervisor/warning.js +6 -6
  152. package/dist/commands/teamwork/supervisor/warning.js.map +1 -0
  153. package/dist/commands/{channel → teamwork}/supervisor.d.ts +21 -21
  154. package/dist/commands/teamwork/supervisor.d.ts.map +1 -0
  155. package/dist/commands/{channel → teamwork}/supervisor.js +53 -63
  156. package/dist/commands/teamwork/supervisor.js.map +1 -0
  157. package/dist/commands/teamwork/teammate-adapters.d.ts +31 -0
  158. package/dist/commands/teamwork/teammate-adapters.d.ts.map +1 -0
  159. package/dist/commands/teamwork/teammate-adapters.js +96 -0
  160. package/dist/commands/teamwork/teammate-adapters.js.map +1 -0
  161. package/dist/commands/teamwork/teammate-config.d.ts +19 -0
  162. package/dist/commands/teamwork/teammate-config.d.ts.map +1 -0
  163. package/dist/commands/teamwork/teammate-config.js +97 -0
  164. package/dist/commands/teamwork/teammate-config.js.map +1 -0
  165. package/dist/commands/teamwork/teammate-launch.d.ts +58 -0
  166. package/dist/commands/teamwork/teammate-launch.d.ts.map +1 -0
  167. package/dist/commands/teamwork/teammate-launch.js +125 -0
  168. package/dist/commands/teamwork/teammate-launch.js.map +1 -0
  169. package/dist/commands/teamwork/text-body.d.ts +13 -0
  170. package/dist/commands/teamwork/text-body.d.ts.map +1 -0
  171. package/dist/commands/{channel → teamwork}/text-body.js +3 -3
  172. package/dist/commands/teamwork/text-body.js.map +1 -0
  173. package/dist/commands/teamwork/threads.d.ts +35 -0
  174. package/dist/commands/teamwork/threads.d.ts.map +1 -0
  175. package/dist/commands/{channel → teamwork}/threads.js +19 -19
  176. package/dist/commands/teamwork/threads.js.map +1 -0
  177. package/dist/commands/teamwork/title.d.ts +12 -0
  178. package/dist/commands/teamwork/title.d.ts.map +1 -0
  179. package/dist/commands/teamwork/title.js +24 -0
  180. package/dist/commands/teamwork/title.js.map +1 -0
  181. package/dist/commands/{channel → teamwork}/wait.d.ts +1 -5
  182. package/dist/commands/teamwork/wait.d.ts.map +1 -0
  183. package/dist/commands/{channel → teamwork}/wait.js +8 -21
  184. package/dist/commands/teamwork/wait.js.map +1 -0
  185. package/dist/commands/update.d.ts.map +1 -1
  186. package/dist/commands/update.js +48 -89
  187. package/dist/commands/update.js.map +1 -1
  188. package/dist/commands/workflow.d.ts +1 -1
  189. package/dist/commands/workflow.d.ts.map +1 -1
  190. package/dist/commands/workflow.js +9 -10
  191. package/dist/commands/workflow.js.map +1 -1
  192. package/dist/configurators/claude.d.ts +0 -17
  193. package/dist/configurators/claude.d.ts.map +1 -1
  194. package/dist/configurators/claude.js +2 -61
  195. package/dist/configurators/claude.js.map +1 -1
  196. package/dist/configurators/shared.d.ts.map +1 -1
  197. package/dist/configurators/shared.js +2 -2
  198. package/dist/configurators/shared.js.map +1 -1
  199. package/dist/configurators/snow.js +1 -1
  200. package/dist/configurators/snow.js.map +1 -1
  201. package/dist/configurators/workflow.d.ts +1 -1
  202. package/dist/configurators/workflow.js +5 -5
  203. package/dist/configurators/workflow.js.map +1 -1
  204. package/dist/constants/paths.d.ts +1 -1
  205. package/dist/constants/paths.d.ts.map +1 -1
  206. package/dist/constants/paths.js +1 -1
  207. package/dist/constants/paths.js.map +1 -1
  208. package/dist/migrations/manifests/0.7.0-beta.10.json +9 -0
  209. package/dist/migrations/manifests/0.7.0-beta.11.json +9 -0
  210. package/dist/migrations/manifests/0.7.0-beta.12.json +9 -0
  211. package/dist/migrations/manifests/0.7.0-beta.13.json +9 -0
  212. package/dist/migrations/manifests/0.7.0-beta.14.json +9 -0
  213. package/dist/migrations/manifests/0.7.0-beta.15.json +9 -0
  214. package/dist/migrations/manifests/0.7.0-beta.16.json +9 -0
  215. package/dist/migrations/manifests/0.7.0-beta.17.json +9 -0
  216. package/dist/migrations/manifests/0.7.0-beta.18.json +9 -0
  217. package/dist/migrations/manifests/0.7.0-beta.19.json +9 -0
  218. package/dist/migrations/manifests/0.7.0-beta.20.json +9 -0
  219. package/dist/migrations/manifests/0.7.0-beta.21.json +17 -0
  220. package/dist/migrations/manifests/0.7.0-beta.22.json +9 -0
  221. package/dist/migrations/manifests/0.7.0-beta.23.json +9 -0
  222. package/dist/migrations/manifests/0.7.0-beta.24.json +9 -0
  223. package/dist/migrations/manifests/0.7.0-beta.25.json +9 -0
  224. package/dist/migrations/manifests/0.7.0-beta.26.json +9 -0
  225. package/dist/migrations/manifests/0.7.0-beta.27.json +9 -0
  226. package/dist/migrations/manifests/0.7.0-beta.28.json +9 -0
  227. package/dist/migrations/manifests/0.7.0-beta.29.json +9 -0
  228. package/dist/migrations/manifests/0.7.0-beta.30.json +9 -0
  229. package/dist/migrations/manifests/0.7.0-beta.31.json +9 -0
  230. package/dist/migrations/manifests/0.7.0-beta.32.json +9 -0
  231. package/dist/migrations/manifests/0.7.0-beta.33.json +9 -0
  232. package/dist/migrations/manifests/0.7.0-beta.34.json +9 -0
  233. package/dist/migrations/manifests/0.7.0-beta.35.json +9 -0
  234. package/dist/migrations/manifests/0.7.0-beta.36.json +9 -0
  235. package/dist/migrations/manifests/0.7.0-beta.37.json +9 -0
  236. package/dist/migrations/manifests/0.7.0-beta.38.json +9 -0
  237. package/dist/migrations/manifests/0.7.0-beta.39.json +9 -0
  238. package/dist/migrations/manifests/0.7.0-beta.40.json +9 -0
  239. package/dist/migrations/manifests/0.7.0-beta.41.json +9 -0
  240. package/dist/migrations/manifests/0.7.0-beta.42.json +9 -0
  241. package/dist/migrations/manifests/0.7.0-beta.43.json +9 -0
  242. package/dist/migrations/manifests/0.7.0-beta.44.json +9 -0
  243. package/dist/migrations/manifests/0.7.0-beta.45.json +9 -0
  244. package/dist/migrations/manifests/0.7.0-beta.46.json +9 -0
  245. package/dist/migrations/manifests/0.7.0-beta.47.json +9 -0
  246. package/dist/migrations/manifests/0.7.0-beta.48.json +9 -0
  247. package/dist/migrations/manifests/0.7.0-beta.49.json +13 -0
  248. package/dist/migrations/manifests/0.7.0-beta.50.json +12 -0
  249. package/dist/migrations/manifests/0.7.0-beta.51.json +9 -0
  250. package/dist/migrations/manifests/0.7.0-beta.52.json +9 -0
  251. package/dist/migrations/manifests/0.7.0-beta.53.json +27 -0
  252. package/dist/migrations/manifests/0.7.0-beta.54.json +8 -0
  253. package/dist/migrations/manifests/0.7.1.json +9 -0
  254. package/dist/templates/claude/hooks/statusline.py +0 -7
  255. package/dist/templates/codex/hooks/session-start.py +31 -38
  256. package/dist/templates/common/bundled-skills/trellis-decision-space-construction-and-merging/SKILL.md +10 -0
  257. package/dist/templates/common/bundled-skills/trellis-decision-space-construction-and-merging/workflow.md +40 -0
  258. package/dist/templates/common/bundled-skills/trellis-delivery-review-and-closeout/SKILL.md +10 -0
  259. package/dist/templates/common/bundled-skills/trellis-delivery-review-and-closeout/workflow.md +55 -0
  260. package/dist/templates/common/bundled-skills/trellis-goal-exploration-and-requirements/SKILL.md +10 -0
  261. package/dist/templates/common/bundled-skills/trellis-goal-exploration-and-requirements/workflow.md +33 -0
  262. package/dist/templates/common/bundled-skills/trellis-meta/SKILL.md +25 -25
  263. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-agents.md +1 -1
  264. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-skills-or-commands.md +13 -19
  265. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-spec-structure.md +1 -1
  266. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-task-lifecycle.md +27 -75
  267. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-workflow.md +17 -56
  268. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/overview.md +1 -1
  269. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/bundled-skills.md +14 -11
  270. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/generated-files.md +0 -33
  271. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/multi-agent-teamwork.md +32 -0
  272. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/spec-system.md +1 -1
  273. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/task-system.md +25 -111
  274. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/workflow.md +19 -60
  275. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/skills-and-commands.md +1 -1
  276. package/dist/templates/common/bundled-skills/trellis-session-insight/SKILL.md +1 -1
  277. package/dist/templates/common/bundled-skills/trellis-session-insight/references/cli-quick-reference.md +1 -1
  278. package/dist/templates/common/bundled-skills/trellis-solution-design-and-convergence/SKILL.md +10 -0
  279. package/dist/templates/common/bundled-skills/trellis-solution-design-and-convergence/workflow.md +36 -0
  280. package/dist/templates/common/bundled-skills/trellis-task-implementation/SKILL.md +10 -0
  281. package/dist/templates/common/bundled-skills/trellis-task-implementation/workflow.md +29 -0
  282. package/dist/templates/common/bundled-skills/trellis-teamwork/SKILL.md +73 -0
  283. package/dist/templates/common/bundled-skills/trellis-teamwork/references/coordination-modes.md +29 -0
  284. package/dist/templates/common/bundled-skills/trellis-teamwork/references/teammate-configuration-matrix.md +31 -0
  285. package/dist/templates/common/bundled-skills/trellis-teamwork/references/teammate-processes.md +37 -0
  286. package/dist/templates/common/bundled-skills/trellis-teamwork/references/teamwork-plan-construction.md +78 -0
  287. package/dist/templates/common/commands/continue.md +9 -49
  288. package/dist/templates/common/commands/finish-work.md +10 -58
  289. package/dist/templates/common/commands/start.md +19 -49
  290. package/dist/templates/common/skills/brainstorm.md +11 -199
  291. package/dist/templates/copilot/hooks/session-start.py +30 -26
  292. package/dist/templates/copilot/prompts/brainstorm.prompt.md +7 -160
  293. package/dist/templates/copilot/prompts/finish-work.prompt.md +11 -88
  294. package/dist/templates/copilot/prompts/record-session.prompt.md +4 -12
  295. package/dist/templates/copilot/prompts/start.prompt.md +12 -10
  296. package/dist/templates/dsh/DSH.md +2 -2
  297. package/dist/templates/kiro/agents/trellis.json +2 -2
  298. package/dist/templates/markdown/agents.md +14 -3
  299. package/dist/templates/markdown/spec/guides/cross-layer-thinking-guide.md.txt +9 -8
  300. package/dist/templates/markdown/spec/guides/cross-platform-thinking-guide.md.txt +1 -1
  301. package/dist/templates/markdown/workspace-index.md +0 -1
  302. package/dist/templates/omp/extensions/trellis/index.ts.txt +28 -17
  303. package/dist/templates/opencode/lib/session-utils.js +20 -25
  304. package/dist/templates/opencode/lib/trellis-context.js +4 -76
  305. package/dist/templates/opencode/plugins/inject-subagent-context.js +5 -4
  306. package/dist/templates/opencode/plugins/inject-workflow-state.js +14 -17
  307. package/dist/templates/shared-hooks/inject-shell-session-context.py +3 -3
  308. package/dist/templates/shared-hooks/inject-subagent-context.py +445 -67
  309. package/dist/templates/shared-hooks/inject-workflow-state.py +44 -36
  310. package/dist/templates/shared-hooks/session-start.py +21 -33
  311. package/dist/templates/trellis/agents/delegated-worktree-primary-agent.md +18 -0
  312. package/dist/templates/trellis/agents/teammate-profiles.json +8 -0
  313. package/dist/templates/trellis/agents/teammate.md +63 -0
  314. package/dist/templates/trellis/config.yaml +29 -38
  315. package/dist/templates/trellis/gitignore.txt +1 -0
  316. package/dist/templates/trellis/index.d.ts +8 -12
  317. package/dist/templates/trellis/index.d.ts.map +1 -1
  318. package/dist/templates/trellis/index.js +14 -25
  319. package/dist/templates/trellis/index.js.map +1 -1
  320. package/dist/templates/trellis/scripts/add_session.py +1 -1
  321. package/dist/templates/trellis/scripts/common/__init__.py +0 -1
  322. package/dist/templates/trellis/scripts/common/active_task.py +136 -100
  323. package/dist/templates/trellis/scripts/common/config.py +7 -9
  324. package/dist/templates/trellis/scripts/common/git_context.py +1 -1
  325. package/dist/templates/trellis/scripts/common/io.py +19 -0
  326. package/dist/templates/trellis/scripts/common/paths.py +0 -1
  327. package/dist/templates/trellis/scripts/common/safe_commit.py +11 -90
  328. package/dist/templates/trellis/scripts/common/session_context.py +1 -8
  329. package/dist/templates/trellis/scripts/common/spec_match.py +1 -1
  330. package/dist/templates/trellis/scripts/common/task_context.py +152 -59
  331. package/dist/templates/trellis/scripts/common/task_continuity.py +563 -0
  332. package/dist/templates/trellis/scripts/common/task_store.py +70 -548
  333. package/dist/templates/trellis/scripts/common/task_utils.py +4 -98
  334. package/dist/templates/trellis/scripts/common/task_workflow.py +1096 -0
  335. package/dist/templates/trellis/scripts/common/tasks.py +5 -8
  336. package/dist/templates/trellis/scripts/common/workflow_phase.py +8 -7
  337. package/dist/templates/trellis/scripts/hooks/linear_sync.py +3 -3
  338. package/dist/templates/trellis/scripts/task.py +114 -377
  339. package/dist/templates/trellis/workflow.md +111 -706
  340. package/dist/utils/agent-refs.d.ts +5 -5
  341. package/dist/utils/agent-refs.js +6 -6
  342. package/dist/utils/file-writer.d.ts +3 -2
  343. package/dist/utils/file-writer.d.ts.map +1 -1
  344. package/dist/utils/file-writer.js +3 -2
  345. package/dist/utils/file-writer.js.map +1 -1
  346. package/dist/utils/managed-paths.d.ts +0 -7
  347. package/dist/utils/managed-paths.d.ts.map +1 -1
  348. package/dist/utils/managed-paths.js +0 -40
  349. package/dist/utils/managed-paths.js.map +1 -1
  350. package/dist/utils/manifest-prune.d.ts.map +1 -1
  351. package/dist/utils/manifest-prune.js +2 -11
  352. package/dist/utils/manifest-prune.js.map +1 -1
  353. package/dist/utils/uninstall-scrubbers.d.ts.map +1 -1
  354. package/dist/utils/uninstall-scrubbers.js +3 -3
  355. package/dist/utils/uninstall-scrubbers.js.map +1 -1
  356. package/dist/utils/workflow-resolver.d.ts +10 -16
  357. package/dist/utils/workflow-resolver.d.ts.map +1 -1
  358. package/dist/utils/workflow-resolver.js +25 -36
  359. package/dist/utils/workflow-resolver.js.map +1 -1
  360. package/package.json +2 -2
  361. package/dist/commands/channel/adapters/claude.d.ts.map +0 -1
  362. package/dist/commands/channel/adapters/claude.js.map +0 -1
  363. package/dist/commands/channel/adapters/codex.d.ts.map +0 -1
  364. package/dist/commands/channel/adapters/codex.js.map +0 -1
  365. package/dist/commands/channel/adapters/index.d.ts.map +0 -1
  366. package/dist/commands/channel/adapters/index.js.map +0 -1
  367. package/dist/commands/channel/adapters/types.d.ts.map +0 -1
  368. package/dist/commands/channel/adapters/types.js.map +0 -1
  369. package/dist/commands/channel/agent-loader.d.ts.map +0 -1
  370. package/dist/commands/channel/agent-loader.js.map +0 -1
  371. package/dist/commands/channel/context-loader.d.ts.map +0 -1
  372. package/dist/commands/channel/context-loader.js.map +0 -1
  373. package/dist/commands/channel/context-trust.d.ts.map +0 -1
  374. package/dist/commands/channel/context-trust.js.map +0 -1
  375. package/dist/commands/channel/context.d.ts +0 -16
  376. package/dist/commands/channel/context.d.ts.map +0 -1
  377. package/dist/commands/channel/context.js.map +0 -1
  378. package/dist/commands/channel/create.d.ts +0 -29
  379. package/dist/commands/channel/create.d.ts.map +0 -1
  380. package/dist/commands/channel/create.js +0 -47
  381. package/dist/commands/channel/create.js.map +0 -1
  382. package/dist/commands/channel/dev-parse-trace.d.ts.map +0 -1
  383. package/dist/commands/channel/dev-parse-trace.js.map +0 -1
  384. package/dist/commands/channel/guard.d.ts.map +0 -1
  385. package/dist/commands/channel/guard.js.map +0 -1
  386. package/dist/commands/channel/index.d.ts +0 -3
  387. package/dist/commands/channel/index.d.ts.map +0 -1
  388. package/dist/commands/channel/index.js.map +0 -1
  389. package/dist/commands/channel/interrupt.d.ts.map +0 -1
  390. package/dist/commands/channel/interrupt.js +0 -22
  391. package/dist/commands/channel/interrupt.js.map +0 -1
  392. package/dist/commands/channel/kill.d.ts +0 -7
  393. package/dist/commands/channel/kill.d.ts.map +0 -1
  394. package/dist/commands/channel/kill.js.map +0 -1
  395. package/dist/commands/channel/list.d.ts +0 -18
  396. package/dist/commands/channel/list.d.ts.map +0 -1
  397. package/dist/commands/channel/list.js.map +0 -1
  398. package/dist/commands/channel/messages.d.ts.map +0 -1
  399. package/dist/commands/channel/messages.js.map +0 -1
  400. package/dist/commands/channel/rm.d.ts +0 -27
  401. package/dist/commands/channel/rm.d.ts.map +0 -1
  402. package/dist/commands/channel/rm.js.map +0 -1
  403. package/dist/commands/channel/run.d.ts +0 -32
  404. package/dist/commands/channel/run.js +0 -141
  405. package/dist/commands/channel/run.js.map +0 -1
  406. package/dist/commands/channel/send.d.ts.map +0 -1
  407. package/dist/commands/channel/send.js.map +0 -1
  408. package/dist/commands/channel/spawn.d.ts.map +0 -1
  409. package/dist/commands/channel/spawn.js.map +0 -1
  410. package/dist/commands/channel/store/events.d.ts +0 -22
  411. package/dist/commands/channel/store/events.d.ts.map +0 -1
  412. package/dist/commands/channel/store/events.js.map +0 -1
  413. package/dist/commands/channel/store/filter.d.ts +0 -3
  414. package/dist/commands/channel/store/filter.d.ts.map +0 -1
  415. package/dist/commands/channel/store/filter.js +0 -2
  416. package/dist/commands/channel/store/filter.js.map +0 -1
  417. package/dist/commands/channel/store/lock.d.ts.map +0 -1
  418. package/dist/commands/channel/store/lock.js.map +0 -1
  419. package/dist/commands/channel/store/paths.d.ts.map +0 -1
  420. package/dist/commands/channel/store/paths.js.map +0 -1
  421. package/dist/commands/channel/store/schema.d.ts +0 -27
  422. package/dist/commands/channel/store/schema.d.ts.map +0 -1
  423. package/dist/commands/channel/store/schema.js +0 -34
  424. package/dist/commands/channel/store/schema.js.map +0 -1
  425. package/dist/commands/channel/store/thread-state.d.ts.map +0 -1
  426. package/dist/commands/channel/store/thread-state.js.map +0 -1
  427. package/dist/commands/channel/store/watch.d.ts +0 -19
  428. package/dist/commands/channel/store/watch.d.ts.map +0 -1
  429. package/dist/commands/channel/store/watch.js.map +0 -1
  430. package/dist/commands/channel/supervisor/idle.d.ts.map +0 -1
  431. package/dist/commands/channel/supervisor/idle.js.map +0 -1
  432. package/dist/commands/channel/supervisor/inbox.d.ts.map +0 -1
  433. package/dist/commands/channel/supervisor/inbox.js.map +0 -1
  434. package/dist/commands/channel/supervisor/shutdown.d.ts.map +0 -1
  435. package/dist/commands/channel/supervisor/shutdown.js.map +0 -1
  436. package/dist/commands/channel/supervisor/stdout.d.ts.map +0 -1
  437. package/dist/commands/channel/supervisor/stdout.js.map +0 -1
  438. package/dist/commands/channel/supervisor/turns.d.ts.map +0 -1
  439. package/dist/commands/channel/supervisor/turns.js.map +0 -1
  440. package/dist/commands/channel/supervisor/warning.d.ts.map +0 -1
  441. package/dist/commands/channel/supervisor/warning.js.map +0 -1
  442. package/dist/commands/channel/supervisor.d.ts.map +0 -1
  443. package/dist/commands/channel/supervisor.js.map +0 -1
  444. package/dist/commands/channel/text-body.d.ts +0 -13
  445. package/dist/commands/channel/text-body.d.ts.map +0 -1
  446. package/dist/commands/channel/text-body.js.map +0 -1
  447. package/dist/commands/channel/threads.d.ts +0 -39
  448. package/dist/commands/channel/threads.d.ts.map +0 -1
  449. package/dist/commands/channel/threads.js.map +0 -1
  450. package/dist/commands/channel/title.d.ts +0 -12
  451. package/dist/commands/channel/title.d.ts.map +0 -1
  452. package/dist/commands/channel/title.js +0 -24
  453. package/dist/commands/channel/title.js.map +0 -1
  454. package/dist/commands/channel/wait.d.ts.map +0 -1
  455. package/dist/commands/channel/wait.js.map +0 -1
  456. package/dist/commands/channel/workers.d.ts +0 -9
  457. package/dist/commands/channel/workers.d.ts.map +0 -1
  458. package/dist/commands/channel/workers.js +0 -31
  459. package/dist/commands/channel/workers.js.map +0 -1
  460. package/dist/templates/common/bundled-skills/trellis-channel/SKILL.md +0 -69
  461. package/dist/templates/common/bundled-skills/trellis-channel/references/command-reference.md +0 -549
  462. package/dist/templates/common/bundled-skills/trellis-channel/references/forum.md +0 -233
  463. package/dist/templates/common/bundled-skills/trellis-channel/references/progress-debugging.md +0 -237
  464. package/dist/templates/common/bundled-skills/trellis-channel/references/subnode-work.md +0 -222
  465. package/dist/templates/common/bundled-skills/trellis-channel/references/workers.md +0 -295
  466. package/dist/templates/common/bundled-skills/trellis-channel/references/workflows.md +0 -131
  467. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/multi-agent-channel.md +0 -70
  468. package/dist/templates/common/bundled-skills/trellis-research-record/SKILL.md +0 -14
  469. package/dist/templates/copilot/prompts/parallel.prompt.md +0 -204
  470. package/dist/templates/trellis/agents/check.md +0 -70
  471. package/dist/templates/trellis/agents/implement.md +0 -71
  472. package/dist/templates/trellis/agents/subnode.env +0 -4
  473. package/dist/templates/trellis/agents/subnode.md +0 -76
  474. package/dist/templates/trellis/scripts/common/context_projection.py +0 -508
  475. package/dist/templates/trellis/scripts/common/continuation_record.py +0 -450
  476. package/dist/templates/trellis/scripts/common/ownership_record.py +0 -439
  477. package/dist/templates/trellis/scripts/subnode_artifact.py +0 -735
  478. package/dist/templates/trellis/scripts/workspace_note.py +0 -126
  479. /package/dist/commands/{channel → teamwork}/adapters/types.js +0 -0
  480. /package/dist/commands/{channel → teamwork}/supervisor/idle.d.ts +0 -0
  481. /package/dist/commands/{channel → teamwork}/supervisor/idle.js +0 -0
  482. /package/dist/commands/{channel → teamwork}/supervisor/turns.d.ts +0 -0
  483. /package/dist/commands/{channel → teamwork}/supervisor/turns.js +0 -0
@@ -2,28 +2,21 @@
2
2
  description: "Trellis Copilot prompt: Method 1: Simple parameters"
3
3
  ---
4
4
 
5
- [!] **Prerequisite**: This command should only be used AFTER the human has tested and committed the code.
5
+ [!] **Prerequisite**: Record verified progress and the actual commit references for this session. Do not imply that the task is complete merely because work was committed.
6
6
 
7
- **Do NOT run `git commit` directly** — the scripts below handle their own commits for `.trellis/` metadata. You only need to read git history (`git log`, `git status`, `git diff`) and run the Python scripts.
7
+ Task status and phase state are changed only through Trellis CLI. This prompt records the developer session journal; it does not archive, complete, or cancel tasks.
8
8
 
9
9
  ---
10
10
 
11
11
  ## Record Work Progress
12
12
 
13
- ### Step 1: Get Context & Check Tasks
13
+ ### Step 1: Get Context
14
14
 
15
15
  ```bash
16
16
  python3 ./.trellis/scripts/get_context.py --mode record
17
17
  ```
18
18
 
19
- [!] Archive tasks whose work is **actually done** — judge by work status, not the `status` field in task.json:
20
- - Code committed? → Archive it (don't wait for PR)
21
- - All acceptance criteria met? → Archive it
22
- - Don't skip archiving just because `status` still says `planning` or `in_progress`
23
-
24
- ```bash
25
- python3 ./.trellis/scripts/task.py archive <task-name>
26
- ```
19
+ Review the current phase, changed files, recent commits, remaining work, and blockers. Use the Delivery Review and On-Site Closeout Phase Skill with the Trellis CLI to complete or cancel a task when its acceptance conditions are met.
27
20
 
28
21
  ### Step 2: One-Click Add Session
29
22
 
@@ -62,5 +55,4 @@ EOF
62
55
  |---------|---------|
63
56
  | `python3 ./.trellis/scripts/get_context.py --mode record` | Get context for record-session |
64
57
  | `python3 ./.trellis/scripts/add_session.py --title "..." --commit "..."` | **One-click add session (recommended, branch auto-complete)** |
65
- | `python3 ./.trellis/scripts/task.py archive <name>` | Archive completed task (auto-commits) |
66
58
  | `python3 ./.trellis/scripts/task.py list` | List active tasks |
@@ -4,7 +4,7 @@ description: "Trellis Copilot prompt: Start Session"
4
4
 
5
5
  # Start Session
6
6
 
7
- Initialize a Trellis-managed development session. This platform has no session-start hook, so manually load the equivalent context by following these steps (each one mirrors a section the hook would otherwise inject).
7
+ Use this prompt to inspect or refresh Trellis context. Copilot also supplies SessionStart context and a per-turn workflow-state breadcrumb through its hooks.
8
8
 
9
9
  ---
10
10
 
@@ -38,15 +38,13 @@ cat .trellis/spec/<package>/<layer>/index.md # for each relevant layer
38
38
  Index files list the specific guideline docs to read when you actually start coding.
39
39
 
40
40
  ## Step 4: Decide next action
41
- From Step 1 you know the current task and status. Check the task directory:
41
+ Use the current `<workflow-state>` breadcrumb to identify the business phase; task lifecycle status (`planning` or `in_progress`) and artifact presence do not identify that phase. If the breadcrumb is missing or stale, inspect the task with `task.py phase show <task>` and follow the matching phase Skill in `.trellis/workflow.md`.
42
42
 
43
- - **Active task status `planning` + no `prd.md`** → Phase 1.1. Load the `trellis-brainstorm` skill.
44
- - **Active task status `planning` + `prd.md` exists** → stay in Phase 1. Lightweight tasks can be PRD-only; complex tasks need `design.md` + `implement.md`. Load the relevant Phase 1 step detail before `task.py start`.
45
- - **Active task status `in_progress`** → Phase 2 step 2.1. Load the step detail:
46
- ```bash
47
- {{PYTHON_CMD}} ./.trellis/scripts/get_context.py --mode phase --step 2.1 --platform {{CLI_FLAG}}
48
- ```
49
- - **No active task** → classify first. For simple conversation / small task, ask only whether this turn should create a Trellis task. For complex work, ask whether you may create a Trellis task and enter planning. If the user says no, skip Trellis for this session.
43
+ - **An active phase is recorded** → continue that phase and load its matching Skill.
44
+ - **The task has no initialized phase route** → load `trellis-goal-exploration-and-requirements`, align and obtain the user's confirmation of the current requirements baseline, then initialize the applicable ordered route with `task.py phase init`.
45
+ - **No active task** → classify first. Handle a clear, low-risk, reversible, authorized, immediately verifiable request directly; otherwise ask for task-creation consent and begin with `trellis-goal-exploration-and-requirements`.
46
+
47
+ `task.py start` enters implementation only after an accepted implementation contract from Solution Design and Convergence Phase and separate implementation authorization.
50
48
 
51
49
  ---
52
50
 
@@ -54,7 +52,11 @@ From Step 1 you know the current task and status. Check the task directory:
54
52
 
55
53
  | User intent | Skill |
56
54
  |---|---|
57
- | New feature / unclear requirements | `trellis-brainstorm` |
55
+ | Goal and requirements | `trellis-goal-exploration-and-requirements` |
56
+ | Decision alternatives | `trellis-decision-space-construction-and-merging` |
57
+ | Solution design | `trellis-solution-design-and-convergence` |
58
+ | Implementation | `trellis-task-implementation` |
59
+ | Delivery review | `trellis-delivery-review-and-closeout` |
58
60
  | About to write code | `trellis-before-dev` |
59
61
  | Done coding / quality check | `trellis-check` |
60
62
  | Stuck / fixed same bug multiple times | `trellis-break-loop` |
@@ -27,8 +27,8 @@ In dsh:
27
27
  2. The main session dispatches `trellis-agent-research`,
28
28
  `trellis-agent-implement`, and `trellis-agent-check` through DSH's native
29
29
  `subagent` tool. Each child loads exactly one matching role skill.
30
- 3. Finish through `trellis-finish-work`, which preserves the required order:
31
- commit, archive, then journal.
30
+ 3. Use Delivery Review and On-Site Closeout Phase to review and close the task. `trellis-finish-work` records
31
+ session progress separately and does not change task lifecycle state.
32
32
 
33
33
  ## Companion plugin fallback contract
34
34
 
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "trellis",
3
- "description": "Trellis workflow main agent. Drives the Trellis development workflow: reads .trellis/workflow.md, classifies each turn, and routes work through plan / implement / check phases. Use as the default Kiro agent for projects that run Trellis.",
4
- "prompt": "# Trellis Workflow Agent\n\nYou are the main session agent for a project that uses the Trellis workflow.\n\n## On Every Turn\n\nA `userPromptSubmit` hook injects a `<workflow-state>` breadcrumb each turn telling you the active task and its current phase. An `agentSpawn` hook injects a `<session-context>` overview when this agent starts. Trust those injections to orient yourself — do not re-derive context from scratch.\n\n## How to Work\n\n1. **Follow the workflow.** `.trellis/workflow.md` is the single source of truth for phases and steps. It is also attached as a resource for this agent. Read it (or the injected Phase Index) and follow the matching phase.\n2. **Resolve the active task** with `python3 ./.trellis/scripts/task.py current --source` when the breadcrumb is missing or stale.\n3. **Classify the turn** before acting: simple conversation, small edit, or a complex task that needs a Trellis task directory + planning. Do not create a task for trivial turns.\n4. **Plan before implementing.** For complex work, write `prd.md` (and `design.md` / `implement.md` when warranted) and get the user's confirmation before entering implementation.\n5. **Load task context in order** for implementation/check: jsonl entries -> `prd.md` -> `design.md` (if present) -> `implement.md` (if present).\n6. **Verify** with the project's lint / type-check / test commands before declaring work done.\n\n## Constraints\n\n- Do NOT run `git commit` / `git push` / `git merge` unless the user explicitly asks.\n- Keep changes surgical and scoped to the request.\n- Discover guidelines on demand: `python3 ./.trellis/scripts/get_context.py --mode packages`.\n",
3
+ "description": "Trellis workflow main agent. Follows the current task route and matching Skills, or uses the taskless route when eligible.",
4
+ "prompt": "# Trellis Workflow Agent\n\nYou are the main session agent for a project that uses the Trellis workflow.\n\n## On Every Turn\n\nA `userPromptSubmit` hook injects a `<workflow-state>` breadcrumb each turn with the active task and its current phase. An `agentSpawn` hook injects a `<session-context>` overview when this agent starts. Use these to orient yourself; resolve missing or stale state through Trellis CLI.\n\n## How to Work\n\n1. Follow `.trellis/workflow.md` and the matching phase Skill. The workflow and its task route define the business phase; task lifecycle status and artifact presence do not.\n2. If the breadcrumb is missing or stale, inspect the active task with `python3 ./.trellis/scripts/task.py current --json` and `python3 ./.trellis/scripts/task.py phase show <task>`.\n3. With no active task, use the taskless route only when `.trellis/workflow.md` permits it; otherwise create the task and establish its baseline through Goal Exploration and Requirements Confirmation Phase.\n4. The Goal Exploration and Requirements Confirmation Phase requires the user's confirmation of the current requirements revision. Before Task Implementation and Test Verification Phase, both an accepted `implementation_contract` from Solution Design and Convergence Phase and separate implementation authorization are required. Delivery Review and On-Site Closeout Phase governs delivery acceptance, task completion, and cancellation.\n5. Use task artifacts and context manifests as required by the current route and any dispatched agent; do not require a fixed set of planning documents based only on task complexity.\n6. Verify with project checks appropriate to the changes before reporting completion.\n\n## Constraints\n\n- Do NOT run `git commit` / `git push` / `git merge` unless the user explicitly asks.\n- Keep changes scoped to the request.\n- Discover guidelines on demand: `python3 ./.trellis/scripts/get_context.py --mode packages`.\n",
5
5
  "tools": [
6
6
  "read",
7
7
  "write",
@@ -1,9 +1,20 @@
1
1
  <!-- TRELLIS:START -->
2
- # Trellis
2
+ # Trellis Instructions
3
3
 
4
- Follow `.trellis/workflow.md`; read the applicable `.trellis/spec/` guidance before editing code, and keep task facts in `.trellis/tasks/`. Project-scoped helpers live in `.agents/skills/`.
4
+ These instructions are for AI assistants working in this project.
5
5
 
6
- When a live Trellis Channel wait returns a host continuation, resume only that continuation until it resolves, times out, or errors. Do not run another host action meanwhile, including another wait, shell command, or status/message query; use diagnostics only on demand after it returns.
6
+ This project is managed by Trellis. The working knowledge you need lives under `.trellis/`:
7
+
8
+ - `.trellis/workflow.md` — development phases, when to create tasks, skill routing
9
+ - `.trellis/spec/` — package- and layer-scoped coding guidelines (read before writing code in a given layer)
10
+ - `.trellis/workspace/` — per-developer journals and session traces
11
+ - `.trellis/tasks/` — task records and their planning, implementation, and review artifacts
12
+
13
+ If a Trellis command is available on your platform (e.g. `/trellis:finish-work`, `/trellis:continue`), prefer it over manual steps. Not every platform exposes every command.
14
+
15
+ If you're using Codex or another agent-capable tool, additional project-scoped helpers may live in:
16
+ - `.agents/skills/` — reusable Trellis skills
17
+ - `.codex/agents/` — optional custom subagents
7
18
 
8
19
  Managed by Trellis. Edits outside this block are preserved; edits inside may be overwritten by a future `trellis update`.
9
20
 
@@ -216,7 +216,7 @@ When a CLI auto-detects a mode by probing a remote resource (e.g., checking if `
216
216
 
217
217
  **Real-world example**: Custom registry flow had 8 bugs across 3 review rounds: (1) probe only ran in interactive mode, (2) transient errors fell through to wrong mode, (3) giget URI had `#ref` in wrong position, (4) prefetched templates leaked across source switches, (5) `--template` shortcut bypassed probe but `downloadTemplateById` internally used catch-all `fetchTemplateIndex`, turning timeouts into "Template not found".
218
218
 
219
- **Real-world example**: Agent-session update hints fetched npm `latest` metadata with `response.read(4096)` and then parsed it as complete JSON. The `@pennixrv/trellis` package metadata exceeded 4 KB, so the JSON was truncated, parse failed silently, and the first session injection showed no update hint. Fix: read the complete response before parsing, and add a regression where `version` is followed by an 8 KB metadata tail.
219
+ **Real-world example**: Agent-session update hints fetched npm `latest` metadata with `response.read(4096)` and then parsed it as complete JSON. The `@mindfoldhq/trellis` package metadata exceeded 4 KB, so the JSON was truncated, parse failed silently, and the first session injection showed no update hint. Fix: read the complete response before parsing, and add a regression where `version` is followed by an 8 KB metadata tail.
220
220
 
221
221
  ---
222
222
 
@@ -284,7 +284,7 @@ When a CLI auto-detects a mode by probing a remote resource (e.g., checking if `
284
284
 
285
285
  **Real-world example**: Custom registry flow had 8 bugs across 3 review rounds: (1) probe only ran in interactive mode, (2) transient errors fell through to wrong mode, (3) giget URI had `#ref` in wrong position, (4) prefetched templates leaked across source switches, (5) `--template` shortcut bypassed probe but `downloadTemplateById` internally used catch-all `fetchTemplateIndex`, turning timeouts into "Template not found".
286
286
 
287
- **Real-world example**: Agent-session update hints fetched npm `latest` metadata with `response.read(4096)` and then parsed it as complete JSON. The `@pennixrv/trellis` package metadata exceeded 4 KB, so the JSON was truncated, parse failed silently, and the first session injection showed no update hint. Fix: read the complete response before parsing, and add a regression where `version` is followed by an 8 KB metadata tail.
287
+ **Real-world example**: Agent-session update hints fetched npm `latest` metadata with `response.read(4096)` and then parsed it as complete JSON. The `@mindfoldhq/trellis` package metadata exceeded 4 KB, so the JSON was truncated, parse failed silently, and the first session injection showed no update hint. Fix: read the complete response before parsing, and add a regression where `version` is followed by an 8 KB metadata tail.
288
288
 
289
289
  ---
290
290
 
@@ -319,9 +319,10 @@ CLI input → event writer → events.jsonl → reader → filter → reducer
319
319
  - [ ] Add at least one regression that proves history replay and live filtering
320
320
  use the same filter model
321
321
 
322
- **Real-world example**: Thread channels added `kind: "thread"`, `description`,
323
- `context`, labels, and `lastSeq`. The first implementation replayed thread
324
- state correctly, but several commands still re-parsed event payload fields with
325
- local casts. The fix was to make the core event layer own `ThreadChannelEvent`
326
- and `isThreadEvent`, make `reduceChannelMetadata` the only channel metadata
327
- projection, and make `reduceThreads` the only thread replay reducer.
322
+ **Real-world example**: Forum Teamwork Sessions added thread events with
323
+ `description`, `context`, labels, and sequence tracking. The first
324
+ implementation replayed thread state correctly, but several commands still
325
+ re-parsed event payload fields with local casts. The fix was to make Core own
326
+ `ThreadTeamworkEvent` and `isThreadEvent`, use
327
+ `reduceTeamworkSessionMetadata` for session metadata, and use `reduceThreads`
328
+ for thread replay.
@@ -600,7 +600,7 @@ When release notes or docs claim an asset is bundled, installed automatically, o
600
600
  included with Trellis, verify the whole distribution path:
601
601
 
602
602
  - [ ] Source file exists in the branch being tagged, not only in another branch,
603
- docs submodule, or marketplace tree.
603
+ docs submodule, or external Marketplace repository.
604
604
  - [ ] `pnpm build` copies the asset into `dist/templates/**`.
605
605
  - [ ] `npm pack --dry-run --json` includes the expected `dist/**` path.
606
606
  - [ ] The built binary installs the asset in a fresh temp repository.
@@ -17,7 +17,6 @@ workspace/
17
17
  |-- index.md # Personal index with session history
18
18
  |-- tasks/ # Task files
19
19
  | |-- *.json # Active tasks
20
- | +-- archive/ # Archived tasks by month
21
20
  +-- journal-N.md # Journal files (sequential: 1, 2, 3...)
22
21
  ```
23
22
 
@@ -59,7 +59,7 @@ function isInsideRoot(root: string, candidate: string): boolean {
59
59
  }
60
60
 
61
61
  // ---------------------------------------------------------------------------
62
- // Trusted context roots (mirrors packages/cli/src/commands/channel/context-trust.ts;
62
+ // Trusted context roots (mirrors packages/cli/src/commands/teamwork/context-trust.ts;
63
63
  // standalone copy since templates don't import from the CLI package).
64
64
  // ---------------------------------------------------------------------------
65
65
 
@@ -69,7 +69,7 @@ function stripTrustValue(s: string): string {
69
69
  return s.trim().replace(/\s*#.*$/, "").trim().replace(/^['"]|['"]$/g, "");
70
70
  }
71
71
 
72
- function parseChannelTrustSection(content: string): { trustedDirs: string[]; autoTrustSymlinks?: boolean } {
72
+ function parseTeamworkTrustSection(content: string): { trustedDirs: string[]; autoTrustSymlinks?: boolean } {
73
73
  const lines = content.split("\n");
74
74
  const trustedDirs: string[] = [];
75
75
  let autoTrustSymlinks: boolean | undefined;
@@ -115,7 +115,7 @@ function parseChannelTrustSection(content: string): { trustedDirs: string[]; aut
115
115
  const val = stripTrustValue(boolMatch[1]!).toLowerCase();
116
116
  if (val === "false") autoTrustSymlinks = false;
117
117
  else if (val === "true") autoTrustSymlinks = true;
118
- else process.stderr.write(`[channel] channel.auto_trust_trellis_symlinks: invalid value '${val}', ignoring\n`);
118
+ else process.stderr.write(`[teamwork] teamwork.auto_trust_trellis_symlinks: invalid value '${val}', ignoring\n`);
119
119
  continue;
120
120
  }
121
121
  }
@@ -128,7 +128,7 @@ function resolveTrustedRoots(projectRoot: string): string[] {
128
128
  let config: { trustedDirs: string[]; autoTrustSymlinks?: boolean } = { trustedDirs: [] };
129
129
  if (existsSync(configPath)) {
130
130
  try {
131
- config = parseChannelTrustSection(readFileSync(configPath, "utf-8"));
131
+ config = parseTeamworkTrustSection(readFileSync(configPath, "utf-8"));
132
132
  } catch {
133
133
  // ignore
134
134
  }
@@ -202,9 +202,9 @@ function displayProjectPath(projectRoot: string, filePath: string, taskDir?: str
202
202
  function resolveActiveTaskStatus(
203
203
  projectRoot: string,
204
204
  contextKey: string | null,
205
- ): { status: string; taskDir: string | null; taskTitle: string | null } {
205
+ ): { status: string; phaseStatus: string | null; taskDir: string | null; taskTitle: string | null } {
206
206
  const sessionsDir = join(projectRoot, ".trellis", ".runtime", "sessions");
207
- if (!existsSync(sessionsDir)) return { status: "no_task", taskDir: null, taskTitle: null };
207
+ if (!existsSync(sessionsDir)) return { status: "no_task", phaseStatus: null, taskDir: null, taskTitle: null };
208
208
 
209
209
  // --- 通过 context key 解析 session 文件 ---
210
210
  let sessionFilePath: string | null = null;
@@ -214,7 +214,7 @@ function resolveActiveTaskStatus(
214
214
  if (existsSync(candidate)) {
215
215
  sessionFilePath = candidate;
216
216
  } else {
217
- return { status: "no_task", taskDir: null, taskTitle: null };
217
+ return { status: "no_task", phaseStatus: null, taskDir: null, taskTitle: null };
218
218
  }
219
219
  } else {
220
220
  // No identity: use single-session fallback only when there is exactly one session file.
@@ -222,12 +222,12 @@ function resolveActiveTaskStatus(
222
222
  try {
223
223
  sessionFiles = readdirSync(sessionsDir).filter((f) => f.endsWith(".json"));
224
224
  } catch {
225
- return { status: "no_task", taskDir: null, taskTitle: null };
225
+ return { status: "no_task", phaseStatus: null, taskDir: null, taskTitle: null };
226
226
  }
227
227
  if (sessionFiles.length === 1) {
228
228
  sessionFilePath = join(sessionsDir, sessionFiles[0]);
229
229
  } else {
230
- return { status: "no_task", taskDir: null, taskTitle: null };
230
+ return { status: "no_task", phaseStatus: null, taskDir: null, taskTitle: null };
231
231
  }
232
232
  }
233
233
 
@@ -236,12 +236,12 @@ function resolveActiveTaskStatus(
236
236
  try {
237
237
  sessionData = JSON.parse(readFileSync(sessionFilePath, "utf-8"));
238
238
  } catch {
239
- return { status: "no_task", taskDir: null, taskTitle: null };
239
+ return { status: "no_task", phaseStatus: null, taskDir: null, taskTitle: null };
240
240
  }
241
241
 
242
242
  const currentTask = sessionData.current_task;
243
243
  if (typeof currentTask !== "string" || !currentTask)
244
- return { status: "no_task", taskDir: null, taskTitle: null };
244
+ return { status: "no_task", phaseStatus: null, taskDir: null, taskTitle: null };
245
245
 
246
246
  // Same jail the jsonl-referenced files already go through below. `task.py`
247
247
  // now refuses to store a ref that leaves the project, but a session file
@@ -249,19 +249,30 @@ function resolveActiveTaskStatus(
249
249
  // rewrite session files — so a poisoned pointer outlives the upgrade that
250
250
  // closed the writer.
251
251
  const taskDir = resolveProjectFile(projectRoot, currentTask, resolveTrustedRoots(projectRoot));
252
- if (!taskDir) return { status: "no_task", taskDir: null, taskTitle: null };
252
+ if (!taskDir) return { status: "no_task", phaseStatus: null, taskDir: null, taskTitle: null };
253
253
  const taskJsonPath = join(taskDir, "task.json");
254
- if (!existsSync(taskJsonPath)) return { status: "no_task", taskDir: null, taskTitle: null };
254
+ if (!existsSync(taskJsonPath)) return { status: "no_task", phaseStatus: null, taskDir: null, taskTitle: null };
255
255
 
256
256
  let taskData: Record<string, unknown>;
257
257
  try {
258
258
  taskData = JSON.parse(readFileSync(taskJsonPath, "utf-8"));
259
259
  } catch {
260
- return { status: "no_task", taskDir: null, taskTitle: null };
260
+ return { status: "no_task", phaseStatus: null, taskDir: null, taskTitle: null };
261
261
  }
262
262
 
263
+ const taskMeta = taskData.meta;
264
+ const phaseWorkflow = taskMeta && typeof taskMeta === "object" && !Array.isArray(taskMeta)
265
+ ? (taskMeta as Record<string, unknown>).task_workflow as Record<string, unknown> | undefined
266
+ : undefined;
267
+ const route = phaseWorkflow?.phase_ids;
268
+ const phaseId = phaseWorkflow?.current_phase_id || (Array.isArray(route) ? route[route.length - 1] : undefined);
269
+ const phaseMap = phaseWorkflow?.phases;
270
+ const phase = typeof phaseId === "string" && phaseMap && typeof phaseMap === "object" && !Array.isArray(phaseMap)
271
+ ? (phaseMap as Record<string, Record<string, unknown>>)[phaseId]
272
+ : null;
263
273
  return {
264
- status: typeof taskData.status === "string" ? taskData.status : "planning",
274
+ status: typeof phaseId === "string" && phase ? phaseId : (typeof taskData.status === "string" ? taskData.status : "planning"),
275
+ phaseStatus: typeof phase?.status === "string" ? phase.status : null,
265
276
  taskDir,
266
277
  taskTitle: typeof taskData.title === "string" ? taskData.title : null,
267
278
  };
@@ -818,7 +829,7 @@ class TurnContextCache {
818
829
  return { workflowMsg: this.workflowMsg };
819
830
  }
820
831
 
821
- const { status } = resolveActiveTaskStatus(projectRoot, contextKey);
832
+ const { status, phaseStatus } = resolveActiveTaskStatus(projectRoot, contextKey);
822
833
 
823
834
  const workflowPath = join(projectRoot, ".trellis", "workflow.md");
824
835
  let workflowMd = "";
@@ -839,7 +850,7 @@ class TurnContextCache {
839
850
  // When skip keyword is present, skip workflow state injection this turn
840
851
  this.workflowMsg = this.skipThisTurn
841
852
  ? ""
842
- : `<workflow-state>\n${workflowBody}\n</workflow-state>\n\n<session-overview>\n${SESSION_OVERVIEW_TEXT}\n</session-overview>`;
853
+ : `<workflow-state>\n${phaseStatus ? `Phase: ${status} (${phaseStatus})\n` : ""}${workflowBody}\n</workflow-state>\n\n<session-overview>\n${SESSION_OVERVIEW_TEXT}\n</session-overview>`;
843
854
 
844
855
  this.key = cacheKey;
845
856
  this.timestamp = now;
@@ -71,12 +71,9 @@ function getTaskStatus(ctx, platformInput = null) {
71
71
  const taskStatus = taskData.status || "unknown"
72
72
 
73
73
  if (taskStatus === "completed") {
74
- return `Status: COMPLETED\nTask: ${taskTitle}\nNext-Action: Run /trellis:finish-work. If the working tree is dirty, return to Phase 3.4 first.`
74
+ return `Status: COMPLETED\nTask: ${taskTitle}\nNext-Action: Start another task or end the session; finish-work only records the session journal.`
75
75
  }
76
76
 
77
- const hasPrd = existsSync(join(taskDir, "prd.md"))
78
- const hasDesign = existsSync(join(taskDir, "design.md"))
79
- const hasImplementPlan = existsSync(join(taskDir, "implement.md"))
80
77
  const artifactNames = ["prd.md", "design.md", "implement.md", "implement.jsonl", "check.jsonl"]
81
78
  const present = artifactNames.filter(name => existsSync(join(taskDir, name)))
82
79
  if (existsSync(join(taskDir, "research"))) present.push("research/")
@@ -87,24 +84,13 @@ function getTaskStatus(ctx, platformInput = null) {
87
84
  (!existsSync(implementJsonl) || hasCuratedJsonlEntry(implementJsonl)) &&
88
85
  (!existsSync(checkJsonl) || hasCuratedJsonlEntry(checkJsonl))
89
86
 
90
- if (taskStatus === "planning" && !hasPrd) {
91
- return `Status: PLANNING\nTask: ${taskTitle}\nPresent: ${presentLine}\nNext-Action: Load trellis-brainstorm and write prd.md. Stay in planning.`
92
- }
93
-
94
87
  if (taskStatus === "planning") {
95
- const missingComplex = []
96
- if (!hasDesign) missingComplex.push("design.md")
97
- if (!hasImplementPlan) missingComplex.push("implement.md")
98
- const nextBits = []
99
- if (missingComplex.length > 0) {
100
- nextBits.push(
101
- `Lightweight task can request start review with PRD-only; complex task must add ${missingComplex.join(", ")} before start`,
102
- )
103
- } else {
104
- nextBits.push("Planning artifacts are present; ask for review before `task.py start`")
105
- }
88
+ const nextBits = [
89
+ "Follow the current per-turn workflow-state; task lifecycle status and artifact presence do not identify the business phase",
90
+ "If no phase route is initialized, load `trellis-goal-exploration-and-requirements` and confirm the requirements baseline before initializing the route",
91
+ ]
106
92
  if (!jsonlReady) {
107
- nextBits.push("curate `implement.jsonl` and `check.jsonl` before sub-agent mode start")
93
+ nextBits.push("curate task context manifests only when a dispatched agent needs them")
108
94
  }
109
95
  return `Status: PLANNING\nTask: ${taskTitle}\nPresent: ${presentLine}\nNext-Action: ${nextBits.join("; ")}. Do not enter implementation until the user confirms start.`
110
96
  }
@@ -112,7 +98,7 @@ function getTaskStatus(ctx, platformInput = null) {
112
98
  return (
113
99
  `Status: ${String(taskStatus).toUpperCase()}\nTask: ${taskTitle}\n` +
114
100
  `Present: ${presentLine}\n` +
115
- "Next-Action: Follow the matching per-turn workflow-state. " +
101
+ "Next-Action: Follow the matching per-turn workflow-state; task lifecycle status does not identify the business phase. " +
116
102
  "Implementation/check context order is jsonl entries -> `prd.md` -> `design.md if present` -> `implement.md if present`."
117
103
  )
118
104
  }
@@ -393,8 +379,8 @@ Trellis compact SessionStart context. Use it to orient the session; load details
393
379
  if (workflowContent) {
394
380
  const allLines = workflowContent.split("\n")
395
381
  const overviewLines = [
396
- "# Development Workflow - Session Summary",
397
- "Full guide: .trellis/workflow.md. Step detail: `python3 ./.trellis/scripts/get_context.py --mode phase --step <X.Y>`.",
382
+ "# 工作流会话摘要",
383
+ "完整说明:.trellis/workflow.md。阶段详情:读取当前阶段提示指定的 Skill。",
398
384
  "",
399
385
  ]
400
386
 
@@ -402,9 +388,18 @@ Trellis compact SessionStart context. Use it to orient the session; load details
402
388
  let rangeEnd = allLines.length
403
389
  for (let i = 0; i < allLines.length; i++) {
404
390
  const stripped = allLines[i].trim()
405
- if (rangeStart === -1 && stripped === "## Phase Index") {
391
+ const heading = stripped.replace(/^#{2,3}\s+/, "")
392
+ const isPhaseHeading =
393
+ /^#{2,3}\s+/.test(stripped) &&
394
+ ["目标探索与需求核对阶段", "Goal Exploration and Requirements Confirmation Phase"].some(
395
+ (title) =>
396
+ heading === title ||
397
+ heading.endsWith(`:${title}`) ||
398
+ heading.endsWith(`: ${title}`),
399
+ )
400
+ if (rangeStart === -1 && ["## 阶段索引", "## Phase Index"].includes(stripped)) {
406
401
  rangeStart = i
407
- } else if (rangeStart !== -1 && stripped === "## Phase 1: Plan") {
402
+ } else if (rangeStart !== -1 && isPhaseHeading) {
408
403
  rangeEnd = i
409
404
  break
410
405
  }
@@ -372,14 +372,10 @@ export class TrellisContext {
372
372
  * Get active task from session runtime context.
373
373
  *
374
374
  * Resolution order (mirrors Python `active_task.resolve_active_task`):
375
- * 1. Lookup the runtime file for the input-derived context key. A known
376
- * key is authoritative when it contains a task; a missing or empty
377
- * context may use the guarded unbound-task projection.
378
- * 2. If no context key is available and exactly one session runtime file
379
- * exists locally, use it (`_resolveSingleSessionFallback`). Refuses to
380
- * guess when 0 or ≥2 files exist so multi-window isolation holds.
381
- * 3. If no session file exists, expose one resumable task assigned to the
382
- * current developer as a read-only unbound projection.
375
+ * 1. Lookup the runtime file for the input-derived context key.
376
+ * 2. If that misses and exactly one session runtime file exists locally,
377
+ * use it (`_resolveSingleSessionFallback`). Refuses to guess when 0 or
378
+ * ≥2 files exist so multi-window isolation holds.
383
379
  */
384
380
  getActiveTask(platformInput = null) {
385
381
  const contextKey = this.getContextKey(platformInput)
@@ -394,11 +390,6 @@ export class TrellisContext {
394
390
  stale: !taskDir || !existsSync(taskDir),
395
391
  }
396
392
  }
397
- const unbound = this._resolveUnboundTask()
398
- if (unbound) {
399
- return unbound
400
- }
401
- return { taskPath: null, source: "none", stale: false }
402
393
  }
403
394
 
404
395
  const fallback = this._resolveSingleSessionFallback()
@@ -406,11 +397,6 @@ export class TrellisContext {
406
397
  return fallback
407
398
  }
408
399
 
409
- const unbound = this._resolveUnboundTask()
410
- if (unbound) {
411
- return unbound
412
- }
413
-
414
400
  return { taskPath: null, source: "none", stale: false }
415
401
  }
416
402
 
@@ -452,64 +438,6 @@ export class TrellisContext {
452
438
  }
453
439
  }
454
440
 
455
- _resolveUnboundTask() {
456
- const sessionsDir = join(this.directory, ".trellis", ".runtime", "sessions")
457
- if (existsSync(sessionsDir)) {
458
- let sessionFiles
459
- try {
460
- sessionFiles = readdirSync(sessionsDir).filter(name => name.endsWith(".json"))
461
- } catch {
462
- return null
463
- }
464
- if (sessionFiles.some(file => {
465
- try {
466
- const context = JSON.parse(readFileSync(join(sessionsDir, file), "utf-8"))
467
- return Boolean(this.normalizeTaskRef(context?.current_task || ""))
468
- } catch {
469
- return false
470
- }
471
- })) return null
472
- }
473
-
474
- const developer = (process.env.TRELLIS_DEVELOPER || "").trim() || (() => {
475
- try {
476
- const content = readFileSync(join(this.directory, ".trellis", ".developer"), "utf-8")
477
- return content.split(/\r?\n/).find(line => line.startsWith("name="))?.slice(5).trim() || ""
478
- } catch {
479
- return ""
480
- }
481
- })()
482
- if (!developer) return null
483
-
484
- const tasksDir = join(this.directory, ".trellis", "tasks")
485
- let taskNames
486
- try {
487
- taskNames = readdirSync(tasksDir).filter(name => name !== "archive")
488
- } catch {
489
- return null
490
- }
491
-
492
- const candidates = taskNames.flatMap(name => {
493
- try {
494
- const data = JSON.parse(readFileSync(join(tasksDir, name, "task.json"), "utf-8"))
495
- if (data.assignee !== developer || !["planning", "in_progress", "review"].includes(data.status)) return []
496
- return [`.trellis/tasks/${name}`]
497
- } catch {
498
- return []
499
- }
500
- })
501
- if (candidates.length === 0) return null
502
- if (candidates.length === 1) {
503
- return { taskPath: candidates[0], source: "unbound", stale: false }
504
- }
505
- return {
506
- taskPath: null,
507
- source: "unbound_ambiguous",
508
- stale: false,
509
- candidatePaths: candidates.sort(),
510
- }
511
- }
512
-
513
441
  getCurrentTask(platformInput = null) {
514
442
  return this.getActiveTask(platformInput).taskPath
515
443
  }
@@ -471,9 +471,10 @@ export default async ({ directory, platform: hostPlatform = process.platform, en
471
471
  // run when earlier ones miss):
472
472
  // 1. Exact session runtime context lookup for input.sessionID
473
473
  // 2. `Active task: <path>` hint in the dispatch prompt
474
- // (explicit per-dispatch override)
475
- // 3. Single-session fallback only when the input has no session
476
- // identity and exactly 1 runtime file exists locally
474
+ // (explicit per-dispatch override — beats single-session
475
+ // inference so multi-window users can disambiguate)
476
+ // 3. Single-session fallback — only when exactly 1 session
477
+ // runtime file exists locally
477
478
  let taskDir = null
478
479
  let taskSource = null
479
480
 
@@ -502,7 +503,7 @@ export default async ({ directory, platform: hostPlatform = process.platform, en
502
503
  }
503
504
  }
504
505
 
505
- if (!taskDir && !contextKey) {
506
+ if (!taskDir) {
506
507
  const fallback = ctx._resolveSingleSessionFallback()
507
508
  if (fallback?.taskPath) {
508
509
  const fallbackDir = ctx.resolveTaskDir(fallback.taskPath)
@@ -244,14 +244,6 @@ function loadBreadcrumbs(workflowPath) {
244
244
  */
245
245
  function getActiveTask(ctx, platformInput = null) {
246
246
  const active = ctx.getActiveTask(platformInput)
247
- if (active.source === "unbound_ambiguous") {
248
- return {
249
- id: null,
250
- status: "unbound_ambiguous",
251
- source: active.source,
252
- candidates: active.candidatePaths || [],
253
- }
254
- }
255
247
  const taskRef = active.taskPath
256
248
  if (!taskRef) return null
257
249
  const taskDir = ctx.resolveTaskDir(taskRef)
@@ -264,8 +256,14 @@ function getActiveTask(ctx, platformInput = null) {
264
256
  const data = JSON.parse(readFileSync(taskJsonPath, "utf-8"))
265
257
  const status = typeof data.status === "string" ? data.status : ""
266
258
  if (!status) return null
259
+ const phaseWorkflow = data.meta?.task_workflow
260
+ const phases = phaseWorkflow?.phases
261
+ const phaseId = phaseWorkflow?.current_phase_id || phaseWorkflow?.phase_ids?.at(-1)
262
+ const phase = typeof phaseId === "string" ? phases?.[phaseId] : null
267
263
  const id = data.id || taskRef.split("/").pop()
268
- if (active.source === "unbound") return { id, status: "unbound_task", source: active.source }
264
+ if (typeof phaseId === "string" && phase && typeof phase.status === "string") {
265
+ return { id, status: phaseId, phaseStatus: phase.status, source: active.source }
266
+ }
269
267
  return { id, status, source: active.source }
270
268
  } catch {
271
269
  return null
@@ -279,17 +277,16 @@ function getActiveTask(ctx, platformInput = null) {
279
277
  * "Refer to workflow.md for current step." line
280
278
  * - no_task pseudo-status (id === null) → header omits task info
281
279
  */
282
- function buildBreadcrumb(id, status, templates, candidates = []) {
280
+ function buildBreadcrumb(id, status, templates, phaseStatus = null) {
283
281
  let body = templates[status]
284
282
  if (body === undefined) {
285
283
  body = "Refer to workflow.md for current step."
286
284
  }
287
- let header
288
- if (status === "unbound_ambiguous") {
289
- header = `Status: ${status}\nCandidates: ${candidates.join(", ")}`
290
- } else {
291
- header = id === null ? `Status: ${status}` : `Task: ${id} (${status})`
292
- }
285
+ const header = id === null
286
+ ? `Status: ${status}`
287
+ : phaseStatus
288
+ ? `Task: ${id}\nPhase: ${status} (${phaseStatus})`
289
+ : `Task: ${id} (${status})`
293
290
  return `<workflow-state>\n${header}\n${body}\n</workflow-state>`
294
291
  }
295
292
 
@@ -332,7 +329,7 @@ export default async ({ directory }) => {
332
329
  const templates = loadBreadcrumbs(resolveWorkflowMd(ctx, directory, platformInput))
333
330
  const task = getActiveTask(ctx, platformInput)
334
331
  const breadcrumb = task
335
- ? buildBreadcrumb(task.id, task.status, templates, task.candidates)
332
+ ? buildBreadcrumb(task.id, task.status, templates, task.phaseStatus)
336
333
  : buildBreadcrumb(null, "no_task", templates)
337
334
 
338
335
  prependEphemeralText(messages, breadcrumb)