@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
@@ -12,6 +12,7 @@ import { DIR_NAMES, FILE_NAMES, PATHS } from "../constants/paths.js";
12
12
  import { VERSION } from "../constants/version.js";
13
13
  import { agentsMdContent } from "../templates/markdown/index.js";
14
14
  import { setWriteMode, writeFile, } from "../utils/file-writer.js";
15
+ import { emptyTaskJson } from "../utils/task-json.js";
15
16
  import { detectProjectType, detectMonorepo, sanitizePkgName, } from "../utils/project-detector.js";
16
17
  import { initializeHashes } from "../utils/template-hash.js";
17
18
  import { fetchTemplateIndex, probeRegistryIndex, downloadTemplateById, downloadRegistryDirect, parseRegistrySource, TIMEOUTS, TEMPLATE_INDEX_URL, } from "../utils/template-fetcher.js";
@@ -65,29 +66,120 @@ function getPythonCommand() {
65
66
  // Bootstrap Task Creation
66
67
  // =============================================================================
67
68
  const BOOTSTRAP_TASK_NAME = "00-bootstrap-guidelines";
69
+ /**
70
+ * Slugify a developer name for safe use in task directory names.
71
+ *
72
+ * Unlike `sanitizePkgName` (which only strips npm @scope/ prefixes), this
73
+ * handles arbitrary developer input: spaces, Unicode letters, punctuation,
74
+ * path separators. Returns "user" fallback when input slugifies to empty.
75
+ *
76
+ * Exported for unit testing; not part of the public API.
77
+ */
78
+ export function slugifyDeveloperName(name) {
79
+ const slug = name
80
+ .toLowerCase()
81
+ .normalize("NFKD")
82
+ .replace(/[^\p{Letter}\p{Number}]+/gu, "-")
83
+ .replace(/^-+|-+$/g, "");
84
+ return slug || "user";
85
+ }
86
+ /**
87
+ * Write a task skeleton (task.json + prd.md + .current-task pointer).
88
+ *
89
+ * Idempotent: if the task dir already exists, returns true without touching
90
+ * anything. Shared by both creator bootstrap and joiner onboarding flows.
91
+ */
92
+ function writeTaskSkeleton(cwd, taskName, taskJson, prdContent) {
93
+ const taskDir = path.join(cwd, PATHS.TASKS, taskName);
94
+ if (fs.existsSync(taskDir))
95
+ return true; // idempotent
96
+ try {
97
+ fs.mkdirSync(taskDir, { recursive: true });
98
+ fs.writeFileSync(path.join(taskDir, FILE_NAMES.TASK_JSON), JSON.stringify(taskJson, null, 2), "utf-8");
99
+ fs.writeFileSync(path.join(taskDir, FILE_NAMES.PRD), prdContent, "utf-8");
100
+ fs.writeFileSync(path.join(cwd, PATHS.CURRENT_TASK_FILE), `${PATHS.TASKS}/${taskName}`, "utf-8");
101
+ return true;
102
+ }
103
+ catch {
104
+ return false;
105
+ }
106
+ }
107
+ /**
108
+ * Compute the bootstrap checklist items (previously stored as structured
109
+ * `subtasks: [{name, status}]` in task.json). Per task 04-21-task-schema-unify
110
+ * (D1), these live as markdown `- [ ]` items in prd.md instead, so task.json
111
+ * stays canonical with `subtasks: string[]` (child task dir names, same as
112
+ * task_store.py).
113
+ */
114
+ function getBootstrapChecklistItems(projectType, packages) {
115
+ if (packages && packages.length > 0) {
116
+ const items = packages.map((pkg) => `Fill guidelines for ${pkg.name}`);
117
+ items.push("Add code examples");
118
+ return items;
119
+ }
120
+ if (projectType === "frontend") {
121
+ return ["Fill frontend guidelines", "Add code examples"];
122
+ }
123
+ if (projectType === "backend") {
124
+ return ["Fill backend guidelines", "Add code examples"];
125
+ }
126
+ return [
127
+ "Fill backend guidelines",
128
+ "Fill frontend guidelines",
129
+ "Add code examples",
130
+ ];
131
+ }
132
+ function getBootstrapRelatedFiles(projectType, packages) {
133
+ if (packages && packages.length > 0) {
134
+ return packages.map((pkg) => `.trellis/spec/${sanitizePkgName(pkg.name)}/`);
135
+ }
136
+ if (projectType === "frontend") {
137
+ return [".trellis/spec/frontend/"];
138
+ }
139
+ if (projectType === "backend") {
140
+ return [".trellis/spec/backend/"];
141
+ }
142
+ return [".trellis/spec/backend/", ".trellis/spec/frontend/"];
143
+ }
68
144
  function getBootstrapPrdContent(projectType, packages) {
69
- const header = `# Bootstrap: Fill Project Development Guidelines
145
+ const checklistItems = getBootstrapChecklistItems(projectType, packages);
146
+ const checklistMarkdown = checklistItems
147
+ .map((item) => `- [ ] ${item}`)
148
+ .join("\n");
149
+ const header = `# Bootstrap Task: Fill Project Development Guidelines
70
150
 
71
- ## Purpose
151
+ **You (the AI) are running this task. The developer does not read this file.**
72
152
 
73
- Welcome to Trellis! This is your first task.
153
+ The developer just ran \`trellis init\` on this project for the first time.
154
+ \`.trellis/\` now exists with empty spec scaffolding, and this task has been
155
+ set as their current task. They'll open their AI tool, run \`/trellis:continue\`,
156
+ and you'll land here.
74
157
 
75
- AI agents use \`.trellis/spec/\` to understand YOUR project's coding conventions.
76
- **Starting from scratch = AI writes generic code that doesn't match your project style.**
158
+ **Your job**: help them populate \`.trellis/spec/\` with the team's real
159
+ coding conventions. Every future AI session this project's
160
+ \`trellis-implement\` and \`trellis-check\` sub-agents — auto-loads spec files
161
+ listed in per-task jsonl manifests. Empty spec = sub-agents write generic
162
+ code. Real spec = sub-agents match the team's actual patterns.
77
163
 
78
- Filling these guidelines is a one-time setup that pays off for every future AI session.
164
+ Don't dump instructions. Open with a short greeting, figure out if the repo
165
+ has any existing convention docs (CLAUDE.md, .cursorrules, etc.), and drive
166
+ the rest conversationally.
79
167
 
80
168
  ---
81
169
 
82
- ## Your Task
170
+ ## Status (update the checkboxes as you complete each item)
171
+
172
+ ${checklistMarkdown}
173
+
174
+ ---
83
175
 
84
- Fill in the guideline files based on your **existing codebase**.
176
+ ## Spec files to populate
85
177
  `;
86
178
  const backendSection = `
87
179
 
88
- ### Backend Guidelines
180
+ ### Backend guidelines
89
181
 
90
- | File | What to Document |
182
+ | File | What to document |
91
183
  |------|------------------|
92
184
  | \`.trellis/spec/backend/directory-structure.md\` | Where different file types go (routes, services, utils) |
93
185
  | \`.trellis/spec/backend/database-guidelines.md\` | ORM, migrations, query patterns, naming conventions |
@@ -97,9 +189,9 @@ Fill in the guideline files based on your **existing codebase**.
97
189
  `;
98
190
  const frontendSection = `
99
191
 
100
- ### Frontend Guidelines
192
+ ### Frontend guidelines
101
193
 
102
- | File | What to Document |
194
+ | File | What to document |
103
195
  |------|------------------|
104
196
  | \`.trellis/spec/frontend/directory-structure.md\` | Component/page/hook organization |
105
197
  | \`.trellis/spec/frontend/component-guidelines.md\` | Component patterns, props conventions |
@@ -110,18 +202,20 @@ Fill in the guideline files based on your **existing codebase**.
110
202
  `;
111
203
  const footer = `
112
204
 
113
- ### Thinking Guides (Optional)
205
+ ### Thinking guides (already populated)
114
206
 
115
- The \`.trellis/spec/guides/\` directory contains thinking guides that are already
116
- filled with general best practices. You can customize them for your project if needed.
207
+ \`.trellis/spec/guides/\` contains general thinking guides pre-filled with
208
+ best practices. Customize only if something clearly doesn't fit this project.
117
209
 
118
210
  ---
119
211
 
120
- ## How to Fill Guidelines
212
+ ## How to fill the spec
121
213
 
122
- ### Step 0: Import from Existing Specs (Recommended)
214
+ ### Step 1: Import from existing convention files first (preferred)
123
215
 
124
- Many projects already have coding conventions documented. **Check these first** before writing from scratch:
216
+ Search the repo for existing convention docs. If any exist, read them and
217
+ extract the relevant rules into the matching \`.trellis/spec/\` files —
218
+ usually much faster than documenting from scratch.
125
219
 
126
220
  | File / Directory | Tool |
127
221
  |------|------|
@@ -138,50 +232,60 @@ Many projects already have coding conventions documented. **Check these first**
138
232
  | \`CONTRIBUTING.md\` | General project conventions |
139
233
  | \`.editorconfig\` | Editor formatting rules |
140
234
 
141
- If any of these exist, read them first and extract the relevant coding conventions into the corresponding \`.trellis/spec/\` files. This saves significant effort compared to writing everything from scratch.
235
+ ### Step 2: Analyze the codebase for anything not covered by existing docs
142
236
 
143
- ### Step 1: Analyze the Codebase
237
+ Scan real code to discover patterns. Before writing each spec file:
238
+ - Find 2-3 real examples of each pattern in the codebase.
239
+ - Reference real file paths (not hypothetical ones).
240
+ - Document anti-patterns the team clearly avoids.
144
241
 
145
- Ask AI to help discover patterns from actual code:
242
+ ### Step 3: Document reality, not ideals
146
243
 
147
- - "Read all existing config files (CLAUDE.md, .cursorrules, etc.) and extract coding conventions into .trellis/spec/"
148
- - "Analyze my codebase and document the patterns you see"
149
- - "Find error handling / component / API patterns and document them"
244
+ **Critical**: write what the code *actually does*, not what it should do.
245
+ Sub-agents match the spec, so aspirational patterns that don't exist in the
246
+ codebase will cause sub-agents to write code that looks out of place.
150
247
 
151
- ### Step 2: Document Reality, Not Ideals
248
+ If the team has known tech debt, document the current state — improvement
249
+ is a separate conversation, not a bootstrap concern.
152
250
 
153
- Write what your codebase **actually does**, not what you wish it did.
154
- AI needs to match existing patterns, not introduce new ones.
251
+ ---
155
252
 
156
- - **Look at existing code** - Find 2-3 examples of each pattern
157
- - **Include file paths** - Reference real files as examples
158
- - **List anti-patterns** - What does your team avoid?
253
+ ## Quick explainer of the runtime (share when they ask "why do we need spec at all")
159
254
 
160
- ---
255
+ - Every AI coding task spawns two sub-agents: \`trellis-implement\` (writes
256
+ code) and \`trellis-check\` (verifies quality).
257
+ - Each task has \`implement.jsonl\` / \`check.jsonl\` manifests listing which
258
+ spec files to load.
259
+ - The platform hook auto-injects those spec files + the task's \`prd.md\`
260
+ into every sub-agent prompt, so the sub-agent codes/reviews per team
261
+ conventions without anyone pasting them manually.
262
+ - Source of truth: \`.trellis/spec/\`. That's why filling it well now pays
263
+ off forever.
161
264
 
162
- ## Completion Checklist
265
+ ---
163
266
 
164
- - [ ] Guidelines filled for your project type
165
- - [ ] At least 2-3 real code examples in each guideline
166
- - [ ] Anti-patterns documented
267
+ ## Completion
167
268
 
168
- When done:
269
+ When the developer confirms the checklist items above are done with real
270
+ examples (not placeholders), guide them to run:
169
271
 
170
272
  \`\`\`bash
171
273
  python3 ./.trellis/scripts/task.py finish
172
274
  python3 ./.trellis/scripts/task.py archive 00-bootstrap-guidelines
173
275
  \`\`\`
174
276
 
175
- ---
277
+ After archive, every new developer who joins this project will get a
278
+ \`00-join-<slug>\` onboarding task instead of this bootstrap task.
176
279
 
177
- ## Why This Matters
280
+ ---
178
281
 
179
- After completing this task:
282
+ ## Suggested opening line
180
283
 
181
- 1. AI will write code that matches your project style
182
- 2. Relevant \`/trellis:before-*-dev\` commands will inject real context
183
- 3. \`/trellis:check-*\` commands will validate against your actual standards
184
- 4. Future developers (human or AI) will onboard faster
284
+ "Welcome to Trellis! Your init just set me up to help you fill the project
285
+ spec a one-time setup so every future AI session follows the team's
286
+ conventions instead of writing generic code. Before we start, do you have
287
+ any existing convention docs (CLAUDE.md, .cursorrules, CONTRIBUTING.md,
288
+ etc.) I can pull from, or should I scan the codebase from scratch?"
185
289
  `;
186
290
  let content = header;
187
291
  if (packages && packages.length > 0) {
@@ -214,43 +318,15 @@ After completing this task:
214
318
  }
215
319
  function getBootstrapTaskJson(developer, projectType, packages) {
216
320
  const today = new Date().toISOString().split("T")[0];
217
- let subtasks;
218
- let relatedFiles;
219
- if (packages && packages.length > 0) {
220
- // Monorepo: subtask per package
221
- subtasks = packages.map((pkg) => ({
222
- name: `Fill guidelines for ${pkg.name}`,
223
- status: "pending",
224
- }));
225
- subtasks.push({ name: "Add code examples", status: "pending" });
226
- relatedFiles = packages.map((pkg) => `.trellis/spec/${sanitizePkgName(pkg.name)}/`);
227
- }
228
- else if (projectType === "frontend") {
229
- subtasks = [
230
- { name: "Fill frontend guidelines", status: "pending" },
231
- { name: "Add code examples", status: "pending" },
232
- ];
233
- relatedFiles = [".trellis/spec/frontend/"];
234
- }
235
- else if (projectType === "backend") {
236
- subtasks = [
237
- { name: "Fill backend guidelines", status: "pending" },
238
- { name: "Add code examples", status: "pending" },
239
- ];
240
- relatedFiles = [".trellis/spec/backend/"];
241
- }
242
- else {
243
- // fullstack
244
- subtasks = [
245
- { name: "Fill backend guidelines", status: "pending" },
246
- { name: "Fill frontend guidelines", status: "pending" },
247
- { name: "Add code examples", status: "pending" },
248
- ];
249
- relatedFiles = [".trellis/spec/backend/", ".trellis/spec/frontend/"];
250
- }
251
- return {
321
+ const relatedFiles = getBootstrapRelatedFiles(projectType, packages);
322
+ // Canonical 24-field shape via emptyTaskJson factory.
323
+ // Checklist items (previously stored as structured `subtasks`) are now
324
+ // rendered as `- [ ]` items in prd.md; task.json.subtasks is always
325
+ // string[] (child task dir names) per the canonical schema.
326
+ return emptyTaskJson({
252
327
  id: BOOTSTRAP_TASK_NAME,
253
- name: "Bootstrap Guidelines",
328
+ name: BOOTSTRAP_TASK_NAME,
329
+ title: "Bootstrap Guidelines",
254
330
  description: "Fill in project development guidelines for AI agents",
255
331
  status: "in_progress",
256
332
  dev_type: "docs",
@@ -258,43 +334,166 @@ function getBootstrapTaskJson(developer, projectType, packages) {
258
334
  creator: developer,
259
335
  assignee: developer,
260
336
  createdAt: today,
261
- completedAt: null,
262
- commit: null,
263
- subtasks,
264
- children: [],
265
- parent: null,
266
337
  relatedFiles,
267
338
  notes: `First-time setup task created by trellis init (${projectType} project)`,
268
- meta: {},
269
- };
339
+ });
270
340
  }
271
341
  /**
272
342
  * Create bootstrap task for first-time setup
273
343
  */
274
344
  function createBootstrapTask(cwd, developer, projectType, packages) {
275
- const taskDir = path.join(cwd, PATHS.TASKS, BOOTSTRAP_TASK_NAME);
276
- const taskRelativePath = `${PATHS.TASKS}/${BOOTSTRAP_TASK_NAME}`;
277
- // Check if already exists
278
- if (fs.existsSync(taskDir)) {
279
- return true; // Already exists, not an error
280
- }
281
- try {
282
- // Create task directory
283
- fs.mkdirSync(taskDir, { recursive: true });
284
- // Write task.json
285
- const taskJson = getBootstrapTaskJson(developer, projectType, packages);
286
- fs.writeFileSync(path.join(taskDir, FILE_NAMES.TASK_JSON), JSON.stringify(taskJson, null, 2), "utf-8");
287
- // Write prd.md
288
- const prdContent = getBootstrapPrdContent(projectType, packages);
289
- fs.writeFileSync(path.join(taskDir, FILE_NAMES.PRD), prdContent, "utf-8");
290
- // Set as current task
291
- const currentTaskFile = path.join(cwd, PATHS.CURRENT_TASK_FILE);
292
- fs.writeFileSync(currentTaskFile, taskRelativePath, "utf-8");
293
- return true;
294
- }
295
- catch {
296
- return false;
297
- }
345
+ const taskJson = getBootstrapTaskJson(developer, projectType, packages);
346
+ const prdContent = getBootstrapPrdContent(projectType, packages);
347
+ return writeTaskSkeleton(cwd, BOOTSTRAP_TASK_NAME, taskJson, prdContent);
348
+ }
349
+ // =============================================================================
350
+ // Joiner Onboarding Task Creation
351
+ // =============================================================================
352
+ /**
353
+ * task.json factory for joiner onboarding. Mirrors the bootstrap factory but
354
+ * uses dev_type "docs", higher priority "P1", and the developer-specific task
355
+ * name (so multiple joiners in the same checkout don't collide).
356
+ */
357
+ function getJoinerTaskJson(developer, taskName) {
358
+ const today = new Date().toISOString().split("T")[0];
359
+ return emptyTaskJson({
360
+ id: taskName,
361
+ name: taskName,
362
+ title: `Joining: Onboard to this Trellis project (${developer})`,
363
+ description: "Onboard a new developer to an existing Trellis project: learn the workflow, conventions, and find assigned work",
364
+ status: "in_progress",
365
+ dev_type: "docs",
366
+ priority: "P1",
367
+ creator: developer,
368
+ assignee: developer,
369
+ createdAt: today,
370
+ notes: "Generated by trellis init for a new developer joining an existing Trellis project",
371
+ });
372
+ }
373
+ /**
374
+ * PRD content for joiner onboarding. Kept concise (~80 lines) — deeper
375
+ * guidance lives in skills and docs.
376
+ */
377
+ function getJoinerPrdContent(developer) {
378
+ const slug = slugifyDeveloperName(developer);
379
+ return `# Joiner Onboarding Task
380
+
381
+ **You (the AI) are running this task. The developer does not read this file.**
382
+
383
+ \`${developer}\` just ran \`trellis init\` on a fresh clone, saw "Developer
384
+ initialized", and will now start asking you questions in chat. This task is
385
+ already set as their current task (\`.trellis/.current-task\` points here), so
386
+ when they run \`/trellis:continue\` you'll land back on this PRD.
387
+
388
+ Your job is to orient them to Trellis. Don't dump all of this at them — open
389
+ with a short greeting, ask where they want to start, and fill in the rest as
390
+ they engage.
391
+
392
+ ---
393
+
394
+ ## Topics to cover (adapt order to their questions)
395
+
396
+ ### 1. What Trellis is + the workflow
397
+
398
+ Trellis is a workflow layer over Claude Code / Cursor / etc. that keeps AI
399
+ agents consistent with project-specific conventions instead of writing generic
400
+ code every session.
401
+
402
+ - **Three phases**: Plan (brainstorm → \`prd.md\`) → Execute (code + check) →
403
+ Finish (capture + wrap). Full reference: \`.trellis/workflow.md\`.
404
+ - **Task lifecycle**: planning → in_progress → done → archive, under
405
+ \`.trellis/tasks/\`.
406
+ - **Core slash commands**:
407
+ - \`/trellis:continue\` — resume the current task (their primary entry,
408
+ since current-task is already set to this onboarding task)
409
+ - \`/trellis:finish-work\` — wrap up a finished task
410
+ - \`/trellis:start\` — session boot from scratch (not needed here; the
411
+ SessionStart hook does its job automatically)
412
+
413
+ ### 2. Runtime mechanics (explain when they ask "how does it know what to do")
414
+
415
+ - **SessionStart hook** runs \`get_context.py\` and injects identity, git
416
+ status, current-task pointer, active tasks, and workflow phase into the AI
417
+ conversation at every session start.
418
+ - **\`<workflow-state>\` tag** is auto-injected with every user message,
419
+ carrying the current task + phase hint.
420
+ - **\`/trellis:continue\`** loads the Phase Index, reads \`prd.md\` + recent
421
+ activity, and routes to the right skill (\`trellis-brainstorm\` for planning,
422
+ \`trellis-implement\` for coding, \`trellis-check\` for verification).
423
+ - **\`trellis-implement\` sub-agent** is spawned when code needs to be written.
424
+ The platform hook reads \`{TASK_DIR}/implement.jsonl\` and auto-injects those
425
+ spec files + \`prd.md\` into the sub-agent's prompt so it codes per project
426
+ conventions.
427
+ - **\`trellis-check\` sub-agent** follows the same pattern with \`check.jsonl\`
428
+ — reviews changes against specs, auto-fixes issues, runs lint/typecheck.
429
+
430
+ File layout (mention when they ask "where does what live"):
431
+ - \`.trellis/.current-task\` — session pointer, gitignored, per-checkout
432
+ - \`.trellis/tasks/<task>/{implement,check}.jsonl\` — per-task context manifests
433
+ - \`.trellis/spec/\` — project-wide conventions (source of truth)
434
+ - \`.trellis/workspace/${developer}/journal-*.md\` — their session log,
435
+ rotated at ~2000 lines
436
+
437
+ ### 3. This project's actual conventions
438
+
439
+ - Summarize \`.trellis/spec/\` for them — what coding conventions this
440
+ specific team enforces.
441
+ - Point at the last 5 entries in \`.trellis/tasks/archive/\` as a rhythm
442
+ example of how people actually work here. **If archive is empty** (the
443
+ project just started), skip this — don't invent examples.
444
+ - Not your job in this onboarding to teach them the business code itself —
445
+ the README and their teammates handle that.
446
+
447
+ ### 4. Their assigned work
448
+
449
+ - Check if \`.trellis/workspace/${developer}/\` already exists — if yes, it's
450
+ their journal from another machine and worth mentioning.
451
+ - Run \`python3 ./.trellis/scripts/task.py list --assignee ${developer}\` to
452
+ show tasks assigned to them. (Quote the name if it contains spaces.)
453
+ - Remind them that the "My Tasks" section appears in the SessionStart context
454
+ on every new session.
455
+
456
+ ---
457
+
458
+ ## Optional: walk through a small task end-to-end
459
+
460
+ If they want to practice before touching real work, offer to pick a tiny
461
+ P3 task or a typo fix and run the full cycle together: \`/trellis:continue\`
462
+ → you implement via sub-agents → \`/trellis:finish-work\`.
463
+
464
+ ---
465
+
466
+ ## Completion
467
+
468
+ When they feel oriented (or after you've covered the four topics with
469
+ reasonable back-and-forth), guide them to run:
470
+
471
+ \`\`\`bash
472
+ python3 ./.trellis/scripts/task.py finish
473
+ python3 ./.trellis/scripts/task.py archive 00-join-${slug}
474
+ \`\`\`
475
+
476
+ ---
477
+
478
+ ## Suggested opening line
479
+
480
+ "Welcome! Your \`trellis init\` set me up to onboard you to this project. I
481
+ can walk you through the workflow, show you the runtime mechanics under the
482
+ hood, summarize the team's spec, or jump to what you're already curious about
483
+ — which would you prefer?"
484
+ `;
485
+ }
486
+ /**
487
+ * Create joiner onboarding task for a new developer on an existing Trellis
488
+ * project. Task name is slugified to be filesystem-safe for arbitrary
489
+ * developer names (spaces, Unicode, punctuation).
490
+ */
491
+ function createJoinerOnboardingTask(cwd, developer) {
492
+ const slug = slugifyDeveloperName(developer);
493
+ const taskName = `00-join-${slug}`;
494
+ const taskJson = getJoinerTaskJson(developer, taskName);
495
+ const prdContent = getJoinerPrdContent(developer);
496
+ return writeTaskSkeleton(cwd, taskName, taskJson, prdContent);
298
497
  }
299
498
  /**
300
499
  * Handle re-init when .trellis/ already exists.
@@ -396,6 +595,10 @@ async function handleReinit(cwd, options, developerName) {
396
595
  devName = await askInput("Your name: ");
397
596
  }
398
597
  }
598
+ // Capture pre-init state: if .developer did not exist before we ran
599
+ // init_developer.py, this checkout had no identity → treat as a new
600
+ // joiner onboarding onto an existing Trellis project.
601
+ const hadDeveloperFileBefore = fs.existsSync(path.join(cwd, DIR_NAMES.WORKFLOW, FILE_NAMES.DEVELOPER));
399
602
  try {
400
603
  const pythonCmd = getPythonCommand();
401
604
  const scriptPath = path.join(cwd, PATHS.SCRIPTS, "init_developer.py");
@@ -409,6 +612,18 @@ async function handleReinit(cwd, options, developerName) {
409
612
  console.log(chalk.yellow("⚠ Could not initialize developer. Run manually:"));
410
613
  console.log(chalk.gray(` python3 .trellis/scripts/init_developer.py ${devName}`));
411
614
  }
615
+ // Create joiner onboarding task for fresh checkouts (no prior .developer).
616
+ // Runs outside the init_developer try/catch so failures surface as warnings.
617
+ if (!hadDeveloperFileBefore) {
618
+ try {
619
+ if (!createJoinerOnboardingTask(cwd, devName)) {
620
+ console.warn(chalk.yellow("⚠ Failed to create joiner onboarding task"));
621
+ }
622
+ }
623
+ catch (err) {
624
+ console.warn(chalk.yellow(`⚠ Joiner onboarding setup failed: ${err instanceof Error ? err.message : String(err)}`));
625
+ }
626
+ }
412
627
  }
413
628
  return true;
414
629
  }
@@ -438,6 +653,9 @@ function writeMonorepoConfig(cwd, packages) {
438
653
  if (pkg.isSubmodule) {
439
654
  lines.push(" type: submodule");
440
655
  }
656
+ else if (pkg.isGitRepo) {
657
+ lines.push(" git: true");
658
+ }
441
659
  }
442
660
  // Use first non-submodule package as default, fallback to first package
443
661
  const defaultPkg = packages.find((p) => !p.isSubmodule)?.name ?? packages[0]?.name;
@@ -449,6 +667,10 @@ function writeMonorepoConfig(cwd, packages) {
449
667
  export async function init(options) {
450
668
  const cwd = process.cwd();
451
669
  const isFirstInit = !fs.existsSync(path.join(cwd, DIR_NAMES.WORKFLOW));
670
+ // Captured here (before createWorkflowStructure + init_developer run) so
671
+ // the three-branch dispatch at the bottom can tell "fresh clone joiner"
672
+ // (.trellis/ exists, .developer missing) apart from "creator first init".
673
+ const hadDeveloperFileAtStart = fs.existsSync(path.join(cwd, DIR_NAMES.WORKFLOW, FILE_NAMES.DEVELOPER));
452
674
  // Generate ASCII art banner dynamically using FIGlet "Rebel" font
453
675
  const banner = figlet.textSync("Trellis", { font: "Rebel" });
454
676
  console.log(chalk.cyan(`\n${banner.trimEnd()}`));
@@ -540,7 +762,26 @@ export async function init(options) {
540
762
  // options.monorepo: true = --monorepo, false = --no-monorepo, undefined = auto
541
763
  const detected = detectMonorepo(cwd);
542
764
  if (options.monorepo === true && !detected) {
543
- console.log(chalk.red("Error: --monorepo specified but no monorepo configuration found."));
765
+ console.log(chalk.red("Error: --monorepo specified but no multi-package layout detected."));
766
+ console.log("");
767
+ console.log(chalk.gray("Checked:"));
768
+ console.log(chalk.gray(" ✗ pnpm-workspace.yaml"));
769
+ console.log(chalk.gray(" ✗ package.json workspaces"));
770
+ console.log(chalk.gray(" ✗ Cargo.toml [workspace]"));
771
+ console.log(chalk.gray(" ✗ go.work"));
772
+ console.log(chalk.gray(" ✗ pyproject.toml [tool.uv.workspace]"));
773
+ console.log(chalk.gray(" ✗ .gitmodules"));
774
+ console.log(chalk.gray(" ✗ sibling .git directories (need ≥ 2)"));
775
+ console.log("");
776
+ console.log("To configure manually, add to .trellis/config.yaml:");
777
+ console.log("");
778
+ console.log(chalk.cyan(" packages:"));
779
+ console.log(chalk.cyan(" frontend:"));
780
+ console.log(chalk.cyan(" path: ./frontend"));
781
+ console.log(chalk.cyan(" git: true # if it has its own .git"));
782
+ console.log(chalk.cyan(" backend:"));
783
+ console.log(chalk.cyan(" path: ./backend"));
784
+ console.log(chalk.cyan(" git: true"));
544
785
  return;
545
786
  }
546
787
  if (detected && detected.length > 0) {
@@ -552,11 +793,15 @@ export async function init(options) {
552
793
  // Show detected packages and ask
553
794
  console.log(chalk.blue("\n🔍 Detected monorepo packages:"));
554
795
  for (const pkg of detected) {
555
- const sub = pkg.isSubmodule ? chalk.gray(" (submodule)") : "";
796
+ const tag = pkg.isSubmodule
797
+ ? chalk.gray(" (submodule)")
798
+ : pkg.isGitRepo
799
+ ? chalk.gray(" (git repo)")
800
+ : "";
556
801
  console.log(chalk.gray(` - ${pkg.name}`) +
557
802
  chalk.gray(` (${pkg.path})`) +
558
803
  chalk.gray(` [${pkg.type}]`) +
559
- sub);
804
+ tag);
560
805
  }
561
806
  console.log("");
562
807
  const { useMonorepo } = await inquirer.prompt([
@@ -961,11 +1206,9 @@ export async function init(options) {
961
1206
  // Create Workflow Structure
962
1207
  // ==========================================================================
963
1208
  // Create workflow structure with project type
964
- // Multi-agent is enabled by default
965
1209
  console.log(chalk.blue("📁 Creating workflow structure..."));
966
1210
  await createWorkflowStructure(cwd, {
967
1211
  projectType,
968
- multiAgent: true,
969
1212
  skipSpecTemplates: useRemoteTemplate,
970
1213
  packages: monorepoPackages,
971
1214
  remoteSpecPackages,
@@ -1010,14 +1253,33 @@ export async function init(options) {
1010
1253
  cwd,
1011
1254
  stdio: "pipe", // Silent
1012
1255
  });
1013
- // Create bootstrap task only on first init (not re-init for new platforms/devices)
1014
- if (isFirstInit) {
1015
- createBootstrapTask(cwd, developerName, projectType, monorepoPackages);
1016
- }
1017
1256
  }
1018
1257
  catch {
1019
1258
  // Silent failure - user can run init_developer.py manually
1020
1259
  }
1260
+ // Three-branch dispatch using flags captured at init() start (before
1261
+ // createWorkflowStructure/init_developer ran, so they reflect the disk
1262
+ // state of the user's checkout, not the state this init just produced):
1263
+ // isFirstInit=true → creator bootstrap (new project)
1264
+ // isFirstInit=false + no .developer file → joiner onboarding (fresh clone)
1265
+ // isFirstInit=false + .developer exists → same-dev re-init, no task
1266
+ //
1267
+ // Runs OUTSIDE the init_developer try/catch (which uses stdio: "pipe")
1268
+ // so joiner failures surface as warnings instead of being silently
1269
+ // swallowed.
1270
+ if (isFirstInit) {
1271
+ createBootstrapTask(cwd, developerName, projectType, monorepoPackages);
1272
+ }
1273
+ else if (!hadDeveloperFileAtStart) {
1274
+ try {
1275
+ if (!createJoinerOnboardingTask(cwd, developerName)) {
1276
+ console.warn(chalk.yellow("⚠ Failed to create joiner onboarding task"));
1277
+ }
1278
+ }
1279
+ catch (err) {
1280
+ console.warn(chalk.yellow(`⚠ Joiner onboarding setup failed: ${err instanceof Error ? err.message : String(err)}`));
1281
+ }
1282
+ }
1021
1283
  }
1022
1284
  // Print "What We Solve" section
1023
1285
  printWhatWeSolve();
@@ -1052,10 +1314,10 @@ async function createRootFiles(cwd) {
1052
1314
  function printWhatWeSolve() {
1053
1315
  console.log(chalk.gray("\nSound familiar? ") +
1054
1316
  chalk.bold("You'll never say these again!!\n"));
1055
- // Pain point 1: Bug loop → Thinking Guides + Ralph Loop
1317
+ // Pain point 1: Bug loop → Thinking Guides + Check Loop
1056
1318
  console.log(chalk.gray("✗ ") + '"Fix A → break B → fix B → break A..."');
1057
1319
  console.log(chalk.green(" ✓ ") +
1058
- chalk.white("Thinking Guides + Ralph Loop: Think first, verify after"));
1320
+ chalk.white("Thinking Guides + Check Loop: Think first, verify after"));
1059
1321
  // Pain point 2: Instructions ignored/forgotten → Sub-agents + per-agent spec injection
1060
1322
  console.log(chalk.gray("✗ ") +
1061
1323
  '"Wrote CLAUDE.md, AI ignored it. Reminded AI, it forgot 5 turns later."');