@mindfoldhq/trellis 0.4.0 → 0.5.0-beta.10

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 (427) hide show
  1. package/dist/cli/index.js +0 -1
  2. package/dist/cli/index.js.map +1 -1
  3. package/dist/commands/init.d.ts +10 -1
  4. package/dist/commands/init.d.ts.map +1 -1
  5. package/dist/commands/init.js +382 -120
  6. package/dist/commands/init.js.map +1 -1
  7. package/dist/commands/update.d.ts +5 -0
  8. package/dist/commands/update.d.ts.map +1 -1
  9. package/dist/commands/update.js +178 -61
  10. package/dist/commands/update.js.map +1 -1
  11. package/dist/configurators/antigravity.d.ts +3 -4
  12. package/dist/configurators/antigravity.d.ts.map +1 -1
  13. package/dist/configurators/antigravity.js +17 -10
  14. package/dist/configurators/antigravity.js.map +1 -1
  15. package/dist/configurators/claude.d.ts +5 -28
  16. package/dist/configurators/claude.d.ts.map +1 -1
  17. package/dist/configurators/claude.js +30 -51
  18. package/dist/configurators/claude.js.map +1 -1
  19. package/dist/configurators/codebuddy.d.ts +6 -7
  20. package/dist/configurators/codebuddy.d.ts.map +1 -1
  21. package/dist/configurators/codebuddy.js +23 -51
  22. package/dist/configurators/codebuddy.js.map +1 -1
  23. package/dist/configurators/codex.d.ts +3 -6
  24. package/dist/configurators/codex.d.ts.map +1 -1
  25. package/dist/configurators/codex.js +29 -12
  26. package/dist/configurators/codex.js.map +1 -1
  27. package/dist/configurators/copilot.d.ts +6 -5
  28. package/dist/configurators/copilot.d.ts.map +1 -1
  29. package/dist/configurators/copilot.js +42 -13
  30. package/dist/configurators/copilot.js.map +1 -1
  31. package/dist/configurators/cursor.d.ts +6 -1
  32. package/dist/configurators/cursor.d.ts.map +1 -1
  33. package/dist/configurators/cursor.js +22 -45
  34. package/dist/configurators/cursor.js.map +1 -1
  35. package/dist/configurators/droid.d.ts +6 -1
  36. package/dist/configurators/droid.d.ts.map +1 -1
  37. package/dist/configurators/droid.js +23 -41
  38. package/dist/configurators/droid.js.map +1 -1
  39. package/dist/configurators/gemini.d.ts +8 -4
  40. package/dist/configurators/gemini.d.ts.map +1 -1
  41. package/dist/configurators/gemini.js +28 -47
  42. package/dist/configurators/gemini.js.map +1 -1
  43. package/dist/configurators/index.d.ts +1 -1
  44. package/dist/configurators/index.d.ts.map +1 -1
  45. package/dist/configurators/index.js +146 -100
  46. package/dist/configurators/index.js.map +1 -1
  47. package/dist/configurators/kilo.d.ts +3 -4
  48. package/dist/configurators/kilo.d.ts.map +1 -1
  49. package/dist/configurators/kilo.js +19 -46
  50. package/dist/configurators/kilo.js.map +1 -1
  51. package/dist/configurators/kiro.d.ts +4 -4
  52. package/dist/configurators/kiro.d.ts.map +1 -1
  53. package/dist/configurators/kiro.js +18 -14
  54. package/dist/configurators/kiro.js.map +1 -1
  55. package/dist/configurators/opencode.d.ts +7 -25
  56. package/dist/configurators/opencode.d.ts.map +1 -1
  57. package/dist/configurators/opencode.js +57 -56
  58. package/dist/configurators/opencode.js.map +1 -1
  59. package/dist/configurators/qoder.d.ts +6 -3
  60. package/dist/configurators/qoder.d.ts.map +1 -1
  61. package/dist/configurators/qoder.js +27 -46
  62. package/dist/configurators/qoder.js.map +1 -1
  63. package/dist/configurators/shared.d.ts +68 -3
  64. package/dist/configurators/shared.d.ts.map +1 -1
  65. package/dist/configurators/shared.js +274 -3
  66. package/dist/configurators/shared.js.map +1 -1
  67. package/dist/configurators/windsurf.d.ts +3 -4
  68. package/dist/configurators/windsurf.d.ts.map +1 -1
  69. package/dist/configurators/windsurf.js +17 -10
  70. package/dist/configurators/windsurf.js.map +1 -1
  71. package/dist/configurators/workflow.d.ts +0 -3
  72. package/dist/configurators/workflow.d.ts.map +1 -1
  73. package/dist/configurators/workflow.js +1 -7
  74. package/dist/configurators/workflow.js.map +1 -1
  75. package/dist/migrations/manifests/0.4.0.json +1 -1
  76. package/dist/migrations/manifests/0.5.0-beta.0.json +1646 -0
  77. package/dist/migrations/manifests/0.5.0-beta.1.json +9 -0
  78. package/dist/migrations/manifests/0.5.0-beta.2.json +9 -0
  79. package/dist/migrations/manifests/0.5.0-beta.3.json +9 -0
  80. package/dist/migrations/manifests/0.5.0-beta.4.json +9 -0
  81. package/dist/migrations/manifests/0.5.0-beta.5.json +222 -0
  82. package/dist/migrations/manifests/0.5.0-beta.6.json +9 -0
  83. package/dist/migrations/manifests/0.5.0-beta.7.json +9 -0
  84. package/dist/migrations/manifests/0.5.0-beta.8.json +9 -0
  85. package/dist/migrations/manifests/0.5.0-beta.9.json +48 -0
  86. package/dist/templates/claude/agents/{check.md → trellis-check.md} +3 -31
  87. package/dist/templates/claude/agents/{implement.md → trellis-implement.md} +1 -2
  88. package/dist/templates/claude/agents/trellis-research.md +137 -0
  89. package/dist/templates/claude/index.d.ts +5 -37
  90. package/dist/templates/claude/index.d.ts.map +1 -1
  91. package/dist/templates/claude/index.js +3 -42
  92. package/dist/templates/claude/index.js.map +1 -1
  93. package/dist/templates/claude/settings.json +6 -4
  94. package/dist/templates/{iflow/agents/check.md → codebuddy/agents/trellis-check.md} +3 -31
  95. package/dist/templates/{iflow/agents/implement.md → codebuddy/agents/trellis-implement.md} +1 -2
  96. package/dist/templates/codebuddy/agents/trellis-research.md +137 -0
  97. package/dist/templates/codebuddy/index.d.ts +6 -16
  98. package/dist/templates/codebuddy/index.d.ts.map +1 -1
  99. package/dist/templates/codebuddy/index.js +6 -36
  100. package/dist/templates/codebuddy/index.js.map +1 -1
  101. package/dist/templates/codebuddy/settings.json +59 -0
  102. package/dist/templates/codex/agents/trellis-check.toml +38 -0
  103. package/dist/templates/codex/agents/{implement.toml → trellis-implement.toml} +1 -1
  104. package/dist/templates/codex/agents/trellis-research.toml +60 -0
  105. package/dist/templates/codex/config.toml +10 -0
  106. package/dist/templates/codex/hooks/session-start.py +65 -29
  107. package/dist/templates/codex/hooks.json +11 -0
  108. package/dist/templates/codex/index.d.ts +0 -1
  109. package/dist/templates/codex/index.d.ts.map +1 -1
  110. package/dist/templates/codex/index.js +1 -8
  111. package/dist/templates/codex/index.js.map +1 -1
  112. package/dist/templates/codex/skills/start/SKILL.md +1 -1
  113. package/dist/templates/common/commands/continue.md +51 -0
  114. package/dist/templates/common/commands/finish-work.md +32 -0
  115. package/dist/templates/common/commands/start.md +56 -0
  116. package/dist/templates/common/index.d.ts +28 -0
  117. package/dist/templates/common/index.d.ts.map +1 -0
  118. package/dist/templates/common/index.js +55 -0
  119. package/dist/templates/common/index.js.map +1 -0
  120. package/dist/templates/{droid/commands/trellis → common/skills}/brainstorm.md +51 -12
  121. package/dist/templates/{iflow/commands/trellis → common/skills}/break-loop.md +4 -4
  122. package/dist/templates/common/skills/check.md +87 -0
  123. package/dist/templates/{codebuddy/commands/trellis → common/skills}/update-spec.md +18 -21
  124. package/dist/templates/copilot/hooks/session-start.py +65 -29
  125. package/dist/templates/copilot/hooks.json +8 -0
  126. package/dist/templates/copilot/prompts/start.prompt.md +13 -16
  127. package/dist/templates/cursor/agents/trellis-check.md +94 -0
  128. package/dist/templates/cursor/agents/trellis-implement.md +94 -0
  129. package/dist/templates/cursor/agents/trellis-research.md +137 -0
  130. package/dist/templates/cursor/hooks.json +24 -0
  131. package/dist/templates/cursor/index.d.ts +6 -17
  132. package/dist/templates/cursor/index.d.ts.map +1 -1
  133. package/dist/templates/cursor/index.js +6 -37
  134. package/dist/templates/cursor/index.js.map +1 -1
  135. package/dist/templates/droid/droids/trellis-check.md +94 -0
  136. package/dist/templates/droid/droids/trellis-implement.md +94 -0
  137. package/dist/templates/droid/droids/trellis-research.md +137 -0
  138. package/dist/templates/droid/index.d.ts +7 -19
  139. package/dist/templates/droid/index.d.ts.map +1 -1
  140. package/dist/templates/droid/index.js +7 -39
  141. package/dist/templates/droid/index.js.map +1 -1
  142. package/dist/templates/droid/settings.json +59 -0
  143. package/dist/templates/extract.d.ts +7 -193
  144. package/dist/templates/extract.d.ts.map +1 -1
  145. package/dist/templates/extract.js +7 -310
  146. package/dist/templates/extract.js.map +1 -1
  147. package/dist/templates/gemini/agents/trellis-check.md +94 -0
  148. package/dist/templates/gemini/agents/trellis-implement.md +94 -0
  149. package/dist/templates/gemini/agents/trellis-research.md +137 -0
  150. package/dist/templates/gemini/index.d.ts +6 -14
  151. package/dist/templates/gemini/index.d.ts.map +1 -1
  152. package/dist/templates/gemini/index.js +6 -37
  153. package/dist/templates/gemini/index.js.map +1 -1
  154. package/dist/templates/gemini/settings.json +28 -0
  155. package/dist/templates/kiro/agents/trellis-check.json +13 -0
  156. package/dist/templates/kiro/agents/trellis-implement.json +13 -0
  157. package/dist/templates/kiro/agents/trellis-research.json +21 -0
  158. package/dist/templates/kiro/index.d.ts +11 -11
  159. package/dist/templates/kiro/index.d.ts.map +1 -1
  160. package/dist/templates/kiro/index.js +11 -33
  161. package/dist/templates/kiro/index.js.map +1 -1
  162. package/dist/templates/opencode/agents/{check.md → trellis-check.md} +3 -30
  163. package/dist/templates/opencode/agents/{implement.md → trellis-implement.md} +1 -1
  164. package/dist/templates/opencode/agents/{research.md → trellis-research.md} +1 -2
  165. package/dist/templates/opencode/plugins/inject-subagent-context.js +18 -190
  166. package/dist/templates/opencode/plugins/inject-workflow-state.js +172 -0
  167. package/dist/templates/opencode/plugins/session-start.js +76 -39
  168. package/dist/templates/qoder/agents/trellis-check.md +94 -0
  169. package/dist/templates/qoder/agents/trellis-implement.md +94 -0
  170. package/dist/templates/qoder/agents/trellis-research.md +137 -0
  171. package/dist/templates/qoder/index.d.ts +7 -10
  172. package/dist/templates/qoder/index.d.ts.map +1 -1
  173. package/dist/templates/qoder/index.js +7 -32
  174. package/dist/templates/qoder/index.js.map +1 -1
  175. package/dist/templates/qoder/settings.json +47 -0
  176. package/dist/templates/shared-hooks/index.d.ts +19 -0
  177. package/dist/templates/shared-hooks/index.d.ts.map +1 -0
  178. package/dist/templates/shared-hooks/index.js +30 -0
  179. package/dist/templates/shared-hooks/index.js.map +1 -0
  180. package/dist/templates/{iflow/hooks → shared-hooks}/inject-subagent-context.py +77 -266
  181. package/dist/templates/shared-hooks/inject-workflow-state.py +244 -0
  182. package/dist/templates/{claude/hooks → shared-hooks}/session-start.py +172 -55
  183. package/dist/templates/template-utils.d.ts +26 -0
  184. package/dist/templates/template-utils.d.ts.map +1 -0
  185. package/dist/templates/template-utils.js +60 -0
  186. package/dist/templates/template-utils.js.map +1 -0
  187. package/dist/templates/trellis/config.yaml +6 -0
  188. package/dist/templates/trellis/index.d.ts +1 -15
  189. package/dist/templates/trellis/index.d.ts.map +1 -1
  190. package/dist/templates/trellis/index.js +2 -29
  191. package/dist/templates/trellis/index.js.map +1 -1
  192. package/dist/templates/trellis/scripts/common/cli_adapter.py +31 -8
  193. package/dist/templates/trellis/scripts/common/config.py +126 -1
  194. package/dist/templates/trellis/scripts/common/git_context.py +25 -2
  195. package/dist/templates/trellis/scripts/common/task_context.py +23 -28
  196. package/dist/templates/trellis/scripts/common/task_store.py +0 -12
  197. package/dist/templates/trellis/scripts/common/types.py +0 -2
  198. package/dist/templates/trellis/scripts/common/workflow_phase.py +176 -0
  199. package/dist/templates/trellis/scripts/task.py +13 -35
  200. package/dist/templates/trellis/workflow.md +283 -298
  201. package/dist/types/ai-tools.d.ts +30 -3
  202. package/dist/types/ai-tools.d.ts.map +1 -1
  203. package/dist/types/ai-tools.js +119 -15
  204. package/dist/types/ai-tools.js.map +1 -1
  205. package/dist/types/migration.d.ts +8 -1
  206. package/dist/types/migration.d.ts.map +1 -1
  207. package/dist/utils/project-detector.d.ts +2 -0
  208. package/dist/utils/project-detector.d.ts.map +1 -1
  209. package/dist/utils/project-detector.js +120 -11
  210. package/dist/utils/project-detector.js.map +1 -1
  211. package/dist/utils/task-json.d.ts +46 -0
  212. package/dist/utils/task-json.d.ts.map +1 -0
  213. package/dist/utils/task-json.js +49 -0
  214. package/dist/utils/task-json.js.map +1 -0
  215. package/package.json +3 -2
  216. package/dist/configurators/iflow.d.ts +0 -33
  217. package/dist/configurators/iflow.d.ts.map +0 -1
  218. package/dist/configurators/iflow.js +0 -99
  219. package/dist/configurators/iflow.js.map +0 -1
  220. package/dist/templates/antigravity/index.d.ts +0 -12
  221. package/dist/templates/antigravity/index.d.ts.map +0 -1
  222. package/dist/templates/antigravity/index.js +0 -29
  223. package/dist/templates/antigravity/index.js.map +0 -1
  224. package/dist/templates/claude/agents/debug.md +0 -106
  225. package/dist/templates/claude/agents/dispatch.md +0 -213
  226. package/dist/templates/claude/agents/plan.md +0 -396
  227. package/dist/templates/claude/agents/research.md +0 -120
  228. package/dist/templates/claude/commands/trellis/brainstorm.md +0 -487
  229. package/dist/templates/claude/commands/trellis/break-loop.md +0 -125
  230. package/dist/templates/claude/commands/trellis/check-cross-layer.md +0 -153
  231. package/dist/templates/claude/commands/trellis/check.md +0 -25
  232. package/dist/templates/claude/commands/trellis/create-command.md +0 -154
  233. package/dist/templates/claude/commands/trellis/finish-work.md +0 -153
  234. package/dist/templates/claude/commands/trellis/integrate-skill.md +0 -219
  235. package/dist/templates/claude/commands/trellis/onboard.md +0 -358
  236. package/dist/templates/claude/commands/trellis/parallel.md +0 -192
  237. package/dist/templates/claude/commands/trellis/record-session.md +0 -62
  238. package/dist/templates/claude/commands/trellis/start.md +0 -393
  239. package/dist/templates/claude/commands/trellis/update-spec.md +0 -354
  240. package/dist/templates/claude/hooks/inject-subagent-context.py +0 -803
  241. package/dist/templates/claude/hooks/ralph-loop.py +0 -396
  242. package/dist/templates/codebuddy/commands/trellis/before-dev.md +0 -29
  243. package/dist/templates/codebuddy/commands/trellis/brainstorm.md +0 -487
  244. package/dist/templates/codebuddy/commands/trellis/break-loop.md +0 -107
  245. package/dist/templates/codebuddy/commands/trellis/check-cross-layer.md +0 -153
  246. package/dist/templates/codebuddy/commands/trellis/check.md +0 -25
  247. package/dist/templates/codebuddy/commands/trellis/create-command.md +0 -154
  248. package/dist/templates/codebuddy/commands/trellis/finish-work.md +0 -143
  249. package/dist/templates/codebuddy/commands/trellis/integrate-skill.md +0 -219
  250. package/dist/templates/codebuddy/commands/trellis/onboard.md +0 -358
  251. package/dist/templates/codebuddy/commands/trellis/record-session.md +0 -61
  252. package/dist/templates/codebuddy/commands/trellis/start.md +0 -373
  253. package/dist/templates/codex/agents/check.toml +0 -23
  254. package/dist/templates/codex/agents/research.toml +0 -26
  255. package/dist/templates/codex/codex-skills/parallel/SKILL.md +0 -194
  256. package/dist/templates/cursor/commands/trellis-before-dev.md +0 -29
  257. package/dist/templates/cursor/commands/trellis-brainstorm.md +0 -487
  258. package/dist/templates/cursor/commands/trellis-break-loop.md +0 -107
  259. package/dist/templates/cursor/commands/trellis-check-cross-layer.md +0 -153
  260. package/dist/templates/cursor/commands/trellis-check.md +0 -25
  261. package/dist/templates/cursor/commands/trellis-create-command.md +0 -154
  262. package/dist/templates/cursor/commands/trellis-finish-work.md +0 -143
  263. package/dist/templates/cursor/commands/trellis-integrate-skill.md +0 -219
  264. package/dist/templates/cursor/commands/trellis-onboard.md +0 -358
  265. package/dist/templates/cursor/commands/trellis-record-session.md +0 -62
  266. package/dist/templates/cursor/commands/trellis-start.md +0 -373
  267. package/dist/templates/cursor/commands/trellis-update-spec.md +0 -354
  268. package/dist/templates/droid/commands/trellis/before-dev.md +0 -33
  269. package/dist/templates/droid/commands/trellis/break-loop.md +0 -111
  270. package/dist/templates/droid/commands/trellis/check-cross-layer.md +0 -157
  271. package/dist/templates/droid/commands/trellis/check.md +0 -29
  272. package/dist/templates/droid/commands/trellis/create-command.md +0 -158
  273. package/dist/templates/droid/commands/trellis/finish-work.md +0 -147
  274. package/dist/templates/droid/commands/trellis/integrate-skill.md +0 -223
  275. package/dist/templates/droid/commands/trellis/onboard.md +0 -362
  276. package/dist/templates/droid/commands/trellis/record-session.md +0 -66
  277. package/dist/templates/droid/commands/trellis/start.md +0 -377
  278. package/dist/templates/droid/commands/trellis/update-spec.md +0 -358
  279. package/dist/templates/gemini/commands/trellis/before-dev.toml +0 -33
  280. package/dist/templates/gemini/commands/trellis/brainstorm.toml +0 -435
  281. package/dist/templates/gemini/commands/trellis/break-loop.toml +0 -129
  282. package/dist/templates/gemini/commands/trellis/check-cross-layer.toml +0 -147
  283. package/dist/templates/gemini/commands/trellis/check.toml +0 -29
  284. package/dist/templates/gemini/commands/trellis/create-command.toml +0 -119
  285. package/dist/templates/gemini/commands/trellis/finish-work.toml +0 -133
  286. package/dist/templates/gemini/commands/trellis/integrate-skill.toml +0 -104
  287. package/dist/templates/gemini/commands/trellis/onboard.toml +0 -111
  288. package/dist/templates/gemini/commands/trellis/record-session.toml +0 -66
  289. package/dist/templates/gemini/commands/trellis/start.toml +0 -354
  290. package/dist/templates/gemini/commands/trellis/update-spec.toml +0 -132
  291. package/dist/templates/iflow/agents/debug.md +0 -106
  292. package/dist/templates/iflow/agents/dispatch.md +0 -213
  293. package/dist/templates/iflow/agents/plan.md +0 -396
  294. package/dist/templates/iflow/agents/research.md +0 -120
  295. package/dist/templates/iflow/commands/trellis/before-dev.md +0 -29
  296. package/dist/templates/iflow/commands/trellis/brainstorm.md +0 -487
  297. package/dist/templates/iflow/commands/trellis/check-cross-layer.md +0 -153
  298. package/dist/templates/iflow/commands/trellis/check.md +0 -25
  299. package/dist/templates/iflow/commands/trellis/create-command.md +0 -152
  300. package/dist/templates/iflow/commands/trellis/finish-work.md +0 -153
  301. package/dist/templates/iflow/commands/trellis/integrate-skill.md +0 -219
  302. package/dist/templates/iflow/commands/trellis/onboard.md +0 -358
  303. package/dist/templates/iflow/commands/trellis/parallel.md +0 -192
  304. package/dist/templates/iflow/commands/trellis/record-session.md +0 -62
  305. package/dist/templates/iflow/commands/trellis/start.md +0 -393
  306. package/dist/templates/iflow/commands/trellis/update-spec.md +0 -354
  307. package/dist/templates/iflow/hooks/ralph-loop.py +0 -395
  308. package/dist/templates/iflow/hooks/session-start.py +0 -403
  309. package/dist/templates/iflow/index.d.ts +0 -54
  310. package/dist/templates/iflow/index.d.ts.map +0 -1
  311. package/dist/templates/iflow/index.js +0 -85
  312. package/dist/templates/iflow/index.js.map +0 -1
  313. package/dist/templates/iflow/settings.json +0 -60
  314. package/dist/templates/kilo/index.d.ts +0 -16
  315. package/dist/templates/kilo/index.d.ts.map +0 -1
  316. package/dist/templates/kilo/index.js +0 -39
  317. package/dist/templates/kilo/index.js.map +0 -1
  318. package/dist/templates/kilo/workflows/before-dev.md +0 -29
  319. package/dist/templates/kilo/workflows/brainstorm.md +0 -487
  320. package/dist/templates/kilo/workflows/break-loop.md +0 -125
  321. package/dist/templates/kilo/workflows/check-cross-layer.md +0 -153
  322. package/dist/templates/kilo/workflows/check.md +0 -25
  323. package/dist/templates/kilo/workflows/create-command.md +0 -152
  324. package/dist/templates/kilo/workflows/finish-work.md +0 -129
  325. package/dist/templates/kilo/workflows/integrate-skill.md +0 -219
  326. package/dist/templates/kilo/workflows/onboard.md +0 -358
  327. package/dist/templates/kilo/workflows/parallel.md +0 -193
  328. package/dist/templates/kilo/workflows/record-session.md +0 -62
  329. package/dist/templates/kilo/workflows/start.md +0 -387
  330. package/dist/templates/kilo/workflows/update-spec.md +0 -285
  331. package/dist/templates/kiro/skills/before-dev/SKILL.md +0 -34
  332. package/dist/templates/kiro/skills/brainstorm/SKILL.md +0 -492
  333. package/dist/templates/kiro/skills/break-loop/SKILL.md +0 -130
  334. package/dist/templates/kiro/skills/check/SKILL.md +0 -30
  335. package/dist/templates/kiro/skills/check-cross-layer/SKILL.md +0 -158
  336. package/dist/templates/kiro/skills/create-command/SKILL.md +0 -101
  337. package/dist/templates/kiro/skills/finish-work/SKILL.md +0 -148
  338. package/dist/templates/kiro/skills/integrate-skill/SKILL.md +0 -221
  339. package/dist/templates/kiro/skills/onboard/SKILL.md +0 -363
  340. package/dist/templates/kiro/skills/record-session/SKILL.md +0 -67
  341. package/dist/templates/kiro/skills/start/SKILL.md +0 -351
  342. package/dist/templates/kiro/skills/update-spec/SKILL.md +0 -335
  343. package/dist/templates/markdown/spec/backend/directory-structure.md +0 -292
  344. package/dist/templates/markdown/spec/backend/index.md +0 -40
  345. package/dist/templates/markdown/spec/backend/script-conventions.md +0 -742
  346. package/dist/templates/markdown/spec/guides/code-reuse-thinking-guide.md +0 -118
  347. package/dist/templates/markdown/spec/guides/cross-platform-thinking-guide.md +0 -394
  348. package/dist/templates/opencode/agents/debug.md +0 -129
  349. package/dist/templates/opencode/agents/dispatch.md +0 -223
  350. package/dist/templates/opencode/agents/trellis-plan.md +0 -427
  351. package/dist/templates/opencode/commands/trellis/before-dev.md +0 -29
  352. package/dist/templates/opencode/commands/trellis/brainstorm.md +0 -487
  353. package/dist/templates/opencode/commands/trellis/break-loop.md +0 -125
  354. package/dist/templates/opencode/commands/trellis/check-cross-layer.md +0 -153
  355. package/dist/templates/opencode/commands/trellis/check.md +0 -25
  356. package/dist/templates/opencode/commands/trellis/create-command.md +0 -154
  357. package/dist/templates/opencode/commands/trellis/finish-work.md +0 -144
  358. package/dist/templates/opencode/commands/trellis/integrate-skill.md +0 -219
  359. package/dist/templates/opencode/commands/trellis/migrate-specs.md +0 -0
  360. package/dist/templates/opencode/commands/trellis/onboard.md +0 -358
  361. package/dist/templates/opencode/commands/trellis/parallel.md +0 -193
  362. package/dist/templates/opencode/commands/trellis/record-session.md +0 -62
  363. package/dist/templates/opencode/commands/trellis/start.md +0 -351
  364. package/dist/templates/opencode/commands/trellis/update-spec.md +0 -354
  365. package/dist/templates/qoder/skills/before-dev/SKILL.md +0 -34
  366. package/dist/templates/qoder/skills/brainstorm/SKILL.md +0 -492
  367. package/dist/templates/qoder/skills/break-loop/SKILL.md +0 -130
  368. package/dist/templates/qoder/skills/check/SKILL.md +0 -30
  369. package/dist/templates/qoder/skills/check-cross-layer/SKILL.md +0 -158
  370. package/dist/templates/qoder/skills/create-command/SKILL.md +0 -101
  371. package/dist/templates/qoder/skills/finish-work/SKILL.md +0 -134
  372. package/dist/templates/qoder/skills/integrate-skill/SKILL.md +0 -221
  373. package/dist/templates/qoder/skills/onboard/SKILL.md +0 -363
  374. package/dist/templates/qoder/skills/record-session/SKILL.md +0 -67
  375. package/dist/templates/qoder/skills/start/SKILL.md +0 -388
  376. package/dist/templates/qoder/skills/update-spec/SKILL.md +0 -290
  377. package/dist/templates/trellis/scripts/common/phase.py +0 -254
  378. package/dist/templates/trellis/scripts/common/registry.py +0 -335
  379. package/dist/templates/trellis/scripts/common/worktree.py +0 -305
  380. package/dist/templates/trellis/scripts/create_bootstrap.py +0 -298
  381. package/dist/templates/trellis/scripts/multi_agent/__init__.py +0 -5
  382. package/dist/templates/trellis/scripts/multi_agent/_bootstrap.py +0 -17
  383. package/dist/templates/trellis/scripts/multi_agent/cleanup.py +0 -398
  384. package/dist/templates/trellis/scripts/multi_agent/create_pr.py +0 -620
  385. package/dist/templates/trellis/scripts/multi_agent/plan.py +0 -213
  386. package/dist/templates/trellis/scripts/multi_agent/start.py +0 -539
  387. package/dist/templates/trellis/scripts/multi_agent/status.py +0 -76
  388. package/dist/templates/trellis/scripts/multi_agent/status_display.py +0 -542
  389. package/dist/templates/trellis/scripts/multi_agent/status_monitor.py +0 -225
  390. package/dist/templates/trellis/scripts-shell-archive/add-session.sh +0 -384
  391. package/dist/templates/trellis/scripts-shell-archive/common/developer.sh +0 -129
  392. package/dist/templates/trellis/scripts-shell-archive/common/git-context.sh +0 -263
  393. package/dist/templates/trellis/scripts-shell-archive/common/paths.sh +0 -208
  394. package/dist/templates/trellis/scripts-shell-archive/common/phase.sh +0 -150
  395. package/dist/templates/trellis/scripts-shell-archive/common/registry.sh +0 -247
  396. package/dist/templates/trellis/scripts-shell-archive/common/task-queue.sh +0 -142
  397. package/dist/templates/trellis/scripts-shell-archive/common/task-utils.sh +0 -151
  398. package/dist/templates/trellis/scripts-shell-archive/common/worktree.sh +0 -128
  399. package/dist/templates/trellis/scripts-shell-archive/create-bootstrap.sh +0 -299
  400. package/dist/templates/trellis/scripts-shell-archive/get-context.sh +0 -7
  401. package/dist/templates/trellis/scripts-shell-archive/get-developer.sh +0 -15
  402. package/dist/templates/trellis/scripts-shell-archive/init-developer.sh +0 -34
  403. package/dist/templates/trellis/scripts-shell-archive/multi-agent/cleanup.sh +0 -396
  404. package/dist/templates/trellis/scripts-shell-archive/multi-agent/create-pr.sh +0 -241
  405. package/dist/templates/trellis/scripts-shell-archive/multi-agent/plan.sh +0 -207
  406. package/dist/templates/trellis/scripts-shell-archive/multi-agent/start.sh +0 -317
  407. package/dist/templates/trellis/scripts-shell-archive/multi-agent/status.sh +0 -828
  408. package/dist/templates/trellis/scripts-shell-archive/task.sh +0 -1204
  409. package/dist/templates/trellis/worktree.yaml +0 -47
  410. package/dist/templates/windsurf/index.d.ts +0 -21
  411. package/dist/templates/windsurf/index.d.ts.map +0 -1
  412. package/dist/templates/windsurf/index.js +0 -44
  413. package/dist/templates/windsurf/index.js.map +0 -1
  414. package/dist/templates/windsurf/workflows/trellis-before-dev.md +0 -31
  415. package/dist/templates/windsurf/workflows/trellis-brainstorm.md +0 -491
  416. package/dist/templates/windsurf/workflows/trellis-break-loop.md +0 -111
  417. package/dist/templates/windsurf/workflows/trellis-check-cross-layer.md +0 -157
  418. package/dist/templates/windsurf/workflows/trellis-check.md +0 -27
  419. package/dist/templates/windsurf/workflows/trellis-create-command.md +0 -154
  420. package/dist/templates/windsurf/workflows/trellis-finish-work.md +0 -147
  421. package/dist/templates/windsurf/workflows/trellis-integrate-skill.md +0 -220
  422. package/dist/templates/windsurf/workflows/trellis-onboard.md +0 -362
  423. package/dist/templates/windsurf/workflows/trellis-record-session.md +0 -66
  424. package/dist/templates/windsurf/workflows/trellis-start.md +0 -373
  425. package/dist/templates/windsurf/workflows/trellis-update-spec.md +0 -358
  426. /package/dist/templates/{claude/commands/trellis → common/skills}/before-dev.md +0 -0
  427. /package/dist/templates/{claude/hooks → shared-hooks}/statusline.py +0 -0
@@ -1,416 +1,401 @@
1
1
  # Development Workflow
2
2
 
3
- > Based on [Effective Harnesses for Long-Running Agents](https://www.anthropic.com/engineering/effective-harnesses-for-long-running-agents)
4
-
5
3
  ---
6
4
 
7
- ## Table of Contents
5
+ ## Core Principles
8
6
 
9
- 1. [Quick Start (Do This First)](#quick-start-do-this-first)
10
- 2. [Workflow Overview](#workflow-overview)
11
- 3. [Session Start Process](#session-start-process)
12
- 4. [Development Process](#development-process)
13
- 5. [Session End](#session-end)
14
- 6. [File Descriptions](#file-descriptions)
15
- 7. [Best Practices](#best-practices)
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
16
12
 
17
13
  ---
18
14
 
19
- ## Quick Start (Do This First)
15
+ ## Trellis System
20
16
 
21
- ### Step 0: Initialize Developer Identity (First Time Only)
17
+ ### Developer Identity
22
18
 
23
- > **Multi-developer support**: Each developer/Agent needs to initialize their identity first
19
+ On first use, initialize your identity:
24
20
 
25
21
  ```bash
26
- # Check if already initialized
27
- python3 ./.trellis/scripts/get_developer.py
28
-
29
- # If not initialized, run:
30
22
  python3 ./.trellis/scripts/init_developer.py <your-name>
31
- # Example: python3 ./.trellis/scripts/init_developer.py cursor-agent
32
23
  ```
33
24
 
34
- This creates:
35
- - `.trellis/.developer` - Your identity file (gitignored, not committed)
36
- - `.trellis/workspace/<your-name>/` - Your personal workspace directory
25
+ Creates `.trellis/.developer` (gitignored) + `.trellis/workspace/<your-name>/`.
37
26
 
38
- **Naming suggestions**:
39
- - Human developers: Use your name, e.g., `john-doe`
40
- - Cursor AI: `cursor-agent` or `cursor-<task>`
41
- - Claude Code: `claude-agent` or `claude-<task>`
42
- - iFlow cli: `iflow-agent` or `iflow-<task>`
27
+ ### Spec System
43
28
 
44
- ### Step 1: Understand Current Context
29
+ `.trellis/spec/` holds coding guidelines organized by package and layer.
45
30
 
46
- ```bash
47
- # Get full context in one command
48
- python3 ./.trellis/scripts/get_context.py
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.
49
33
 
50
- # Or check manually:
51
- python3 ./.trellis/scripts/get_developer.py # Your identity
52
- python3 ./.trellis/scripts/task.py list # Active tasks
53
- git status && git log --oneline -10 # Git state
34
+ ```bash
35
+ python3 ./.trellis/scripts/get_context.py --mode packages # list packages / layers
54
36
  ```
55
37
 
56
- ### Step 2: Read Project Guidelines [MANDATORY]
38
+ **When to update spec**: new pattern/convention found · bug-fix prevention to codify · new technical decision.
57
39
 
58
- **CRITICAL**: Read guidelines before writing any code:
40
+ ### Task System
41
+
42
+ Every task has its own directory under `.trellis/tasks/{MM-DD-name}/` holding `prd.md`, `implement.jsonl`, `check.jsonl`, `task.json`, optional `research/`, `info.md`.
59
43
 
60
44
  ```bash
61
- # Discover available packages and spec layers
62
- python3 ./.trellis/scripts/get_context.py --mode packages
45
+ # Task lifecycle
46
+ python3 ./.trellis/scripts/task.py create "<title>" [--slug <name>] [--parent <dir>]
47
+ python3 ./.trellis/scripts/task.py start <name> # set as current (writes .current-task, triggers after_start hooks)
48
+ python3 ./.trellis/scripts/task.py finish # clear current task (triggers after_finish hooks)
49
+ python3 ./.trellis/scripts/task.py archive <name> # move to archive/{year-month}/
50
+ python3 ./.trellis/scripts/task.py list [--mine] [--status <s>]
51
+ python3 ./.trellis/scripts/task.py list-archive
52
+
53
+ # Code-spec context (injected into implement/check agents via JSONL)
54
+ python3 ./.trellis/scripts/task.py init-context <name> <type> # type: backend|frontend|fullstack|test|docs
55
+ python3 ./.trellis/scripts/task.py add-context <name> <action> <file> <reason>
56
+ python3 ./.trellis/scripts/task.py list-context <name> [action]
57
+ python3 ./.trellis/scripts/task.py validate <name>
58
+
59
+ # Task metadata
60
+ python3 ./.trellis/scripts/task.py set-branch <name> <branch>
61
+ python3 ./.trellis/scripts/task.py set-base-branch <name> <branch> # PR target
62
+ python3 ./.trellis/scripts/task.py set-scope <name> <scope>
63
+
64
+ # Hierarchy (parent/child)
65
+ python3 ./.trellis/scripts/task.py add-subtask <parent> <child>
66
+ python3 ./.trellis/scripts/task.py remove-subtask <parent> <child>
67
+
68
+ # PR creation
69
+ python3 ./.trellis/scripts/task.py create-pr [name] [--dry-run]
70
+ ```
63
71
 
64
- # Read the spec index for each relevant module
65
- cat .trellis/spec/<package>/<layer>/index.md
72
+ > Run `python3 ./.trellis/scripts/task.py --help` to see the authoritative, up-to-date list.
66
73
 
67
- # Always read shared guides
68
- cat .trellis/spec/guides/index.md
69
- ```
74
+ **Current-task mechanism**: `task.py start` writes the task path into `.trellis/.current-task`. Hook-capable platforms auto-inject this at session start, so the AI knows what you're working on without being told.
70
75
 
71
- **Why this matters?**
72
- - Understand which spec layers apply to your task
73
- - Know coding standards for the packages you'll modify
74
- - Learn the overall code quality requirements
76
+ ### Workspace System
75
77
 
76
- ### Step 3: Before Coding - Read Specific Guidelines (Required)
78
+ Records every AI session for cross-session tracking under `.trellis/workspace/<developer>/`.
77
79
 
78
- Based on your task, read the **detailed** guideline files listed in each spec index's **Pre-Development Checklist**:
80
+ - `journal-N.md` session log. **Max 2000 lines per file**; a new `journal-(N+1).md` is auto-created when exceeded.
81
+ - `index.md` — personal index (total sessions, last active).
79
82
 
80
83
  ```bash
81
- # The index points to specific files — read those, not just the index
82
- cat .trellis/spec/<package>/<layer>/error-handling.md
83
- cat .trellis/spec/<package>/<layer>/conventions.md
84
- # etc. — based on what the Pre-Development Checklist lists
84
+ python3 ./.trellis/scripts/add_session.py --title "Title" --commit "hash" --summary "Summary"
85
85
  ```
86
86
 
87
- ---
88
-
89
- ## Workflow Overview
87
+ ### Context Script
90
88
 
91
- ### Core Principles
89
+ ```bash
90
+ python3 ./.trellis/scripts/get_context.py # full session context
91
+ python3 ./.trellis/scripts/get_context.py --mode packages # available packages + spec layers
92
+ python3 ./.trellis/scripts/get_context.py --mode phase --step <X.Y> # detailed guide for a workflow step
93
+ ```
92
94
 
93
- 1. **Read Before Write** - Understand context before starting
94
- 2. **Follow Standards** - [!] **MUST read `.trellis/spec/` guidelines before coding**
95
- 3. **Incremental Development** - Complete one task at a time
96
- 4. **Record Promptly** - Update tracking files immediately after completion
97
- 5. **Document Limits** - [!] **Max 2000 lines per journal document**
95
+ ---
98
96
 
99
- ### File System
97
+ ## Phase Index
100
98
 
101
99
  ```
102
- .trellis/
103
- |-- .developer # Developer identity (gitignored)
104
- |-- scripts/
105
- | |-- __init__.py # Python package init
106
- | |-- common/ # Shared utilities (Python)
107
- | | |-- __init__.py
108
- | | |-- paths.py # Path utilities
109
- | | |-- developer.py # Developer management
110
- | | +-- git_context.py # Git context implementation
111
- | |-- multi_agent/ # Multi-agent pipeline scripts
112
- | | |-- __init__.py
113
- | | |-- start.py # Start worktree agent
114
- | | |-- status.py # Monitor agent status
115
- | | |-- create_pr.py # Create PR
116
- | | +-- cleanup.py # Cleanup worktree
117
- | |-- init_developer.py # Initialize developer identity
118
- | |-- get_developer.py # Get current developer name
119
- | |-- task.py # Manage tasks
120
- | |-- get_context.py # Get session context
121
- | +-- add_session.py # One-click session recording
122
- |-- workspace/ # Developer workspaces
123
- | |-- index.md # Workspace index + Session template
124
- | +-- {developer}/ # Per-developer directories
125
- | |-- index.md # Personal index (with @@@auto markers)
126
- | +-- journal-N.md # Journal files (sequential numbering)
127
- |-- tasks/ # Task tracking
128
- | +-- {MM}-{DD}-{name}/
129
- | +-- task.json
130
- |-- spec/ # [!] MUST READ before coding
131
- | |-- frontend/ # Frontend guidelines (if applicable)
132
- | | |-- index.md # Start here - guidelines index
133
- | | +-- *.md # Topic-specific docs
134
- | |-- backend/ # Backend guidelines (if applicable)
135
- | | |-- index.md # Start here - guidelines index
136
- | | +-- *.md # Topic-specific docs
137
- | +-- guides/ # Thinking guides
138
- | |-- index.md # Guides index
139
- | |-- cross-layer-thinking-guide.md # Pre-implementation checklist
140
- | +-- *.md # Other guides
141
- +-- workflow.md # This document
100
+ Phase 1: Plan → figure out what to do (brainstorm + research → prd.md)
101
+ Phase 2: Execute write code and pass quality checks
102
+ Phase 3: Finish → distill lessons + wrap-up
142
103
  ```
143
104
 
144
- ---
105
+ ### Phase 1: Plan
106
+ - 1.0 Create task `[required · once]`
107
+ - 1.1 Requirement exploration `[required · repeatable]`
108
+ - 1.2 Research `[optional · repeatable]`
109
+ - 1.3 Configure context `[required · once]` — Claude Code, Cursor, OpenCode, Codex, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid
110
+ - 1.4 Completion criteria
145
111
 
146
- ## Session Start Process
112
+ ### Phase 2: Execute
113
+ - 2.1 Implement `[required · repeatable]`
114
+ - 2.2 Quality check `[required · repeatable]`
115
+ - 2.3 Rollback `[on demand]`
147
116
 
148
- ### Step 1: Get Session Context
117
+ ### Phase 3: Finish
118
+ - 3.1 Quality verification `[required · repeatable]`
119
+ - 3.2 Debug retrospective `[on demand]`
120
+ - 3.3 Spec update `[required · once]`
121
+ - 3.4 Wrap-up reminder
149
122
 
150
- Use the unified context script:
123
+ ### Rules
151
124
 
152
- ```bash
153
- # Get all context in one command
154
- python3 ./.trellis/scripts/get_context.py
125
+ 1. Identify which Phase you're in, then continue from the next step there
126
+ 2. Run steps in order inside each Phase; `[required]` steps can't be skipped
127
+ 3. Phases can roll back (e.g., Execute reveals a prd defect → return to Plan to fix, then re-enter Execute)
128
+ 4. Steps tagged `[once]` are skipped if already done; don't re-run
155
129
 
156
- # Or get JSON format
157
- python3 ./.trellis/scripts/get_context.py --json
158
- ```
130
+ ### Skill Routing
159
131
 
160
- ### Step 2: Read Development Guidelines [!] REQUIRED
132
+ When a user request matches one of these intents, load the corresponding skill first — do not skip skills.
161
133
 
162
- **[!] CRITICAL: MUST read guidelines before writing any code**
134
+ | User intent | Skill |
135
+ |---|---|
136
+ | Wants a new feature / requirement unclear | trellis-brainstorm |
137
+ | About to write code / start implementing | trellis-before-dev |
138
+ | Finished writing / want to verify | trellis-check |
139
+ | Stuck / fixed same bug several times | trellis-break-loop |
140
+ | Spec needs update | trellis-update-spec |
163
141
 
164
- Based on what you'll develop, read the corresponding guidelines:
142
+ ### DO NOT skip skills
165
143
 
166
- ```bash
167
- # Discover available packages and spec layers
168
- python3 ./.trellis/scripts/get_context.py --mode packages
144
+ | What you're thinking | Why it's wrong |
145
+ |---|---|
146
+ | "This is simple, just code it" | Simple tasks often grow complex; before-dev takes under a minute |
147
+ | "I already thought it through in plan mode" | Plan-mode output lives in memory — sub-agents can't see it; must be persisted to prd.md |
148
+ | "I already know the spec" | The spec may have been updated since you last read it; read again |
149
+ | "Code first, check later" | `check` surfaces issues you won't notice yourself; earlier is cheaper |
169
150
 
170
- # Read spec indexes for relevant modules
171
- cat .trellis/spec/<package>/<layer>/index.md
151
+ ### Loading Step Detail
172
152
 
173
- # For cross-layer features
174
- cat .trellis/spec/guides/cross-layer-thinking-guide.md
153
+ At each step, run this to fetch detailed guidance:
154
+
155
+ ```bash
156
+ python3 ./.trellis/scripts/get_context.py --mode phase --step <step>
157
+ # e.g. python3 ./.trellis/scripts/get_context.py --mode phase --step 1.1
175
158
  ```
176
159
 
177
- ### Step 3: Select Task to Develop
160
+ ---
178
161
 
179
- Use the task management script:
162
+ ## Phase 1: Plan
180
163
 
181
- ```bash
182
- # List active tasks
183
- python3 ./.trellis/scripts/task.py list
164
+ Goal: figure out what to build, produce a clear requirements doc and the context needed to implement it.
184
165
 
185
- # Create new task (creates directory with task.json)
186
- python3 ./.trellis/scripts/task.py create "<title>" --slug <task-name>
166
+ #### 1.0 Create task `[required · once]`
167
+
168
+ Create the task directory and set it as current:
169
+
170
+ ```bash
171
+ python3 ./.trellis/scripts/task.py create "<task title>" --slug <name>
172
+ python3 ./.trellis/scripts/task.py start <task-dir>
187
173
  ```
188
174
 
189
- ---
175
+ Skip when: `.trellis/.current-task` already points to a task.
190
176
 
191
- ## Development Process
177
+ #### 1.1 Requirement exploration `[required · repeatable]`
192
178
 
193
- ### Task Development Flow
179
+ Load the `trellis-brainstorm` skill and explore requirements interactively with the user per the skill's guidance.
194
180
 
195
- ```
196
- 1. Create or select task
197
- --> python3 ./.trellis/scripts/task.py create "<title>" --slug <name> or list
181
+ The brainstorm skill will guide you to:
182
+ - Ask one question at a time
183
+ - Prefer researching over asking the user
184
+ - Prefer offering options over open-ended questions
185
+ - Update `prd.md` immediately after each user answer
198
186
 
199
- 2. Start task (mark as current)
200
- --> python3 ./.trellis/scripts/task.py start <name>
201
- --> Writes .trellis/.current-task; future sessions see it in <current-state>
187
+ Return to this step whenever requirements change and revise `prd.md`.
202
188
 
203
- 3. Write code according to guidelines
204
- --> Read .trellis/spec/ docs relevant to your task
205
- --> For cross-layer: read .trellis/spec/guides/
189
+ #### 1.2 Research `[optional · repeatable]`
206
190
 
207
- 4. Self-test
208
- --> Run project's lint/test commands (see spec docs)
209
- --> Manual feature testing
191
+ 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.
210
192
 
211
- 5. Commit code
212
- --> git add <files>
213
- --> git commit -m "type(scope): description"
214
- Format: feat/fix/docs/refactor/test/chore
193
+ [Claude Code, Cursor, OpenCode, Codex, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid]
215
194
 
216
- 6. Record session (one command)
217
- --> python3 ./.trellis/scripts/add_session.py --title "Title" --commit "hash"
195
+ Spawn the research sub-agent:
218
196
 
219
- 7. Finish task (clear current)
220
- --> python3 ./.trellis/scripts/task.py finish
221
- --> Only when the task is fully done; otherwise leave it set so the
222
- next session resumes where you left off
223
- ```
197
+ - **Agent type**: `trellis-research`
198
+ - **Task description**: Research <specific question>
199
+ - **Key requirement**: Research output MUST be persisted to `{TASK_DIR}/research/`
224
200
 
225
- ### Code Quality Checklist
201
+ [/Claude Code, Cursor, OpenCode, Codex, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid]
226
202
 
227
- **Must pass before commit**:
228
- - [OK] Lint checks pass (project-specific command)
229
- - [OK] Type checks pass (if applicable)
230
- - [OK] Manual feature testing passes
203
+ [Kilo, Antigravity, Windsurf]
231
204
 
232
- **Project-specific checks**:
233
- - See `.trellis/spec/<package>/<layer>/quality-guidelines.md` for package-specific checks
205
+ Do the research in the main session directly and write findings into `{TASK_DIR}/research/`.
234
206
 
235
- ---
207
+ [/Kilo, Antigravity, Windsurf]
208
+
209
+ **Research artifact conventions**:
210
+ - One file per research topic (e.g. `research/auth-library-comparison.md`)
211
+ - Record third-party library usage examples, API references, version constraints in files
212
+ - Note relevant spec file paths you discovered for later reference
213
+
214
+ Brainstorm and research can interleave freely — pause to research a technical question, then return to talk with the user.
215
+
216
+ **Key principle**: Research output must be written to files, not left only in the chat. Conversations get compacted; files don't.
217
+
218
+ #### 1.3 Configure context `[required · once]`
236
219
 
237
- ## Session End
220
+ [Claude Code, Cursor, OpenCode, Codex, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid]
238
221
 
239
- ### One-Click Session Recording
222
+ Once research output is solid, initialize the agent context files:
240
223
 
241
- After code is committed, use:
224
+ ```bash
225
+ python3 ./.trellis/scripts/task.py init-context "$TASK_DIR" <type> --platform <platform>
226
+ # type: backend | frontend | fullstack
227
+ # platform: claude | codex | cursor | kiro | gemini | opencode | qoder | codebuddy | copilot | droid
228
+ ```
229
+
230
+ `--platform` is auto-filled by per-platform skills/commands (via `{{CLI_FLAG}}` substitution). Specify it explicitly only for CLI-direct invocations; otherwise the script falls back to filesystem auto-detection, which can misfire on multi-platform setups.
231
+
232
+ Skip when: `implement.jsonl` already exists.
233
+
234
+ Append any extra spec files or code patterns you find `[optional · repeatable]`:
242
235
 
243
236
  ```bash
244
- python3 ./.trellis/scripts/add_session.py \
245
- --title "Session Title" \
246
- --commit "abc1234" \
247
- --summary "Brief summary"
237
+ python3 ./.trellis/scripts/task.py add-context "$TASK_DIR" implement "<path>" "<reason>"
238
+ python3 ./.trellis/scripts/task.py add-context "$TASK_DIR" check "<path>" "<reason>"
248
239
  ```
249
240
 
250
- This automatically:
251
- 1. Detects current journal file
252
- 2. Creates new file if 2000-line limit exceeded
253
- 3. Appends session content
254
- 4. Updates index.md (sessions count, history table)
241
+ These jsonl files are auto-injected into sub-agent prompts during Phase 2 via hook.
242
+
243
+ [/Claude Code, Cursor, OpenCode, Codex, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid]
244
+
245
+ [Kilo, Antigravity, Windsurf]
246
+
247
+ Skip this step. Context is loaded directly by the `trellis-before-dev` skill in Phase 2.
255
248
 
256
- ### Pre-end Checklist
249
+ [/Kilo, Antigravity, Windsurf]
257
250
 
258
- Use `/trellis:finish-work` command to run through:
259
- 1. [OK] All code committed, commit message follows convention
260
- 2. [OK] Session recorded via `add_session.py`
261
- 3. [OK] No lint/test errors
262
- 4. [OK] Working directory clean (or WIP noted)
263
- 5. [OK] Spec docs updated if needed
251
+ #### 1.4 Completion criteria
252
+
253
+ | Condition | Required |
254
+ |------|:---:|
255
+ | `prd.md` exists | |
256
+ | User confirms requirements | |
257
+ | `research/` has artifacts (complex tasks) | recommended |
258
+ | `info.md` technical design (complex tasks) | optional |
259
+
260
+ [Claude Code, Cursor, OpenCode, Codex, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid]
261
+
262
+ | `implement.jsonl` exists | ✅ |
263
+
264
+ [/Claude Code, Cursor, OpenCode, Codex, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid]
264
265
 
265
266
  ---
266
267
 
267
- ## File Descriptions
268
+ ## Phase 2: Execute
268
269
 
269
- ### 1. workspace/ - Developer Workspaces
270
+ Goal: turn the prd into code that passes quality checks.
270
271
 
271
- **Purpose**: Record each AI Agent session's work content
272
+ #### 2.1 Implement `[required · repeatable]`
272
273
 
273
- **Structure** (Multi-developer support):
274
- ```
275
- workspace/
276
- |-- index.md # Main index (Active Developers table)
277
- +-- {developer}/ # Per-developer directory
278
- |-- index.md # Personal index (with @@@auto markers)
279
- +-- journal-N.md # Journal files (sequential: 1, 2, 3...)
280
- ```
274
+ [Claude Code, Cursor, OpenCode, Codex, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid]
281
275
 
282
- **When to update**:
283
- - [OK] End of each session
284
- - [OK] Complete important task
285
- - [OK] Fix important bug
276
+ Spawn the implement sub-agent:
286
277
 
287
- ### 2. spec/ - Development Guidelines
278
+ - **Agent type**: `trellis-implement`
279
+ - **Task description**: Implement the requirements per prd.md, consulting materials under `{TASK_DIR}/research/`; finish by running project lint and type-check
288
280
 
289
- **Purpose**: Documented standards for consistent development
281
+ The platform hook auto-handles:
282
+ - Reads `implement.jsonl` and injects the referenced spec files into the agent prompt
283
+ - Injects prd.md content
290
284
 
291
- **Structure** (Multi-doc format):
292
- ```
293
- spec/
294
- |-- frontend/ # Frontend docs (if applicable)
295
- | |-- index.md # Start here
296
- | +-- *.md # Topic-specific docs
297
- |-- backend/ # Backend docs (if applicable)
298
- | |-- index.md # Start here
299
- | +-- *.md # Topic-specific docs
300
- +-- guides/ # Thinking guides
301
- |-- index.md # Start here
302
- +-- *.md # Guide-specific docs
303
- ```
285
+ [/Claude Code, Cursor, OpenCode, Codex, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid]
304
286
 
305
- **When to update**:
306
- - [OK] New pattern discovered
307
- - [OK] Bug fixed that reveals missing guidance
308
- - [OK] New convention established
287
+ [Kilo, Antigravity, Windsurf]
309
288
 
310
- ### 3. Tasks - Task Tracking
289
+ 1. Load the `trellis-before-dev` skill to read project guidelines
290
+ 2. Read `{TASK_DIR}/prd.md` for requirements
291
+ 3. Consult materials under `{TASK_DIR}/research/`
292
+ 4. Implement the code per requirements
293
+ 5. Run project lint and type-check
311
294
 
312
- Each task is a directory containing `task.json`:
295
+ [/Kilo, Antigravity, Windsurf]
313
296
 
314
- ```
315
- tasks/
316
- |-- 01-21-my-task/
317
- | +-- task.json
318
- +-- archive/
319
- +-- 2026-01/
320
- +-- 01-15-old-task/
321
- +-- task.json
322
- ```
297
+ #### 2.2 Quality check `[required · repeatable]`
323
298
 
324
- **Commands**:
325
- ```bash
326
- python3 ./.trellis/scripts/task.py create "<title>" [--slug <name>] # Create task directory
327
- python3 ./.trellis/scripts/task.py start <name> # Set as current task (writes .current-task, triggers after_start hooks)
328
- python3 ./.trellis/scripts/task.py finish # Clear current task (triggers after_finish hooks)
329
- python3 ./.trellis/scripts/task.py archive <name> # Archive to archive/{year-month}/
330
- python3 ./.trellis/scripts/task.py list # List active tasks
331
- python3 ./.trellis/scripts/task.py list-archive # List archived tasks
332
- ```
299
+ [Claude Code, Cursor, OpenCode, Codex, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid]
333
300
 
334
- **Current task mechanism**: `task.py start <name>` writes the selected task path to `.trellis/.current-task`. The SessionStart hook reads this file to inject `## CURRENT TASK` into every new session's context, so the AI immediately knows what you're working on without being told. Run `task.py finish` when you're done — subsequent sessions will show `(none)` until you start another task.
301
+ Spawn the check sub-agent:
335
302
 
336
- ---
303
+ - **Agent type**: `trellis-check`
304
+ - **Task description**: Review all code changes against spec and prd; fix any findings directly; ensure lint and type-check pass
305
+
306
+ The check agent's job:
307
+ - Review code changes against specs
308
+ - Auto-fix issues it finds
309
+ - Run lint and typecheck to verify
337
310
 
338
- ## Best Practices
311
+ [/Claude Code, Cursor, OpenCode, Codex, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid]
339
312
 
340
- ### [OK] DO - Should Do
313
+ [Kilo, Antigravity, Windsurf]
341
314
 
342
- 1. **Before session start**:
343
- - Run `python3 ./.trellis/scripts/get_context.py` for full context
344
- - [!] **MUST read** relevant `.trellis/spec/` docs
315
+ Load the `trellis-check` skill and verify the code per its guidance:
316
+ - Spec compliance
317
+ - lint / type-check / tests
318
+ - Cross-layer consistency (when changes span layers)
345
319
 
346
- 2. **During development**:
347
- - [!] **Follow** `.trellis/spec/` guidelines
348
- - For cross-layer features, use `/trellis:check-cross-layer`
349
- - Develop only one task at a time
350
- - Run lint and tests frequently
320
+ If issues are found → fix → re-check, until green.
351
321
 
352
- 3. **After development complete**:
353
- - Use `/trellis:finish-work` for completion checklist
354
- - After fix bug, use `/trellis:break-loop` for deep analysis
355
- - Human commits after testing passes
356
- - Use `add_session.py` to record progress
322
+ [/Kilo, Antigravity, Windsurf]
357
323
 
358
- ### [X] DON'T - Should Not Do
324
+ #### 2.3 Rollback `[on demand]`
359
325
 
360
- 1. [!] **Don't** skip reading `.trellis/spec/` guidelines
361
- 2. [!] **Don't** let journal single file exceed 2000 lines
362
- 3. **Don't** develop multiple unrelated tasks simultaneously
363
- 4. **Don't** commit code with lint/test errors
364
- 5. **Don't** forget to update spec docs after learning something
365
- 6. [!] **Don't** execute `git commit` - AI should not commit code
326
+ - `check` reveals a prd defect → return to Phase 1, fix `prd.md`, then redo 2.1
327
+ - Implementation went wrong revert code, redo 2.1
328
+ - Need more research research (same as Phase 1.2), write findings into `research/`
366
329
 
367
330
  ---
368
331
 
369
- ## Quick Reference
332
+ ## Phase 3: Finish
370
333
 
371
- ### Must-read Before Development
334
+ Goal: ensure code quality, capture lessons, record the work.
372
335
 
373
- | Task Type | Must-read Document |
374
- |-----------|-------------------|
375
- | Frontend work | `frontend/index.md` → relevant docs |
376
- | Backend work | `backend/index.md` → relevant docs |
377
- | Cross-Layer Feature | `guides/cross-layer-thinking-guide.md` |
336
+ #### 3.1 Quality verification `[required · repeatable]`
378
337
 
379
- ### Commit Convention
338
+ Load the `trellis-check` skill and do a final verification:
339
+ - Spec compliance
340
+ - lint / type-check / tests
341
+ - Cross-layer consistency (when changes span layers)
380
342
 
381
- ```bash
382
- git commit -m "type(scope): description"
383
- ```
343
+ If issues are found → fix → re-check, until green.
384
344
 
385
- **Type**: feat, fix, docs, refactor, test, chore
386
- **Scope**: Module name (e.g., auth, api, ui)
345
+ #### 3.2 Debug retrospective `[on demand]`
387
346
 
388
- ### Common Commands
347
+ If this task involved repeated debugging (the same issue was fixed multiple times), load the `trellis-break-loop` skill to:
348
+ - Classify the root cause
349
+ - Explain why earlier fixes failed
350
+ - Propose prevention
389
351
 
390
- ```bash
391
- # Session management
392
- python3 ./.trellis/scripts/get_context.py # Get full context
393
- python3 ./.trellis/scripts/add_session.py # Record session
394
-
395
- # Task management
396
- python3 ./.trellis/scripts/task.py list # List tasks
397
- python3 ./.trellis/scripts/task.py create "<title>" # Create task
398
-
399
- # Slash commands
400
- /trellis:finish-work # Pre-commit checklist
401
- /trellis:break-loop # Post-debug analysis
402
- /trellis:check-cross-layer # Cross-layer verification
403
- ```
352
+ The goal is to capture debugging lessons so the same class of issue doesn't recur.
404
353
 
405
- ---
354
+ #### 3.3 Spec update `[required · once]`
355
+
356
+ Load the `trellis-update-spec` skill and review whether this task produced new knowledge worth recording:
357
+ - Newly discovered patterns or conventions
358
+ - Pitfalls you hit
359
+ - New technical decisions
406
360
 
407
- ## Summary
361
+ Update the docs under `.trellis/spec/` accordingly. Even if the conclusion is "nothing to update", walk through the judgment.
408
362
 
409
- Following this workflow ensures:
410
- - [OK] Continuity across multiple sessions
411
- - [OK] Consistent code quality
412
- - [OK] Trackable progress
413
- - [OK] Knowledge accumulation in spec docs
414
- - [OK] Transparent team collaboration
363
+ #### 3.4 Wrap-up reminder
364
+
365
+ After the above, remind the user they can run `/finish-work` to wrap up (archive the task, record the session).
366
+
367
+ ---
415
368
 
416
- **Core Philosophy**: Read before write, follow standards, record promptly, capture learnings
369
+ ## Workflow State Breadcrumbs
370
+
371
+ <!-- Injected per-turn by UserPromptSubmit hook (inject-workflow-state.py).
372
+ Edit the text inside each [workflow-state:STATUS]...[/workflow-state:STATUS]
373
+ block to customize per-task-status flow reminders. Users who fork the
374
+ Trellis workflow only need to edit this file, not the hook script.
375
+
376
+ Tag STATUS matches task.json.status. Default statuses: planning /
377
+ in_progress / completed. Add custom status blocks as needed (hyphens
378
+ and underscores allowed). Hook falls back to built-in defaults when
379
+ a status has no tag block. -->
380
+
381
+ [workflow-state:no_task]
382
+ No active task.
383
+ Trigger words in the user message that REQUIRE creating a task (non-negotiable, do NOT self-exempt): 重构 / 抽成 / 独立 / 分发 / 拆出来 / 搞一个 / 做成 / 接入 / 集成 / refactor / rewrite / extract / productize / publish / build X / design Y.
384
+ Task is NOT required ONLY if ALL three hold: (a) zero file writes this turn, (b) answer fits in one reply with no multi-round plan, (c) no research beyond reading 1-2 repo files.
385
+ When in doubt: create task. Over-tasking is cheap; under-tasking leaks plans and research into main context.
386
+ Flow: load `trellis-brainstorm` skill → it creates the task via `python3 ./.trellis/scripts/task.py create` and drives requirements Q&A. For research-heavy work (tool comparison, docs, cross-platform survey), spawn `trellis-research` sub-agents via Task tool — NEVER do 3+ inline WebFetch/WebSearch/`gh api` calls in the main conversation.
387
+ [/workflow-state:no_task]
388
+
389
+ [workflow-state:planning]
390
+ Complete prd.md via trellis-brainstorm skill; then run task.py start.
391
+ Research belongs in `{task_dir}/research/*.md`, written by `trellis-research` sub-agents. Do NOT inline WebFetch/WebSearch in main session — PRD only links to research files.
392
+ [/workflow-state:planning]
393
+
394
+ [workflow-state:in_progress]
395
+ Flow: trellis-implement → trellis-check → trellis-update-spec → finish
396
+ Check conversation history + git status to determine current step; do NOT skip trellis-check.
397
+ [/workflow-state:in_progress]
398
+
399
+ [workflow-state:completed]
400
+ User commits changes; then run task.py archive.
401
+ [/workflow-state:completed]