@mindfoldhq/trellis 0.6.0-beta.2 → 0.6.0-beta.20

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 (330) hide show
  1. package/README.md +1 -1
  2. package/dist/cli/index.d.ts +1 -1
  3. package/dist/cli/index.d.ts.map +1 -1
  4. package/dist/cli/index.js +58 -2
  5. package/dist/cli/index.js.map +1 -1
  6. package/dist/commands/channel/adapters/claude.d.ts +29 -0
  7. package/dist/commands/channel/adapters/claude.d.ts.map +1 -0
  8. package/dist/commands/channel/adapters/claude.js +203 -0
  9. package/dist/commands/channel/adapters/claude.js.map +1 -0
  10. package/dist/commands/channel/adapters/codex.d.ts +85 -0
  11. package/dist/commands/channel/adapters/codex.d.ts.map +1 -0
  12. package/dist/commands/channel/adapters/codex.js +505 -0
  13. package/dist/commands/channel/adapters/codex.js.map +1 -0
  14. package/dist/commands/channel/adapters/index.d.ts +84 -0
  15. package/dist/commands/channel/adapters/index.d.ts.map +1 -0
  16. package/dist/commands/channel/adapters/index.js +115 -0
  17. package/dist/commands/channel/adapters/index.js.map +1 -0
  18. package/dist/commands/channel/adapters/types.d.ts +33 -0
  19. package/dist/commands/channel/adapters/types.d.ts.map +1 -0
  20. package/dist/commands/channel/adapters/types.js +2 -0
  21. package/dist/commands/channel/adapters/types.js.map +1 -0
  22. package/dist/commands/channel/agent-loader.d.ts +32 -0
  23. package/dist/commands/channel/agent-loader.d.ts.map +1 -0
  24. package/dist/commands/channel/agent-loader.js +154 -0
  25. package/dist/commands/channel/agent-loader.js.map +1 -0
  26. package/dist/commands/channel/context-loader.d.ts +26 -0
  27. package/dist/commands/channel/context-loader.d.ts.map +1 -0
  28. package/dist/commands/channel/context-loader.js +290 -0
  29. package/dist/commands/channel/context-loader.js.map +1 -0
  30. package/dist/commands/channel/context.d.ts +16 -0
  31. package/dist/commands/channel/context.d.ts.map +1 -0
  32. package/dist/commands/channel/context.js +83 -0
  33. package/dist/commands/channel/context.js.map +1 -0
  34. package/dist/commands/channel/create.d.ts +27 -0
  35. package/dist/commands/channel/create.d.ts.map +1 -0
  36. package/dist/commands/channel/create.js +39 -0
  37. package/dist/commands/channel/create.js.map +1 -0
  38. package/dist/commands/channel/dev-parse-trace.d.ts +14 -0
  39. package/dist/commands/channel/dev-parse-trace.d.ts.map +1 -0
  40. package/dist/commands/channel/dev-parse-trace.js +70 -0
  41. package/dist/commands/channel/dev-parse-trace.js.map +1 -0
  42. package/dist/commands/channel/guard.d.ts +150 -0
  43. package/dist/commands/channel/guard.d.ts.map +1 -0
  44. package/dist/commands/channel/guard.js +474 -0
  45. package/dist/commands/channel/guard.js.map +1 -0
  46. package/dist/commands/channel/index.d.ts +3 -0
  47. package/dist/commands/channel/index.d.ts.map +1 -0
  48. package/dist/commands/channel/index.js +531 -0
  49. package/dist/commands/channel/index.js.map +1 -0
  50. package/dist/commands/channel/interrupt.d.ts +10 -0
  51. package/dist/commands/channel/interrupt.d.ts.map +1 -0
  52. package/dist/commands/channel/interrupt.js +22 -0
  53. package/dist/commands/channel/interrupt.js.map +1 -0
  54. package/dist/commands/channel/kill.d.ts +7 -0
  55. package/dist/commands/channel/kill.d.ts.map +1 -0
  56. package/dist/commands/channel/kill.js +121 -0
  57. package/dist/commands/channel/kill.js.map +1 -0
  58. package/dist/commands/channel/list.d.ts +17 -0
  59. package/dist/commands/channel/list.d.ts.map +1 -0
  60. package/dist/commands/channel/list.js +233 -0
  61. package/dist/commands/channel/list.js.map +1 -0
  62. package/dist/commands/channel/messages.d.ts +15 -0
  63. package/dist/commands/channel/messages.d.ts.map +1 -0
  64. package/dist/commands/channel/messages.js +245 -0
  65. package/dist/commands/channel/messages.js.map +1 -0
  66. package/dist/commands/channel/rm.d.ts +27 -0
  67. package/dist/commands/channel/rm.d.ts.map +1 -0
  68. package/dist/commands/channel/rm.js +216 -0
  69. package/dist/commands/channel/rm.js.map +1 -0
  70. package/dist/commands/channel/run.d.ts +30 -0
  71. package/dist/commands/channel/run.d.ts.map +1 -0
  72. package/dist/commands/channel/run.js +130 -0
  73. package/dist/commands/channel/run.js.map +1 -0
  74. package/dist/commands/channel/send.d.ts +11 -0
  75. package/dist/commands/channel/send.d.ts.map +1 -0
  76. package/dist/commands/channel/send.js +24 -0
  77. package/dist/commands/channel/send.js.map +1 -0
  78. package/dist/commands/channel/spawn.d.ts +40 -0
  79. package/dist/commands/channel/spawn.d.ts.map +1 -0
  80. package/dist/commands/channel/spawn.js +244 -0
  81. package/dist/commands/channel/spawn.js.map +1 -0
  82. package/dist/commands/channel/store/events.d.ts +39 -0
  83. package/dist/commands/channel/store/events.d.ts.map +1 -0
  84. package/dist/commands/channel/store/events.js +87 -0
  85. package/dist/commands/channel/store/events.js.map +1 -0
  86. package/dist/commands/channel/store/filter.d.ts +3 -0
  87. package/dist/commands/channel/store/filter.d.ts.map +1 -0
  88. package/dist/commands/channel/store/filter.js +2 -0
  89. package/dist/commands/channel/store/filter.js.map +1 -0
  90. package/dist/commands/channel/store/lock.d.ts +23 -0
  91. package/dist/commands/channel/store/lock.d.ts.map +1 -0
  92. package/dist/commands/channel/store/lock.js +99 -0
  93. package/dist/commands/channel/store/lock.js.map +1 -0
  94. package/dist/commands/channel/store/paths.d.ts +63 -0
  95. package/dist/commands/channel/store/paths.d.ts.map +1 -0
  96. package/dist/commands/channel/store/paths.js +246 -0
  97. package/dist/commands/channel/store/paths.js.map +1 -0
  98. package/dist/commands/channel/store/schema.d.ts +27 -0
  99. package/dist/commands/channel/store/schema.d.ts.map +1 -0
  100. package/dist/commands/channel/store/schema.js +34 -0
  101. package/dist/commands/channel/store/schema.js.map +1 -0
  102. package/dist/commands/channel/store/thread-state.d.ts +5 -0
  103. package/dist/commands/channel/store/thread-state.d.ts.map +1 -0
  104. package/dist/commands/channel/store/thread-state.js +16 -0
  105. package/dist/commands/channel/store/thread-state.js.map +1 -0
  106. package/dist/commands/channel/store/watch.d.ts +19 -0
  107. package/dist/commands/channel/store/watch.d.ts.map +1 -0
  108. package/dist/commands/channel/store/watch.js +146 -0
  109. package/dist/commands/channel/store/watch.js.map +1 -0
  110. package/dist/commands/channel/supervisor/idle.d.ts +46 -0
  111. package/dist/commands/channel/supervisor/idle.d.ts.map +1 -0
  112. package/dist/commands/channel/supervisor/idle.js +72 -0
  113. package/dist/commands/channel/supervisor/idle.js.map +1 -0
  114. package/dist/commands/channel/supervisor/inbox.d.ts +30 -0
  115. package/dist/commands/channel/supervisor/inbox.d.ts.map +1 -0
  116. package/dist/commands/channel/supervisor/inbox.js +160 -0
  117. package/dist/commands/channel/supervisor/inbox.js.map +1 -0
  118. package/dist/commands/channel/supervisor/shutdown.d.ts +68 -0
  119. package/dist/commands/channel/supervisor/shutdown.d.ts.map +1 -0
  120. package/dist/commands/channel/supervisor/shutdown.js +146 -0
  121. package/dist/commands/channel/supervisor/shutdown.js.map +1 -0
  122. package/dist/commands/channel/supervisor/stdout.d.ts +51 -0
  123. package/dist/commands/channel/supervisor/stdout.d.ts.map +1 -0
  124. package/dist/commands/channel/supervisor/stdout.js +121 -0
  125. package/dist/commands/channel/supervisor/stdout.js.map +1 -0
  126. package/dist/commands/channel/supervisor/turns.d.ts +31 -0
  127. package/dist/commands/channel/supervisor/turns.d.ts.map +1 -0
  128. package/dist/commands/channel/supervisor/turns.js +45 -0
  129. package/dist/commands/channel/supervisor/turns.js.map +1 -0
  130. package/dist/commands/channel/supervisor/warning.d.ts +48 -0
  131. package/dist/commands/channel/supervisor/warning.d.ts.map +1 -0
  132. package/dist/commands/channel/supervisor/warning.js +77 -0
  133. package/dist/commands/channel/supervisor/warning.js.map +1 -0
  134. package/dist/commands/channel/supervisor.d.ts +59 -0
  135. package/dist/commands/channel/supervisor.d.ts.map +1 -0
  136. package/dist/commands/channel/supervisor.js +344 -0
  137. package/dist/commands/channel/supervisor.js.map +1 -0
  138. package/dist/commands/channel/text-body.d.ts +13 -0
  139. package/dist/commands/channel/text-body.d.ts.map +1 -0
  140. package/dist/commands/channel/text-body.js +47 -0
  141. package/dist/commands/channel/text-body.js.map +1 -0
  142. package/dist/commands/channel/threads.d.ts +39 -0
  143. package/dist/commands/channel/threads.d.ts.map +1 -0
  144. package/dist/commands/channel/threads.js +106 -0
  145. package/dist/commands/channel/threads.js.map +1 -0
  146. package/dist/commands/channel/title.d.ts +12 -0
  147. package/dist/commands/channel/title.d.ts.map +1 -0
  148. package/dist/commands/channel/title.js +24 -0
  149. package/dist/commands/channel/title.js.map +1 -0
  150. package/dist/commands/channel/wait.d.ts +17 -0
  151. package/dist/commands/channel/wait.d.ts.map +1 -0
  152. package/dist/commands/channel/wait.js +75 -0
  153. package/dist/commands/channel/wait.js.map +1 -0
  154. package/dist/commands/init.d.ts +2 -0
  155. package/dist/commands/init.d.ts.map +1 -1
  156. package/dist/commands/init.js +97 -42
  157. package/dist/commands/init.js.map +1 -1
  158. package/dist/commands/mem.d.ts +13 -117
  159. package/dist/commands/mem.d.ts.map +1 -1
  160. package/dist/commands/mem.js +168 -1074
  161. package/dist/commands/mem.js.map +1 -1
  162. package/dist/commands/uninstall.d.ts.map +1 -1
  163. package/dist/commands/uninstall.js +28 -2
  164. package/dist/commands/uninstall.js.map +1 -1
  165. package/dist/commands/update.d.ts.map +1 -1
  166. package/dist/commands/update.js +31 -111
  167. package/dist/commands/update.js.map +1 -1
  168. package/dist/commands/upgrade.d.ts +28 -0
  169. package/dist/commands/upgrade.d.ts.map +1 -0
  170. package/dist/commands/upgrade.js +84 -0
  171. package/dist/commands/upgrade.js.map +1 -0
  172. package/dist/commands/workflow.d.ts +35 -0
  173. package/dist/commands/workflow.d.ts.map +1 -0
  174. package/dist/commands/workflow.js +219 -0
  175. package/dist/commands/workflow.js.map +1 -0
  176. package/dist/configurators/claude.d.ts.map +1 -1
  177. package/dist/configurators/claude.js +1 -0
  178. package/dist/configurators/claude.js.map +1 -1
  179. package/dist/configurators/codex.d.ts.map +1 -1
  180. package/dist/configurators/codex.js +5 -3
  181. package/dist/configurators/codex.js.map +1 -1
  182. package/dist/configurators/shared.js +4 -4
  183. package/dist/configurators/shared.js.map +1 -1
  184. package/dist/configurators/workflow.d.ts +8 -0
  185. package/dist/configurators/workflow.d.ts.map +1 -1
  186. package/dist/configurators/workflow.js +3 -2
  187. package/dist/configurators/workflow.js.map +1 -1
  188. package/dist/migrations/manifests/0.5.10.json +9 -0
  189. package/dist/migrations/manifests/0.5.11.json +16 -0
  190. package/dist/migrations/manifests/0.5.12.json +9 -0
  191. package/dist/migrations/manifests/0.5.13.json +9 -0
  192. package/dist/migrations/manifests/0.5.14.json +9 -0
  193. package/dist/migrations/manifests/0.5.15.json +9 -0
  194. package/dist/migrations/manifests/0.5.16.json +9 -0
  195. package/dist/migrations/manifests/0.5.17.json +9 -0
  196. package/dist/migrations/manifests/0.5.18.json +9 -0
  197. package/dist/migrations/manifests/0.6.0-beta.10.json +9 -0
  198. package/dist/migrations/manifests/0.6.0-beta.11.json +9 -0
  199. package/dist/migrations/manifests/0.6.0-beta.12.json +9 -0
  200. package/dist/migrations/manifests/0.6.0-beta.13.json +9 -0
  201. package/dist/migrations/manifests/0.6.0-beta.14.json +9 -0
  202. package/dist/migrations/manifests/0.6.0-beta.15.json +9 -0
  203. package/dist/migrations/manifests/0.6.0-beta.16.json +9 -0
  204. package/dist/migrations/manifests/0.6.0-beta.17.json +9 -0
  205. package/dist/migrations/manifests/0.6.0-beta.18.json +16 -0
  206. package/dist/migrations/manifests/0.6.0-beta.19.json +9 -0
  207. package/dist/migrations/manifests/0.6.0-beta.20.json +9 -0
  208. package/dist/migrations/manifests/0.6.0-beta.3.json +9 -0
  209. package/dist/migrations/manifests/0.6.0-beta.4.json +9 -0
  210. package/dist/migrations/manifests/0.6.0-beta.5.json +9 -0
  211. package/dist/migrations/manifests/0.6.0-beta.6.json +16 -0
  212. package/dist/migrations/manifests/0.6.0-beta.7.json +9 -0
  213. package/dist/migrations/manifests/0.6.0-beta.8.json +9 -0
  214. package/dist/migrations/manifests/0.6.0-beta.9.json +9 -0
  215. package/dist/templates/claude/agents/trellis-check.md +13 -7
  216. package/dist/templates/claude/agents/trellis-implement.md +8 -7
  217. package/dist/templates/claude/settings.json +4 -4
  218. package/dist/templates/codebuddy/agents/trellis-check.md +13 -7
  219. package/dist/templates/codebuddy/agents/trellis-implement.md +8 -7
  220. package/dist/templates/codebuddy/settings.json +4 -4
  221. package/dist/templates/codex/agents/trellis-check.toml +4 -4
  222. package/dist/templates/codex/agents/trellis-implement.toml +4 -4
  223. package/dist/templates/codex/config.toml +5 -3
  224. package/dist/templates/codex/hooks/session-start.py +205 -119
  225. package/dist/templates/codex/hooks.json +2 -2
  226. package/dist/templates/codex/skills/before-dev/SKILL.md +12 -6
  227. package/dist/templates/codex/skills/brainstorm/SKILL.md +69 -457
  228. package/dist/templates/codex/skills/check/SKILL.md +86 -18
  229. package/dist/templates/codex/skills/start/SKILL.md +33 -323
  230. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-context-loading.md +7 -4
  231. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-spec-structure.md +1 -1
  232. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-workflow.md +3 -2
  233. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/context-injection.md +5 -5
  234. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/spec-system.md +1 -1
  235. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/task-system.md +35 -6
  236. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/agents.md +5 -4
  237. package/dist/templates/common/bundled-skills/trellis-spec-bootstarp/SKILL.md +41 -0
  238. package/dist/templates/common/bundled-skills/trellis-spec-bootstarp/references/mcp-setup.md +90 -0
  239. package/dist/templates/common/bundled-skills/trellis-spec-bootstarp/references/repository-analysis.md +59 -0
  240. package/dist/templates/common/bundled-skills/trellis-spec-bootstarp/references/spec-task-planning.md +61 -0
  241. package/dist/templates/common/bundled-skills/trellis-spec-bootstarp/references/spec-writing.md +70 -0
  242. package/dist/templates/common/commands/continue.md +6 -5
  243. package/dist/templates/common/commands/start.md +9 -6
  244. package/dist/templates/common/skills/before-dev.md +12 -6
  245. package/dist/templates/common/skills/brainstorm.md +68 -504
  246. package/dist/templates/common/skills/check.md +7 -1
  247. package/dist/templates/copilot/hooks/session-start.py +219 -101
  248. package/dist/templates/copilot/hooks.json +2 -2
  249. package/dist/templates/copilot/prompts/before-dev.prompt.md +12 -6
  250. package/dist/templates/copilot/prompts/brainstorm.prompt.md +69 -457
  251. package/dist/templates/copilot/prompts/check.prompt.md +86 -18
  252. package/dist/templates/copilot/prompts/parallel.prompt.md +16 -8
  253. package/dist/templates/copilot/prompts/start.prompt.md +33 -367
  254. package/dist/templates/cursor/agents/trellis-check.md +13 -7
  255. package/dist/templates/cursor/agents/trellis-implement.md +8 -7
  256. package/dist/templates/cursor/hooks.json +1 -7
  257. package/dist/templates/droid/droids/trellis-check.md +13 -7
  258. package/dist/templates/droid/droids/trellis-implement.md +8 -7
  259. package/dist/templates/droid/settings.json +4 -4
  260. package/dist/templates/gemini/agents/trellis-check.md +11 -5
  261. package/dist/templates/gemini/agents/trellis-implement.md +7 -6
  262. package/dist/templates/gemini/settings.json +2 -2
  263. package/dist/templates/kiro/agents/trellis-check.json +1 -1
  264. package/dist/templates/kiro/agents/trellis-implement.json +1 -1
  265. package/dist/templates/markdown/spec/guides/code-reuse-thinking-guide.md.txt +127 -9
  266. package/dist/templates/markdown/spec/guides/cross-layer-thinking-guide.md.txt +171 -6
  267. package/dist/templates/markdown/spec/guides/cross-platform-thinking-guide.md.txt +333 -43
  268. package/dist/templates/markdown/spec/guides/index.md.txt +18 -0
  269. package/dist/templates/opencode/agents/trellis-check.md +13 -7
  270. package/dist/templates/opencode/agents/trellis-implement.md +9 -8
  271. package/dist/templates/opencode/lib/session-utils.js +212 -123
  272. package/dist/templates/opencode/lib/trellis-context.js +73 -11
  273. package/dist/templates/opencode/plugins/inject-subagent-context.js +131 -29
  274. package/dist/templates/opencode/plugins/inject-workflow-state.js +9 -5
  275. package/dist/templates/opencode/plugins/session-start.js +9 -1
  276. package/dist/templates/pi/agents/trellis-check.md +5 -4
  277. package/dist/templates/pi/agents/trellis-implement.md +5 -4
  278. package/dist/templates/pi/extensions/trellis/index.ts.txt +1357 -754
  279. package/dist/templates/qoder/agents/trellis-check.md +11 -5
  280. package/dist/templates/qoder/agents/trellis-implement.md +7 -6
  281. package/dist/templates/qoder/settings.json +4 -4
  282. package/dist/templates/shared-hooks/index.d.ts.map +1 -1
  283. package/dist/templates/shared-hooks/index.js +0 -1
  284. package/dist/templates/shared-hooks/index.js.map +1 -1
  285. package/dist/templates/shared-hooks/inject-subagent-context.py +36 -14
  286. package/dist/templates/shared-hooks/inject-workflow-state.py +40 -42
  287. package/dist/templates/shared-hooks/session-start.py +222 -171
  288. package/dist/templates/trellis/config.yaml +38 -0
  289. package/dist/templates/trellis/index.d.ts +1 -0
  290. package/dist/templates/trellis/index.d.ts.map +1 -1
  291. package/dist/templates/trellis/index.js +2 -0
  292. package/dist/templates/trellis/index.js.map +1 -1
  293. package/dist/templates/trellis/scripts/add_session.py +50 -24
  294. package/dist/templates/trellis/scripts/common/config.py +57 -1
  295. package/dist/templates/trellis/scripts/common/safe_commit.py +285 -0
  296. package/dist/templates/trellis/scripts/common/session_context.py +384 -137
  297. package/dist/templates/trellis/scripts/common/task_context.py +3 -3
  298. package/dist/templates/trellis/scripts/common/task_store.py +161 -15
  299. package/dist/templates/trellis/scripts/common/workflow_phase.py +7 -10
  300. package/dist/templates/trellis/scripts/task.py +3 -3
  301. package/dist/templates/trellis/workflow.md +119 -98
  302. package/dist/utils/cwd-guard.d.ts +38 -0
  303. package/dist/utils/cwd-guard.d.ts.map +1 -0
  304. package/dist/utils/cwd-guard.js +62 -0
  305. package/dist/utils/cwd-guard.js.map +1 -0
  306. package/dist/utils/file-writer.d.ts +13 -0
  307. package/dist/utils/file-writer.d.ts.map +1 -1
  308. package/dist/utils/file-writer.js +59 -1
  309. package/dist/utils/file-writer.js.map +1 -1
  310. package/dist/utils/manifest-prune.d.ts +61 -0
  311. package/dist/utils/manifest-prune.d.ts.map +1 -0
  312. package/dist/utils/manifest-prune.js +136 -0
  313. package/dist/utils/manifest-prune.js.map +1 -0
  314. package/dist/utils/task-json.d.ts +9 -42
  315. package/dist/utils/task-json.d.ts.map +1 -1
  316. package/dist/utils/task-json.js +8 -45
  317. package/dist/utils/task-json.js.map +1 -1
  318. package/dist/utils/template-hash.d.ts +32 -6
  319. package/dist/utils/template-hash.d.ts.map +1 -1
  320. package/dist/utils/template-hash.js +53 -31
  321. package/dist/utils/template-hash.js.map +1 -1
  322. package/dist/utils/uninstall-scrubbers.d.ts +1 -0
  323. package/dist/utils/uninstall-scrubbers.d.ts.map +1 -1
  324. package/dist/utils/uninstall-scrubbers.js +21 -0
  325. package/dist/utils/uninstall-scrubbers.js.map +1 -1
  326. package/dist/utils/workflow-resolver.d.ts +86 -0
  327. package/dist/utils/workflow-resolver.d.ts.map +1 -0
  328. package/dist/utils/workflow-resolver.js +265 -0
  329. package/dist/utils/workflow-resolver.js.map +1 -0
  330. package/package.json +9 -8
@@ -122,18 +122,26 @@ python3 ./.trellis/scripts/task.py add-context "$TASK_DIR" implement "<path>" "<
122
122
  python3 ./.trellis/scripts/task.py add-context "$TASK_DIR" check "<path>" "<reason>"
123
123
  ```
124
124
 
125
- #### Step 4: Create prd.md
125
+ #### Step 4: Update prd.md
126
126
 
127
127
  ```bash
128
- cat > "$TASK_DIR/prd.md" << 'EOF'
128
+ # task.py create already created prd.md; edit it with requirements and acceptance criteria.
129
+ $EDITOR "$TASK_DIR/prd.md"
130
+ ```
131
+
132
+ Use this shape:
133
+
134
+ ```markdown
129
135
  # Feature: <name>
130
136
 
137
+ ## Goal
138
+ ...
139
+
131
140
  ## Requirements
132
141
  - ...
133
142
 
134
143
  ## Acceptance Criteria
135
- - ...
136
- EOF
144
+ - [ ] ...
137
145
  ```
138
146
 
139
147
  #### Step 5: Validate and Start
@@ -181,10 +189,10 @@ python3 ./.trellis/scripts/multi_agent/cleanup.py <branch> # Cleanup wo
181
189
 
182
190
  The dispatch agent in worktree will automatically execute:
183
191
 
184
- 1. implement �?Implement feature
185
- 2. check �?Check code quality
186
- 3. finish �?Final verification
187
- 4. create-pr �?Create PR
192
+ 1. implement �?Implement feature
193
+ 2. check �?Check code quality
194
+ 3. finish �?Final verification
195
+ 4. create-pr �?Create PR
188
196
 
189
197
  ---
190
198
 
@@ -4,394 +4,60 @@ description: "Trellis Copilot prompt: Start Session"
4
4
 
5
5
  # Start Session
6
6
 
7
- Initialize your AI development session and begin working on tasks.
7
+ Initialize a Trellis-managed development session. This platform has no session-start hook, so manually load the equivalent context by following these steps (each one mirrors a section the hook would otherwise inject).
8
8
 
9
9
  ---
10
10
 
11
- ## Operation Types
12
-
13
- | Marker | Meaning | Executor |
14
- |--------|---------|----------|
15
- | `[AI]` | Bash scripts or Task calls executed by AI | You (AI) |
16
- | `[USER]` | Slash commands executed by user | User |
17
-
18
- ---
19
-
20
- ## Initialization `[AI]`
21
-
22
- ### Step 1: Understand Development Workflow
23
-
24
- First, read the workflow guide to understand the development process:
25
-
26
- ```bash
27
- cat .trellis/workflow.md
28
- ```
29
-
30
- **Follow the instructions in workflow.md** - it contains:
31
- - Core principles (Read Before Write, Follow Standards, etc.)
32
- - File system structure
33
- - Development process
34
- - Best practices
35
-
36
- ### Step 2: Get Current Context
37
-
38
- ```bash
39
- python3 ./.trellis/scripts/get_context.py
40
- ```
41
-
42
- This shows: developer identity, git status, current task (if any), active tasks.
43
-
44
- ### Step 3: Read Guidelines Index
45
-
46
- ```bash
47
- python3 ./.trellis/scripts/get_context.py --mode packages
48
- ```
49
-
50
- This shows available packages and their spec layers. Read the relevant spec indexes:
51
-
52
- ```bash
53
- cat .trellis/spec/<package>/<layer>/index.md # Package-specific guidelines
54
- cat .trellis/spec/guides/index.md # Thinking guides (always read)
55
- ```
56
-
57
- > **Important**: The index files are navigation �?they list the actual guideline files (e.g., `error-handling.md`, `conventions.md`, `mock-strategies.md`).
58
- > At this step, just read the indexes to understand what's available.
59
- > When you start actual development, you MUST go back and read the specific guideline files relevant to your task, as listed in the index's Pre-Development Checklist.
60
-
61
- ### Step 4: Report and Ask
62
-
63
- Report what you learned and ask: "What would you like to work on?"
64
-
65
- ---
66
-
67
- ## Task Classification
68
-
69
- When user describes a task, classify it:
70
-
71
- | Type | Criteria | Workflow |
72
- |------|----------|----------|
73
- | **Question** | User asks about code, architecture, or how something works | Answer directly |
74
- | **Trivial Fix** | Typo fix, comment update, single-line change | Direct Edit |
75
- | **Simple Task** | Clear goal, 1-2 files, well-defined scope | Quick confirm �?Implement |
76
- | **Complex Task** | Vague goal, multiple files, architectural decisions | **Brainstorm �?Task Workflow** |
77
-
78
- ### Classification Signals
79
-
80
- **Trivial/Simple indicators:**
81
- - User specifies exact file and change
82
- - "Fix the typo in X"
83
- - "Add field Y to component Z"
84
- - Clear acceptance criteria already stated
85
-
86
- **Complex indicators:**
87
- - "I want to add a feature for..."
88
- - "Can you help me improve..."
89
- - Mentions multiple areas or systems
90
- - No clear implementation path
91
- - User seems unsure about approach
92
-
93
- ### Decision Rule
94
-
95
- > **If in doubt, use Brainstorm + Task Workflow.**
96
- >
97
- > Task Workflow ensures code-spec context is injected to agents, resulting in higher quality code.
98
- > The overhead is minimal, but the benefit is significant.
99
-
100
- ---
101
-
102
- ## Question / Trivial Fix
103
-
104
- For questions or trivial fixes, work directly:
105
-
106
- 1. Answer question or make the fix
107
- 2. If code was changed, remind user to run `/`
108
-
109
- ---
110
-
111
- ## Simple Task
112
-
113
- For simple, well-defined tasks:
114
-
115
- 1. Quick confirm: "I understand you want to [goal]. Shall I proceed?"
116
- 2. If no, clarify and confirm again
117
- 3. **If yes: execute ALL steps below without stopping. Do NOT ask for additional confirmation between steps.**
118
- - Create task directory (Phase 1 Path B, Step 2)
119
- - Write PRD (Step 3)
120
- - Research codebase (Phase 2, Step 5)
121
- - Configure context (Step 6)
122
- - Activate task (Step 7)
123
- - Implement (Phase 3, Step 8)
124
- - Check quality (Step 9)
125
- - Complete (Step 10)
126
-
127
- ---
128
-
129
- ## Complex Task - Brainstorm First
130
-
131
- For complex or vague tasks, **automatically start the brainstorm process** �?do NOT skip directly to implementation.
132
-
133
- See `/` for the full process. Summary:
134
-
135
- 1. **Acknowledge and classify** - State your understanding
136
- 2. **Create task directory** - Track evolving requirements in `prd.md`
137
- 3. **Ask questions one at a time** - Update PRD after each answer
138
- 4. **Propose approaches** - For architectural decisions
139
- 5. **Confirm final requirements** - Get explicit approval
140
- 6. **Proceed to Task Workflow** - With clear requirements in PRD
141
-
142
- > **Subtask Decomposition**: If brainstorm reveals multiple independent work items,
143
- > consider creating subtasks using `--parent` flag or `add-subtask` command.
144
- > See `/` Step 8 for details.
145
-
146
- ### Key Brainstorm Principles
147
-
148
- | Principle | Description |
149
- |-----------|-------------|
150
- | **One question at a time** | Never overwhelm with multiple questions |
151
- | **Update PRD immediately** | After each answer, update the document |
152
- | **Prefer multiple choice** | Easier for users to answer |
153
- | **YAGNI** | Challenge unnecessary complexity |
154
-
155
- ---
156
-
157
- ## Task Workflow (Development Tasks)
158
-
159
- **Why this workflow?**
160
- - Research Agent analyzes what code-spec files are needed
161
- - Code-spec files are configured in jsonl files
162
- - Implement Agent receives code-spec context via Hook injection
163
- - Check Agent verifies against code-spec requirements
164
- - Result: Code that follows project conventions automatically
165
-
166
- ### Overview: Two Entry Points
167
-
168
- ```
169
- From Brainstorm (Complex Task):
170
- PRD confirmed �?Research �?Configure Context �?Activate �?Implement �?Check �?Complete
171
-
172
- From Simple Task:
173
- Confirm �?Create Task �?Write PRD �?Research �?Configure Context �?Activate �?Implement �?Check �?Complete
174
- ```
175
-
176
- **Key principle: Research happens AFTER requirements are clear (PRD exists).**
177
-
178
- ---
179
-
180
- ### Phase 1: Establish Requirements
181
-
182
- #### Path A: From Brainstorm (skip to Phase 2)
183
-
184
- PRD and task directory already exist from brainstorm. Skip directly to Phase 2.
185
-
186
- #### Path B: From Simple Task
187
-
188
- **Step 1: Confirm Understanding** `[AI]`
189
-
190
- Quick confirm:
191
- - What is the goal?
192
- - What type of development? (frontend / backend / fullstack)
193
- - Any specific requirements or constraints?
194
-
195
- **Step 2: Create Task Directory** `[AI]`
11
+ ## Step 1: Current state
12
+ Identity, git status, current task, active tasks, journal location.
196
13
 
197
14
  ```bash
198
- TASK_DIR=$(python3 ./.trellis/scripts/task.py create "<title>" --slug <name>)
199
- ```
200
-
201
- **Step 3: Write PRD** `[AI]`
202
-
203
- Create `prd.md` in the task directory with:
204
-
205
- ```markdown
206
- # <Task Title>
207
-
208
- ## Goal
209
- <What we're trying to achieve>
210
-
211
- ## Requirements
212
- - <Requirement 1>
213
- - <Requirement 2>
214
-
215
- ## Acceptance Criteria
216
- - [ ] <Criterion 1>
217
- - [ ] <Criterion 2>
218
-
219
- ## Technical Notes
220
- <Any technical decisions or constraints>
221
- ```
222
-
223
- ---
224
-
225
- ### Phase 2: Prepare for Implementation (shared)
226
-
227
- > Both paths converge here. PRD and task directory must exist before proceeding.
228
-
229
- **Step 4: Code-Spec Depth Check** `[AI]`
230
-
231
- If the task touches infra or cross-layer contracts, do not start implementation until code-spec depth is defined.
232
-
233
- Trigger this requirement when the change includes any of:
234
- - New or changed command/API signatures
235
- - Database schema or migration changes
236
- - Infra integrations (storage, queue, cache, secrets, env contracts)
237
- - Cross-layer payload transformations
238
-
239
- Must-have before proceeding:
240
- - [ ] Target code-spec files to update are identified
241
- - [ ] Concrete contract is defined (signature, fields, env keys)
242
- - [ ] Validation and error matrix is defined
243
- - [ ] At least one Good/Base/Bad case is defined
244
-
245
- **Step 5: Research the Codebase** `[AI]`
246
-
247
- Based on the confirmed PRD, call Research Agent to find relevant specs and patterns:
248
-
249
- ```
250
- Task(
251
- subagent_type: "trellis-research",
252
- prompt: "Analyze the codebase for this task:
253
-
254
- Task: <goal from PRD>
255
- Type: <frontend/backend/fullstack>
256
-
257
- Please find:
258
- 1. Relevant code-spec files in .trellis/spec/
259
- 2. Existing code patterns to follow (find 2-3 examples)
260
- 3. Files that will likely need modification
261
-
262
- Output:
263
- ## Relevant Code-Specs
264
- - <path>: <why it's relevant>
265
-
266
- ## Code Patterns Found
267
- - <pattern>: <example file path>
268
-
269
- ## Files to Modify
270
- - <path>: <what change>"
271
- )
15
+ {{PYTHON_CMD}} ./.trellis/scripts/get_context.py
272
16
  ```
273
17
 
274
- **Step 6: Configure Context** `[AI]`
275
-
276
- `implement.jsonl` and `check.jsonl` were seeded on `task.py create` with a single self-describing `_example` line. Curate real entries now (see workflow.md Phase 1.3 for the full rule):
18
+ If this output includes a line beginning `Trellis update available:`, copy the full line verbatim when summarizing session context. Do not shorten operational command hints.
277
19
 
278
- - Put **spec files** (`.trellis/spec/<package>/<layer>/*.md`) and **research files** (`{TASK_DIR}/research/*.md`) only.
279
- - Do NOT put code files those are read during implementation, not pre-registered here.
280
- - Split: `implement.jsonl` = specs the implement sub-agent needs; `check.jsonl` = specs the check sub-agent needs.
281
-
282
- Discover available specs:
20
+ ## Step 2: Workflow overview
21
+ Phase Index + skill routing table + DO-NOT-skip rules.
283
22
 
284
23
  ```bash
285
- python3 ./.trellis/scripts/get_context.py --mode packages
24
+ {{PYTHON_CMD}} ./.trellis/scripts/get_context.py --mode phase
286
25
  ```
287
26
 
288
- Append entries (either edit the jsonl file directly, or):
27
+ Full guide in `.trellis/workflow.md` (read on demand).
289
28
 
290
- ```bash
291
- python3 ./.trellis/scripts/task.py add-context "$TASK_DIR" implement "<path>" "<reason>"
292
- python3 ./.trellis/scripts/task.py add-context "$TASK_DIR" check "<path>" "<reason>"
293
- ```
294
-
295
- **Step 7: Activate Task** `[AI]`
29
+ ## Step 3: Guideline indexes
30
+ Discover packages + spec layers, then read each relevant index file.
296
31
 
297
32
  ```bash
298
- python3 ./.trellis/scripts/task.py start "$TASK_DIR"
33
+ {{PYTHON_CMD}} ./.trellis/scripts/get_context.py --mode packages
34
+ cat .trellis/spec/guides/index.md
35
+ cat .trellis/spec/<package>/<layer>/index.md # for each relevant layer
299
36
  ```
300
37
 
301
- This sets the active task through Trellis' session resolver so hooks can inject context for this AI session. If the command fails because no session identity is available, rerun it from an IDE/session that exposes session identity or set `TRELLIS_CONTEXT_ID`.
38
+ Index files list the specific guideline docs to read when you actually start coding.
302
39
 
303
- ---
40
+ ## Step 4: Decide next action
41
+ From Step 1 you know the current task and status. Check the task directory:
304
42
 
305
- ### Phase 3: Execute (shared)
306
-
307
- **Step 8: Implement** `[AI]`
308
-
309
- Call Implement Agent (code-spec context is auto-injected by hook):
310
-
311
- ```
312
- Task(
313
- subagent_type: "trellis-implement",
314
- prompt: "Implement the task described in prd.md.
315
-
316
- Follow all code-spec files that have been injected into your context.
317
- Run lint and typecheck before finishing."
318
- )
319
- ```
320
-
321
- **Step 9: Check Quality** `[AI]`
322
-
323
- Call Check Agent (code-spec context is auto-injected by hook):
324
-
325
- ```
326
- Task(
327
- subagent_type: "trellis-check",
328
- prompt: "Review all code changes against the code-spec requirements.
329
-
330
- Fix any issues you find directly.
331
- Ensure lint and typecheck pass."
332
- )
333
- ```
334
-
335
- **Step 10: Complete** `[AI]`
336
-
337
- 1. Verify lint and typecheck pass
338
- 2. Report what was implemented
339
- 3. Remind user to:
340
- - Test the changes
341
- - Commit when ready
342
- - Run `/` to record this session
343
-
344
- ---
345
-
346
- ## Continuing Existing Task
347
-
348
- If `get_context.py` shows a current task:
349
-
350
- 1. Read the task's `prd.md` to understand the goal
351
- 2. Check `task.json` for current status and phase
352
- 3. Ask user: "Continue working on <task-name>?"
353
-
354
- If yes, resume from the appropriate step (usually Step 7 or 8).
43
+ - **Active task status `planning` + no `prd.md`** → Phase 1.1. Load the `trellis-brainstorm` skill.
44
+ - **Active task status `planning` + `prd.md` exists** → stay in Phase 1. Lightweight tasks can be PRD-only; complex tasks need `design.md` + `implement.md`. Load the relevant Phase 1 step detail before `task.py start`.
45
+ - **Active task status `in_progress`** → Phase 2 step 2.1. Load the step detail:
46
+ ```bash
47
+ {{PYTHON_CMD}} ./.trellis/scripts/get_context.py --mode phase --step 2.1 --platform {{CLI_FLAG}}
48
+ ```
49
+ - **No active task** → classify first. For simple conversation / small task, ask only whether this turn should create a Trellis task. For complex work, ask whether you may create a Trellis task and enter planning. If the user says no, skip Trellis for this session.
355
50
 
356
51
  ---
357
52
 
358
- ## Commands Reference
359
-
360
- ### User Commands `[USER]`
361
-
362
- | Command | When to Use |
363
- |---------|-------------|
364
- | `/` | Begin a session (this command) |
365
- | `/` | Clarify vague requirements (called from start) |
366
- | `/` | Complex tasks needing isolated worktree |
367
- | `/` | Before committing changes |
368
- | `/` | After completing a task |
369
-
370
- ### AI Scripts `[AI]`
371
-
372
- | Script | Purpose |
373
- |--------|---------|
374
- | `python3 ./.trellis/scripts/get_context.py` | Get session context |
375
- | `python3 ./.trellis/scripts/task.py create` | Create task directory (seeds jsonl on sub-agent platforms) |
376
- | `python3 ./.trellis/scripts/task.py add-context` | Append code-spec/research entry to jsonl |
377
- | `python3 ./.trellis/scripts/task.py start` | Set current task |
378
- | `python3 ./.trellis/scripts/task.py finish` | Clear current task |
379
- | `python3 ./.trellis/scripts/task.py archive` | Archive completed task |
380
-
381
- ### Sub Agents `[AI]`
382
-
383
- | Agent | Purpose | Hook Injection |
384
- |-------|---------|----------------|
385
- | research | Analyze codebase | No (reads directly) |
386
- | implement | Write code | Yes (implement.jsonl) |
387
- | check | Review & fix | Yes (check.jsonl) |
388
- | debug | Fix specific issues | Yes (debug.jsonl) |
389
-
390
- ---
53
+ ## Skill routing (quick reference)
391
54
 
392
- ## Key Principle
55
+ | User intent | Skill |
56
+ |---|---|
57
+ | New feature / unclear requirements | `trellis-brainstorm` |
58
+ | About to write code | `trellis-before-dev` |
59
+ | Done coding / quality check | `trellis-check` |
60
+ | Stuck / fixed same bug multiple times | `trellis-break-loop` |
61
+ | Learned something worth capturing | `trellis-update-spec` |
393
62
 
394
- > **Code-spec context is injected, not remembered.**
395
- >
396
- > The Task Workflow ensures agents receive relevant code-spec context automatically.
397
- > This is more reliable than hoping the AI "remembers" conventions.
63
+ Full rules + anti-rationalization table in `.trellis/workflow.md`.
@@ -19,21 +19,25 @@ You are already the `trellis-check` sub-agent that the main session dispatched.
19
19
 
20
20
  Look for the `<!-- trellis-hook-injected -->` marker in your input above.
21
21
 
22
- - **If the marker is present**: prd / spec / research files have already been auto-loaded for you above. Proceed with the check work directly.
23
- - **If the marker is absent**: hook injection didn't fire (Windows + Claude Code, `--continue` resume, fork distribution, hooks disabled, etc.). Find the active task path from your dispatch prompt's first line `Active task: <path>`, then Read `<task-path>/prd.md` and the spec files listed in `<task-path>/check.jsonl` yourself before doing the work.
22
+ - **If the marker is present**: task artifacts, spec, and research files have already been auto-loaded for you above. Proceed with the check work directly.
23
+ - **If the marker is absent**: hook injection didn't fire (Windows + Claude Code, `--continue` resume, fork distribution, hooks disabled, etc.). Find the active task path from your dispatch prompt's first line `Active task: <path>`, then Read `<task-path>/check.jsonl`, each listed file, `<task-path>/prd.md`, `<task-path>/design.md` if present, and `<task-path>/implement.md` if present before doing the work.
24
24
 
25
25
  ## Context
26
26
 
27
27
  Before checking, read:
28
28
  - `.trellis/spec/` - Development guidelines
29
+ - Task `prd.md` - Requirements document
30
+ - Task `design.md` - Technical design (if exists)
31
+ - Task `implement.md` - Execution plan (if exists)
29
32
  - Pre-commit checklist for quality standards
30
33
 
31
34
  ## Core Responsibilities
32
35
 
33
36
  1. **Get code changes** - Use git diff to get uncommitted code
34
- 2. **Check against specs** - Verify code follows guidelines
35
- 3. **Self-fix** - Fix issues yourself, not just report them
36
- 4. **Run verification** - typecheck and lint
37
+ 2. **Review task artifacts** - Check changes against prd.md, design.md if present, and implement.md if present
38
+ 3. **Check against specs** - Verify code follows guidelines
39
+ 4. **Self-fix** - Fix issues yourself, not just report them
40
+ 5. **Run verification** - typecheck and lint
37
41
 
38
42
  ## Important
39
43
 
@@ -52,10 +56,12 @@ git diff --name-only # List changed files
52
56
  git diff # View specific changes
53
57
  ```
54
58
 
55
- ### Step 2: Check Against Specs
59
+ ### Step 2: Check Against Specs and Task Artifacts
56
60
 
57
- Read relevant specs in `.trellis/spec/` to check code:
61
+ Read the task's prd.md, design.md if present, and implement.md if present, then read relevant specs in `.trellis/spec/` to check code:
58
62
 
63
+ - Does it satisfy the task requirements
64
+ - Does it follow the technical design and implementation plan when present
59
65
  - Does it follow directory structure conventions
60
66
  - Does it follow naming conventions
61
67
  - Does it follow code patterns
@@ -20,7 +20,7 @@ You are already the `trellis-implement` sub-agent that the main session dispatch
20
20
  Look for the `<!-- trellis-hook-injected -->` marker in your input above.
21
21
 
22
22
  - **If the marker is present**: prd / spec / research files have already been auto-loaded for you above. Proceed with the implementation work directly.
23
- - **If the marker is absent**: hook injection didn't fire (Windows + Claude Code, `--continue` resume, fork distribution, hooks disabled, etc.). Find the active task path from your dispatch prompt's first line `Active task: <path>`, then Read `<task-path>/prd.md`, `<task-path>/info.md` (if it exists), and the spec files listed in `<task-path>/implement.jsonl` yourself before doing the work.
23
+ - **If the marker is absent**: hook injection didn't fire (Windows + Claude Code, `--continue` resume, fork distribution, hooks disabled, etc.). Find the active task path from your dispatch prompt's first line `Active task: <path>`, then Read `<task-path>/implement.jsonl`, each listed file, `<task-path>/prd.md`, `<task-path>/design.md` if present, and `<task-path>/implement.md` if present before doing the work.
24
24
 
25
25
  ## Context
26
26
 
@@ -28,13 +28,14 @@ Before implementing, read:
28
28
  - `.trellis/workflow.md` - Project workflow
29
29
  - `.trellis/spec/` - Development guidelines
30
30
  - Task `prd.md` - Requirements document
31
- - Task `info.md` - Technical design (if exists)
31
+ - Task `design.md` - Technical design (if exists)
32
+ - Task `implement.md` - Execution plan (if exists)
32
33
 
33
34
  ## Core Responsibilities
34
35
 
35
36
  1. **Understand specs** - Read relevant spec files in `.trellis/spec/`
36
- 2. **Understand requirements** - Read prd.md and info.md
37
- 3. **Implement features** - Write code following specs and design
37
+ 2. **Understand task artifacts** - Read prd.md, design.md if present, and implement.md if present
38
+ 3. **Implement features** - Write code following specs and task artifacts
38
39
  4. **Self-check** - Ensure code quality
39
40
  5. **Report results** - Report completion status
40
41
 
@@ -59,15 +60,15 @@ Read relevant specs based on task type:
59
60
 
60
61
  ### 2. Understand Requirements
61
62
 
62
- Read the task's prd.md and info.md:
63
+ Read the task's prd.md, design.md if present, and implement.md if present:
63
64
 
64
65
  - What are the core requirements
65
66
  - Key points of technical design
66
- - Which files to modify/create
67
+ - Implementation order, validation commands, and rollback points
67
68
 
68
69
  ### 3. Implement Features
69
70
 
70
- - Write code following specs and technical design
71
+ - Write code following specs and task artifacts
71
72
  - Follow existing code patterns
72
73
  - Only do what's required, no over-engineering
73
74
 
@@ -11,13 +11,7 @@
11
11
  "sessionStart": [
12
12
  {
13
13
  "command": "{{PYTHON_CMD}} .cursor/hooks/session-start.py",
14
- "timeout": 10
15
- }
16
- ],
17
- "beforeSubmitPrompt": [
18
- {
19
- "command": "{{PYTHON_CMD}} .cursor/hooks/inject-workflow-state.py",
20
- "timeout": 5
14
+ "timeout": 30
21
15
  }
22
16
  ],
23
17
  "beforeShellExecution": [
@@ -12,21 +12,25 @@ You are the Check Agent in the Trellis workflow.
12
12
 
13
13
  Look for the `<!-- trellis-hook-injected -->` marker in your input above.
14
14
 
15
- - **If the marker is present**: prd / spec / research files have already been auto-loaded for you above. Proceed with the check work directly.
16
- - **If the marker is absent**: hook injection didn't fire (Windows + Claude Code, `--continue` resume, fork distribution, hooks disabled, etc.). Find the active task path from your dispatch prompt's first line `Active task: <path>`, then Read `<task-path>/prd.md` and the spec files listed in `<task-path>/check.jsonl` yourself before doing the work.
15
+ - **If the marker is present**: task artifacts, spec, and research files have already been auto-loaded for you above. Proceed with the check work directly.
16
+ - **If the marker is absent**: hook injection didn't fire (Windows + Claude Code, `--continue` resume, fork distribution, hooks disabled, etc.). Find the active task path from your dispatch prompt's first line `Active task: <path>`, then Read `<task-path>/check.jsonl`, each listed file, `<task-path>/prd.md`, `<task-path>/design.md` if present, and `<task-path>/implement.md` if present before doing the work.
17
17
 
18
18
  ## Context
19
19
 
20
20
  Before checking, read:
21
21
  - `.trellis/spec/` - Development guidelines
22
+ - Task `prd.md` - Requirements document
23
+ - Task `design.md` - Technical design (if exists)
24
+ - Task `implement.md` - Execution plan (if exists)
22
25
  - Pre-commit checklist for quality standards
23
26
 
24
27
  ## Core Responsibilities
25
28
 
26
29
  1. **Get code changes** - Use git diff to get uncommitted code
27
- 2. **Check against specs** - Verify code follows guidelines
28
- 3. **Self-fix** - Fix issues yourself, not just report them
29
- 4. **Run verification** - typecheck and lint
30
+ 2. **Review task artifacts** - Check changes against prd.md, design.md if present, and implement.md if present
31
+ 3. **Check against specs** - Verify code follows guidelines
32
+ 4. **Self-fix** - Fix issues yourself, not just report them
33
+ 5. **Run verification** - typecheck and lint
30
34
 
31
35
  ## Important
32
36
 
@@ -45,10 +49,12 @@ git diff --name-only # List changed files
45
49
  git diff # View specific changes
46
50
  ```
47
51
 
48
- ### Step 2: Check Against Specs
52
+ ### Step 2: Check Against Specs and Task Artifacts
49
53
 
50
- Read relevant specs in `.trellis/spec/` to check code:
54
+ Read the task's prd.md, design.md if present, and implement.md if present, then read relevant specs in `.trellis/spec/` to check code:
51
55
 
56
+ - Does it satisfy the task requirements
57
+ - Does it follow the technical design and implementation plan when present
52
58
  - Does it follow directory structure conventions
53
59
  - Does it follow naming conventions
54
60
  - Does it follow code patterns
@@ -13,7 +13,7 @@ You are the Implement Agent in the Trellis workflow.
13
13
  Look for the `<!-- trellis-hook-injected -->` marker in your input above.
14
14
 
15
15
  - **If the marker is present**: prd / spec / research files have already been auto-loaded for you above. Proceed with the implementation work directly.
16
- - **If the marker is absent**: hook injection didn't fire (Windows + Claude Code, `--continue` resume, fork distribution, hooks disabled, etc.). Find the active task path from your dispatch prompt's first line `Active task: <path>`, then Read `<task-path>/prd.md`, `<task-path>/info.md` (if it exists), and the spec files listed in `<task-path>/implement.jsonl` yourself before doing the work.
16
+ - **If the marker is absent**: hook injection didn't fire (Windows + Claude Code, `--continue` resume, fork distribution, hooks disabled, etc.). Find the active task path from your dispatch prompt's first line `Active task: <path>`, then Read `<task-path>/implement.jsonl`, each listed file, `<task-path>/prd.md`, `<task-path>/design.md` if present, and `<task-path>/implement.md` if present before doing the work.
17
17
 
18
18
  ## Context
19
19
 
@@ -21,13 +21,14 @@ Before implementing, read:
21
21
  - `.trellis/workflow.md` - Project workflow
22
22
  - `.trellis/spec/` - Development guidelines
23
23
  - Task `prd.md` - Requirements document
24
- - Task `info.md` - Technical design (if exists)
24
+ - Task `design.md` - Technical design (if exists)
25
+ - Task `implement.md` - Execution plan (if exists)
25
26
 
26
27
  ## Core Responsibilities
27
28
 
28
29
  1. **Understand specs** - Read relevant spec files in `.trellis/spec/`
29
- 2. **Understand requirements** - Read prd.md and info.md
30
- 3. **Implement features** - Write code following specs and design
30
+ 2. **Understand task artifacts** - Read prd.md, design.md if present, and implement.md if present
31
+ 3. **Implement features** - Write code following specs and task artifacts
31
32
  4. **Self-check** - Ensure code quality
32
33
  5. **Report results** - Report completion status
33
34
 
@@ -52,15 +53,15 @@ Read relevant specs based on task type:
52
53
 
53
54
  ### 2. Understand Requirements
54
55
 
55
- Read the task's prd.md and info.md:
56
+ Read the task's prd.md, design.md if present, and implement.md if present:
56
57
 
57
58
  - What are the core requirements
58
59
  - Key points of technical design
59
- - Which files to modify/create
60
+ - Implementation order, validation commands, and rollback points
60
61
 
61
62
  ### 3. Implement Features
62
63
 
63
- - Write code following specs and technical design
64
+ - Write code following specs and task artifacts
64
65
  - Follow existing code patterns
65
66
  - Only do what's required, no over-engineering
66
67