@mindfoldhq/trellis 0.4.0 → 0.5.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (394) 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 +0 -1
  4. package/dist/commands/init.d.ts.map +1 -1
  5. package/dist/commands/init.js +2 -4
  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 +83 -22
  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 +142 -98
  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 +3 -28
  56. package/dist/configurators/opencode.d.ts.map +1 -1
  57. package/dist/configurators/opencode.js +23 -48
  58. package/dist/configurators/opencode.js.map +1 -1
  59. package/dist/configurators/qoder.d.ts +6 -4
  60. package/dist/configurators/qoder.d.ts.map +1 -1
  61. package/dist/configurators/qoder.js +20 -47
  62. package/dist/configurators/qoder.js.map +1 -1
  63. package/dist/configurators/shared.d.ts +66 -3
  64. package/dist/configurators/shared.d.ts.map +1 -1
  65. package/dist/configurators/shared.js +251 -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 +1644 -0
  77. package/dist/templates/claude/agents/check.md +2 -29
  78. package/dist/templates/claude/agents/research.md +70 -52
  79. package/dist/templates/claude/index.d.ts +5 -37
  80. package/dist/templates/claude/index.d.ts.map +1 -1
  81. package/dist/templates/claude/index.js +3 -42
  82. package/dist/templates/claude/index.js.map +1 -1
  83. package/dist/templates/claude/settings.json +3 -4
  84. package/dist/templates/{iflow → codebuddy}/agents/check.md +3 -30
  85. package/dist/templates/{iflow → codebuddy}/agents/implement.md +1 -1
  86. package/dist/templates/codebuddy/agents/research.md +138 -0
  87. package/dist/templates/codebuddy/index.d.ts +6 -16
  88. package/dist/templates/codebuddy/index.d.ts.map +1 -1
  89. package/dist/templates/codebuddy/index.js +6 -36
  90. package/dist/templates/codebuddy/index.js.map +1 -1
  91. package/dist/templates/codebuddy/settings.json +59 -0
  92. package/dist/templates/codex/agents/research.toml +50 -16
  93. package/dist/templates/codex/config.toml +10 -0
  94. package/dist/templates/codex/hooks/session-start.py +65 -29
  95. package/dist/templates/codex/hooks.json +11 -0
  96. package/dist/templates/codex/index.d.ts +0 -1
  97. package/dist/templates/codex/index.d.ts.map +1 -1
  98. package/dist/templates/codex/index.js +1 -8
  99. package/dist/templates/codex/index.js.map +1 -1
  100. package/dist/templates/common/commands/continue.md +51 -0
  101. package/dist/templates/common/commands/finish-work.md +32 -0
  102. package/dist/templates/common/commands/start.md +56 -0
  103. package/dist/templates/common/index.d.ts +28 -0
  104. package/dist/templates/common/index.d.ts.map +1 -0
  105. package/dist/templates/common/index.js +55 -0
  106. package/dist/templates/common/index.js.map +1 -0
  107. package/dist/templates/{codebuddy/commands/trellis → common/skills}/brainstorm.md +4 -4
  108. package/dist/templates/{opencode/commands/trellis → common/skills}/break-loop.md +4 -4
  109. package/dist/templates/common/skills/check.md +87 -0
  110. package/dist/templates/{codebuddy/commands/trellis → common/skills}/update-spec.md +18 -21
  111. package/dist/templates/copilot/hooks/session-start.py +65 -29
  112. package/dist/templates/copilot/hooks.json +8 -0
  113. package/dist/templates/cursor/agents/check.md +95 -0
  114. package/dist/templates/cursor/agents/implement.md +95 -0
  115. package/dist/templates/cursor/agents/research.md +138 -0
  116. package/dist/templates/cursor/hooks.json +24 -0
  117. package/dist/templates/cursor/index.d.ts +6 -17
  118. package/dist/templates/cursor/index.d.ts.map +1 -1
  119. package/dist/templates/cursor/index.js +6 -37
  120. package/dist/templates/cursor/index.js.map +1 -1
  121. package/dist/templates/droid/droids/check.md +95 -0
  122. package/dist/templates/droid/droids/implement.md +95 -0
  123. package/dist/templates/droid/droids/research.md +138 -0
  124. package/dist/templates/droid/index.d.ts +7 -19
  125. package/dist/templates/droid/index.d.ts.map +1 -1
  126. package/dist/templates/droid/index.js +7 -39
  127. package/dist/templates/droid/index.js.map +1 -1
  128. package/dist/templates/droid/settings.json +59 -0
  129. package/dist/templates/extract.d.ts +7 -193
  130. package/dist/templates/extract.d.ts.map +1 -1
  131. package/dist/templates/extract.js +7 -310
  132. package/dist/templates/extract.js.map +1 -1
  133. package/dist/templates/gemini/agents/check.md +95 -0
  134. package/dist/templates/gemini/agents/implement.md +95 -0
  135. package/dist/templates/gemini/agents/research.md +138 -0
  136. package/dist/templates/gemini/index.d.ts +6 -14
  137. package/dist/templates/gemini/index.d.ts.map +1 -1
  138. package/dist/templates/gemini/index.js +6 -37
  139. package/dist/templates/gemini/index.js.map +1 -1
  140. package/dist/templates/gemini/settings.json +28 -0
  141. package/dist/templates/kiro/agents/check.json +13 -0
  142. package/dist/templates/kiro/agents/implement.json +13 -0
  143. package/dist/templates/kiro/agents/research.json +21 -0
  144. package/dist/templates/kiro/index.d.ts +11 -11
  145. package/dist/templates/kiro/index.d.ts.map +1 -1
  146. package/dist/templates/kiro/index.js +11 -33
  147. package/dist/templates/kiro/index.js.map +1 -1
  148. package/dist/templates/opencode/agents/check.md +3 -30
  149. package/dist/templates/opencode/agents/implement.md +1 -1
  150. package/dist/templates/opencode/agents/research.md +1 -2
  151. package/dist/templates/opencode/plugins/inject-subagent-context.js +9 -183
  152. package/dist/templates/opencode/plugins/inject-workflow-state.js +160 -0
  153. package/dist/templates/opencode/plugins/session-start.js +71 -32
  154. package/dist/templates/qoder/agents/check.md +95 -0
  155. package/dist/templates/qoder/agents/implement.md +95 -0
  156. package/dist/templates/qoder/agents/research.md +138 -0
  157. package/dist/templates/qoder/index.d.ts +7 -10
  158. package/dist/templates/qoder/index.d.ts.map +1 -1
  159. package/dist/templates/qoder/index.js +7 -32
  160. package/dist/templates/qoder/index.js.map +1 -1
  161. package/dist/templates/qoder/settings.json +47 -0
  162. package/dist/templates/shared-hooks/index.d.ts +19 -0
  163. package/dist/templates/shared-hooks/index.d.ts.map +1 -0
  164. package/dist/templates/shared-hooks/index.js +30 -0
  165. package/dist/templates/shared-hooks/index.js.map +1 -0
  166. package/dist/templates/{iflow/hooks → shared-hooks}/inject-subagent-context.py +74 -263
  167. package/dist/templates/shared-hooks/inject-workflow-state.py +231 -0
  168. package/dist/templates/{claude/hooks → shared-hooks}/session-start.py +162 -55
  169. package/dist/templates/template-utils.d.ts +26 -0
  170. package/dist/templates/template-utils.d.ts.map +1 -0
  171. package/dist/templates/template-utils.js +60 -0
  172. package/dist/templates/template-utils.js.map +1 -0
  173. package/dist/templates/trellis/index.d.ts +1 -14
  174. package/dist/templates/trellis/index.d.ts.map +1 -1
  175. package/dist/templates/trellis/index.js +2 -27
  176. package/dist/templates/trellis/index.js.map +1 -1
  177. package/dist/templates/trellis/scripts/common/cli_adapter.py +2 -2
  178. package/dist/templates/trellis/scripts/common/config.py +126 -1
  179. package/dist/templates/trellis/scripts/common/git_context.py +25 -2
  180. package/dist/templates/trellis/scripts/common/task_context.py +3 -23
  181. package/dist/templates/trellis/scripts/common/task_store.py +0 -12
  182. package/dist/templates/trellis/scripts/common/workflow_phase.py +176 -0
  183. package/dist/templates/trellis/scripts/task.py +6 -35
  184. package/dist/templates/trellis/workflow.md +274 -297
  185. package/dist/types/ai-tools.d.ts +21 -3
  186. package/dist/types/ai-tools.d.ts.map +1 -1
  187. package/dist/types/ai-tools.js +106 -15
  188. package/dist/types/ai-tools.js.map +1 -1
  189. package/dist/types/migration.d.ts +8 -1
  190. package/dist/types/migration.d.ts.map +1 -1
  191. package/package.json +3 -2
  192. package/dist/configurators/iflow.d.ts +0 -33
  193. package/dist/configurators/iflow.d.ts.map +0 -1
  194. package/dist/configurators/iflow.js +0 -99
  195. package/dist/configurators/iflow.js.map +0 -1
  196. package/dist/templates/antigravity/index.d.ts +0 -12
  197. package/dist/templates/antigravity/index.d.ts.map +0 -1
  198. package/dist/templates/antigravity/index.js +0 -29
  199. package/dist/templates/antigravity/index.js.map +0 -1
  200. package/dist/templates/claude/agents/debug.md +0 -106
  201. package/dist/templates/claude/agents/dispatch.md +0 -213
  202. package/dist/templates/claude/agents/plan.md +0 -396
  203. package/dist/templates/claude/commands/trellis/brainstorm.md +0 -487
  204. package/dist/templates/claude/commands/trellis/break-loop.md +0 -125
  205. package/dist/templates/claude/commands/trellis/check-cross-layer.md +0 -153
  206. package/dist/templates/claude/commands/trellis/check.md +0 -25
  207. package/dist/templates/claude/commands/trellis/create-command.md +0 -154
  208. package/dist/templates/claude/commands/trellis/finish-work.md +0 -153
  209. package/dist/templates/claude/commands/trellis/integrate-skill.md +0 -219
  210. package/dist/templates/claude/commands/trellis/onboard.md +0 -358
  211. package/dist/templates/claude/commands/trellis/parallel.md +0 -192
  212. package/dist/templates/claude/commands/trellis/record-session.md +0 -62
  213. package/dist/templates/claude/commands/trellis/start.md +0 -393
  214. package/dist/templates/claude/commands/trellis/update-spec.md +0 -354
  215. package/dist/templates/claude/hooks/inject-subagent-context.py +0 -803
  216. package/dist/templates/claude/hooks/ralph-loop.py +0 -396
  217. package/dist/templates/codebuddy/commands/trellis/before-dev.md +0 -29
  218. package/dist/templates/codebuddy/commands/trellis/break-loop.md +0 -107
  219. package/dist/templates/codebuddy/commands/trellis/check-cross-layer.md +0 -153
  220. package/dist/templates/codebuddy/commands/trellis/check.md +0 -25
  221. package/dist/templates/codebuddy/commands/trellis/create-command.md +0 -154
  222. package/dist/templates/codebuddy/commands/trellis/finish-work.md +0 -143
  223. package/dist/templates/codebuddy/commands/trellis/integrate-skill.md +0 -219
  224. package/dist/templates/codebuddy/commands/trellis/onboard.md +0 -358
  225. package/dist/templates/codebuddy/commands/trellis/record-session.md +0 -61
  226. package/dist/templates/codebuddy/commands/trellis/start.md +0 -373
  227. package/dist/templates/codex/codex-skills/parallel/SKILL.md +0 -194
  228. package/dist/templates/cursor/commands/trellis-before-dev.md +0 -29
  229. package/dist/templates/cursor/commands/trellis-brainstorm.md +0 -487
  230. package/dist/templates/cursor/commands/trellis-break-loop.md +0 -107
  231. package/dist/templates/cursor/commands/trellis-check-cross-layer.md +0 -153
  232. package/dist/templates/cursor/commands/trellis-check.md +0 -25
  233. package/dist/templates/cursor/commands/trellis-create-command.md +0 -154
  234. package/dist/templates/cursor/commands/trellis-finish-work.md +0 -143
  235. package/dist/templates/cursor/commands/trellis-integrate-skill.md +0 -219
  236. package/dist/templates/cursor/commands/trellis-onboard.md +0 -358
  237. package/dist/templates/cursor/commands/trellis-record-session.md +0 -62
  238. package/dist/templates/cursor/commands/trellis-start.md +0 -373
  239. package/dist/templates/cursor/commands/trellis-update-spec.md +0 -354
  240. package/dist/templates/droid/commands/trellis/before-dev.md +0 -33
  241. package/dist/templates/droid/commands/trellis/brainstorm.md +0 -491
  242. package/dist/templates/droid/commands/trellis/break-loop.md +0 -111
  243. package/dist/templates/droid/commands/trellis/check-cross-layer.md +0 -157
  244. package/dist/templates/droid/commands/trellis/check.md +0 -29
  245. package/dist/templates/droid/commands/trellis/create-command.md +0 -158
  246. package/dist/templates/droid/commands/trellis/finish-work.md +0 -147
  247. package/dist/templates/droid/commands/trellis/integrate-skill.md +0 -223
  248. package/dist/templates/droid/commands/trellis/onboard.md +0 -362
  249. package/dist/templates/droid/commands/trellis/record-session.md +0 -66
  250. package/dist/templates/droid/commands/trellis/start.md +0 -377
  251. package/dist/templates/droid/commands/trellis/update-spec.md +0 -358
  252. package/dist/templates/gemini/commands/trellis/before-dev.toml +0 -33
  253. package/dist/templates/gemini/commands/trellis/brainstorm.toml +0 -435
  254. package/dist/templates/gemini/commands/trellis/break-loop.toml +0 -129
  255. package/dist/templates/gemini/commands/trellis/check-cross-layer.toml +0 -147
  256. package/dist/templates/gemini/commands/trellis/check.toml +0 -29
  257. package/dist/templates/gemini/commands/trellis/create-command.toml +0 -119
  258. package/dist/templates/gemini/commands/trellis/finish-work.toml +0 -133
  259. package/dist/templates/gemini/commands/trellis/integrate-skill.toml +0 -104
  260. package/dist/templates/gemini/commands/trellis/onboard.toml +0 -111
  261. package/dist/templates/gemini/commands/trellis/record-session.toml +0 -66
  262. package/dist/templates/gemini/commands/trellis/start.toml +0 -354
  263. package/dist/templates/gemini/commands/trellis/update-spec.toml +0 -132
  264. package/dist/templates/iflow/agents/debug.md +0 -106
  265. package/dist/templates/iflow/agents/dispatch.md +0 -213
  266. package/dist/templates/iflow/agents/plan.md +0 -396
  267. package/dist/templates/iflow/agents/research.md +0 -120
  268. package/dist/templates/iflow/commands/trellis/before-dev.md +0 -29
  269. package/dist/templates/iflow/commands/trellis/brainstorm.md +0 -487
  270. package/dist/templates/iflow/commands/trellis/break-loop.md +0 -125
  271. package/dist/templates/iflow/commands/trellis/check-cross-layer.md +0 -153
  272. package/dist/templates/iflow/commands/trellis/check.md +0 -25
  273. package/dist/templates/iflow/commands/trellis/create-command.md +0 -152
  274. package/dist/templates/iflow/commands/trellis/finish-work.md +0 -153
  275. package/dist/templates/iflow/commands/trellis/integrate-skill.md +0 -219
  276. package/dist/templates/iflow/commands/trellis/onboard.md +0 -358
  277. package/dist/templates/iflow/commands/trellis/parallel.md +0 -192
  278. package/dist/templates/iflow/commands/trellis/record-session.md +0 -62
  279. package/dist/templates/iflow/commands/trellis/start.md +0 -393
  280. package/dist/templates/iflow/commands/trellis/update-spec.md +0 -354
  281. package/dist/templates/iflow/hooks/ralph-loop.py +0 -395
  282. package/dist/templates/iflow/hooks/session-start.py +0 -403
  283. package/dist/templates/iflow/index.d.ts +0 -54
  284. package/dist/templates/iflow/index.d.ts.map +0 -1
  285. package/dist/templates/iflow/index.js +0 -85
  286. package/dist/templates/iflow/index.js.map +0 -1
  287. package/dist/templates/iflow/settings.json +0 -60
  288. package/dist/templates/kilo/index.d.ts +0 -16
  289. package/dist/templates/kilo/index.d.ts.map +0 -1
  290. package/dist/templates/kilo/index.js +0 -39
  291. package/dist/templates/kilo/index.js.map +0 -1
  292. package/dist/templates/kilo/workflows/before-dev.md +0 -29
  293. package/dist/templates/kilo/workflows/brainstorm.md +0 -487
  294. package/dist/templates/kilo/workflows/break-loop.md +0 -125
  295. package/dist/templates/kilo/workflows/check-cross-layer.md +0 -153
  296. package/dist/templates/kilo/workflows/check.md +0 -25
  297. package/dist/templates/kilo/workflows/create-command.md +0 -152
  298. package/dist/templates/kilo/workflows/finish-work.md +0 -129
  299. package/dist/templates/kilo/workflows/integrate-skill.md +0 -219
  300. package/dist/templates/kilo/workflows/onboard.md +0 -358
  301. package/dist/templates/kilo/workflows/parallel.md +0 -193
  302. package/dist/templates/kilo/workflows/record-session.md +0 -62
  303. package/dist/templates/kilo/workflows/start.md +0 -387
  304. package/dist/templates/kilo/workflows/update-spec.md +0 -285
  305. package/dist/templates/kiro/skills/before-dev/SKILL.md +0 -34
  306. package/dist/templates/kiro/skills/brainstorm/SKILL.md +0 -492
  307. package/dist/templates/kiro/skills/break-loop/SKILL.md +0 -130
  308. package/dist/templates/kiro/skills/check/SKILL.md +0 -30
  309. package/dist/templates/kiro/skills/check-cross-layer/SKILL.md +0 -158
  310. package/dist/templates/kiro/skills/create-command/SKILL.md +0 -101
  311. package/dist/templates/kiro/skills/finish-work/SKILL.md +0 -148
  312. package/dist/templates/kiro/skills/integrate-skill/SKILL.md +0 -221
  313. package/dist/templates/kiro/skills/onboard/SKILL.md +0 -363
  314. package/dist/templates/kiro/skills/record-session/SKILL.md +0 -67
  315. package/dist/templates/kiro/skills/start/SKILL.md +0 -351
  316. package/dist/templates/kiro/skills/update-spec/SKILL.md +0 -335
  317. package/dist/templates/opencode/agents/debug.md +0 -129
  318. package/dist/templates/opencode/agents/dispatch.md +0 -223
  319. package/dist/templates/opencode/agents/trellis-plan.md +0 -427
  320. package/dist/templates/opencode/commands/trellis/before-dev.md +0 -29
  321. package/dist/templates/opencode/commands/trellis/brainstorm.md +0 -487
  322. package/dist/templates/opencode/commands/trellis/check-cross-layer.md +0 -153
  323. package/dist/templates/opencode/commands/trellis/check.md +0 -25
  324. package/dist/templates/opencode/commands/trellis/create-command.md +0 -154
  325. package/dist/templates/opencode/commands/trellis/finish-work.md +0 -144
  326. package/dist/templates/opencode/commands/trellis/integrate-skill.md +0 -219
  327. package/dist/templates/opencode/commands/trellis/migrate-specs.md +0 -0
  328. package/dist/templates/opencode/commands/trellis/onboard.md +0 -358
  329. package/dist/templates/opencode/commands/trellis/parallel.md +0 -193
  330. package/dist/templates/opencode/commands/trellis/record-session.md +0 -62
  331. package/dist/templates/opencode/commands/trellis/start.md +0 -351
  332. package/dist/templates/opencode/commands/trellis/update-spec.md +0 -354
  333. package/dist/templates/qoder/skills/before-dev/SKILL.md +0 -34
  334. package/dist/templates/qoder/skills/brainstorm/SKILL.md +0 -492
  335. package/dist/templates/qoder/skills/break-loop/SKILL.md +0 -130
  336. package/dist/templates/qoder/skills/check/SKILL.md +0 -30
  337. package/dist/templates/qoder/skills/check-cross-layer/SKILL.md +0 -158
  338. package/dist/templates/qoder/skills/create-command/SKILL.md +0 -101
  339. package/dist/templates/qoder/skills/finish-work/SKILL.md +0 -134
  340. package/dist/templates/qoder/skills/integrate-skill/SKILL.md +0 -221
  341. package/dist/templates/qoder/skills/onboard/SKILL.md +0 -363
  342. package/dist/templates/qoder/skills/record-session/SKILL.md +0 -67
  343. package/dist/templates/qoder/skills/start/SKILL.md +0 -388
  344. package/dist/templates/qoder/skills/update-spec/SKILL.md +0 -290
  345. package/dist/templates/trellis/scripts/common/phase.py +0 -254
  346. package/dist/templates/trellis/scripts/common/registry.py +0 -335
  347. package/dist/templates/trellis/scripts/common/worktree.py +0 -305
  348. package/dist/templates/trellis/scripts/multi_agent/__init__.py +0 -5
  349. package/dist/templates/trellis/scripts/multi_agent/_bootstrap.py +0 -17
  350. package/dist/templates/trellis/scripts/multi_agent/cleanup.py +0 -398
  351. package/dist/templates/trellis/scripts/multi_agent/create_pr.py +0 -620
  352. package/dist/templates/trellis/scripts/multi_agent/plan.py +0 -213
  353. package/dist/templates/trellis/scripts/multi_agent/start.py +0 -539
  354. package/dist/templates/trellis/scripts/multi_agent/status.py +0 -76
  355. package/dist/templates/trellis/scripts/multi_agent/status_display.py +0 -542
  356. package/dist/templates/trellis/scripts/multi_agent/status_monitor.py +0 -225
  357. package/dist/templates/trellis/scripts-shell-archive/add-session.sh +0 -384
  358. package/dist/templates/trellis/scripts-shell-archive/common/developer.sh +0 -129
  359. package/dist/templates/trellis/scripts-shell-archive/common/git-context.sh +0 -263
  360. package/dist/templates/trellis/scripts-shell-archive/common/paths.sh +0 -208
  361. package/dist/templates/trellis/scripts-shell-archive/common/phase.sh +0 -150
  362. package/dist/templates/trellis/scripts-shell-archive/common/registry.sh +0 -247
  363. package/dist/templates/trellis/scripts-shell-archive/common/task-queue.sh +0 -142
  364. package/dist/templates/trellis/scripts-shell-archive/common/task-utils.sh +0 -151
  365. package/dist/templates/trellis/scripts-shell-archive/common/worktree.sh +0 -128
  366. package/dist/templates/trellis/scripts-shell-archive/create-bootstrap.sh +0 -299
  367. package/dist/templates/trellis/scripts-shell-archive/get-context.sh +0 -7
  368. package/dist/templates/trellis/scripts-shell-archive/get-developer.sh +0 -15
  369. package/dist/templates/trellis/scripts-shell-archive/init-developer.sh +0 -34
  370. package/dist/templates/trellis/scripts-shell-archive/multi-agent/cleanup.sh +0 -396
  371. package/dist/templates/trellis/scripts-shell-archive/multi-agent/create-pr.sh +0 -241
  372. package/dist/templates/trellis/scripts-shell-archive/multi-agent/plan.sh +0 -207
  373. package/dist/templates/trellis/scripts-shell-archive/multi-agent/start.sh +0 -317
  374. package/dist/templates/trellis/scripts-shell-archive/multi-agent/status.sh +0 -828
  375. package/dist/templates/trellis/scripts-shell-archive/task.sh +0 -1204
  376. package/dist/templates/trellis/worktree.yaml +0 -47
  377. package/dist/templates/windsurf/index.d.ts +0 -21
  378. package/dist/templates/windsurf/index.d.ts.map +0 -1
  379. package/dist/templates/windsurf/index.js +0 -44
  380. package/dist/templates/windsurf/index.js.map +0 -1
  381. package/dist/templates/windsurf/workflows/trellis-before-dev.md +0 -31
  382. package/dist/templates/windsurf/workflows/trellis-brainstorm.md +0 -491
  383. package/dist/templates/windsurf/workflows/trellis-break-loop.md +0 -111
  384. package/dist/templates/windsurf/workflows/trellis-check-cross-layer.md +0 -157
  385. package/dist/templates/windsurf/workflows/trellis-check.md +0 -27
  386. package/dist/templates/windsurf/workflows/trellis-create-command.md +0 -154
  387. package/dist/templates/windsurf/workflows/trellis-finish-work.md +0 -147
  388. package/dist/templates/windsurf/workflows/trellis-integrate-skill.md +0 -220
  389. package/dist/templates/windsurf/workflows/trellis-onboard.md +0 -362
  390. package/dist/templates/windsurf/workflows/trellis-record-session.md +0 -66
  391. package/dist/templates/windsurf/workflows/trellis-start.md +0 -373
  392. package/dist/templates/windsurf/workflows/trellis-update-spec.md +0 -358
  393. /package/dist/templates/{claude/commands/trellis → common/skills}/before-dev.md +0 -0
  394. /package/dist/templates/{claude/hooks → shared-hooks}/statusline.py +0 -0
@@ -1,17 +1,9 @@
1
- /**
2
- * OpenCode configurator
3
- *
4
- * Configures OpenCode by copying templates from src/templates/opencode/.
5
- * This uses the dogfooding pattern - the same files used by Trellis project itself.
6
- */
7
1
  import { readFileSync, readdirSync, statSync } from "node:fs";
8
2
  import path from "node:path";
3
+ import { AI_TOOLS } from "../types/ai-tools.js";
9
4
  import { getOpenCodeTemplatePath } from "../templates/extract.js";
10
5
  import { ensureDir, writeFile } from "../utils/file-writer.js";
11
- /**
12
- * Files to exclude when copying templates
13
- * These are build artifacts or platform-specific files
14
- */
6
+ import { resolveCommands, resolveSkills } from "./shared.js";
15
7
  const EXCLUDE_PATTERNS = [
16
8
  ".d.ts",
17
9
  ".d.ts.map",
@@ -21,9 +13,6 @@ const EXCLUDE_PATTERNS = [
21
13
  "bun.lock",
22
14
  ".gitignore",
23
15
  ];
24
- /**
25
- * Check if a file should be excluded
26
- */
27
16
  function shouldExclude(filename) {
28
17
  for (const pattern of EXCLUDE_PATTERNS) {
29
18
  if (filename.endsWith(pattern) || filename === pattern) {
@@ -32,14 +21,10 @@ function shouldExclude(filename) {
32
21
  }
33
22
  return false;
34
23
  }
35
- /**
36
- * Recursively copy directory, excluding build artifacts
37
- * Uses writeFile to handle file conflicts with the global writeMode setting
38
- */
39
- async function copyDirFiltered(src, dest) {
24
+ async function copyDirFiltered(src, dest, skipDirs = []) {
40
25
  ensureDir(dest);
41
26
  for (const entry of readdirSync(src)) {
42
- if (shouldExclude(entry)) {
27
+ if (shouldExclude(entry) || skipDirs.includes(entry)) {
43
28
  continue;
44
29
  }
45
30
  const srcPath = path.join(src, entry);
@@ -55,38 +40,28 @@ async function copyDirFiltered(src, dest) {
55
40
  }
56
41
  }
57
42
  /**
58
- * Configure OpenCode by copying from templates
59
- *
60
- * The opencode templates include:
61
- * - commands/ - Slash commands
62
- * - agents/ - Multi-agent pipeline configurations
63
- * - plugins/ - Context injection plugins
64
- * - lib/ - Shared JavaScript utilities
65
- * - package.json - Plugin dependencies
43
+ * Configure OpenCode:
44
+ * - agents/, plugins/, lib/, package.json from platform-specific templates
45
+ * - commands/trellis/ from common templates (resolved with OpenCode context)
66
46
  */
67
47
  export async function configureOpenCode(cwd) {
68
48
  const sourcePath = getOpenCodeTemplatePath();
69
49
  const destPath = path.join(cwd, ".opencode");
70
- // Copy templates, excluding build artifacts
71
- await copyDirFiltered(sourcePath, destPath);
72
- }
73
- /**
74
- * Configure OpenCode agents for Multi-Agent Pipeline
75
- *
76
- * @deprecated Agents are now included in the main .opencode directory copy.
77
- * This function is kept for backwards compatibility but does nothing.
78
- */
79
- export async function configureOpenCodeAgents(_cwd) {
80
- // Agents are now copied as part of configureOpenCode
81
- // This function is kept for API compatibility
82
- }
83
- /**
84
- * Configure OpenCode with full Multi-Agent Pipeline support
85
- *
86
- * This is now equivalent to just calling configureOpenCode since the entire
87
- * .opencode directory is copied at once.
88
- */
89
- export async function configureOpenCodeFull(cwd) {
90
- await configureOpenCode(cwd);
50
+ const ctx = AI_TOOLS.opencode.templateContext;
51
+ await copyDirFiltered(sourcePath, destPath, ["commands"]);
52
+ // start + finish-work as slash commands
53
+ const commandsDir = path.join(destPath, "commands", "trellis");
54
+ ensureDir(commandsDir);
55
+ for (const cmd of resolveCommands(ctx)) {
56
+ await writeFile(path.join(commandsDir, `${cmd.name}.md`), cmd.content);
57
+ }
58
+ // Other 5 as skills
59
+ const skillsDir = path.join(destPath, "skills");
60
+ ensureDir(skillsDir);
61
+ for (const skill of resolveSkills(ctx)) {
62
+ const skillDir = path.join(skillsDir, skill.name);
63
+ ensureDir(skillDir);
64
+ await writeFile(path.join(skillDir, "SKILL.md"), skill.content);
65
+ }
91
66
  }
92
67
  //# sourceMappingURL=opencode.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"opencode.js","sourceRoot":"","sources":["../../src/configurators/opencode.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC9D,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAE/D;;;GAGG;AACH,MAAM,gBAAgB,GAAG;IACvB,OAAO;IACP,WAAW;IACX,SAAS;IACT,aAAa;IACb,cAAc;IACd,UAAU;IACV,YAAY;CACb,CAAC;AAEF;;GAEG;AACH,SAAS,aAAa,CAAC,QAAgB;IACrC,KAAK,MAAM,OAAO,IAAI,g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MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAChD,SAAS,CAAC,SAAS,CAAC,CAAC;IACrB,KAAK,MAAM,KAAK,IAAI,aAAa,CAAC,GAAG,CAAC,EAAE,CAAC;QACvC,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;QAClD,SAAS,CAAC,QAAQ,CAAC,CAAC;QACpB,MAAM,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;IAClE,CAAC;AACH,CAAC"}
@@ -1,8 +1,10 @@
1
1
  /**
2
- * Qoder configurator
3
- *
4
- * Configures Qoder by copying templates from src/templates/qoder/.
5
- * Qoder uses skills (SKILL.md), no hooks or agents.
2
+ * Configure Qoder (pull-based class-2 platform):
3
+ * - skills/trellis-{name}/SKILL.md — all templates as auto-triggered skills
4
+ * - agents/{name}.md sub-agent definitions, with pull-based prelude prepended
5
+ * - hooks/*.py session-start only (no inject-subagent-context.py Qoder hook
6
+ * can't inject sub-agent prompts; sub-agents Read jsonl/prd themselves)
7
+ * - settings.json — hook configuration (SessionStart only)
6
8
  */
7
9
  export declare function configureQoder(cwd: string): Promise<void>;
8
10
  //# sourceMappingURL=qoder.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"qoder.d.ts","sourceRoot":"","sources":["../../src/configurators/qoder.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAgDH,wBAAsB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAK/D"}
1
+ {"version":3,"file":"qoder.d.ts","sourceRoot":"","sources":["../../src/configurators/qoder.ts"],"names":[],"mappings":"AAaA;;;;;;;GAOG;AACH,wBAAsB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAqB/D"}
@@ -1,52 +1,25 @@
1
+ import path from "node:path";
2
+ import { AI_TOOLS } from "../types/ai-tools.js";
3
+ import { writeFile } from "../utils/file-writer.js";
4
+ import { resolvePlaceholders, resolveAllAsSkills, writeSkills, writeAgents, writeSharedHooks, applyPullBasedPreludeMarkdown, } from "./shared.js";
5
+ import { getAllAgents, getSettingsTemplate } from "../templates/qoder/index.js";
1
6
  /**
2
- * Qoder configurator
3
- *
4
- * Configures Qoder by copying templates from src/templates/qoder/.
5
- * Qoder uses skills (SKILL.md), no hooks or agents.
7
+ * Configure Qoder (pull-based class-2 platform):
8
+ * - skills/trellis-{name}/SKILL.md — all templates as auto-triggered skills
9
+ * - agents/{name}.md sub-agent definitions, with pull-based prelude prepended
10
+ * - hooks/*.py session-start only (no inject-subagent-context.py Qoder hook
11
+ * can't inject sub-agent prompts; sub-agents Read jsonl/prd themselves)
12
+ * - settings.json — hook configuration (SessionStart only)
6
13
  */
7
- import { readFileSync, readdirSync, statSync } from "node:fs";
8
- import path from "node:path";
9
- import { getQoderTemplatePath } from "../templates/extract.js";
10
- import { ensureDir, writeFile } from "../utils/file-writer.js";
11
- const EXCLUDE_PATTERNS = [
12
- ".d.ts",
13
- ".d.ts.map",
14
- ".js",
15
- ".js.map",
16
- "__pycache__",
17
- "node_modules",
18
- "bun.lock",
19
- ".gitignore",
20
- ];
21
- function shouldExclude(filename) {
22
- for (const pattern of EXCLUDE_PATTERNS) {
23
- if (filename.endsWith(pattern) || filename === pattern) {
24
- return true;
25
- }
26
- }
27
- return false;
28
- }
29
- async function copyDirFiltered(src, dest) {
30
- ensureDir(dest);
31
- for (const entry of readdirSync(src)) {
32
- if (shouldExclude(entry)) {
33
- continue;
34
- }
35
- const srcPath = path.join(src, entry);
36
- const destPath = path.join(dest, entry);
37
- const stat = statSync(srcPath);
38
- if (stat.isDirectory()) {
39
- await copyDirFiltered(srcPath, destPath);
40
- }
41
- else {
42
- const content = readFileSync(srcPath, "utf-8");
43
- await writeFile(destPath, content);
44
- }
45
- }
46
- }
47
14
  export async function configureQoder(cwd) {
48
- const sourcePath = getQoderTemplatePath();
49
- const destPath = path.join(cwd, ".qoder");
50
- await copyDirFiltered(sourcePath, destPath);
15
+ const config = AI_TOOLS.qoder;
16
+ const configRoot = path.join(cwd, config.configDir);
17
+ await writeSkills(path.join(configRoot, "skills"), resolveAllAsSkills(config.templateContext));
18
+ await writeAgents(path.join(configRoot, "agents"), applyPullBasedPreludeMarkdown(getAllAgents()));
19
+ await writeSharedHooks(path.join(configRoot, "hooks"), {
20
+ exclude: ["inject-subagent-context.py"],
21
+ });
22
+ const settings = getSettingsTemplate();
23
+ await writeFile(path.join(configRoot, settings.targetPath), resolvePlaceholders(settings.content));
51
24
  }
52
25
  //# sourceMappingURL=qoder.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"qoder.js","sourceRoot":"","sources":["../../src/configurators/qoder.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC9D,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAE/D,MAAM,gBAAgB,GAAG;IACvB,OAAO;IACP,WAAW;IACX,KAAK;IACL,SAAS;IACT,aAAa;IACb,cAAc;IACd,UAAU;IACV,YAAY;CACb,CAAC;AAEF,SAAS,aAAa,CAAC,QAAgB;IACrC,KAAK,MAAM,OAAO,IAAI,gBAAgB,EAAE,CAAC;QACvC,IAAI,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,QAAQ,KAAK,OAAO,EAAE,CAAC;YACvD,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,KAAK,UAAU,eAAe,CAAC,GAAW,EAAE,IAA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AM,aAAa,CAAC;AACrB,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAEhF;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,GAAW;IAC9C,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,CAAC;IAC9B,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC;IAEpD,MAAM,WAAW,CACf,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,EAC/B,kBAAkB,CAAC,MAAM,CAAC,eAAe,CAAC,CAC3C,CAAC;IACF,MAAM,WAAW,CACf,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,EAC/B,6BAA6B,CAAC,YAAY,EAAE,CAAC,CAC9C,CAAC;IACF,MAAM,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC,EAAE;QACrD,OAAO,EAAE,CAAC,4BAA4B,CAAC;KACxC,CAAC,CAAC;IAEH,MAAM,QAAQ,GAAG,mBAAmB,EAAE,CAAC;IACvC,MAAM,SAAS,CACb,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,UAAU,CAAC,EAC1C,mBAAmB,CAAC,QAAQ,CAAC,OAAO,CAAC,CACtC,CAAC;AACJ,CAAC"}
@@ -4,9 +4,72 @@
4
4
  * Extracted here to avoid circular dependencies (index.ts imports configurators,
5
5
  * configurators cannot import from index.ts).
6
6
  */
7
+ import type { TemplateContext } from "../types/ai-tools.js";
8
+ export declare function resolvePlaceholders(content: string, context?: TemplateContext): string;
7
9
  /**
8
- * Resolve platform-specific placeholders in template content.
9
- * Used by both init (configurators) and update (collectTemplates in index.ts).
10
+ * Wrap resolved template content with YAML frontmatter for skill format.
11
+ * Used by platforms that use SKILL.md (Codex, Kiro, Qoder, etc.).
10
12
  */
11
- export declare function resolvePlaceholders(content: string): string;
13
+ export declare function wrapWithSkillFrontmatter(name: string, content: string): string;
14
+ /** A resolved template ready to be written to disk. */
15
+ export interface ResolvedTemplate {
16
+ name: string;
17
+ content: string;
18
+ }
19
+ /**
20
+ * Resolve ALL templates as skills with trellis- prefix.
21
+ * Used by skill-only platforms (Kiro, Qoder, Codex) where everything is a skill.
22
+ *
23
+ * `start` is filtered out on agent-capable platforms — the session-start hook
24
+ * injects the workflow overview instead.
25
+ */
26
+ export declare function resolveAllAsSkills(ctx: TemplateContext): ResolvedTemplate[];
27
+ /**
28
+ * Resolve command templates as plain commands (no wrapping).
29
+ * Used by "both" platforms for the user-ritual commands.
30
+ *
31
+ * `start` is filtered out on agent-capable platforms.
32
+ */
33
+ export declare function resolveCommands(ctx: TemplateContext): ResolvedTemplate[];
34
+ /**
35
+ * Resolve only the 5 skill templates with trellis- prefix + SKILL.md frontmatter.
36
+ * Used by "both" platforms for the auto-triggered skills.
37
+ */
38
+ export declare function resolveSkills(ctx: TemplateContext): ResolvedTemplate[];
39
+ /** Write skill directories from resolved templates */
40
+ export declare function writeSkills(skillsRoot: string, skills: {
41
+ name: string;
42
+ content: string;
43
+ }[]): Promise<void>;
44
+ /** Write agent/droid definition files */
45
+ export declare function writeAgents(agentsDir: string, agents: {
46
+ name: string;
47
+ content: string;
48
+ }[], ext?: string): Promise<void>;
49
+ /** Write shared hook scripts to a hooks directory */
50
+ export declare function writeSharedHooks(hooksDir: string, options?: {
51
+ exclude?: readonly string[];
52
+ }): Promise<void>;
53
+ export type SubAgentType = "implement" | "check";
54
+ /** Build the standard "load Trellis context first" prelude block. */
55
+ export declare function buildPullBasedPrelude(agentType: SubAgentType): string;
56
+ /** Insert prelude into a markdown agent definition (after YAML frontmatter). */
57
+ export declare function injectPullBasedPreludeMarkdown(content: string, agentType: SubAgentType): string;
58
+ /** Insert prelude into a TOML agent (codex `developer_instructions`). */
59
+ export declare function injectPullBasedPreludeToml(content: string, agentType: SubAgentType): string;
60
+ /** Best-effort detect agent type from filename ("implement.md" → "implement").
61
+ * Returns null for research and unknown names — they skip the prelude.
62
+ */
63
+ export declare function detectSubAgentType(name: string): SubAgentType | null;
64
+ /** Shared transform: given a list of agents, prepend pull-based prelude to
65
+ * implement/check definitions. Used by both configurator (init-time write)
66
+ * and collectPlatformTemplates (update-time hash comparison) so the two
67
+ * code paths always agree on what's on disk.
68
+ */
69
+ export interface AgentContent {
70
+ name: string;
71
+ content: string;
72
+ }
73
+ export declare function applyPullBasedPreludeMarkdown(agents: readonly AgentContent[]): AgentContent[];
74
+ export declare function applyPullBasedPreludeToml(agents: readonly AgentContent[]): AgentContent[];
12
75
  //# sourceMappingURL=shared.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/configurators/shared.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAUH;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE3D"}
1
+ {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/configurators/shared.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAiD5D,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,eAAe,GACxB,MAAM,CAiCR;AA0BD;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,GACd,MAAM,CAUR;AAcD,uDAAuD;AACvD,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAoBD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,eAAe,GAAG,gBAAgB,EAAE,CAY3E;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,eAAe,GAAG,gBAAgB,EAA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AAS,YAAY,EAAE,GAC9B,YAAY,EAAE,CAShB;AAED,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,SAAS,YAAY,EAAE,GAC9B,YAAY,EAAE,CAShB"}
@@ -13,9 +13,257 @@ function getPythonCommand() {
13
13
  }
14
14
  /**
15
15
  * Resolve platform-specific placeholders in template content.
16
- * Used by both init (configurators) and update (collectTemplates in index.ts).
16
+ *
17
+ * When called without a context, only resolves {{PYTHON_CMD}} (legacy behavior
18
+ * for settings.json, hooks.json, etc.).
19
+ *
20
+ * When called with a TemplateContext, additionally resolves:
21
+ * - {{CMD_REF:name}} → platform-specific command reference
22
+ * - {{EXECUTOR_AI}} → AI executor description
23
+ * - {{USER_ACTION_LABEL}} → user action label
24
+ * - {{#FLAG}}...{{/FLAG}} → conditional include (when FLAG is true)
25
+ * - {{^FLAG}}...{{/FLAG}} → negated conditional (when FLAG is false)
26
+ *
27
+ * Supported conditional flags: AGENT_CAPABLE, HAS_HOOKS
28
+ */
29
+ // Pre-compiled regexes for placeholder resolution
30
+ const RE_PYTHON_CMD = /\{\{PYTHON_CMD\}\}/g;
31
+ const RE_CMD_REF = /\{\{CMD_REF:([\w][\w-]*)\}\}/g;
32
+ const RE_EXECUTOR_AI = /\{\{EXECUTOR_AI\}\}/g;
33
+ const RE_USER_ACTION_LABEL = /\{\{USER_ACTION_LABEL\}\}/g;
34
+ const RE_BLANK_LINES = /\n{3,}/g;
35
+ const CONDITIONAL_FLAGS = ["AGENT_CAPABLE", "HAS_HOOKS"];
36
+ const CONDITIONAL_REGEXES = Object.fromEntries(CONDITIONAL_FLAGS.map((flag) => [
37
+ flag,
38
+ {
39
+ pos: new RegExp(`\\{\\{#${flag}\\}\\}([\\s\\S]*?)\\{\\{/${flag}\\}\\}`, "g"),
40
+ neg: new RegExp(`\\{\\{\\^${flag}\\}\\}([\\s\\S]*?)\\{\\{/${flag}\\}\\}`, "g"),
41
+ },
42
+ ]));
43
+ export function resolvePlaceholders(content, context) {
44
+ let result = content.replace(RE_PYTHON_CMD, getPythonCommand());
45
+ if (!context)
46
+ return result;
47
+ // Simple substitutions
48
+ result = result.replace(RE_CMD_REF, (_match, name) => `${context.cmdRefPrefix}${name}`);
49
+ result = result.replace(RE_EXECUTOR_AI, context.executorAI);
50
+ result = result.replace(RE_USER_ACTION_LABEL, context.userActionLabel);
51
+ // Conditional blocks
52
+ const flagValues = {
53
+ AGENT_CAPABLE: context.agentCapable,
54
+ HAS_HOOKS: context.hasHooks,
55
+ };
56
+ for (const flag of CONDITIONAL_FLAGS) {
57
+ const value = flagValues[flag];
58
+ const { pos, neg } = CONDITIONAL_REGEXES[flag];
59
+ // Reset lastIndex for global regexes reused across calls
60
+ pos.lastIndex = 0;
61
+ neg.lastIndex = 0;
62
+ result = result.replace(pos, value ? "$1" : "");
63
+ result = result.replace(neg, value ? "" : "$1");
64
+ }
65
+ // Clean up blank lines left by removed conditional blocks
66
+ result = result.replace(RE_BLANK_LINES, "\n\n");
67
+ return result;
68
+ }
69
+ // ---------------------------------------------------------------------------
70
+ // Template wrapping utilities
71
+ // ---------------------------------------------------------------------------
72
+ /** Skill description registry — maps template name to auto-trigger description. */
73
+ const SKILL_DESCRIPTIONS = {
74
+ start: "Initializes an AI development session by reading workflow guides, developer identity, git status, active tasks, and project guidelines from .trellis/. Classifies incoming tasks and routes to brainstorm, direct edit, or task workflow. Use when beginning a new coding session, resuming work, starting a new task, or re-establishing project context.",
75
+ continue: "Resume work on the current task. Loads the workflow Phase Index, figures out which phase/step to pick up at, then pulls the step-level detail via get_context.py --mode phase. Use when coming back to an in-progress task and you need to know what to do next.",
76
+ "finish-work": "Wrap up the current session: verify quality gate passed, remind user to commit, archive completed tasks, and record session progress to the developer journal. Use when done coding and ready to end the session.",
77
+ "before-dev": "Discovers and injects project-specific coding guidelines from .trellis/spec/ before implementation begins. Reads spec indexes, pre-development checklists, and shared thinking guides for the target package. Use when starting a new coding task, before writing any code, switching to a different package, or needing to refresh project conventions and standards.",
78
+ brainstorm: "Guides collaborative requirements discovery before implementation. Creates task directory, seeds PRD, asks high-value questions one at a time, researches technical choices, and converges on MVP scope. Use when requirements are unclear, there are multiple valid approaches, or the user describes a new feature or complex task.",
79
+ check: "Comprehensive quality verification: spec compliance, lint, type-check, tests, cross-layer data flow, code reuse, and consistency checks. Use when code is written and needs quality verification, before committing changes, or to catch context drift during long sessions.",
80
+ "break-loop": "Deep bug analysis to break the fix-forget-repeat cycle. Analyzes root cause category, why fixes failed, prevention mechanisms, and captures knowledge into specs. Use after fixing a bug to prevent the same class of bugs.",
81
+ "update-spec": "Captures executable contracts and coding conventions into .trellis/spec/ documents. Use when learning something valuable from debugging, implementing, or discussion that should be preserved for future sessions.",
82
+ };
83
+ /**
84
+ * Wrap resolved template content with YAML frontmatter for skill format.
85
+ * Used by platforms that use SKILL.md (Codex, Kiro, Qoder, etc.).
86
+ */
87
+ export function wrapWithSkillFrontmatter(name, content) {
88
+ // Look up description by base name (without trellis- prefix)
89
+ const baseName = name.replace(/^trellis-/, "");
90
+ const description = SKILL_DESCRIPTIONS[baseName];
91
+ if (!description) {
92
+ throw new Error(`Missing skill description for "${baseName}". Add it to SKILL_DESCRIPTIONS in shared.ts.`);
93
+ }
94
+ return `---\nname: ${name}\ndescription: "${description}"\n---\n\n${content}`;
95
+ }
96
+ // ---------------------------------------------------------------------------
97
+ // Shared configurator helpers
98
+ // ---------------------------------------------------------------------------
99
+ import path from "node:path";
100
+ import { ensureDir, writeFile } from "../utils/file-writer.js";
101
+ import { getCommandTemplates, getSkillTemplates, } from "../templates/common/index.js";
102
+ /**
103
+ * Filter command templates based on platform capabilities.
104
+ *
105
+ * `start.md` is only emitted for agent-less platforms (kilo, antigravity,
106
+ * windsurf). On agent-capable platforms, the session-start hook / plugin
107
+ * already injects the workflow overview, so a user-facing `start` command
108
+ * would be redundant.
109
+ */
110
+ function filterCommands(templates, ctx) {
111
+ if (ctx.agentCapable) {
112
+ return templates.filter((t) => t.name !== "start");
113
+ }
114
+ return templates;
115
+ }
116
+ /**
117
+ * Resolve ALL templates as skills with trellis- prefix.
118
+ * Used by skill-only platforms (Kiro, Qoder, Codex) where everything is a skill.
119
+ *
120
+ * `start` is filtered out on agent-capable platforms — the session-start hook
121
+ * injects the workflow overview instead.
17
122
  */
18
- export function resolvePlaceholders(content) {
19
- return content.replace(/\{\{PYTHON_CMD\}\}/g, getPythonCommand());
123
+ export function resolveAllAsSkills(ctx) {
124
+ const templates = [
125
+ ...filterCommands(getCommandTemplates(), ctx),
126
+ ...getSkillTemplates(),
127
+ ];
128
+ return templates.map((tmpl) => ({
129
+ name: `trellis-${tmpl.name}`,
130
+ content: wrapWithSkillFrontmatter(`trellis-${tmpl.name}`, resolvePlaceholders(tmpl.content, ctx)),
131
+ }));
132
+ }
133
+ /**
134
+ * Resolve command templates as plain commands (no wrapping).
135
+ * Used by "both" platforms for the user-ritual commands.
136
+ *
137
+ * `start` is filtered out on agent-capable platforms.
138
+ */
139
+ export function resolveCommands(ctx) {
140
+ return filterCommands(getCommandTemplates(), ctx).map((tmpl) => ({
141
+ name: tmpl.name,
142
+ content: resolvePlaceholders(tmpl.content, ctx),
143
+ }));
144
+ }
145
+ /**
146
+ * Resolve only the 5 skill templates with trellis- prefix + SKILL.md frontmatter.
147
+ * Used by "both" platforms for the auto-triggered skills.
148
+ */
149
+ export function resolveSkills(ctx) {
150
+ return getSkillTemplates().map((tmpl) => ({
151
+ name: `trellis-${tmpl.name}`,
152
+ content: wrapWithSkillFrontmatter(`trellis-${tmpl.name}`, resolvePlaceholders(tmpl.content, ctx)),
153
+ }));
154
+ }
155
+ // ---------------------------------------------------------------------------
156
+ // Shared configurator write helpers
157
+ // ---------------------------------------------------------------------------
158
+ /** Write skill directories from resolved templates */
159
+ export async function writeSkills(skillsRoot, skills) {
160
+ ensureDir(skillsRoot);
161
+ for (const skill of skills) {
162
+ const skillDir = path.join(skillsRoot, skill.name);
163
+ ensureDir(skillDir);
164
+ await writeFile(path.join(skillDir, "SKILL.md"), skill.content);
165
+ }
166
+ }
167
+ /** Write agent/droid definition files */
168
+ export async function writeAgents(agentsDir, agents, ext = ".md") {
169
+ ensureDir(agentsDir);
170
+ for (const agent of agents) {
171
+ await writeFile(path.join(agentsDir, `${agent.name}${ext}`), agent.content);
172
+ }
173
+ }
174
+ /** Write shared hook scripts to a hooks directory */
175
+ export async function writeSharedHooks(hooksDir, options = {}) {
176
+ const { getSharedHookScripts } = await import("../templates/shared-hooks/index.js");
177
+ const exclude = new Set(options.exclude ?? []);
178
+ ensureDir(hooksDir);
179
+ for (const hook of getSharedHookScripts()) {
180
+ if (exclude.has(hook.name))
181
+ continue;
182
+ await writeFile(path.join(hooksDir, hook.name), hook.content);
183
+ }
184
+ }
185
+ /** Build the standard "load Trellis context first" prelude block. */
186
+ export function buildPullBasedPrelude(agentType) {
187
+ const jsonl = agentType === "check" ? "check.jsonl" : "implement.jsonl";
188
+ return `## Required: Load Trellis Context First
189
+
190
+ This platform does NOT auto-inject task context via hook. Before doing anything else, you MUST load context yourself:
191
+
192
+ 1. Read \`.trellis/.current-task\` to find the current task path (e.g. \`.trellis/tasks/04-17-foo/\`).
193
+ 2. Read the task's \`prd.md\` (requirements) and \`info.md\` if it exists (technical design).
194
+ 3. Read \`<task-path>/${jsonl}\` — JSONL list of dev spec files relevant to this agent.
195
+ 4. For each entry in the JSONL, Read its \`file\` path — these are the dev specs you must follow.
196
+
197
+ If \`.current-task\` is missing or the task has no \`prd.md\`, ask the user what to work on; do NOT proceed without context.
198
+
199
+ ---
200
+
201
+ `;
202
+ }
203
+ /** Insert prelude into a markdown agent definition (after YAML frontmatter). */
204
+ export function injectPullBasedPreludeMarkdown(content, agentType) {
205
+ const prelude = buildPullBasedPrelude(agentType);
206
+ const lines = content.split("\n");
207
+ if (lines[0] !== "---") {
208
+ return prelude + content;
209
+ }
210
+ // Find closing frontmatter
211
+ let close = -1;
212
+ for (let i = 1; i < lines.length; i++) {
213
+ if (lines[i] === "---") {
214
+ close = i;
215
+ break;
216
+ }
217
+ }
218
+ if (close === -1) {
219
+ return prelude + content;
220
+ }
221
+ const head = lines.slice(0, close + 1).join("\n");
222
+ const tail = lines.slice(close + 1).join("\n");
223
+ // Skip leading blank lines in tail to keep things tidy
224
+ const tailTrimmed = tail.replace(/^\n+/, "");
225
+ return `${head}\n\n${prelude}${tailTrimmed}`;
226
+ }
227
+ /** Insert prelude into a TOML agent (codex `developer_instructions`). */
228
+ export function injectPullBasedPreludeToml(content, agentType) {
229
+ const prelude = buildPullBasedPrelude(agentType);
230
+ // Match: developer_instructions = """ followed by newline
231
+ const re = /(developer_instructions\s*=\s*""")(\r?\n)/;
232
+ if (!re.test(content)) {
233
+ return content;
234
+ }
235
+ return content.replace(re, `$1$2${prelude}`);
236
+ }
237
+ /** Best-effort detect agent type from filename ("implement.md" → "implement").
238
+ * Returns null for research and unknown names — they skip the prelude.
239
+ */
240
+ export function detectSubAgentType(name) {
241
+ const base = name.replace(/\.(md|toml|prompt\.md)$/, "");
242
+ if (base === "implement" || base === "check") {
243
+ return base;
244
+ }
245
+ return null;
246
+ }
247
+ export function applyPullBasedPreludeMarkdown(agents) {
248
+ return agents.map((a) => {
249
+ const t = detectSubAgentType(a.name);
250
+ if (!t)
251
+ return { ...a };
252
+ return {
253
+ ...a,
254
+ content: injectPullBasedPreludeMarkdown(a.content, t),
255
+ };
256
+ });
257
+ }
258
+ export function applyPullBasedPreludeToml(agents) {
259
+ return agents.map((a) => {
260
+ const t = detectSubAgentType(a.name);
261
+ if (!t)
262
+ return { ...a };
263
+ return {
264
+ ...a,
265
+ content: injectPullBasedPreludeToml(a.content, t),
266
+ };
267
+ });
20
268
  }
21
269
  //# sourceMappingURL=shared.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"shared.js","sourceRoot":"","sources":["../../src/configurators/shared.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;GAGG;AACH,SAAS,gBAAgB;IACvB,OAAO,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,QAAQ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E,0BAA0B,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;SAClD,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -1,8 +1,7 @@
1
1
  /**
2
- * Configure Windsurf by writing workflow templates.
3
- *
4
- * Output:
5
- * - .windsurf/workflows/<workflow-name>.md
2
+ * Configure Windsurf:
3
+ * - workflows/ — start + finish-work as slash commands
4
+ * - skills/trellis-{name}/SKILL.md — other 5 as auto-triggered skills
6
5
  */
7
6
  export declare function configureWindsurf(cwd: string): Promise<void>;
8
7
  //# sourceMappingURL=windsurf.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"windsurf.d.ts","sourceRoot":"","sources":["../../src/configurators/windsurf.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAQlE"}
1
+ {"version":3,"file":"windsurf.d.ts","sourceRoot":"","sources":["../../src/configurators/windsurf.ts"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAmBlE"}
@@ -1,18 +1,25 @@
1
1
  import path from "node:path";
2
- import { getAllWorkflows } from "../templates/windsurf/index.js";
2
+ import { AI_TOOLS } from "../types/ai-tools.js";
3
3
  import { ensureDir, writeFile } from "../utils/file-writer.js";
4
+ import { resolveCommands, resolveSkills } from "./shared.js";
4
5
  /**
5
- * Configure Windsurf by writing workflow templates.
6
- *
7
- * Output:
8
- * - .windsurf/workflows/<workflow-name>.md
6
+ * Configure Windsurf:
7
+ * - workflows/ — start + finish-work as slash commands
8
+ * - skills/trellis-{name}/SKILL.md — other 5 as auto-triggered skills
9
9
  */
10
10
  export async function configureWindsurf(cwd) {
11
- const workflowRoot = path.join(cwd, ".windsurf", "workflows");
12
- ensureDir(workflowRoot);
13
- for (const workflow of getAllWorkflows()) {
14
- const targetPath = path.join(workflowRoot, `${workflow.name}.md`);
15
- await writeFile(targetPath, workflow.content);
11
+ const ctx = AI_TOOLS.windsurf.templateContext;
12
+ const workflowsDir = path.join(cwd, ".windsurf", "workflows");
13
+ ensureDir(workflowsDir);
14
+ for (const cmd of resolveCommands(ctx)) {
15
+ await writeFile(path.join(workflowsDir, `trellis-${cmd.name}.md`), cmd.content);
16
+ }
17
+ const skillsDir = path.join(cwd, ".windsurf", "skills");
18
+ ensureDir(skillsDir);
19
+ for (const skill of resolveSkills(ctx)) {
20
+ const skillDir = path.join(skillsDir, skill.name);
21
+ ensureDir(skillDir);
22
+ await writeFile(path.join(skillDir, "SKILL.md"), skill.content);
16
23
  }
17
24
  }
18
25
  //# sourceMappingURL=windsurf.js.map