@pennixrv/trellis 0.7.0-beta.8 → 0.7.1-beta.0

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 (485) 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.0-beta.9.json +9 -0
  254. package/dist/migrations/manifests/0.7.1-beta.0.json +9 -0
  255. package/dist/migrations/manifests/0.7.1.json +9 -0
  256. package/dist/templates/claude/hooks/statusline.py +0 -7
  257. package/dist/templates/codex/hooks/session-start.py +31 -38
  258. package/dist/templates/common/bundled-skills/trellis-decision-space-construction-and-merging/SKILL.md +10 -0
  259. package/dist/templates/common/bundled-skills/trellis-decision-space-construction-and-merging/workflow.md +40 -0
  260. package/dist/templates/common/bundled-skills/trellis-delivery-review-and-closeout/SKILL.md +10 -0
  261. package/dist/templates/common/bundled-skills/trellis-delivery-review-and-closeout/workflow.md +55 -0
  262. package/dist/templates/common/bundled-skills/trellis-goal-exploration-and-requirements/SKILL.md +10 -0
  263. package/dist/templates/common/bundled-skills/trellis-goal-exploration-and-requirements/workflow.md +33 -0
  264. package/dist/templates/common/bundled-skills/trellis-meta/SKILL.md +25 -25
  265. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-agents.md +1 -1
  266. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-skills-or-commands.md +13 -19
  267. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-spec-structure.md +1 -1
  268. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-task-lifecycle.md +27 -75
  269. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-workflow.md +17 -56
  270. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/overview.md +1 -1
  271. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/bundled-skills.md +14 -11
  272. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/generated-files.md +0 -33
  273. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/multi-agent-teamwork.md +32 -0
  274. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/spec-system.md +1 -1
  275. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/task-system.md +25 -111
  276. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/workflow.md +19 -60
  277. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/skills-and-commands.md +1 -1
  278. package/dist/templates/common/bundled-skills/trellis-session-insight/SKILL.md +1 -1
  279. package/dist/templates/common/bundled-skills/trellis-session-insight/references/cli-quick-reference.md +1 -1
  280. package/dist/templates/common/bundled-skills/trellis-solution-design-and-convergence/SKILL.md +10 -0
  281. package/dist/templates/common/bundled-skills/trellis-solution-design-and-convergence/workflow.md +36 -0
  282. package/dist/templates/common/bundled-skills/trellis-task-implementation/SKILL.md +10 -0
  283. package/dist/templates/common/bundled-skills/trellis-task-implementation/workflow.md +29 -0
  284. package/dist/templates/common/bundled-skills/trellis-teamwork/SKILL.md +73 -0
  285. package/dist/templates/common/bundled-skills/trellis-teamwork/references/coordination-modes.md +29 -0
  286. package/dist/templates/common/bundled-skills/trellis-teamwork/references/teammate-configuration-matrix.md +31 -0
  287. package/dist/templates/common/bundled-skills/trellis-teamwork/references/teammate-processes.md +37 -0
  288. package/dist/templates/common/bundled-skills/trellis-teamwork/references/teamwork-plan-construction.md +78 -0
  289. package/dist/templates/common/commands/continue.md +9 -49
  290. package/dist/templates/common/commands/finish-work.md +10 -58
  291. package/dist/templates/common/commands/start.md +19 -49
  292. package/dist/templates/common/skills/brainstorm.md +11 -191
  293. package/dist/templates/copilot/hooks/session-start.py +30 -26
  294. package/dist/templates/copilot/prompts/brainstorm.prompt.md +7 -150
  295. package/dist/templates/copilot/prompts/finish-work.prompt.md +11 -88
  296. package/dist/templates/copilot/prompts/record-session.prompt.md +4 -12
  297. package/dist/templates/copilot/prompts/start.prompt.md +12 -10
  298. package/dist/templates/dsh/DSH.md +2 -2
  299. package/dist/templates/kiro/agents/trellis.json +2 -2
  300. package/dist/templates/markdown/agents.md +14 -3
  301. package/dist/templates/markdown/spec/guides/cross-layer-thinking-guide.md.txt +9 -8
  302. package/dist/templates/markdown/spec/guides/cross-platform-thinking-guide.md.txt +1 -1
  303. package/dist/templates/markdown/workspace-index.md +0 -1
  304. package/dist/templates/omp/extensions/trellis/index.ts.txt +28 -17
  305. package/dist/templates/opencode/lib/session-utils.js +20 -25
  306. package/dist/templates/opencode/lib/trellis-context.js +4 -76
  307. package/dist/templates/opencode/plugins/inject-subagent-context.js +5 -4
  308. package/dist/templates/opencode/plugins/inject-workflow-state.js +14 -17
  309. package/dist/templates/shared-hooks/inject-shell-session-context.py +3 -3
  310. package/dist/templates/shared-hooks/inject-subagent-context.py +445 -67
  311. package/dist/templates/shared-hooks/inject-workflow-state.py +44 -36
  312. package/dist/templates/shared-hooks/session-start.py +21 -33
  313. package/dist/templates/trellis/agents/delegated-worktree-primary-agent.md +18 -0
  314. package/dist/templates/trellis/agents/teammate-profiles.json +8 -0
  315. package/dist/templates/trellis/agents/teammate.md +63 -0
  316. package/dist/templates/trellis/config.yaml +29 -38
  317. package/dist/templates/trellis/gitignore.txt +1 -0
  318. package/dist/templates/trellis/index.d.ts +8 -12
  319. package/dist/templates/trellis/index.d.ts.map +1 -1
  320. package/dist/templates/trellis/index.js +14 -25
  321. package/dist/templates/trellis/index.js.map +1 -1
  322. package/dist/templates/trellis/scripts/add_session.py +1 -1
  323. package/dist/templates/trellis/scripts/common/__init__.py +0 -1
  324. package/dist/templates/trellis/scripts/common/active_task.py +136 -100
  325. package/dist/templates/trellis/scripts/common/config.py +7 -9
  326. package/dist/templates/trellis/scripts/common/git_context.py +1 -1
  327. package/dist/templates/trellis/scripts/common/io.py +19 -0
  328. package/dist/templates/trellis/scripts/common/paths.py +0 -1
  329. package/dist/templates/trellis/scripts/common/safe_commit.py +11 -90
  330. package/dist/templates/trellis/scripts/common/session_context.py +1 -8
  331. package/dist/templates/trellis/scripts/common/spec_match.py +1 -1
  332. package/dist/templates/trellis/scripts/common/task_context.py +152 -59
  333. package/dist/templates/trellis/scripts/common/task_continuity.py +598 -0
  334. package/dist/templates/trellis/scripts/common/task_store.py +70 -548
  335. package/dist/templates/trellis/scripts/common/task_utils.py +4 -98
  336. package/dist/templates/trellis/scripts/common/task_workflow.py +1096 -0
  337. package/dist/templates/trellis/scripts/common/tasks.py +5 -8
  338. package/dist/templates/trellis/scripts/common/workflow_phase.py +8 -7
  339. package/dist/templates/trellis/scripts/hooks/linear_sync.py +3 -3
  340. package/dist/templates/trellis/scripts/task.py +119 -377
  341. package/dist/templates/trellis/workflow.md +111 -699
  342. package/dist/utils/agent-refs.d.ts +5 -5
  343. package/dist/utils/agent-refs.js +6 -6
  344. package/dist/utils/file-writer.d.ts +3 -2
  345. package/dist/utils/file-writer.d.ts.map +1 -1
  346. package/dist/utils/file-writer.js +3 -2
  347. package/dist/utils/file-writer.js.map +1 -1
  348. package/dist/utils/managed-paths.d.ts +0 -7
  349. package/dist/utils/managed-paths.d.ts.map +1 -1
  350. package/dist/utils/managed-paths.js +0 -40
  351. package/dist/utils/managed-paths.js.map +1 -1
  352. package/dist/utils/manifest-prune.d.ts.map +1 -1
  353. package/dist/utils/manifest-prune.js +2 -11
  354. package/dist/utils/manifest-prune.js.map +1 -1
  355. package/dist/utils/uninstall-scrubbers.d.ts.map +1 -1
  356. package/dist/utils/uninstall-scrubbers.js +3 -3
  357. package/dist/utils/uninstall-scrubbers.js.map +1 -1
  358. package/dist/utils/workflow-resolver.d.ts +10 -16
  359. package/dist/utils/workflow-resolver.d.ts.map +1 -1
  360. package/dist/utils/workflow-resolver.js +25 -36
  361. package/dist/utils/workflow-resolver.js.map +1 -1
  362. package/package.json +2 -2
  363. package/dist/commands/channel/adapters/claude.d.ts.map +0 -1
  364. package/dist/commands/channel/adapters/claude.js.map +0 -1
  365. package/dist/commands/channel/adapters/codex.d.ts.map +0 -1
  366. package/dist/commands/channel/adapters/codex.js.map +0 -1
  367. package/dist/commands/channel/adapters/index.d.ts.map +0 -1
  368. package/dist/commands/channel/adapters/index.js.map +0 -1
  369. package/dist/commands/channel/adapters/types.d.ts.map +0 -1
  370. package/dist/commands/channel/adapters/types.js.map +0 -1
  371. package/dist/commands/channel/agent-loader.d.ts.map +0 -1
  372. package/dist/commands/channel/agent-loader.js.map +0 -1
  373. package/dist/commands/channel/context-loader.d.ts.map +0 -1
  374. package/dist/commands/channel/context-loader.js.map +0 -1
  375. package/dist/commands/channel/context-trust.d.ts.map +0 -1
  376. package/dist/commands/channel/context-trust.js.map +0 -1
  377. package/dist/commands/channel/context.d.ts +0 -16
  378. package/dist/commands/channel/context.d.ts.map +0 -1
  379. package/dist/commands/channel/context.js.map +0 -1
  380. package/dist/commands/channel/create.d.ts +0 -29
  381. package/dist/commands/channel/create.d.ts.map +0 -1
  382. package/dist/commands/channel/create.js +0 -47
  383. package/dist/commands/channel/create.js.map +0 -1
  384. package/dist/commands/channel/dev-parse-trace.d.ts.map +0 -1
  385. package/dist/commands/channel/dev-parse-trace.js.map +0 -1
  386. package/dist/commands/channel/guard.d.ts.map +0 -1
  387. package/dist/commands/channel/guard.js.map +0 -1
  388. package/dist/commands/channel/index.d.ts +0 -3
  389. package/dist/commands/channel/index.d.ts.map +0 -1
  390. package/dist/commands/channel/index.js.map +0 -1
  391. package/dist/commands/channel/interrupt.d.ts.map +0 -1
  392. package/dist/commands/channel/interrupt.js +0 -22
  393. package/dist/commands/channel/interrupt.js.map +0 -1
  394. package/dist/commands/channel/kill.d.ts +0 -7
  395. package/dist/commands/channel/kill.d.ts.map +0 -1
  396. package/dist/commands/channel/kill.js.map +0 -1
  397. package/dist/commands/channel/list.d.ts +0 -18
  398. package/dist/commands/channel/list.d.ts.map +0 -1
  399. package/dist/commands/channel/list.js.map +0 -1
  400. package/dist/commands/channel/messages.d.ts.map +0 -1
  401. package/dist/commands/channel/messages.js.map +0 -1
  402. package/dist/commands/channel/rm.d.ts +0 -27
  403. package/dist/commands/channel/rm.d.ts.map +0 -1
  404. package/dist/commands/channel/rm.js.map +0 -1
  405. package/dist/commands/channel/run.d.ts +0 -32
  406. package/dist/commands/channel/run.js +0 -141
  407. package/dist/commands/channel/run.js.map +0 -1
  408. package/dist/commands/channel/send.d.ts.map +0 -1
  409. package/dist/commands/channel/send.js.map +0 -1
  410. package/dist/commands/channel/spawn.d.ts.map +0 -1
  411. package/dist/commands/channel/spawn.js.map +0 -1
  412. package/dist/commands/channel/store/events.d.ts +0 -22
  413. package/dist/commands/channel/store/events.d.ts.map +0 -1
  414. package/dist/commands/channel/store/events.js.map +0 -1
  415. package/dist/commands/channel/store/filter.d.ts +0 -3
  416. package/dist/commands/channel/store/filter.d.ts.map +0 -1
  417. package/dist/commands/channel/store/filter.js +0 -2
  418. package/dist/commands/channel/store/filter.js.map +0 -1
  419. package/dist/commands/channel/store/lock.d.ts.map +0 -1
  420. package/dist/commands/channel/store/lock.js.map +0 -1
  421. package/dist/commands/channel/store/paths.d.ts.map +0 -1
  422. package/dist/commands/channel/store/paths.js.map +0 -1
  423. package/dist/commands/channel/store/schema.d.ts +0 -27
  424. package/dist/commands/channel/store/schema.d.ts.map +0 -1
  425. package/dist/commands/channel/store/schema.js +0 -34
  426. package/dist/commands/channel/store/schema.js.map +0 -1
  427. package/dist/commands/channel/store/thread-state.d.ts.map +0 -1
  428. package/dist/commands/channel/store/thread-state.js.map +0 -1
  429. package/dist/commands/channel/store/watch.d.ts +0 -19
  430. package/dist/commands/channel/store/watch.d.ts.map +0 -1
  431. package/dist/commands/channel/store/watch.js.map +0 -1
  432. package/dist/commands/channel/supervisor/idle.d.ts.map +0 -1
  433. package/dist/commands/channel/supervisor/idle.js.map +0 -1
  434. package/dist/commands/channel/supervisor/inbox.d.ts.map +0 -1
  435. package/dist/commands/channel/supervisor/inbox.js.map +0 -1
  436. package/dist/commands/channel/supervisor/shutdown.d.ts.map +0 -1
  437. package/dist/commands/channel/supervisor/shutdown.js.map +0 -1
  438. package/dist/commands/channel/supervisor/stdout.d.ts.map +0 -1
  439. package/dist/commands/channel/supervisor/stdout.js.map +0 -1
  440. package/dist/commands/channel/supervisor/turns.d.ts.map +0 -1
  441. package/dist/commands/channel/supervisor/turns.js.map +0 -1
  442. package/dist/commands/channel/supervisor/warning.d.ts.map +0 -1
  443. package/dist/commands/channel/supervisor/warning.js.map +0 -1
  444. package/dist/commands/channel/supervisor.d.ts.map +0 -1
  445. package/dist/commands/channel/supervisor.js.map +0 -1
  446. package/dist/commands/channel/text-body.d.ts +0 -13
  447. package/dist/commands/channel/text-body.d.ts.map +0 -1
  448. package/dist/commands/channel/text-body.js.map +0 -1
  449. package/dist/commands/channel/threads.d.ts +0 -39
  450. package/dist/commands/channel/threads.d.ts.map +0 -1
  451. package/dist/commands/channel/threads.js.map +0 -1
  452. package/dist/commands/channel/title.d.ts +0 -12
  453. package/dist/commands/channel/title.d.ts.map +0 -1
  454. package/dist/commands/channel/title.js +0 -24
  455. package/dist/commands/channel/title.js.map +0 -1
  456. package/dist/commands/channel/wait.d.ts.map +0 -1
  457. package/dist/commands/channel/wait.js.map +0 -1
  458. package/dist/commands/channel/workers.d.ts +0 -9
  459. package/dist/commands/channel/workers.d.ts.map +0 -1
  460. package/dist/commands/channel/workers.js +0 -31
  461. package/dist/commands/channel/workers.js.map +0 -1
  462. package/dist/templates/common/bundled-skills/trellis-channel/SKILL.md +0 -69
  463. package/dist/templates/common/bundled-skills/trellis-channel/references/command-reference.md +0 -549
  464. package/dist/templates/common/bundled-skills/trellis-channel/references/forum.md +0 -233
  465. package/dist/templates/common/bundled-skills/trellis-channel/references/progress-debugging.md +0 -237
  466. package/dist/templates/common/bundled-skills/trellis-channel/references/subnode-work.md +0 -193
  467. package/dist/templates/common/bundled-skills/trellis-channel/references/workers.md +0 -295
  468. package/dist/templates/common/bundled-skills/trellis-channel/references/workflows.md +0 -131
  469. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/multi-agent-channel.md +0 -70
  470. package/dist/templates/common/bundled-skills/trellis-research-record/SKILL.md +0 -14
  471. package/dist/templates/copilot/prompts/parallel.prompt.md +0 -204
  472. package/dist/templates/trellis/agents/check.md +0 -70
  473. package/dist/templates/trellis/agents/implement.md +0 -71
  474. package/dist/templates/trellis/agents/subnode.env +0 -4
  475. package/dist/templates/trellis/agents/subnode.md +0 -69
  476. package/dist/templates/trellis/scripts/common/context_projection.py +0 -508
  477. package/dist/templates/trellis/scripts/common/continuation_record.py +0 -450
  478. package/dist/templates/trellis/scripts/common/ownership_record.py +0 -439
  479. package/dist/templates/trellis/scripts/subnode_artifact.py +0 -597
  480. package/dist/templates/trellis/scripts/workspace_note.py +0 -126
  481. /package/dist/commands/{channel → teamwork}/adapters/types.js +0 -0
  482. /package/dist/commands/{channel → teamwork}/supervisor/idle.d.ts +0 -0
  483. /package/dist/commands/{channel → teamwork}/supervisor/idle.js +0 -0
  484. /package/dist/commands/{channel → teamwork}/supervisor/turns.d.ts +0 -0
  485. /package/dist/commands/{channel → teamwork}/supervisor/turns.js +0 -0
@@ -1,773 +1,185 @@
1
- # Development Workflow
1
+ # Trellis 工作流
2
2
 
3
- ---
3
+ ## 核心原则
4
4
 
5
- ## Core Principles
5
+ 1. 保持下表列出的业务阶段各自独立。每个阶段都有自己的活动、产物、接受条件和回流路径。
6
+ 2. 任务与阶段事实由 Trellis CLI 管理。Skills、Hooks、Teamwork、Paseo 和其他组件按各自职责提供指引、证据或执行能力。
7
+ 3. 采用满足任务风险和验收需要的最小流程。可以基于证据跳过阶段;边界清楚、风险低、可逆、已获授权且能立即验证的请求可以不创建 Trellis task。
8
+ 4. 在任务资产中记录决定和当前证据。不得从阶段状态、Teamwork 结果或会话交接状态推断任务状态。
6
9
 
7
- 1. **Plan before code** — figure out what to do before you start
8
- 2. **Specs injected, not remembered** — guidelines are injected via hook/skill, not recalled from memory
9
- 3. **Persist everything** — research, decisions, and lessons all go to files; conversations get compacted, files don't
10
- 4. **Incremental development** — one task at a time
11
- 5. **Capture learnings** — after each task, review and write new knowledge back to spec
10
+ ## Trellis 项目上下文
12
11
 
13
- ---
12
+ ### 项目规范
14
13
 
15
- ## Trellis System
16
-
17
- ### Developer Identity
18
-
19
- On first use, initialize your identity:
20
-
21
- ```bash
22
- python3 ./.trellis/scripts/init_developer.py <your-name>
23
- ```
24
-
25
- Creates `.trellis/.developer` (gitignored) + `.trellis/workspace/<your-name>/`.
26
-
27
- ### Spec System
28
-
29
- `.trellis/spec/` holds coding guidelines organized by package and layer.
30
-
31
- - `.trellis/spec/<package>/<layer>/index.md` — entry point with **Pre-Development Checklist** + **Quality Check**. Actual guidelines live in the `.md` files it points to.
32
- - `.trellis/spec/guides/index.md` — cross-package thinking guides.
14
+ `.trellis/spec/` 保存项目和 package 规范。修改代码前,读取适用的 `AGENTS.md` 和规范文件。使用 `get_context.py --mode packages` 查找 package 与规范层级。
33
15
 
34
16
  ```bash
35
- python3 ./.trellis/scripts/get_context.py --mode packages # list packages / layers
17
+ python3 ./.trellis/scripts/get_context.py --mode packages
18
+ python3 ./.trellis/scripts/get_context.py --mode spec --file <path>
36
19
  ```
37
20
 
38
- **When to update spec**: new pattern/convention found · bug-fix prevention to codify · new technical decision.
39
-
40
- ### Task System
21
+ ### 任务记录
41
22
 
42
- Every task has its own directory under `.trellis/tasks/{MM-DD-name}/` holding `task.json`, `prd.md`, optional `design.md`, optional `implement.md`, optional `research/`, and context manifests (`implement.jsonl`, `check.jsonl`) for sub-agent-capable platforms.
23
+ Trellis task 位于 `.trellis/tasks/`,包含 `task.json`、需求以及任务所需的设计、实施、研究或上下文资产。使用 Trellis CLI 创建和启动任务、初始化和推进阶段路线,以及完成或取消任务。不得手工修改任务状态或阶段状态。
43
24
 
44
25
  ```bash
45
- # Task lifecycle
46
- python3 ./.trellis/scripts/task.py create "<title>" [--slug <name>] [--parent <dir>]
47
- python3 ./.trellis/scripts/task.py start <name> # set active task (session-scoped when available)
48
- python3 ./.trellis/scripts/task.py replan <name> "<reason>" # return material ambiguity to planning
49
- python3 ./.trellis/scripts/task.py current --source # show active task and source
50
- python3 ./.trellis/scripts/task.py finish # clear active task (triggers after_finish hooks)
51
- python3 ./.trellis/scripts/task.py archive <name> # move to archive/{year-month}/
52
- python3 ./.trellis/scripts/task.py list [--mine] [--status <s>]
53
- python3 ./.trellis/scripts/task.py list-archive
54
-
55
- # Code-spec context (injected into implement/check agents via JSONL).
56
- # `implement.jsonl` / `check.jsonl` are seeded (empty) on `task create` for sub-agent-capable
57
- # platforms; the AI curates real spec + research entries during planning. `validate` fails
58
- # and `start` refuses while a seeded manifest is still empty — sub-agents would run with
59
- # zero spec context. Pass `start --allow-empty-context` when that is intentional.
60
- python3 ./.trellis/scripts/task.py add-context <name> <action> <file> <reason>
61
- python3 ./.trellis/scripts/task.py list-context <name> [action]
62
- python3 ./.trellis/scripts/task.py validate <name>
63
-
64
- # Task metadata
65
- python3 ./.trellis/scripts/task.py set-branch <name> <branch>
66
- python3 ./.trellis/scripts/task.py set-base-branch <name> <branch> # PR target
67
- python3 ./.trellis/scripts/task.py set-scope <name> <scope>
68
- python3 ./.trellis/scripts/task.py set-meta <name> delivery_mode analysis_only
69
-
70
- # Hierarchy (parent/child)
71
- python3 ./.trellis/scripts/task.py add-subtask <parent> <child>
72
- python3 ./.trellis/scripts/task.py remove-subtask <parent> <child>
73
-
74
- # PR creation
75
- python3 ./.trellis/scripts/task.py create-pr [name] [--dry-run]
26
+ python3 ./.trellis/scripts/task.py create "<title>" [--slug <name>] [--parent <task>]
27
+ python3 ./.trellis/scripts/task.py phase init <task> --task-kind <analysis|implementation|combined> --complexity <simple|standard|complex> --project-context <new|existing> --phase-ids <ordered-ids>
28
+ python3 ./.trellis/scripts/task.py phase show <task>
29
+ python3 ./.trellis/scripts/task.py validate <task>
30
+ python3 ./.trellis/scripts/task.py start <task>
31
+ python3 ./.trellis/scripts/task.py complete <task>
32
+ python3 ./.trellis/scripts/task.py cancel <task> --reason "<reason>" --evidence-ref <reference>
76
33
  ```
77
34
 
78
- > Run `python3 ./.trellis/scripts/task.py --help` to see the authoritative, up-to-date list.
79
-
80
- **Current-task mechanism**: `task.py create` creates the task directory and (when session identity is available) auto-sets the per-session active-task pointer so the planning breadcrumb fires immediately. `task.py start` writes the same pointer (idempotent if already set) and flips `task.json.status` from `planning` to `in_progress`. State is stored under `.trellis/.runtime/sessions/`. If no context key is available from hook input, `TRELLIS_CONTEXT_ID`, or a platform-native session environment variable, `task.py start` fails with a session identity hint because it cannot persist a session pointer; read-only context may still project one unique developer-owned resumable task. `task.py finish` deletes the current session file (status unchanged). `task.py archive <task>` writes `status=completed`, moves the directory to `archive/`, and deletes any runtime session files that still point at the archived task.
35
+ 使用 `phase artifact`、`accept`、`skip`、`wait`、`block`、`resume`、`return`、`route` 和 `authorize` 执行对应的阶段操作。准确参数以 `task.py --help` 为准。跳过阶段必须提供理由和证据;目标探索与需求核对阶段不可省略。
81
36
 
82
- ### Workspace System
37
+ 只有阶段路线已到达获准的实施入口时,`task.py start` 才会将任务从 `planning` 改为 `in_progress`。分析任务可在交付审查与现场收尾阶段后仍处于 `planning` 时完成。`complete` 和 `cancel` 会清除任务的运行时会话指针;任务记录保留在原位置。
83
38
 
84
- Records every AI session for cross-session tracking under `.trellis/workspace/<developer>/`.
39
+ 在支持原生实施或检查 agent 的平台上,任务上下文清单(`implement.jsonl`、`check.jsonl`)用于提供相关规范和研究资料。只有这些 agent 会读取清单时才需要维护;清单不能替代任务资产或阶段证据。
85
40
 
86
- - `journal-N.md` — session log. **Max 2000 lines per file**; a new `journal-(N+1).md` is auto-created when exceeded.
87
- - `index.md` — personal index (total sessions, last active).
41
+ ### 工作区与会话上下文
88
42
 
89
- ```bash
90
- python3 ./.trellis/scripts/add_session.py --title "Title" --commit "hash" --summary "Summary"
91
- ```
92
-
93
- ### Context Script
43
+ 会话日志保存在 `.trellis/workspace/<developer>/`,用于记录会话进度,与 Trellis task 生命周期及正式会话交接包相互独立。
94
44
 
95
45
  ```bash
96
- python3 ./.trellis/scripts/get_context.py # full session runtime
97
- python3 ./.trellis/scripts/get_context.py --mode packages # available packages + spec layers
98
- python3 ./.trellis/scripts/get_context.py --mode phase --step <X.Y> # detailed guide for a workflow step
46
+ python3 ./.trellis/scripts/get_context.py
47
+ python3 ./.trellis/scripts/get_context.py --mode phase
48
+ python3 ./.trellis/scripts/add_session.py --title "<title>" --summary "<summary>"
99
49
  ```
100
50
 
101
- ---
102
-
103
- <!--
104
- WORKFLOW-STATE BREADCRUMB CONTRACT (read this before editing the tag blocks below)
105
-
106
- The [workflow-state:STATUS] blocks embedded in the ## Phase Index section
107
- below are the SINGLE source of truth for the per-turn `<workflow-state>`
108
- breadcrumb that every supported AI platform's UserPromptSubmit hook
109
- reads. inject-workflow-state.py (Python platforms) and
110
- inject-workflow-state.js (OpenCode plugin) only parse them — there is no
111
- fallback dict baked into the scripts after v0.5.0-rc.0.
112
-
113
- STATUS charset: [A-Za-z0-9_-]+. When the hook can't find a tag, it
114
- degrades to a generic "Refer to workflow.md for current step." line —
115
- intentionally visible so users notice and fix a broken workflow.md.
116
-
117
- INVARIANT (test/regression.test.ts):
118
- Every workflow-walkthrough step marked `[required · once]` must have a
119
- matching enforcement line in its phase's [workflow-state:*] block. The
120
- breadcrumb is the only per-turn channel; if a mandatory step isn't
121
- mentioned there, the AI silently skips it (Phase 1 planning gate
122
- skip and Phase 3.4 commit skip both manifested via this gap).
123
-
124
- TAG ↔ PHASE scoping:
125
- [workflow-state:no_task] → no active task; before Phase 1
126
- [workflow-state:unbound_task] → one developer-owned task exists without a session pointer
127
- [workflow-state:unbound_ambiguous] → multiple developer-owned tasks exist without a session pointer
128
- [workflow-state:unbound_ambiguous-inline] → Codex inline variant of unbound_ambiguous
129
- [workflow-state:task_error] → active task record is unreadable; repair it before continuing
130
- [workflow-state:planning] → all of Phase 1 (status='planning')
131
- [workflow-state:planning-inline] → Codex inline variant of Phase 1
132
- [workflow-state:in_progress] → Phase 2 + Phase 3.2-3.4
133
- (status stays 'in_progress' from
134
- task.py start until task.py archive)
135
- [workflow-state:in_progress-inline] → Codex inline variant of Phase 2/3
136
- [workflow-state:completed] → currently DEAD: cmd_archive flips
137
- status and moves the dir in the same
138
- call, so the resolver loses the
139
- pointer (block kept for a future
140
- explicit in_progress→completed
141
- transition)
142
-
143
- Editing checklist:
144
- - When you change a [workflow-state:STATUS] block, also check the
145
- matching phase's `[required · once]` walkthrough steps for sync
146
- - Run `trellis update` after editing to push the new bodies to
147
- downstream user projects (block-level managed replacement)
148
- - Full runtime contract:
149
- .trellis/spec/cli/backend/workflow-state-contract.md
150
- -->
151
-
152
- ## Phase Index
153
-
154
- ```
155
- Phase 1: Plan → classify, then create planning artifacts for work that needs a task
156
- Phase 2: Execute → implement only after task status is in_progress
157
- Phase 3: Finish → verify, update spec, commit, and wrap up
51
+ 每个 task 的 workflow selector(`task.json.workflow`、开发者偏好或 `config.yaml` 默认值)用于选择工作流文档。它独立于任务的 `phase_ids` 和 `current_phase_id`,不会创建另一条阶段路线。
52
+
53
+ ## 阶段索引
54
+
55
+ 任务路线从下表列出的业务阶段中按需选取,组成有序路线;每个阶段对应一个提供本阶段流程和图示的 Skill。
56
+
57
+ | 业务阶段 | 内部标识 | 对应 Skill | 目的 |
58
+ | --- | --- | --- | --- |
59
+ | 目标探索与需求核对阶段 | `goal_exploration_and_requirements` | `trellis-goal-exploration-and-requirements` | 建立并由用户明确确认当前目标与需求基线。 |
60
+ | 决策空间构造与归并阶段 | `decision_space_construction_and_merging` | `trellis-decision-space-construction-and-merging` | 识别、比较并整理实质选择及其依赖。 |
61
+ | 解决方案设计与收敛阶段 | `solution_design_and_convergence` | `trellis-solution-design-and-convergence` | 收敛决策,并接受分析结论或实施合同。 |
62
+ | 任务实施与测试验证阶段 | `task_implementation` | `trellis-task-implementation` | 实施并验证已获授权的合同。 |
63
+ | 交付审查与现场收尾阶段 | `delivery_review_and_closeout` | `trellis-delivery-review-and-closeout` | 审查当前交付、处理缺口并完成或取消任务。 |
64
+
65
+ ```mermaid
66
+ flowchart LR
67
+ request["用户请求"] --> triage{"是否需要 Trellis task?"}
68
+ triage -->|"否;边界清楚、低风险、可逆、已授权且可验证"| direct["直接处理并验证"]
69
+ triage -->|"是"| goal_exploration_and_requirements["目标探索与需求核对阶段"]
70
+ goal_exploration_and_requirements -->|"当前基线已获用户确认"| decision_space_construction_and_merging["决策空间构造与归并阶段"]
71
+ decision_space_construction_and_merging -->|"已接受或有证据的跳过记录"| solution_design_and_convergence["解决方案设计与收敛阶段"]
72
+ solution_design_and_convergence -->|"实施合同已授权"| task_implementation["任务实施与测试验证阶段"]
73
+ solution_design_and_convergence -->|"分析结论或 no_go"| delivery_review_and_closeout["交付审查与现场收尾阶段"]
74
+ task_implementation -->|"交付候选"| delivery_review_and_closeout
158
75
  ```
159
76
 
160
- ### Request Triage
161
-
162
- - Direct small work: for a clearly bounded, single-surface operation with an immediate verification path, proceed without creating a Trellis task. Apply normal safety rules. If discovery expands the scope or reveals a design, ownership, release, or durable-record need, stop and create a task before continuing.
163
- - Complex task: ask whether you may create a Trellis task and enter planning. If the user says no, do not do broad inline implementation; explain, clarify scope, or suggest a smaller split.
164
- - User approval to create a task is not approval to start implementation. Planning still happens first.
165
-
166
- ### Analysis-only tasks
167
-
168
- An analysis-only task is eligible only when `task.json.meta.delivery_mode = "analysis_only"` exactly and its `prd.md` names the evidence deliverable plus a no-change boundary for product source, runtime configuration, deployment, credentials, and external systems. Task creation consent authorizes that bounded evidence work, not protected-target changes.
169
-
170
- Keep an eligible analysis-only task in `planning`: write its research, audit, or design evidence; verify its acceptance criteria and boundary; commit task artifacts; then archive directly. Do not run `task.py start`, configure implementation context, or wait for a second implementation approval. If the evidence recommends a protected-target change, record the recommendation and create a separate change-bearing task before doing it.
171
-
172
- ### Planning Artifacts
173
-
174
- - `prd.md` — requirements, constraints, and acceptance criteria. Do not put technical design or execution checklists here.
175
- - `design.md` — technical design for complex tasks: boundaries, contracts, data flow, tradeoffs, compatibility, rollout / rollback shape.
176
- - `implement.md` — execution plan for complex tasks: ordered checklist, validation commands, review gates, and rollback points.
177
- - `implement.jsonl` / `check.jsonl` — spec and research manifests for sub-agent context. They do not replace `implement.md`.
178
- - Lightweight tasks may be PRD-only. Complex tasks must have `prd.md`, `design.md`, and `implement.md` before `task.py start`.
179
-
180
- ### Parent / Child Task Trees
77
+ 图示表达常见阶段转换,不是固定路线矩阵。目标探索与需求核对阶段保留当前目标和需求基线的用户确认;后续业务阶段可按任务需要和现有证据省略。进入决策空间构造与归并阶段或解决方案设计与收敛阶段的路线均须保留该确认。`no_go` 仍须经过交付审查与现场收尾阶段。正式会话交接是独立附加操作,只有用户明确要求时才执行,也不是任务推进或收尾的前置条件。
181
78
 
182
- Use a parent task when one user request contains several independently verifiable deliverables. The parent task owns the source requirement set, the task map, cross-child acceptance criteria, and final integration review; it normally should not be the implementation target unless it also has direct work.
183
-
184
- Use child tasks for deliverables that can be planned, implemented, checked, and archived independently. Parent/child structure is not a dependency system: if one child must wait for another, write that ordering in the child `prd.md` / `implement.md` and keep each child's acceptance criteria testable.
185
-
186
- Create new children with `task.py create "<title>" --slug <name> --parent <parent-dir>`. Link existing tasks with `task.py add-subtask <parent> <child>`, and unlink mistakes with `task.py remove-subtask <parent> <child>`.
187
-
188
- <!-- Per-turn breadcrumb: shown when there is no active task (before Phase 1) -->
79
+ <!-- 宿主 Hook 从以下区块读取每轮工作流提示。 -->
189
80
 
190
81
  [workflow-state:no_task]
191
- No active task. First classify the current turn. Direct small work with a clear single owner and immediate verification may proceed without a Trellis task under normal safety rules.
192
- If scope expands or requires design, ownership, release, credentials, or a durable record, create a Trellis task before continuing.
193
- Complex task: ask the user if you can create a Trellis task and enter the planning phase. If the user says no, explain, clarify scope, or suggest a smaller split.
82
+ 先判断请求性质。只有范围清楚、责任方单一、风险低、可逆、已获授权且能立即验证时,才直接处理而不创建任务;否则创建或恢复 Trellis task。创建任务不代表获准实施。
194
83
  [/workflow-state:no_task]
195
84
 
196
- <!-- Per-turn breadcrumb: shown when one resumable task exists without a direct session binding. -->
197
-
198
- [workflow-state:unbound_task]
199
- An existing task is assigned to the current developer, but this shell has no direct Trellis session binding. Do not create a duplicate task. Continue reading and working from the existing task artifacts; before any lifecycle write or closure, run the native `task.py start <task>` command once a direct session identity is available. Never edit `.trellis/.runtime/sessions/` manually.
200
- [/workflow-state:unbound_task]
201
-
202
- <!-- Per-turn breadcrumb shown when multiple resumable tasks exist without a direct session binding. -->
203
-
204
- [workflow-state:unbound_ambiguous]
205
- Multiple active tasks belong to the current developer, but this shell has no direct Trellis session binding. Do not guess or create a duplicate task. Review the listed candidates and run `python3 ./.trellis/scripts/task.py start <task>` with the intended task once a direct session identity is available.
206
- [/workflow-state:unbound_ambiguous]
207
-
208
- [workflow-state:unbound_ambiguous-inline]
209
- Multiple active tasks belong to the current developer, but this Codex session has no direct Trellis session binding. Do not guess or create a duplicate task. Review the listed candidates and run `python3 ./.trellis/scripts/task.py start <task>` with the intended task once a direct session identity is available.
210
- [/workflow-state:unbound_ambiguous-inline]
211
-
212
- <!-- Per-turn breadcrumb: shown when the active task record cannot be read. -->
213
-
214
85
  [workflow-state:task_error]
215
- The active task record could not be read. Do not create or activate another task.
216
- Inspect the task directory named above and repair its task.json. It must be a valid JSON object with a non-empty status.
217
- Preserve existing task fields and artifacts. If the correct status cannot be determined safely, ask the user before reconstructing the record.
86
+ 活动任务记录无法读取。停止修改任务状态,依据现有任务资产修复该记录后再继续。
218
87
  [/workflow-state:task_error]
219
88
 
220
- ### Phase 1: Plan
221
- - 1.0 Create task `[required · once]` (only after task-creation consent)
222
- - 1.1 Requirement exploration `[required · repeatable]` (`prd.md`; complex tasks also need `design.md` + `implement.md`)
223
- - 1.2 Research `[optional · repeatable]`
224
- - 1.3 Configure context `[required · once]` — Claude Code, Cursor, OpenCode, Codex, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, Oh My Pi, ZCode, Snow, Reasonix, Grok, Kimi Code (sub-agent-dispatch platforms only; inline and eligible analysis-only tasks skip)
225
- - 1.4 Activate task `[required · once]` (change-bearing tasks only: review gate, then `task.py start`; status → in_progress)
226
- - 1.5 Completion criteria
227
-
228
- <!-- Per-turn breadcrumb: shown throughout Phase 1 (status='planning') -->
229
-
230
89
  [workflow-state:planning]
231
- Load `trellis-brainstorm`; stay in planning.
232
- If `task.json.meta.delivery_mode = "analysis_only"` exactly, complete the declared evidence work now. Do not wait for a start review or run `task.py start`; when the PRD boundary and acceptance evidence pass, commit task artifacts and archive directly. A protected-target recommendation requires a separate change-bearing task.
233
- Lightweight: `prd.md` can be enough. Complex: finish `prd.md`, `design.md`, and `implement.md`; ask for review before `task.py start`. If `decision-needed` items or an unsealed decision graph remain, load `pennix-decision-gates`, batch only independent frontier questions, and stay in planning.
234
- Multi-deliverable scope: consider a parent task plus independently verifiable child tasks; dependencies must be written in child artifacts, not implied by tree position.
235
- Sub-agent mode: curate `implement.jsonl` and `check.jsonl` as spec/research manifests before start.
90
+ 任务尚未初始化阶段路线。核对需求后,按适用性选择有序阶段,并为省略阶段记录理由和证据,再使用 `task.py phase init`。解决方案设计与收敛阶段的实施合同获接受且另行取得实施授权前,不得开始实施。
236
91
  [/workflow-state:planning]
237
92
 
238
- <!-- Per-turn breadcrumb: shown throughout Phase 1 when Codex uses its default
239
- codex.dispatch_mode=inline. Codex-only alternate to [workflow-state:planning]. The main agent
240
- edits code directly in Phase 2, so jsonl curation is skipped —
241
- the inline workflow loads `trellis-before-dev` instead of injecting JSONL
242
- into a sub-agent. -->
243
-
244
93
  [workflow-state:planning-inline]
245
- Load `trellis-brainstorm`; stay in planning.
246
- If `task.json.meta.delivery_mode = "analysis_only"` exactly, complete the declared evidence work now. Do not wait for a start review or run `task.py start`; when the PRD boundary and acceptance evidence pass, commit task artifacts and archive directly. A protected-target recommendation requires a separate change-bearing task.
247
- Lightweight: `prd.md` can be enough. Complex: finish `prd.md`, `design.md`, and `implement.md`; ask for review before `task.py start`. If `decision-needed` items or an unsealed decision graph remain, load `pennix-decision-gates`, batch only independent frontier questions, and stay in planning.
248
- Multi-deliverable scope: consider a parent task plus independently verifiable child tasks; dependencies must be written in child artifacts, not implied by tree position.
249
- Inline mode: skip jsonl curation; Phase 2 reads artifacts/specs via `trellis-before-dev`.
94
+ 遵循 `planning` 的相同规划路线,并在主会话中工作。除非用户或任务合同有此要求,否则不要派发原生实施或检查 agent。
250
95
  [/workflow-state:planning-inline]
251
96
 
252
- ### Phase 2: Execute
253
- - 2.1 Implement `[required · repeatable]`
254
- - 2.2 Quality check `[required · repeatable]`
255
- - 2.3 Rollback `[on demand]`
256
-
257
- <!-- Per-turn breadcrumb: shown while status='in_progress'.
258
- Scope: all of Phase 2 + Phase 3.2-3.4 (status stays 'in_progress' from
259
- task.py start until task.py archive; only archive flips it). The body
260
- therefore must cover every required step from implementation through
261
- commit, including Phase 3.3 spec update and Phase 3.4 commit. -->
262
-
263
- Sub-agent dispatch protocol applies to all platforms and all sub-agents, including native Codex `SubagentStart` context injection with child-side pull fallback, class-2 Gemini/Qoder/Copilot/Reasonix/Trae/Grok/Kimi Code/DeepSeek Harness, hook-backed ZCode/Snow, and `trellis-research`: every dispatch prompt starts with `Active task: <task path from task.py current>` before role-specific instructions. On Grok Build, use `spawn_subagent` with `subagent_type` set to the Trellis agent name (e.g. `trellis-implement`). On Kimi Code, dispatch the built-in `coder` / `explore` sub-agent with the matching `.kimi-code/skills/trellis-<role>/SKILL.md` instructions. On DeepSeek Harness, tell the child to load the matching `.dsh/skills/trellis-agent-<role>/SKILL.md` exactly once, then choose the synchronization path by capability. If the optional companion plugin exposes `trellis_wait`, dispatch `subagent` in its default continuable background mode, continue independent work, and call `trellis_wait` once per dependent child id when a dependent gate is next; each call returns only after DSH has queued that child's native settlement notice. Without `trellis_wait`, dispatch each child with `run_in_background: false` from the outset so no dependent gate can overtake it. Never simulate waiting with shell sleep, polling loops, `job_output`, repeated `list_agents`, or another long-running command, and never leave a background child without an event-driven wait path.
264
-
265
97
  [workflow-state:in_progress]
266
- If implementation discovers a material unresolved decision, record `decision-needed`, run `task.py replan <task> "<reason>"`, and return to the planning frontier; do not ask a native question during implementation.
267
- Tools: `trellis-implement` / `trellis-research` name sub-agent roles dispatched through your platform's sub-agent mechanism, not skills the main session loads itself (on Claude Code: use the Task/Agent tool, never the Skill tool). `trellis-update-spec` is a skill. `trellis-check` exists as both; prefer the Agent/role form when verifying after code changes.
268
- On DeepSeek Harness, role instructions ship as collision-free `trellis-agent-implement` / `trellis-agent-check` / `trellis-agent-research` skills under `.dsh/skills/`. The main session must not load them itself: tell the child to load the matching role skill exactly once. If `trellis_wait` is available, use the default background mode, do independent work, then call `trellis_wait` once per dependent child id and consume each native settlement notice before entering the dependent gate. If it is unavailable, dispatch every child with `run_in_background: false` from the outset. Do not poll, sleep, or start a background child without an event-driven wait path.
269
- Flow: `trellis-implement` -> `trellis-check` -> `trellis-update-spec` -> commit (Phase 3.4) -> `/trellis:finish-work`.
270
- Use this block only when `codex.dispatch_mode: auto` is explicitly selected. Sub-agent self-exemption: if already running as `trellis-implement`, do NOT spawn another `trellis-implement` or `trellis-check`; if already running as `trellis-check`, do NOT spawn another `trellis-check` or `trellis-implement`. Dispatch is main session only.
271
- Dispatch prompt starts with `Active task: <task path from task.py current>`. Read context: jsonl entries -> `prd.md` -> `design.md if present` -> `implement.md if present`.
98
+ 任务生命周期状态为 `in_progress`。读取下方当前阶段提示。任务实施与测试验证阶段按已接受合同和目标包适用规范推进,并运行与改动相称的验证。代码修改前或切换目标包时,可使用 `trellis-before-dev` 辅助定位规范;需要完整质量核验时,可使用 `trellis-check`。已配置时可使用宿主原生 agent 路径。实施变更不得超出授权范围。
272
99
  [/workflow-state:in_progress]
273
100
 
274
- <!-- Per-turn breadcrumb: shown while status='in_progress' when Codex uses its
275
- default codex.dispatch_mode=inline. Codex-only alternate to
276
- [workflow-state:in_progress]. The main session edits code directly
277
- instead of dispatching sub-agents. -->
278
-
279
101
  [workflow-state:in_progress-inline]
280
- Flow: `trellis-before-dev` -> edit -> `trellis-check` -> validation -> `trellis-update-spec` -> commit (Phase 3.4) -> `/trellis:finish-work`.
281
- If implementation discovers a material unresolved decision, record `decision-needed`, run `task.py replan <task> "<reason>"`, and return to the planning frontier; native questions are planning-only.
282
- Do not dispatch implement/check sub-agents in inline mode.
283
- Read context: `prd.md` -> `design.md if present` -> `implement.md if present`, plus relevant spec/research loaded by skills.
102
+ 遵循 `in_progress` 的相同阶段路线,并在主会话中工作,运行与变更相称的检查。
284
103
  [/workflow-state:in_progress-inline]
285
104
 
286
- ### Phase 3: Finish
287
- - 3.2 Debug retrospective `[on demand]`
288
- - 3.3 Spec update `[required · once]`
289
- - 3.4 Commit changes `[required · once]`
290
- - 3.5 Wrap-up reminder
291
-
292
- > Note: step 3.1 was folded into 2.2 (last-iteration full-scope check) and 3.4 (commit preamble). Numbering kept stable to avoid breaking external references.
293
-
294
- <!-- Per-turn breadcrumb: shown while status='completed'.
295
- Currently DEAD in normal flow: cmd_archive writes status='completed' in
296
- the same call that moves the task dir to archive/, so the active-task
297
- resolver loses the pointer and the hook never fires on archived tasks.
298
- Block preserved for a future status-transition redesign (e.g. an
299
- explicit in_progress→completed command). Edit through the same spec
300
- channel as the live blocks. -->
301
-
302
- [workflow-state:completed]
303
- Code committed. Run `/trellis:finish-work`; if dirty, return to Phase 3.4 first.
304
- [/workflow-state:completed]
305
-
306
- ### Rules
307
-
308
- 1. Identify which Phase you're in, then continue from the next step there
309
- 2. Run steps in order inside each Phase; `[required]` steps can't be skipped
310
- 3. Phases can roll back (e.g., Execute reveals a prd defect → return to Plan to fix, then re-enter Execute)
311
- 4. Steps tagged `[once]` are skipped if the output already exists; don't re-run
312
- 5. Artifact presence informs the next step; missing `design.md` / `implement.md` is valid for lightweight tasks and incomplete planning for complex tasks.
313
-
314
- ### Active Task Routing
315
-
316
- When a user request matches one of these intents inside an active task, route first, then load the detailed phase step if needed.
317
-
318
- [Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, Oh My Pi, ZCode, Snow, Reasonix, Trae, Grok, Kimi Code, DeepSeek Harness]
319
-
320
- - Planning or unclear requirements -> `trellis-brainstorm`.
321
- - Explicit eligible `analysis_only` -> complete evidence in planning, then commit artifacts and archive directly.
322
- - `in_progress` implementation/check -> dispatch `trellis-implement` / `trellis-check`.
323
- - Repeated debugging -> `trellis-break-loop`; spec updates -> `trellis-update-spec`.
324
-
325
- [/Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, Oh My Pi, ZCode, Snow, Reasonix, Trae, Grok, Kimi Code, DeepSeek Harness]
326
-
327
- [codex-inline, Kilo, Antigravity, Devin]
328
-
329
- - Planning or unclear requirements -> `trellis-brainstorm`.
330
- - Explicit eligible `analysis_only` -> complete evidence in planning, then commit artifacts and archive directly.
331
- - Before editing -> `trellis-before-dev`; after editing -> `trellis-check`.
332
- - Repeated debugging -> `trellis-break-loop`; spec updates -> `trellis-update-spec`.
333
-
334
- [/codex-inline, Kilo, Antigravity, Devin]
335
-
336
- ### Guardrails
337
-
338
- - Only an eligible `task.json.meta.delivery_mode = "analysis_only"` task may complete while `planning`; it may write evidence artifacts, but any protected-target change requires a separate change-bearing task.
339
- - Task creation approval is not implementation approval; change-bearing implementation waits for `task.py start` after artifact review.
340
- - PRD-only is valid for lightweight tasks; complex tasks need `design.md` + `implement.md`.
341
- - Planning must be persisted to task artifacts; checks must run before reporting completion.
342
-
343
- ### Loading Step Detail
344
-
345
- At each step, run this to fetch detailed guidance:
346
-
347
- ```bash
348
- python3 ./.trellis/scripts/get_context.py --mode phase --step <step>
349
- # e.g. python3 ./.trellis/scripts/get_context.py --mode phase --step 1.1
350
- ```
351
-
352
- ---
353
-
354
- ## Phase 1: Plan
355
-
356
- Goal: classify the request, perform only eligible direct small work without a task, and create planning artifacts when a task is needed.
357
-
358
- #### 1.0 Create task `[required · once]`
359
-
360
- Create the task directory only after task-creation consent. The command sets status to `planning`, writes `task.json`, creates a default `prd.md`, and auto-targets the new task when session identity is available:
361
-
362
- ```bash
363
- python3 ./.trellis/scripts/task.py create "<task title>" --slug <name>
364
- ```
365
-
366
- `--slug` is the human-readable name only. Do **not** include the `MM-DD-` date prefix; `task.py create` adds that prefix automatically.
367
-
368
- For task trees, create the parent task first and then create each child with `--parent <parent-dir>`. Do not start the parent just because children exist; start the child that owns the next independently verifiable deliverable.
369
-
370
- After this command succeeds, the per-turn breadcrumb auto-switches to `[workflow-state:planning]`, telling the AI to stay in planning.
371
-
372
- Run only `create` here — do not also run `start`. `start` flips status to `in_progress`, which switches the breadcrumb to the implementation phase before planning artifacts are reviewed. Save `start` for step 1.4.
373
-
374
- For an evidence-only task, set `task.json.meta.delivery_mode = "analysis_only"` at creation or with `task.py set-meta`. Its PRD must name the evidence deliverable and exclude protected-target changes before the task proceeds.
375
-
376
- Skip when `python3 ./.trellis/scripts/task.py current --source` already points to a task.
377
-
378
- #### 1.1 Requirement exploration `[required · repeatable]`
379
-
380
- Load the `trellis-brainstorm` skill and explore requirements interactively with the user per the skill's guidance.
381
-
382
- For an eligible analysis-only task, converge the PRD boundary, then perform the declared research, audit, or design work in this phase. It does not need a start review or `task.py start`; after acceptance evidence is recorded, continue directly to Phase 3.3.
383
-
384
- The brainstorm skill will guide you to:
385
- - Batch up to three independent material frontier questions; ask one only when dependency ordering requires it
386
- - Prefer researching over asking the user
387
- - Prefer offering options over open-ended questions
388
- - Update `prd.md` immediately after each user answer
389
- - Split large scopes into a parent task plus child tasks when the deliverables can be verified independently
390
- - Keep `prd.md` focused on requirements and acceptance criteria
391
- - For complex tasks, produce `design.md` and `implement.md` before implementation starts
392
-
393
- When considering a parent/child split:
394
- - Use a parent task when one request contains several independently verifiable deliverables.
395
- - Parent tasks own source requirements, child-task mapping, cross-child acceptance criteria, and final integration review.
396
- - Child tasks own actual deliverables that can be planned, implemented, checked, and archived independently.
397
- - Parent/child structure is not a dependency system. If child B depends on child A, write that ordering in child B's `prd.md` / `implement.md`.
398
- - Start the child task that owns the next deliverable. Do not start the parent unless the parent itself has direct implementation work.
399
-
400
- Return to this step whenever requirements change and revise the relevant artifact.
401
-
402
- #### 1.2 Research `[optional · repeatable]`
403
-
404
- Research can happen at any time during requirement exploration. It isn't limited to local code — you can use any available tool (MCP servers, skills, web search, etc.) to look up external information, including third-party library docs, industry practices, API references, etc.
405
-
406
- [Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, Oh My Pi, ZCode, Snow, Reasonix, Trae, Grok, Kimi Code, DeepSeek Harness]
407
-
408
- Spawn the research sub-agent:
409
-
410
- - **Agent type**: `trellis-research`
411
- - **Task description**: Research <specific question>
412
- - **Key requirement**: Research output MUST be persisted to `{TASK_DIR}/research/`
413
- - **DeepSeek Harness**: tell the child to load `trellis-agent-research` exactly once. If `trellis_wait` is available, use the default continuable background mode, dispatch independent questions concurrently when useful, continue unrelated work, then call `trellis_wait` once per child id and consume each settlement notice before advancing. Without `trellis_wait`, dispatch each required child with `run_in_background: false`; do not poll or sleep.
414
-
415
- [/Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, Oh My Pi, ZCode, Snow, Reasonix, Trae, Grok, Kimi Code, DeepSeek Harness]
416
-
417
- [codex-inline, Kilo, Antigravity, Devin]
418
-
419
- Do the research in the main session directly and write findings into `{TASK_DIR}/research/`. `codex-inline` is the explicit mode that keeps work in the main session.
420
-
421
- [/codex-inline, Kilo, Antigravity, Devin]
422
-
423
- **Research artifact conventions**:
424
- - One file per research topic (e.g. `research/auth-library-comparison.md`)
425
- - Record third-party library usage examples, API references, version constraints in files
426
- - Note relevant spec file paths you discovered for later reference
427
-
428
- Brainstorm and research can interleave freely — pause to research a technical question, then return to talk with the user.
429
-
430
- **Key principle**: Research output must be written to files, not left only in the chat. Conversations get compacted; files don't.
431
-
432
- #### 1.3 Configure context `[required · once]`
433
-
434
- Eligible analysis-only tasks skip this step because they never enter Phase 2 or dispatch implementation/check agents.
105
+ [workflow-state:goal_exploration_and_requirements]
106
+ 读取 `trellis-goal-exploration-and-requirements` 及其 `workflow.md`。用户明确确认当前需求资产 revision 前,不得离开目标探索与需求核对阶段。
107
+ [/workflow-state:goal_exploration_and_requirements]
435
108
 
436
- [Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, Oh My Pi, ZCode, Snow, Reasonix, Trae, Grok, Kimi Code, DeepSeek Harness]
109
+ [workflow-state:decision_space_construction_and_merging]
110
+ 读取 `trellis-decision-space-construction-and-merging` 及其 `workflow.md`。只有条件依赖会改变下游选择时才使用决策树;本阶段无实质价值时,记录有证据支持的跳过理由。
111
+ [/workflow-state:decision_space_construction_and_merging]
437
112
 
438
- Curate `implement.jsonl` and `check.jsonl` so the Phase 2 sub-agents get the right spec/research context. These files were seeded on `task create` with a single self-describing `_example` line; your job here is to fill in real entries.
113
+ [workflow-state:solution_design_and_convergence]
114
+ 读取 `trellis-solution-design-and-convergence` 及其 `workflow.md`。接受阶段前解决保留给用户决定的事项;已接受的实施合同不等同于实施授权。
115
+ [/workflow-state:solution_design_and_convergence]
439
116
 
440
- **Location**: `{TASK_DIR}/implement.jsonl` and `{TASK_DIR}/check.jsonl` (already exist).
117
+ [workflow-state:task_implementation]
118
+ 读取 `trellis-task-implementation` 及其 `workflow.md`。遵循已授权的实施合同,并使用源码 owner 仓库的规范、工具和验证路径。
119
+ [/workflow-state:task_implementation]
441
120
 
442
- **Format**: one JSON object per line — `{"file": "<path>", "reason": "<why>"}`. Paths are repo-root relative.
121
+ [workflow-state:delivery_review_and_closeout]
122
+ 读取 `trellis-delivery-review-and-closeout` 及其 `workflow.md`。核对当前合同和 revision,解决缺口或按影响回流,并在完成或取消任务前确认资源安全。
123
+ [/workflow-state:delivery_review_and_closeout]
443
124
 
444
- **What to put in**:
445
- - **Spec files** — `.trellis/spec/<package>/<layer>/index.md` and any specific guideline files (`error-handling.md`, `conventions.md`, etc.) relevant to this task
446
- - **Research files** — `{TASK_DIR}/research/*.md` that the sub-agent will need to consult
125
+ ### 目标探索与需求核对阶段
447
126
 
448
- **What NOT to put in**:
449
- - Code files (`src/**`, `packages/**/*.ts`, etc.) — those are read by the sub-agent during implementation, not pre-registered here
450
- - Files you're about to modify — same reason
127
+ #### 1.1 建立需求基线
451
128
 
452
- **Split between the two files**:
453
- - `implement.jsonl` → specs + research the implement sub-agent needs to write code correctly
454
- - `check.jsonl` → specs for the check sub-agent (quality guidelines, check conventions, same research if needed)
129
+ 读取目标探索与需求核对阶段 Skill。仅收集可能改变目标、范围、接受标准、约束或路线的证据。将当前基线记录为阶段产物,并在推进前取得绑定其当前资产 revision 的用户明确确认。
455
130
 
456
- These manifests do not replace `implement.md`. `implement.md` is the human-readable execution plan for a complex task; jsonl files only list context files to inject or load.
131
+ ### 决策空间构造与归并阶段
457
132
 
458
- **How to discover relevant specs**:
133
+ #### 2.1 整理实质决策
459
134
 
460
- ```bash
461
- python3 ./.trellis/scripts/get_context.py --mode packages
462
- ```
463
-
464
- Lists every package + its spec layers with paths. Pick the entries that match this task's domain.
465
-
466
- **How to append entries**:
467
-
468
- Either edit the jsonl file directly in your editor, or use:
469
-
470
- ```bash
471
- python3 ./.trellis/scripts/task.py add-context "$TASK_DIR" implement "<path>" "<reason>"
472
- python3 ./.trellis/scripts/task.py add-context "$TASK_DIR" check "<path>" "<reason>"
473
- ```
474
-
475
- Delete the seed `_example` line once real entries exist (optional — it's skipped automatically by consumers).
476
-
477
- Ready gate: both `implement.jsonl` and `check.jsonl` must contain at least one real `{"file": "...", "reason": "..."}` entry before `task.py start`. The seed `_example` row alone is not ready.
478
-
479
- Skip this step only when both files already have real curated entries.
480
-
481
- [/Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, Oh My Pi, ZCode, Snow, Reasonix, Trae, Grok, Kimi Code, DeepSeek Harness]
482
-
483
- [codex-inline, Kilo, Antigravity, Devin]
484
-
485
- Skip this step. Context is loaded directly by the `trellis-before-dev` skill in Phase 2.
486
-
487
- [/codex-inline, Kilo, Antigravity, Devin]
488
-
489
- #### 1.4 Activate task `[required · once]`
490
-
491
- This step applies only to change-bearing tasks. An eligible analysis-only task stays in `planning` and, after its evidence work is complete, continues directly to Phase 3.3 without running `task.py start`.
492
-
493
- After artifact review, flip the task status to `in_progress`:
494
-
495
- ```bash
496
- python3 ./.trellis/scripts/task.py start <task-dir>
497
- ```
498
-
499
- For lightweight tasks, `prd.md` can be enough. For complex tasks, `prd.md`, `design.md`, and `implement.md` must exist and be reviewed before start. On sub-agent-dispatch platforms, `implement.jsonl` and `check.jsonl` must both have real curated entries before start. Runtime consumers tolerate missing or seed-only manifests for compatibility, but that tolerance is not a planning-ready state.
500
-
501
- After this command succeeds, the breadcrumb auto-switches to `[workflow-state:in_progress]`, and the rest of Phase 2 / 3 follows.
502
-
503
- If `task.py start` errors with a session-identity message (no context key from hook input, `TRELLIS_CONTEXT_ID`, or platform-native session env), follow the hint in the error to set up session identity, then retry.
504
-
505
- #### 1.5 Completion criteria
506
-
507
- | Condition | Required |
508
- |------|:---:|
509
- | `prd.md` exists | ✅ |
510
- | Change-bearing task: user confirms implementation | ✅ |
511
- | Change-bearing task: `task.py start` has been run (status = in_progress) | ✅ |
512
- | Analysis-only task: exact metadata, named evidence deliverable, recorded acceptance evidence, and protected targets unchanged | ✅ |
513
- | `research/` has artifacts (complex tasks) | recommended |
514
- | `design.md` exists (complex tasks) | ✅ |
515
- | `implement.md` exists (complex tasks) | ✅ |
516
-
517
- [Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, Oh My Pi, ZCode, Snow, Reasonix, Trae, Grok, Kimi Code, DeepSeek Harness]
518
-
519
- | Change-bearing task: `implement.jsonl` and `check.jsonl` each contain at least one real curated entry (seed row does not count) | ✅ |
520
-
521
- [/Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, Oh My Pi, ZCode, Snow, Reasonix, Trae, Grok, Kimi Code, DeepSeek Harness]
522
-
523
- ---
524
-
525
- ## Phase 2: Execute
526
-
527
- Goal: turn reviewed planning artifacts into code that passes quality checks.
528
-
529
- #### 2.1 Implement `[required · repeatable]`
530
-
531
- [Claude Code, Cursor, OpenCode, codex-sub-agent, CodeBuddy, Droid, Pi, ZCode, Snow, Oh My Pi]
532
-
533
- Spawn the implement sub-agent:
534
-
535
- - **Agent type**: `trellis-implement`
536
- - **Task description**: Implement the reviewed task artifacts, consulting materials under `{TASK_DIR}/research/`; finish by running project lint and type-check
537
- - **Dispatch prompt guard**: The prompt MUST start with `Active task: <task path>`, then tell the spawned agent it is already the `trellis-implement` sub-agent and must implement directly, not spawn another `trellis-implement` / `trellis-check`.
538
-
539
- The platform hook/plugin auto-handles:
540
- - Reads `implement.jsonl` and injects referenced spec/research files into the agent prompt
541
- - Injects `prd.md`, `design.md` if present, and `implement.md` if present
542
- - For Codex, `SubagentStart` supplies native context injection; the agent profile keeps child-side loading as the fallback
543
-
544
- [/Claude Code, Cursor, OpenCode, codex-sub-agent, CodeBuddy, Droid, Pi, ZCode, Snow, Oh My Pi]
545
-
546
- [Gemini, Qoder, Copilot, Reasonix, Trae, Grok, Kimi Code, DeepSeek Harness]
547
-
548
- Spawn the implement sub-agent:
549
-
550
- - **Agent type**: `trellis-implement`
551
- - **Task description**: Implement the reviewed task artifacts, consulting materials under `{TASK_DIR}/research/`; finish by running project lint and type-check
552
- - **Dispatch prompt guard**: The prompt MUST start with `Active task: <task path>`, then explicitly say the spawned agent is already `trellis-implement` and must implement directly without spawning another `trellis-implement` / `trellis-check`.
553
- - **DeepSeek Harness**: tell the child to load `trellis-agent-implement` exactly once. If `trellis_wait` is available, use the default background mode, continue independent work, then wait once for that child id and consume its successful native settlement notice before Phase 2.2. Without `trellis_wait`, dispatch that child with `run_in_background: false`. Do not poll or sleep.
554
-
555
- The pull-based sub-agent definition auto-handles the context load requirement:
556
- - Resolves the active task with `task.py current --source`, then reads `prd.md`, `design.md` if present, and `implement.md` if present
557
- - Reads `implement.jsonl` and requires the agent to load each referenced spec/research file before coding
558
-
559
- [/Gemini, Qoder, Copilot, Reasonix, Trae, Grok, Kimi Code, DeepSeek Harness]
560
-
561
- [Kiro]
562
-
563
- Spawn the implement sub-agent:
564
-
565
- - **Agent type**: `trellis-implement`
566
- - **Task description**: Implement the reviewed task artifacts, consulting materials under `{TASK_DIR}/research/`; finish by running project lint and type-check
567
- - **Dispatch prompt guard**: Tell the spawned agent it is already the `trellis-implement` sub-agent and must implement directly, not spawn another `trellis-implement` / `trellis-check`.
135
+ 读取决策空间构造与归并阶段 Skill。选择能表达相关选项及其关系的最简方式。满足既定触发条件时查找外部先例;Teamwork 仍是可选的只读证据支持。
568
136
 
569
- The platform prelude auto-handles the context load requirement:
570
- - Reads `implement.jsonl` and injects referenced spec/research files into the agent prompt
571
- - Injects `prd.md`, `design.md` if present, and `implement.md` if present
137
+ ### 解决方案设计与收敛阶段
572
138
 
573
- [/Kiro]
139
+ #### 3.1 收敛当前方案
574
140
 
575
- [codex-inline, Kilo, Antigravity, Devin]
141
+ 读取解决方案设计与收敛阶段 Skill。解决必要的用户决定,并依据当前目标、风险、责任、依赖、验证、停止与恢复条件及重要后果审查方案。通过 Trellis CLI 接受当前阶段结果。
576
142
 
577
- 1. Load the `trellis-before-dev` skill to read project guidelines
578
- 2. Read `{TASK_DIR}/prd.md`, then `design.md` if present, then `implement.md` if present
579
- 3. Consult materials under `{TASK_DIR}/research/`
580
- 4. Implement the code per reviewed artifacts
581
- 5. Run project lint and type-check
143
+ ### 任务实施与测试验证阶段
582
144
 
583
- [/codex-inline, Kilo, Antigravity, Devin]
145
+ #### 4.1 实施已授权合同
584
146
 
585
- #### 2.2 Quality check `[required · repeatable]`
147
+ 读取任务实施与测试验证阶段 Skill、源码 owner 仓库适用的 `AGENTS.md` 和规范。按合同顺序推进必要工作包。Teamwork 仅提供只读协作;只有明确授权委派 Git worktree 写入时才使用 Paseo。
586
148
 
587
- [Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, Oh My Pi, ZCode, Snow, Reasonix, Trae, Grok, Kimi Code, DeepSeek Harness]
149
+ #### 4.2 验证与集成
588
150
 
589
- Spawn the check sub-agent:
151
+ 按风险和影响选择相称的验证深度,集成已接受工作并记录当前证据。在任务实施与测试验证阶段中修复局部问题。只有合同、目标、授权、依赖或接受条件需要修订时,才回到最早受影响的前置阶段。
590
152
 
591
- - **Agent type**: `trellis-check`
592
- - **Task description**: Review all code changes against specs and task artifacts; fix any findings directly; ensure lint and type-check pass
593
- - **Dispatch prompt guard**: The prompt MUST start with `Active task: <task path>`, then tell the spawned agent it is already the `trellis-check` sub-agent and must review/fix directly, not spawn another `trellis-check` / `trellis-implement`.
594
- - **DeepSeek Harness**: tell the child to load `trellis-agent-check` exactly once. If `trellis_wait` is available, use the default background mode, continue independent work, then wait once for that child id and consume its successful native settlement notice before Phase 3. Without `trellis_wait`, dispatch that child with `run_in_background: false`. Do not poll or sleep.
153
+ ### 交付审查与现场收尾阶段
595
154
 
596
- The check agent's job:
597
- - Review code changes against specs
598
- - Review code changes against `prd.md`, `design.md` if present, and `implement.md` if present
599
- - Auto-fix issues it finds
600
- - Run lint and typecheck to verify
601
- - A required check that cannot run, is skipped, or exits non-zero is blocked/failed, never passed. Do not weaken or rewrite acceptance criteria to advance the workflow.
155
+ #### 5.1 审查当前交付
602
156
 
603
- [/Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi, Oh My Pi, ZCode, Snow, Reasonix, Trae, Grok, Kimi Code, DeepSeek Harness]
157
+ 读取交付审查与现场收尾阶段 Skill。依据已接受合同和需求审查当前结果,核验必需工作及验证,记录允许保留的遗留,并将未解决的缺口回流到最早受影响的阶段。
604
158
 
605
- [codex-inline, Kilo, Antigravity, Devin]
159
+ #### 5.2 完成或取消任务
606
160
 
607
- Load the `trellis-check` skill and verify the code per its guidance:
608
- - Spec compliance
609
- - lint / type-check / tests
610
- - Cross-layer consistency (when changes span layers)
161
+ 只有交付审查与现场收尾阶段结果获接受且必需资源安全时才使用 `complete`。只有用户明确撤回并完成交付审查与现场收尾阶段中的取消审查后才使用 `cancel --reason`。正式会话交接仍是独立操作。
611
162
 
612
- If issues are found → fix → re-check, until green.
163
+ ## 跨组件职责
613
164
 
614
- [/codex-inline, Kilo, Antigravity, Devin]
165
+ | 组件 | 在任务路线中的职责 |
166
+ | --- | --- |
167
+ | Trellis CLI 与 task record | 唯一写入任务生命周期、阶段路线、阶段接受和实施授权的组件。 |
168
+ | 阶段 Skills 与 workflow | 指引各阶段工作;不写入任务状态,也不替代用户决定。 |
169
+ | `pennix-workflow-routing` | 为跨组件工作选择组件 owner、允许的传输方式和适用的原生入口。 |
170
+ | `pennix-decision-grill` | 需要用户决定时同步提问;由 Trellis 记录结果。 |
171
+ | Trellis Teamwork | 提供可选协作和只读证据;不选择阶段、不接受工作,也不写入产品代码。 |
172
+ | Pennix Lifecycle | 路线需要时核验组件和 Paseo 的已安装版本及就绪状态。 |
173
+ | Paseo | 管理已授权的 Paseo workspace 与委派 Git worktree 运行事实;不管理任务阶段或接受。 |
174
+ | 组件 owner 仓库 | 管理组件源码、测试、文档、原生工作流资产及组件验收。 |
175
+ | Hooks | 注入当前上下文或运行辅助检查;不构成权限边界。 |
615
176
 
616
- **Final pass (before Phase 3.4 commit)**: the last 2.2 of a task must run full-scope, not just on the latest implement chunk. List all affected packages with `python3 ./.trellis/scripts/get_context.py --mode packages`, then load each package's spec index Quality Check section. This catches cross-layer / multi-package issues a mid-iteration local 2.2 cannot.
617
-
618
- #### 2.3 Rollback `[on demand]`
619
-
620
- - `check` reveals a prd defect → return to Phase 1, fix `prd.md`, then redo 2.1
621
- - Implementation went wrong → revert code, redo 2.1
622
- - Need more research → research (same as Phase 1.2), write findings into `research/`
623
-
624
- ---
625
-
626
- ## Phase 3: Finish
627
-
628
- Goal: ensure code quality, capture lessons, record the work.
629
-
630
- **Analysis-only completion route**: after the evidence work in Phase 1, verify the PRD acceptance criteria and no-change boundary, then continue with 3.3 and 3.4 for task artifacts only before `/trellis:finish-work`. Do not run Phase 2 or `task.py start`.
631
-
632
- #### 3.2 Debug retrospective `[on demand]`
633
-
634
- If this task involved repeated debugging (the same issue was fixed multiple times), load the `trellis-break-loop` skill to:
635
- - Classify the root cause
636
- - Explain why earlier fixes failed
637
- - Propose prevention
638
-
639
- The goal is to capture debugging lessons so the same class of issue doesn't recur.
640
-
641
- #### 3.3 Spec update `[required · once]`
642
-
643
- Load the `trellis-update-spec` skill and review whether this task produced new knowledge worth recording:
644
- - Newly discovered patterns or conventions
645
- - Pitfalls you hit
646
- - New technical decisions
647
-
648
- Update the docs under `.trellis/spec/` accordingly. Even if the conclusion is "nothing to update", walk through the judgment.
649
-
650
- #### 3.4 Commit changes `[required · once]`
651
-
652
- **Spec-sync preamble**: before drafting commits, ask: did this task fix a bug or surface non-obvious knowledge that should land in `.trellis/spec/` so future-you (or future-AI) doesn't repeat the mistake? If yes, return to Phase 3.3 first — spec writes belong in the same task's commit batch, not as a forgotten follow-up.
653
-
654
- The AI drives a batched commit of this task's code changes so `/finish-work` can run cleanly afterwards. Goal: produce work commits FIRST, then bookkeeping (archive + journal) commits land after — never interleaved.
655
-
656
- **Step-by-step**:
657
-
658
- 1. **Inspect dirty state**:
659
- ```bash
660
- git status --porcelain
661
- ```
662
- Snapshot every dirty path. If the working tree is clean, skip to 3.5.
663
-
664
- 2. **Learn commit style** from recent history (so drafted messages blend in):
665
- ```bash
666
- git log --oneline -5
667
- ```
668
- Note the prefix convention (`feat:` / `fix:` / `chore:` / `docs:` ...), language (中文/English), and length style.
669
-
670
- 3. **Classify dirty files into two groups**:
671
- - **AI-edited this session** — files you wrote/edited via Edit/Write/Bash tool calls in this session. You know what changed and why.
672
- - **Unrecognized** — dirty files you did NOT touch this session (could be the user's manual edits, leftover WIP from a previous session, or unrelated work). Do NOT silently include these.
673
-
674
- 4. **Draft a commit plan**. Group AI-edited files into logical commits (1 commit per coherent change unit, not 1 commit per file). Each entry: `<commit message>` + file list. List unrecognized files separately at the bottom.
675
-
676
- 5. **Present the plan once, ask for one-shot confirmation**. Format:
677
- ```
678
- Proposed commits (in order):
679
- 1. <message>
680
- - <file>
681
- - <file>
682
- 2. <message>
683
- - <file>
684
-
685
- Unrecognized dirty files (NOT in any commit — confirm include/exclude):
686
- - <file>
687
- - <file>
688
-
689
- Reply 'ok' / '行' to execute. Reply with edits, or '我自己来' / 'manual' to abort.
690
- ```
691
-
692
- 6. **On confirmation**: run `git add <files>` + `git commit -m "<msg>"` for each batch in order. Do not amend. Do not push.
693
-
694
- 7. **On rejection** (user replies "不行" / "我自己来" / "manual" / any pushback on the plan): stop. Do not attempt a second plan. The user will commit by hand; you skip ahead to 3.5 once they confirm.
695
-
696
- **Rules**:
697
- - No `git commit --amend` anywhere — three-stage three-commit flow (work commits → archive commit → journal commit).
698
- - Never push to remote in this step.
699
- - If the user wants different message wording but accepts the file grouping, edit the message and re-confirm once — but if they reject the grouping, exit to manual mode.
700
- - The batched plan is one prompt; do not prompt per commit.
701
-
702
- #### 3.5 Wrap-up reminder
703
-
704
- After the above, remind the user they can run `/finish-work` to wrap up (archive the task, record the session).
705
-
706
- ---
707
-
708
- ## Customizing Trellis (for forks)
709
-
710
- This section is for developers who want to modify the Trellis workflow itself. All customization is done by editing this file; the scripts are parsers only.
711
-
712
- ### Changing what a step means
713
-
714
- Edit the corresponding step's walkthrough body in the Phase 1 / 2 / 3 sections above. Critical invariants:
715
- - No active task must triage first; direct small work may proceed only when bounded, single-surface, and immediately verifiable, otherwise create a Trellis task first.
716
- - Planning must distinguish lightweight PRD-only tasks from complex tasks that require `prd.md`, `design.md`, and `implement.md` before start.
717
- - Every required execution path must keep the Phase 3.4 commit reminder reachable before `/trellis:finish-work`.
718
-
719
- All tag blocks live in the `## Phase Index` section above, immediately after each phase summary:
720
-
721
- | Scope | Corresponding tag |
722
- |---|---|
723
- | No active task (before Phase 1) | `[workflow-state:no_task]` (after the Phase Index ASCII art) |
724
- | One developer-owned task without a session binding | `[workflow-state:unbound_task]` (bind before lifecycle writes) |
725
- | Multiple developer-owned tasks without a session binding | `[workflow-state:unbound_ambiguous]` / `[workflow-state:unbound_ambiguous-inline]` (choose and bind explicitly) |
726
- | Active task record unreadable | `[workflow-state:task_error]` (repair the existing task before continuing) |
727
- | All of Phase 1 (task created → ready for implementation) | `[workflow-state:planning]` (after Phase 1 summary) |
728
- | Codex inline Phase 1 | `[workflow-state:planning-inline]` |
729
- | Phase 2 + Phase 3.2–3.4 (implementation + check + wrap-up) | `[workflow-state:in_progress]` (after Phase 2 summary) |
730
- | Codex inline Phase 2 + Phase 3.2–3.4 | `[workflow-state:in_progress-inline]` |
731
- | After Phase 3.5 (archived) | `[workflow-state:completed]` (after Phase 3 summary; **currently DEAD**) |
732
-
733
- ### Changing the per-turn prompt text
734
-
735
- Directly edit the body of the corresponding `[workflow-state:STATUS]` block. After editing, run `trellis update` (if you're a template maintainer) or restart your AI session (if you're customizing your own project) — no script changes required.
736
-
737
- ### Adding a custom status
738
-
739
- Add a new block:
740
-
741
- ```
742
- [workflow-state:my-status]
743
- your per-turn prompt text
744
- [/workflow-state:my-status]
745
- ```
746
-
747
- Constraints:
748
- - STATUS charset: `[A-Za-z0-9_-]+` (underscores and hyphens allowed, e.g. `in-review`, `blocked-by-team`)
749
- - A lifecycle hook must write `task.json.status` to your custom value, otherwise the tag is never read
750
- - Lifecycle hooks live in `task.json.hooks.after_*` and bind to one of `after_create / after_start / after_finish / after_archive`
751
-
752
- ### Adding a lifecycle hook
753
-
754
- Add a `hooks` field to your `task.json`:
755
-
756
- ```json
757
- {
758
- "hooks": {
759
- "after_finish": [
760
- "your-script-or-command-here"
761
- ]
762
- }
763
- }
764
- ```
177
+ 根据实际工作选择工具和 Skill。组件已安装或列在阶段表中,不代表必须调用。可选组件缺失时,不阻塞不依赖该组件的路线。
765
178
 
766
- Supported events: `after_create / after_start / after_finish / after_archive`. Note that `after_finish` ≠ a status change (it only clears the active-task pointer); use `after_archive` for "task is done" notifications.
179
+ ## 定制本工作流
767
180
 
768
- ### Full contract
181
+ 本文件中的 `[workflow-state:...]` 区块是每轮任务提示的源文本。阶段 ID 必须与 `packages/core/src/task/phase.ts` 一致;修改阶段索引或标题时同步更新宿主解析器。`get_context.py --mode phase` 返回阶段索引;`--step <phase.step>` 返回对应章节。
769
182
 
770
- For the workflow state machine's runtime contract, the locations of all status writers, pseudo-statuses (`no_task` / `stale_<source_type>`), the hook reachability matrix, and other deep details, see:
183
+ 打包 Skill 位于 `packages/cli/src/templates/common/bundled-skills/`。每个阶段 Skill 都有自己的 `workflow.md` 流程和图示;宿主 configurator 从该目录发现打包 Skill。
771
184
 
772
- - `.trellis/spec/cli/backend/workflow-state-contract.md` — runtime contract + writer table + test invariants
773
- - `.trellis/scripts/inject-workflow-state.py` — actual parser (reads workflow.md only, no embedded text)
185
+ 修改模板后,更新相关测试,并验证默认工作流与阶段提示注入。不要增加任务归档命令,也不要把正式会话交接纳入任务生命周期。