@jahanxu/trellis 0.4.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 (422) hide show
  1. package/LICENSE +235 -0
  2. package/README.md +212 -0
  3. package/bin/trellis.js +3 -0
  4. package/dist/cli/index.d.ts +3 -0
  5. package/dist/cli/index.d.ts.map +1 -0
  6. package/dist/cli/index.js +97 -0
  7. package/dist/cli/index.js.map +1 -0
  8. package/dist/commands/init.d.ts +21 -0
  9. package/dist/commands/init.d.ts.map +1 -0
  10. package/dist/commands/init.js +527 -0
  11. package/dist/commands/init.js.map +1 -0
  12. package/dist/commands/update.d.ts +27 -0
  13. package/dist/commands/update.d.ts.map +1 -0
  14. package/dist/commands/update.js +1289 -0
  15. package/dist/commands/update.js.map +1 -0
  16. package/dist/configurators/antigravity.d.ts +8 -0
  17. package/dist/configurators/antigravity.d.ts.map +1 -0
  18. package/dist/configurators/antigravity.js +18 -0
  19. package/dist/configurators/antigravity.js.map +1 -0
  20. package/dist/configurators/claude.d.ts +32 -0
  21. package/dist/configurators/claude.d.ts.map +1 -0
  22. package/dist/configurators/claude.js +98 -0
  23. package/dist/configurators/claude.js.map +1 -0
  24. package/dist/configurators/codex.d.ts +8 -0
  25. package/dist/configurators/codex.d.ts.map +1 -0
  26. package/dist/configurators/codex.js +20 -0
  27. package/dist/configurators/codex.js.map +1 -0
  28. package/dist/configurators/cursor.d.ts +5 -0
  29. package/dist/configurators/cursor.d.ts.map +1 -0
  30. package/dist/configurators/cursor.js +52 -0
  31. package/dist/configurators/cursor.js.map +1 -0
  32. package/dist/configurators/gemini.d.ts +8 -0
  33. package/dist/configurators/gemini.d.ts.map +1 -0
  34. package/dist/configurators/gemini.js +52 -0
  35. package/dist/configurators/gemini.js.map +1 -0
  36. package/dist/configurators/iflow.d.ts +33 -0
  37. package/dist/configurators/iflow.d.ts.map +1 -0
  38. package/dist/configurators/iflow.js +99 -0
  39. package/dist/configurators/iflow.js.map +1 -0
  40. package/dist/configurators/index.d.ts +55 -0
  41. package/dist/configurators/index.d.ts.map +1 -0
  42. package/dist/configurators/index.js +220 -0
  43. package/dist/configurators/index.js.map +1 -0
  44. package/dist/configurators/kilo.d.ts +8 -0
  45. package/dist/configurators/kilo.d.ts.map +1 -0
  46. package/dist/configurators/kilo.js +51 -0
  47. package/dist/configurators/kilo.js.map +1 -0
  48. package/dist/configurators/kiro.d.ts +8 -0
  49. package/dist/configurators/kiro.d.ts.map +1 -0
  50. package/dist/configurators/kiro.js +20 -0
  51. package/dist/configurators/kiro.js.map +1 -0
  52. package/dist/configurators/opencode.d.ts +32 -0
  53. package/dist/configurators/opencode.d.ts.map +1 -0
  54. package/dist/configurators/opencode.js +92 -0
  55. package/dist/configurators/opencode.js.map +1 -0
  56. package/dist/configurators/shared.d.ts +12 -0
  57. package/dist/configurators/shared.d.ts.map +1 -0
  58. package/dist/configurators/shared.js +21 -0
  59. package/dist/configurators/shared.js.map +1 -0
  60. package/dist/configurators/workflow.d.ts +28 -0
  61. package/dist/configurators/workflow.d.ts.map +1 -0
  62. package/dist/configurators/workflow.js +134 -0
  63. package/dist/configurators/workflow.js.map +1 -0
  64. package/dist/constants/paths.d.ts +68 -0
  65. package/dist/constants/paths.d.ts.map +1 -0
  66. package/dist/constants/paths.js +77 -0
  67. package/dist/constants/paths.js.map +1 -0
  68. package/dist/constants/version.d.ts +9 -0
  69. package/dist/constants/version.d.ts.map +1 -0
  70. package/dist/constants/version.js +15 -0
  71. package/dist/constants/version.js.map +1 -0
  72. package/dist/index.d.ts +9 -0
  73. package/dist/index.d.ts.map +1 -0
  74. package/dist/index.js +9 -0
  75. package/dist/index.js.map +1 -0
  76. package/dist/migrations/index.d.ts +54 -0
  77. package/dist/migrations/index.d.ts.map +1 -0
  78. package/dist/migrations/index.js +160 -0
  79. package/dist/migrations/index.js.map +1 -0
  80. package/dist/migrations/manifests/0.1.9.json +30 -0
  81. package/dist/migrations/manifests/0.2.0.json +49 -0
  82. package/dist/migrations/manifests/0.2.12.json +9 -0
  83. package/dist/migrations/manifests/0.2.13.json +9 -0
  84. package/dist/migrations/manifests/0.2.14.json +175 -0
  85. package/dist/migrations/manifests/0.2.15.json +33 -0
  86. package/dist/migrations/manifests/0.3.0-beta.0.json +278 -0
  87. package/dist/migrations/manifests/0.3.0-beta.1.json +9 -0
  88. package/dist/migrations/manifests/0.3.0-beta.10.json +9 -0
  89. package/dist/migrations/manifests/0.3.0-beta.11.json +9 -0
  90. package/dist/migrations/manifests/0.3.0-beta.12.json +9 -0
  91. package/dist/migrations/manifests/0.3.0-beta.13.json +9 -0
  92. package/dist/migrations/manifests/0.3.0-beta.14.json +9 -0
  93. package/dist/migrations/manifests/0.3.0-beta.15.json +9 -0
  94. package/dist/migrations/manifests/0.3.0-beta.16.json +9 -0
  95. package/dist/migrations/manifests/0.3.0-beta.2.json +9 -0
  96. package/dist/migrations/manifests/0.3.0-beta.3.json +9 -0
  97. package/dist/migrations/manifests/0.3.0-beta.4.json +9 -0
  98. package/dist/migrations/manifests/0.3.0-beta.5.json +9 -0
  99. package/dist/migrations/manifests/0.3.0-beta.6.json +9 -0
  100. package/dist/migrations/manifests/0.3.0-beta.7.json +11 -0
  101. package/dist/migrations/manifests/0.3.0-beta.8.json +9 -0
  102. package/dist/migrations/manifests/0.3.0-beta.9.json +9 -0
  103. package/dist/migrations/manifests/0.3.0-rc.0.json +9 -0
  104. package/dist/migrations/manifests/0.3.0-rc.1.json +9 -0
  105. package/dist/migrations/manifests/0.3.0-rc.2.json +9 -0
  106. package/dist/migrations/manifests/0.3.0-rc.3.json +9 -0
  107. package/dist/migrations/manifests/0.3.0-rc.4.json +9 -0
  108. package/dist/migrations/manifests/0.3.0-rc.5.json +9 -0
  109. package/dist/migrations/manifests/0.3.0-rc.6.json +9 -0
  110. package/dist/migrations/manifests/0.3.0.json +11 -0
  111. package/dist/templates/antigravity/index.d.ts +12 -0
  112. package/dist/templates/antigravity/index.d.ts.map +1 -0
  113. package/dist/templates/antigravity/index.js +29 -0
  114. package/dist/templates/antigravity/index.js.map +1 -0
  115. package/dist/templates/claude/agents/check.md +122 -0
  116. package/dist/templates/claude/agents/debug.md +106 -0
  117. package/dist/templates/claude/agents/dispatch.md +214 -0
  118. package/dist/templates/claude/agents/implement.md +96 -0
  119. package/dist/templates/claude/agents/plan.md +396 -0
  120. package/dist/templates/claude/agents/research.md +120 -0
  121. package/dist/templates/claude/commands/trellis/before-backend-dev.md +13 -0
  122. package/dist/templates/claude/commands/trellis/before-frontend-dev.md +13 -0
  123. package/dist/templates/claude/commands/trellis/before-role-work.md +364 -0
  124. package/dist/templates/claude/commands/trellis/brainstorm.md +474 -0
  125. package/dist/templates/claude/commands/trellis/break-loop.md +125 -0
  126. package/dist/templates/claude/commands/trellis/check-backend.md +13 -0
  127. package/dist/templates/claude/commands/trellis/check-cross-layer.md +153 -0
  128. package/dist/templates/claude/commands/trellis/check-frontend.md +13 -0
  129. package/dist/templates/claude/commands/trellis/create-command.md +154 -0
  130. package/dist/templates/claude/commands/trellis/finish-work.md +153 -0
  131. package/dist/templates/claude/commands/trellis/handoff.md +445 -0
  132. package/dist/templates/claude/commands/trellis/integrate-skill.md +219 -0
  133. package/dist/templates/claude/commands/trellis/onboard.md +358 -0
  134. package/dist/templates/claude/commands/trellis/parallel.md +193 -0
  135. package/dist/templates/claude/commands/trellis/pick-task.md +515 -0
  136. package/dist/templates/claude/commands/trellis/record-session.md +62 -0
  137. package/dist/templates/claude/commands/trellis/start.md +373 -0
  138. package/dist/templates/claude/commands/trellis/update-spec.md +354 -0
  139. package/dist/templates/claude/hooks/inject-subagent-context.py +873 -0
  140. package/dist/templates/claude/hooks/ralph-loop.py +388 -0
  141. package/dist/templates/claude/hooks/session-start.py +200 -0
  142. package/dist/templates/claude/index.d.ts +54 -0
  143. package/dist/templates/claude/index.d.ts.map +1 -0
  144. package/dist/templates/claude/index.js +85 -0
  145. package/dist/templates/claude/index.js.map +1 -0
  146. package/dist/templates/claude/settings.json +41 -0
  147. package/dist/templates/codex/index.d.ts +18 -0
  148. package/dist/templates/codex/index.d.ts.map +1 -0
  149. package/dist/templates/codex/index.js +40 -0
  150. package/dist/templates/codex/index.js.map +1 -0
  151. package/dist/templates/codex/skills/before-backend-dev/SKILL.md +18 -0
  152. package/dist/templates/codex/skills/before-frontend-dev/SKILL.md +18 -0
  153. package/dist/templates/codex/skills/brainstorm/SKILL.md +479 -0
  154. package/dist/templates/codex/skills/break-loop/SKILL.md +130 -0
  155. package/dist/templates/codex/skills/check-backend/SKILL.md +18 -0
  156. package/dist/templates/codex/skills/check-cross-layer/SKILL.md +158 -0
  157. package/dist/templates/codex/skills/check-frontend/SKILL.md +18 -0
  158. package/dist/templates/codex/skills/create-command/SKILL.md +101 -0
  159. package/dist/templates/codex/skills/finish-work/SKILL.md +148 -0
  160. package/dist/templates/codex/skills/integrate-skill/SKILL.md +221 -0
  161. package/dist/templates/codex/skills/onboard/SKILL.md +363 -0
  162. package/dist/templates/codex/skills/record-session/SKILL.md +67 -0
  163. package/dist/templates/codex/skills/start/SKILL.md +330 -0
  164. package/dist/templates/codex/skills/update-spec/SKILL.md +335 -0
  165. package/dist/templates/cursor/commands/trellis-before-backend-dev.md +13 -0
  166. package/dist/templates/cursor/commands/trellis-before-frontend-dev.md +13 -0
  167. package/dist/templates/cursor/commands/trellis-brainstorm.md +474 -0
  168. package/dist/templates/cursor/commands/trellis-break-loop.md +107 -0
  169. package/dist/templates/cursor/commands/trellis-check-backend.md +13 -0
  170. package/dist/templates/cursor/commands/trellis-check-cross-layer.md +153 -0
  171. package/dist/templates/cursor/commands/trellis-check-frontend.md +13 -0
  172. package/dist/templates/cursor/commands/trellis-create-command.md +154 -0
  173. package/dist/templates/cursor/commands/trellis-finish-work.md +143 -0
  174. package/dist/templates/cursor/commands/trellis-integrate-skill.md +219 -0
  175. package/dist/templates/cursor/commands/trellis-onboard.md +358 -0
  176. package/dist/templates/cursor/commands/trellis-record-session.md +62 -0
  177. package/dist/templates/cursor/commands/trellis-start.md +366 -0
  178. package/dist/templates/cursor/commands/trellis-update-spec.md +354 -0
  179. package/dist/templates/cursor/index.d.ts +24 -0
  180. package/dist/templates/cursor/index.d.ts.map +1 -0
  181. package/dist/templates/cursor/index.js +44 -0
  182. package/dist/templates/cursor/index.js.map +1 -0
  183. package/dist/templates/extract.d.ts +166 -0
  184. package/dist/templates/extract.d.ts.map +1 -0
  185. package/dist/templates/extract.js +296 -0
  186. package/dist/templates/extract.js.map +1 -0
  187. package/dist/templates/gemini/commands/trellis/before-backend-dev.toml +17 -0
  188. package/dist/templates/gemini/commands/trellis/before-frontend-dev.toml +17 -0
  189. package/dist/templates/gemini/commands/trellis/brainstorm.toml +420 -0
  190. package/dist/templates/gemini/commands/trellis/break-loop.toml +129 -0
  191. package/dist/templates/gemini/commands/trellis/check-backend.toml +17 -0
  192. package/dist/templates/gemini/commands/trellis/check-cross-layer.toml +147 -0
  193. package/dist/templates/gemini/commands/trellis/check-frontend.toml +17 -0
  194. package/dist/templates/gemini/commands/trellis/create-command.toml +119 -0
  195. package/dist/templates/gemini/commands/trellis/finish-work.toml +133 -0
  196. package/dist/templates/gemini/commands/trellis/integrate-skill.toml +104 -0
  197. package/dist/templates/gemini/commands/trellis/onboard.toml +111 -0
  198. package/dist/templates/gemini/commands/trellis/record-session.toml +66 -0
  199. package/dist/templates/gemini/commands/trellis/start.toml +292 -0
  200. package/dist/templates/gemini/commands/trellis/update-spec.toml +132 -0
  201. package/dist/templates/gemini/index.d.ts +21 -0
  202. package/dist/templates/gemini/index.d.ts.map +1 -0
  203. package/dist/templates/gemini/index.js +44 -0
  204. package/dist/templates/gemini/index.js.map +1 -0
  205. package/dist/templates/iflow/agents/check.md +122 -0
  206. package/dist/templates/iflow/agents/debug.md +106 -0
  207. package/dist/templates/iflow/agents/dispatch.md +214 -0
  208. package/dist/templates/iflow/agents/implement.md +96 -0
  209. package/dist/templates/iflow/agents/plan.md +396 -0
  210. package/dist/templates/iflow/agents/research.md +120 -0
  211. package/dist/templates/iflow/commands/trellis/before-backend-dev.md +13 -0
  212. package/dist/templates/iflow/commands/trellis/before-frontend-dev.md +13 -0
  213. package/dist/templates/iflow/commands/trellis/brainstorm.md +474 -0
  214. package/dist/templates/iflow/commands/trellis/break-loop.md +125 -0
  215. package/dist/templates/iflow/commands/trellis/check-backend.md +13 -0
  216. package/dist/templates/iflow/commands/trellis/check-cross-layer.md +153 -0
  217. package/dist/templates/iflow/commands/trellis/check-frontend.md +13 -0
  218. package/dist/templates/iflow/commands/trellis/create-command.md +152 -0
  219. package/dist/templates/iflow/commands/trellis/finish-work.md +153 -0
  220. package/dist/templates/iflow/commands/trellis/integrate-skill.md +219 -0
  221. package/dist/templates/iflow/commands/trellis/onboard.md +358 -0
  222. package/dist/templates/iflow/commands/trellis/parallel.md +193 -0
  223. package/dist/templates/iflow/commands/trellis/record-session.md +62 -0
  224. package/dist/templates/iflow/commands/trellis/start.md +373 -0
  225. package/dist/templates/iflow/commands/trellis/update-spec.md +354 -0
  226. package/dist/templates/iflow/hooks/inject-subagent-context.py +788 -0
  227. package/dist/templates/iflow/hooks/ralph-loop.py +388 -0
  228. package/dist/templates/iflow/hooks/session-start.py +143 -0
  229. package/dist/templates/iflow/index.d.ts +54 -0
  230. package/dist/templates/iflow/index.d.ts.map +1 -0
  231. package/dist/templates/iflow/index.js +85 -0
  232. package/dist/templates/iflow/index.js.map +1 -0
  233. package/dist/templates/iflow/settings.json +40 -0
  234. package/dist/templates/kilo/commands/trellis/before-backend-dev.md +13 -0
  235. package/dist/templates/kilo/commands/trellis/before-frontend-dev.md +13 -0
  236. package/dist/templates/kilo/commands/trellis/brainstorm.md +474 -0
  237. package/dist/templates/kilo/commands/trellis/break-loop.md +125 -0
  238. package/dist/templates/kilo/commands/trellis/check-backend.md +13 -0
  239. package/dist/templates/kilo/commands/trellis/check-cross-layer.md +153 -0
  240. package/dist/templates/kilo/commands/trellis/check-frontend.md +13 -0
  241. package/dist/templates/kilo/commands/trellis/create-command.md +152 -0
  242. package/dist/templates/kilo/commands/trellis/finish-work.md +129 -0
  243. package/dist/templates/kilo/commands/trellis/integrate-skill.md +219 -0
  244. package/dist/templates/kilo/commands/trellis/onboard.md +358 -0
  245. package/dist/templates/kilo/commands/trellis/parallel.md +194 -0
  246. package/dist/templates/kilo/commands/trellis/record-session.md +62 -0
  247. package/dist/templates/kilo/commands/trellis/start.md +321 -0
  248. package/dist/templates/kilo/commands/trellis/update-spec.md +285 -0
  249. package/dist/templates/kilo/index.d.ts +16 -0
  250. package/dist/templates/kilo/index.d.ts.map +1 -0
  251. package/dist/templates/kilo/index.js +39 -0
  252. package/dist/templates/kilo/index.js.map +1 -0
  253. package/dist/templates/kiro/index.d.ts +18 -0
  254. package/dist/templates/kiro/index.d.ts.map +1 -0
  255. package/dist/templates/kiro/index.js +40 -0
  256. package/dist/templates/kiro/index.js.map +1 -0
  257. package/dist/templates/kiro/skills/before-backend-dev/SKILL.md +18 -0
  258. package/dist/templates/kiro/skills/before-frontend-dev/SKILL.md +18 -0
  259. package/dist/templates/kiro/skills/brainstorm/SKILL.md +479 -0
  260. package/dist/templates/kiro/skills/break-loop/SKILL.md +130 -0
  261. package/dist/templates/kiro/skills/check-backend/SKILL.md +18 -0
  262. package/dist/templates/kiro/skills/check-cross-layer/SKILL.md +158 -0
  263. package/dist/templates/kiro/skills/check-frontend/SKILL.md +18 -0
  264. package/dist/templates/kiro/skills/create-command/SKILL.md +101 -0
  265. package/dist/templates/kiro/skills/finish-work/SKILL.md +148 -0
  266. package/dist/templates/kiro/skills/integrate-skill/SKILL.md +221 -0
  267. package/dist/templates/kiro/skills/onboard/SKILL.md +363 -0
  268. package/dist/templates/kiro/skills/record-session/SKILL.md +67 -0
  269. package/dist/templates/kiro/skills/start/SKILL.md +330 -0
  270. package/dist/templates/kiro/skills/update-spec/SKILL.md +335 -0
  271. package/dist/templates/markdown/agents.md +18 -0
  272. package/dist/templates/markdown/gitignore.txt +12 -0
  273. package/dist/templates/markdown/index.d.ts +27 -0
  274. package/dist/templates/markdown/index.d.ts.map +1 -0
  275. package/dist/templates/markdown/index.js +52 -0
  276. package/dist/templates/markdown/index.js.map +1 -0
  277. package/dist/templates/markdown/spec/backend/database-guidelines.md.txt +51 -0
  278. package/dist/templates/markdown/spec/backend/directory-structure.md.txt +54 -0
  279. package/dist/templates/markdown/spec/backend/error-handling.md.txt +51 -0
  280. package/dist/templates/markdown/spec/backend/index.md +40 -0
  281. package/dist/templates/markdown/spec/backend/index.md.txt +38 -0
  282. package/dist/templates/markdown/spec/backend/logging-guidelines.md.txt +51 -0
  283. package/dist/templates/markdown/spec/backend/quality-guidelines.md.txt +51 -0
  284. package/dist/templates/markdown/spec/backend/script-conventions.md +467 -0
  285. package/dist/templates/markdown/spec/frontend/component-guidelines.md.txt +59 -0
  286. package/dist/templates/markdown/spec/frontend/directory-structure.md.txt +54 -0
  287. package/dist/templates/markdown/spec/frontend/hook-guidelines.md.txt +51 -0
  288. package/dist/templates/markdown/spec/frontend/index.md.txt +39 -0
  289. package/dist/templates/markdown/spec/frontend/quality-guidelines.md.txt +51 -0
  290. package/dist/templates/markdown/spec/frontend/state-management.md.txt +51 -0
  291. package/dist/templates/markdown/spec/frontend/type-safety.md.txt +51 -0
  292. package/dist/templates/markdown/spec/guides/code-reuse-thinking-guide.md +118 -0
  293. package/dist/templates/markdown/spec/guides/code-reuse-thinking-guide.md.txt +92 -0
  294. package/dist/templates/markdown/spec/guides/cross-layer-thinking-guide.md.txt +94 -0
  295. package/dist/templates/markdown/spec/guides/cross-platform-thinking-guide.md +394 -0
  296. package/dist/templates/markdown/spec/guides/cross-platform-thinking-guide.md.txt +319 -0
  297. package/dist/templates/markdown/spec/guides/index.md.txt +79 -0
  298. package/dist/templates/markdown/workspace-index.md +123 -0
  299. package/dist/templates/markdown/worktree.yaml.txt +58 -0
  300. package/dist/templates/opencode/agents/check.md +146 -0
  301. package/dist/templates/opencode/agents/debug.md +129 -0
  302. package/dist/templates/opencode/agents/dispatch.md +223 -0
  303. package/dist/templates/opencode/agents/implement.md +120 -0
  304. package/dist/templates/opencode/agents/research.md +147 -0
  305. package/dist/templates/opencode/agents/trellis-plan.md +427 -0
  306. package/dist/templates/opencode/commands/trellis/before-backend-dev.md +13 -0
  307. package/dist/templates/opencode/commands/trellis/before-frontend-dev.md +13 -0
  308. package/dist/templates/opencode/commands/trellis/brainstorm.md +474 -0
  309. package/dist/templates/opencode/commands/trellis/break-loop.md +125 -0
  310. package/dist/templates/opencode/commands/trellis/check-backend.md +13 -0
  311. package/dist/templates/opencode/commands/trellis/check-cross-layer.md +153 -0
  312. package/dist/templates/opencode/commands/trellis/check-frontend.md +13 -0
  313. package/dist/templates/opencode/commands/trellis/create-command.md +154 -0
  314. package/dist/templates/opencode/commands/trellis/finish-work.md +144 -0
  315. package/dist/templates/opencode/commands/trellis/integrate-skill.md +219 -0
  316. package/dist/templates/opencode/commands/trellis/migrate-specs.md +0 -0
  317. package/dist/templates/opencode/commands/trellis/onboard.md +358 -0
  318. package/dist/templates/opencode/commands/trellis/parallel.md +194 -0
  319. package/dist/templates/opencode/commands/trellis/record-session.md +62 -0
  320. package/dist/templates/opencode/commands/trellis/start.md +338 -0
  321. package/dist/templates/opencode/commands/trellis/update-spec.md +354 -0
  322. package/dist/templates/opencode/lib/trellis-context.js +436 -0
  323. package/dist/templates/opencode/package.json +5 -0
  324. package/dist/templates/opencode/plugin/inject-subagent-context.js +538 -0
  325. package/dist/templates/opencode/plugin/session-start.js +192 -0
  326. package/dist/templates/trellis/VERSION +1 -0
  327. package/dist/templates/trellis/deliverables/README.md +51 -0
  328. package/dist/templates/trellis/gitignore.txt +29 -0
  329. package/dist/templates/trellis/index.d.ts +49 -0
  330. package/dist/templates/trellis/index.d.ts.map +1 -0
  331. package/dist/templates/trellis/index.js +92 -0
  332. package/dist/templates/trellis/index.js.map +1 -0
  333. package/dist/templates/trellis/paths.README.md +277 -0
  334. package/dist/templates/trellis/paths.yaml +41 -0
  335. package/dist/templates/trellis/pool/implementations.json +5 -0
  336. package/dist/templates/trellis/pool/prototypes.json +5 -0
  337. package/dist/templates/trellis/pool/requirements.json +5 -0
  338. package/dist/templates/trellis/scripts/__init__.py +5 -0
  339. package/dist/templates/trellis/scripts/add_session.py +391 -0
  340. package/dist/templates/trellis/scripts/common/__init__.py +80 -0
  341. package/dist/templates/trellis/scripts/common/cli_adapter.py +522 -0
  342. package/dist/templates/trellis/scripts/common/developer.py +189 -0
  343. package/dist/templates/trellis/scripts/common/git_context.py +383 -0
  344. package/dist/templates/trellis/scripts/common/paths.py +346 -0
  345. package/dist/templates/trellis/scripts/common/phase.py +253 -0
  346. package/dist/templates/trellis/scripts/common/project_paths.py +189 -0
  347. package/dist/templates/trellis/scripts/common/registry.py +365 -0
  348. package/dist/templates/trellis/scripts/common/task_queue.py +255 -0
  349. package/dist/templates/trellis/scripts/common/task_utils.py +177 -0
  350. package/dist/templates/trellis/scripts/common/worktree.py +218 -0
  351. package/dist/templates/trellis/scripts/create_bootstrap.py +290 -0
  352. package/dist/templates/trellis/scripts/get_context.py +16 -0
  353. package/dist/templates/trellis/scripts/get_developer.py +26 -0
  354. package/dist/templates/trellis/scripts/handoff_generator.py +380 -0
  355. package/dist/templates/trellis/scripts/init_developer.py +51 -0
  356. package/dist/templates/trellis/scripts/multi_agent/__init__.py +5 -0
  357. package/dist/templates/trellis/scripts/multi_agent/cleanup.py +403 -0
  358. package/dist/templates/trellis/scripts/multi_agent/create_pr.py +329 -0
  359. package/dist/templates/trellis/scripts/multi_agent/plan.py +233 -0
  360. package/dist/templates/trellis/scripts/multi_agent/start.py +461 -0
  361. package/dist/templates/trellis/scripts/multi_agent/status.py +817 -0
  362. package/dist/templates/trellis/scripts/pool.py +373 -0
  363. package/dist/templates/trellis/scripts/task.py +1162 -0
  364. package/dist/templates/trellis/scripts-shell-archive/add-session.sh +384 -0
  365. package/dist/templates/trellis/scripts-shell-archive/common/developer.sh +129 -0
  366. package/dist/templates/trellis/scripts-shell-archive/common/git-context.sh +263 -0
  367. package/dist/templates/trellis/scripts-shell-archive/common/paths.sh +208 -0
  368. package/dist/templates/trellis/scripts-shell-archive/common/phase.sh +150 -0
  369. package/dist/templates/trellis/scripts-shell-archive/common/registry.sh +247 -0
  370. package/dist/templates/trellis/scripts-shell-archive/common/task-queue.sh +142 -0
  371. package/dist/templates/trellis/scripts-shell-archive/common/task-utils.sh +151 -0
  372. package/dist/templates/trellis/scripts-shell-archive/common/worktree.sh +128 -0
  373. package/dist/templates/trellis/scripts-shell-archive/create-bootstrap.sh +299 -0
  374. package/dist/templates/trellis/scripts-shell-archive/get-context.sh +7 -0
  375. package/dist/templates/trellis/scripts-shell-archive/get-developer.sh +15 -0
  376. package/dist/templates/trellis/scripts-shell-archive/init-developer.sh +34 -0
  377. package/dist/templates/trellis/scripts-shell-archive/multi-agent/cleanup.sh +396 -0
  378. package/dist/templates/trellis/scripts-shell-archive/multi-agent/create-pr.sh +241 -0
  379. package/dist/templates/trellis/scripts-shell-archive/multi-agent/plan.sh +207 -0
  380. package/dist/templates/trellis/scripts-shell-archive/multi-agent/start.sh +317 -0
  381. package/dist/templates/trellis/scripts-shell-archive/multi-agent/status.sh +828 -0
  382. package/dist/templates/trellis/scripts-shell-archive/task.sh +1204 -0
  383. package/dist/templates/trellis/spec/roles/designer/index.md +243 -0
  384. package/dist/templates/trellis/spec/roles/designer/mock-data-standards.md +481 -0
  385. package/dist/templates/trellis/spec/roles/designer/prototype-guidelines.md +429 -0
  386. package/dist/templates/trellis/spec/roles/frontend-impl/api-integration.md +565 -0
  387. package/dist/templates/trellis/spec/roles/frontend-impl/index.md +321 -0
  388. package/dist/templates/trellis/spec/roles/frontend-impl/state-management.md +599 -0
  389. package/dist/templates/trellis/spec/roles/pm/index.md +112 -0
  390. package/dist/templates/trellis/spec/roles/pm/prd-template.md +124 -0
  391. package/dist/templates/trellis/tasks/.gitkeep +0 -0
  392. package/dist/templates/trellis/workflow.md +416 -0
  393. package/dist/templates/trellis/worktree.yaml +47 -0
  394. package/dist/types/ai-tools.d.ts +56 -0
  395. package/dist/types/ai-tools.d.ts.map +1 -0
  396. package/dist/types/ai-tools.js +103 -0
  397. package/dist/types/ai-tools.js.map +1 -0
  398. package/dist/types/migration.d.ts +86 -0
  399. package/dist/types/migration.d.ts.map +1 -0
  400. package/dist/types/migration.js +8 -0
  401. package/dist/types/migration.js.map +1 -0
  402. package/dist/utils/compare-versions.d.ts +12 -0
  403. package/dist/utils/compare-versions.d.ts.map +1 -0
  404. package/dist/utils/compare-versions.js +76 -0
  405. package/dist/utils/compare-versions.js.map +1 -0
  406. package/dist/utils/file-writer.d.ts +23 -0
  407. package/dist/utils/file-writer.d.ts.map +1 -0
  408. package/dist/utils/file-writer.js +140 -0
  409. package/dist/utils/file-writer.js.map +1 -0
  410. package/dist/utils/project-detector.d.ts +16 -0
  411. package/dist/utils/project-detector.d.ts.map +1 -0
  412. package/dist/utils/project-detector.js +186 -0
  413. package/dist/utils/project-detector.js.map +1 -0
  414. package/dist/utils/template-fetcher.d.ts +51 -0
  415. package/dist/utils/template-fetcher.d.ts.map +1 -0
  416. package/dist/utils/template-fetcher.js +174 -0
  417. package/dist/utils/template-fetcher.js.map +1 -0
  418. package/dist/utils/template-hash.d.ts +78 -0
  419. package/dist/utils/template-hash.d.ts.map +1 -0
  420. package/dist/utils/template-hash.js +233 -0
  421. package/dist/utils/template-hash.js.map +1 -0
  422. package/package.json +87 -0
@@ -0,0 +1,527 @@
1
+ import { execSync } from "node:child_process";
2
+ import fs from "node:fs";
3
+ import path from "node:path";
4
+ import readline from "node:readline";
5
+ import chalk from "chalk";
6
+ import figlet from "figlet";
7
+ import inquirer from "inquirer";
8
+ import { createWorkflowStructure } from "../configurators/workflow.js";
9
+ import { getInitToolChoices, resolveCliFlag, configurePlatform, getPlatformsWithPythonHooks, } from "../configurators/index.js";
10
+ import { AI_TOOLS } from "../types/ai-tools.js";
11
+ import { DIR_NAMES, FILE_NAMES, PATHS } from "../constants/paths.js";
12
+ import { VERSION } from "../constants/version.js";
13
+ import { agentsMdContent } from "../templates/markdown/index.js";
14
+ import { setWriteMode, writeFile, } from "../utils/file-writer.js";
15
+ import { detectProjectType, } from "../utils/project-detector.js";
16
+ import { initializeHashes } from "../utils/template-hash.js";
17
+ import { fetchTemplateIndex, downloadTemplateById, } from "../utils/template-fetcher.js";
18
+ /**
19
+ * Detect available Python command (python3 or python)
20
+ */
21
+ function getPythonCommand() {
22
+ // Try python3 first (preferred on macOS/Linux)
23
+ try {
24
+ execSync("python3 --version", { stdio: "pipe" });
25
+ return "python3";
26
+ }
27
+ catch {
28
+ // Fall back to python (common on Windows)
29
+ try {
30
+ execSync("python --version", { stdio: "pipe" });
31
+ return "python";
32
+ }
33
+ catch {
34
+ // Default to python3, let it fail with a clear error
35
+ return "python3";
36
+ }
37
+ }
38
+ }
39
+ // =============================================================================
40
+ // Bootstrap Task Creation
41
+ // =============================================================================
42
+ const BOOTSTRAP_TASK_NAME = "00-bootstrap-guidelines";
43
+ function getBootstrapPrdContent(projectType) {
44
+ const header = `# Bootstrap: Fill Project Development Guidelines
45
+
46
+ ## Purpose
47
+
48
+ Welcome to Trellis! This is your first task.
49
+
50
+ AI agents use \`.trellis/spec/\` to understand YOUR project's coding conventions.
51
+ **Empty templates = AI writes generic code that doesn't match your project style.**
52
+
53
+ Filling these guidelines is a one-time setup that pays off for every future AI session.
54
+
55
+ ---
56
+
57
+ ## Your Task
58
+
59
+ Fill in the guideline files based on your **existing codebase**.
60
+ `;
61
+ const backendSection = `
62
+
63
+ ### Backend Guidelines
64
+
65
+ | File | What to Document |
66
+ |------|------------------|
67
+ | \`.trellis/spec/backend/directory-structure.md\` | Where different file types go (routes, services, utils) |
68
+ | \`.trellis/spec/backend/database-guidelines.md\` | ORM, migrations, query patterns, naming conventions |
69
+ | \`.trellis/spec/backend/error-handling.md\` | How errors are caught, logged, and returned |
70
+ | \`.trellis/spec/backend/logging-guidelines.md\` | Log levels, format, what to log |
71
+ | \`.trellis/spec/backend/quality-guidelines.md\` | Code review standards, testing requirements |
72
+ `;
73
+ const frontendSection = `
74
+
75
+ ### Frontend Guidelines
76
+
77
+ | File | What to Document |
78
+ |------|------------------|
79
+ | \`.trellis/spec/frontend/directory-structure.md\` | Component/page/hook organization |
80
+ | \`.trellis/spec/frontend/component-guidelines.md\` | Component patterns, props conventions |
81
+ | \`.trellis/spec/frontend/hook-guidelines.md\` | Custom hook naming, patterns |
82
+ | \`.trellis/spec/frontend/state-management.md\` | State library, patterns, what goes where |
83
+ | \`.trellis/spec/frontend/type-safety.md\` | TypeScript conventions, type organization |
84
+ | \`.trellis/spec/frontend/quality-guidelines.md\` | Linting, testing, accessibility |
85
+ `;
86
+ const footer = `
87
+
88
+ ### Thinking Guides (Optional)
89
+
90
+ The \`.trellis/spec/guides/\` directory contains thinking guides that are already
91
+ filled with general best practices. You can customize them for your project if needed.
92
+
93
+ ---
94
+
95
+ ## How to Fill Guidelines
96
+
97
+ ### Step 0: Import from Existing Specs (Recommended)
98
+
99
+ Many projects already have coding conventions documented. **Check these first** before writing from scratch:
100
+
101
+ | File / Directory | Tool |
102
+ |------|------|
103
+ | \`CLAUDE.md\` / \`CLAUDE.local.md\` | Claude Code |
104
+ | \`AGENTS.md\` | Claude Code |
105
+ | \`.cursorrules\` | Cursor |
106
+ | \`.cursor/rules/*.mdc\` | Cursor (rules directory) |
107
+ | \`.windsurfrules\` | Windsurf |
108
+ | \`.clinerules\` | Cline |
109
+ | \`.roomodes\` | Roo Code |
110
+ | \`.github/copilot-instructions.md\` | GitHub Copilot |
111
+ | \`.vscode/settings.json\` → \`github.copilot.chat.codeGeneration.instructions\` | VS Code Copilot |
112
+ | \`CONVENTIONS.md\` / \`.aider.conf.yml\` | aider |
113
+ | \`CONTRIBUTING.md\` | General project conventions |
114
+ | \`.editorconfig\` | Editor formatting rules |
115
+
116
+ 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.
117
+
118
+ ### Step 1: Analyze the Codebase
119
+
120
+ Ask AI to help discover patterns from actual code:
121
+
122
+ - "Read all existing config files (CLAUDE.md, .cursorrules, etc.) and extract coding conventions into .trellis/spec/"
123
+ - "Analyze my codebase and document the patterns you see"
124
+ - "Find error handling / component / API patterns and document them"
125
+
126
+ ### Step 2: Document Reality, Not Ideals
127
+
128
+ Write what your codebase **actually does**, not what you wish it did.
129
+ AI needs to match existing patterns, not introduce new ones.
130
+
131
+ - **Look at existing code** - Find 2-3 examples of each pattern
132
+ - **Include file paths** - Reference real files as examples
133
+ - **List anti-patterns** - What does your team avoid?
134
+
135
+ ---
136
+
137
+ ## Completion Checklist
138
+
139
+ - [ ] Guidelines filled for your project type
140
+ - [ ] At least 2-3 real code examples in each guideline
141
+ - [ ] Anti-patterns documented
142
+
143
+ When done:
144
+
145
+ \`\`\`bash
146
+ python3 ./.trellis/scripts/task.py finish
147
+ python3 ./.trellis/scripts/task.py archive 00-bootstrap-guidelines
148
+ \`\`\`
149
+
150
+ ---
151
+
152
+ ## Why This Matters
153
+
154
+ After completing this task:
155
+
156
+ 1. AI will write code that matches your project style
157
+ 2. Relevant \`/trellis:before-*-dev\` commands will inject real context
158
+ 3. \`/trellis:check-*\` commands will validate against your actual standards
159
+ 4. Future developers (human or AI) will onboard faster
160
+ `;
161
+ let content = header;
162
+ if (projectType === "frontend") {
163
+ content += frontendSection;
164
+ }
165
+ else if (projectType === "backend") {
166
+ content += backendSection;
167
+ }
168
+ else {
169
+ // fullstack
170
+ content += backendSection;
171
+ content += frontendSection;
172
+ }
173
+ content += footer;
174
+ return content;
175
+ }
176
+ function getBootstrapTaskJson(developer, projectType) {
177
+ const today = new Date().toISOString().split("T")[0];
178
+ let subtasks;
179
+ let relatedFiles;
180
+ if (projectType === "frontend") {
181
+ subtasks = [
182
+ { name: "Fill frontend guidelines", status: "pending" },
183
+ { name: "Add code examples", status: "pending" },
184
+ ];
185
+ relatedFiles = [".trellis/spec/frontend/"];
186
+ }
187
+ else if (projectType === "backend") {
188
+ subtasks = [
189
+ { name: "Fill backend guidelines", status: "pending" },
190
+ { name: "Add code examples", status: "pending" },
191
+ ];
192
+ relatedFiles = [".trellis/spec/backend/"];
193
+ }
194
+ else {
195
+ // fullstack
196
+ subtasks = [
197
+ { name: "Fill backend guidelines", status: "pending" },
198
+ { name: "Fill frontend guidelines", status: "pending" },
199
+ { name: "Add code examples", status: "pending" },
200
+ ];
201
+ relatedFiles = [".trellis/spec/backend/", ".trellis/spec/frontend/"];
202
+ }
203
+ return {
204
+ id: BOOTSTRAP_TASK_NAME,
205
+ name: "Bootstrap Guidelines",
206
+ description: "Fill in project development guidelines for AI agents",
207
+ status: "in_progress",
208
+ dev_type: "docs",
209
+ priority: "P1",
210
+ creator: developer,
211
+ assignee: developer,
212
+ createdAt: today,
213
+ completedAt: null,
214
+ commit: null,
215
+ subtasks,
216
+ relatedFiles,
217
+ notes: `First-time setup task created by trellis init (${projectType} project)`,
218
+ };
219
+ }
220
+ /**
221
+ * Create bootstrap task for first-time setup
222
+ */
223
+ function createBootstrapTask(cwd, developer, projectType) {
224
+ const taskDir = path.join(cwd, PATHS.TASKS, BOOTSTRAP_TASK_NAME);
225
+ const taskRelativePath = `${PATHS.TASKS}/${BOOTSTRAP_TASK_NAME}`;
226
+ // Check if already exists
227
+ if (fs.existsSync(taskDir)) {
228
+ return true; // Already exists, not an error
229
+ }
230
+ try {
231
+ // Create task directory
232
+ fs.mkdirSync(taskDir, { recursive: true });
233
+ // Write task.json
234
+ const taskJson = getBootstrapTaskJson(developer, projectType);
235
+ fs.writeFileSync(path.join(taskDir, FILE_NAMES.TASK_JSON), JSON.stringify(taskJson, null, 2), "utf-8");
236
+ // Write prd.md
237
+ const prdContent = getBootstrapPrdContent(projectType);
238
+ fs.writeFileSync(path.join(taskDir, FILE_NAMES.PRD), prdContent, "utf-8");
239
+ // Set as current task
240
+ const currentTaskFile = path.join(cwd, PATHS.CURRENT_TASK_FILE);
241
+ fs.writeFileSync(currentTaskFile, taskRelativePath, "utf-8");
242
+ return true;
243
+ }
244
+ catch {
245
+ return false;
246
+ }
247
+ }
248
+ const _cliFlagCheck = true;
249
+ export async function init(options) {
250
+ const cwd = process.cwd();
251
+ // Generate ASCII art banner dynamically using FIGlet "Rebel" font
252
+ const banner = figlet.textSync("Trellis", { font: "Rebel" });
253
+ console.log(chalk.cyan(`\n${banner.trimEnd()}`));
254
+ console.log(chalk.gray("\n All-in-one AI framework & toolkit for Claude Code & Cursor\n"));
255
+ // Set write mode based on options
256
+ let writeMode = "ask";
257
+ if (options.force) {
258
+ writeMode = "force";
259
+ console.log(chalk.gray("Mode: Force overwrite existing files\n"));
260
+ }
261
+ else if (options.skipExisting) {
262
+ writeMode = "skip";
263
+ console.log(chalk.gray("Mode: Skip existing files\n"));
264
+ }
265
+ setWriteMode(writeMode);
266
+ // Detect developer name from git config or options
267
+ let developerName = options.user;
268
+ if (!developerName) {
269
+ // Only detect from git if current directory is a git repo
270
+ const isGitRepo = fs.existsSync(path.join(cwd, ".git"));
271
+ if (isGitRepo) {
272
+ try {
273
+ developerName = execSync("git config user.name", {
274
+ cwd,
275
+ encoding: "utf-8",
276
+ }).trim();
277
+ }
278
+ catch {
279
+ // Git not available or no user.name configured
280
+ }
281
+ }
282
+ }
283
+ if (developerName) {
284
+ console.log(chalk.blue("👤 Developer:"), chalk.gray(developerName));
285
+ }
286
+ else if (!options.yes) {
287
+ // Ask for developer name if not detected and not in yes mode
288
+ console.log(chalk.gray("\nTrellis supports team collaboration - each developer has their own\n" +
289
+ `workspace directory (${PATHS.WORKSPACE}/{name}/) to track AI sessions.\n` +
290
+ "Tip: Usually this is your git username (git config user.name).\n"));
291
+ developerName = await askInput("Your name: ");
292
+ while (!developerName) {
293
+ console.log(chalk.yellow("Name is required"));
294
+ developerName = await askInput("Your name: ");
295
+ }
296
+ console.log(chalk.blue("👤 Developer:"), chalk.gray(developerName));
297
+ }
298
+ // Detect project type (silent - no output)
299
+ const detectedType = detectProjectType(cwd);
300
+ // Tool definitions derived from platform registry
301
+ const TOOLS = getInitToolChoices();
302
+ // Build tools from explicit flags
303
+ const explicitTools = TOOLS.filter((t) => options[t.key]).map((t) => t.key);
304
+ let tools;
305
+ if (explicitTools.length > 0) {
306
+ // Explicit flags take precedence (works with or without -y)
307
+ tools = explicitTools;
308
+ }
309
+ else if (options.yes) {
310
+ // No explicit tools + -y: default to Cursor and Claude
311
+ tools = TOOLS.filter((t) => t.defaultChecked).map((t) => t.key);
312
+ }
313
+ else {
314
+ // Interactive mode
315
+ const answers = await inquirer.prompt([
316
+ {
317
+ type: "checkbox",
318
+ name: "tools",
319
+ message: "Select AI tools to configure:",
320
+ choices: TOOLS.map((t) => ({
321
+ name: t.name,
322
+ value: t.key,
323
+ checked: t.defaultChecked,
324
+ })),
325
+ },
326
+ ]);
327
+ tools = answers.tools;
328
+ }
329
+ // Treat unknown project type as fullstack
330
+ const projectType = detectedType === "unknown" ? "fullstack" : detectedType;
331
+ if (tools.length === 0) {
332
+ console.log(chalk.yellow("No tools selected. At least one tool is required."));
333
+ return;
334
+ }
335
+ // ==========================================================================
336
+ // Template Selection
337
+ // ==========================================================================
338
+ let selectedTemplate = null;
339
+ let templateStrategy = "skip";
340
+ // Determine template strategy from flags
341
+ if (options.overwrite) {
342
+ templateStrategy = "overwrite";
343
+ }
344
+ else if (options.append) {
345
+ templateStrategy = "append";
346
+ }
347
+ if (options.template) {
348
+ // Template specified via --template flag
349
+ selectedTemplate = options.template;
350
+ }
351
+ else if (!options.yes) {
352
+ // Interactive mode: show template selection
353
+ const templates = await fetchTemplateIndex();
354
+ if (templates.length > 0) {
355
+ // Build template choices with "blank" as first (default)
356
+ const templateChoices = [
357
+ {
358
+ name: "blank (default - empty templates)",
359
+ value: "blank",
360
+ },
361
+ ...templates
362
+ .filter((t) => t.type === "spec") // MVP: only spec templates
363
+ .map((t) => ({
364
+ name: `${t.id} (${t.name})`,
365
+ value: t.id,
366
+ })),
367
+ ];
368
+ const templateAnswer = await inquirer.prompt([
369
+ {
370
+ type: "list",
371
+ name: "template",
372
+ message: "Select a spec template:",
373
+ choices: templateChoices,
374
+ default: "blank",
375
+ },
376
+ ]);
377
+ if (templateAnswer.template !== "blank") {
378
+ selectedTemplate = templateAnswer.template;
379
+ // Check if spec directory already exists and ask what to do
380
+ const specDir = path.join(cwd, PATHS.SPEC);
381
+ if (fs.existsSync(specDir) && !options.overwrite && !options.append) {
382
+ const actionAnswer = await inquirer.prompt([
383
+ {
384
+ type: "list",
385
+ name: "action",
386
+ message: `Directory ${PATHS.SPEC} already exists. What do you want to do?`,
387
+ choices: [
388
+ { name: "Skip (keep existing)", value: "skip" },
389
+ { name: "Overwrite (replace all)", value: "overwrite" },
390
+ { name: "Append (add missing files only)", value: "append" },
391
+ ],
392
+ default: "skip",
393
+ },
394
+ ]);
395
+ templateStrategy = actionAnswer.action;
396
+ }
397
+ }
398
+ }
399
+ }
400
+ // If -y flag: selectedTemplate stays null, use blank templates
401
+ // ==========================================================================
402
+ // Download Remote Template (if selected)
403
+ // ==========================================================================
404
+ let useRemoteTemplate = false;
405
+ if (selectedTemplate) {
406
+ console.log(chalk.blue(`📦 Downloading template "${selectedTemplate}"...`));
407
+ const result = await downloadTemplateById(cwd, selectedTemplate, templateStrategy);
408
+ if (result.success) {
409
+ if (result.skipped) {
410
+ console.log(chalk.gray(` ${result.message}`));
411
+ }
412
+ else {
413
+ console.log(chalk.green(` ${result.message}`));
414
+ useRemoteTemplate = true;
415
+ }
416
+ }
417
+ else {
418
+ console.log(chalk.yellow(` ${result.message}`));
419
+ console.log(chalk.gray(" Falling back to blank templates..."));
420
+ }
421
+ }
422
+ // ==========================================================================
423
+ // Create Workflow Structure
424
+ // ==========================================================================
425
+ // Create workflow structure with project type
426
+ // Multi-agent is enabled by default
427
+ console.log(chalk.blue("📁 Creating workflow structure..."));
428
+ await createWorkflowStructure(cwd, {
429
+ projectType,
430
+ multiAgent: true,
431
+ skipSpecTemplates: useRemoteTemplate,
432
+ });
433
+ // Write version file for update tracking
434
+ const versionPath = path.join(cwd, DIR_NAMES.WORKFLOW, ".version");
435
+ fs.writeFileSync(versionPath, VERSION);
436
+ // Configure selected tools by copying entire directories (dogfooding)
437
+ for (const tool of tools) {
438
+ const platformId = resolveCliFlag(tool);
439
+ if (platformId) {
440
+ console.log(chalk.blue(`📝 Configuring ${AI_TOOLS[platformId].name}...`));
441
+ await configurePlatform(platformId, cwd);
442
+ }
443
+ }
444
+ // Show Windows platform detection notice
445
+ if (process.platform === "win32") {
446
+ const pythonPlatforms = getPlatformsWithPythonHooks();
447
+ const hasSelectedPythonPlatform = pythonPlatforms.some((id) => tools.includes(AI_TOOLS[id].cliFlag));
448
+ if (hasSelectedPythonPlatform) {
449
+ console.log(chalk.yellow('📌 Windows detected: Using "python" for hooks'));
450
+ }
451
+ }
452
+ // Create root files (skip if exists)
453
+ await createRootFiles(cwd);
454
+ // Initialize template hashes for modification tracking
455
+ const hashedCount = initializeHashes(cwd);
456
+ if (hashedCount > 0) {
457
+ console.log(chalk.gray(`📋 Tracking ${hashedCount} template files for updates`));
458
+ }
459
+ // Initialize developer identity (silent - no output)
460
+ if (developerName) {
461
+ try {
462
+ const pythonCmd = getPythonCommand();
463
+ const scriptPath = path.join(cwd, PATHS.SCRIPTS, "init_developer.py");
464
+ execSync(`${pythonCmd} "${scriptPath}" "${developerName}"`, {
465
+ cwd,
466
+ stdio: "pipe", // Silent
467
+ });
468
+ // Create bootstrap task to guide user through filling guidelines
469
+ createBootstrapTask(cwd, developerName, projectType);
470
+ }
471
+ catch {
472
+ // Silent failure - user can run init_developer.py manually
473
+ }
474
+ }
475
+ // Print "What We Solve" section
476
+ printWhatWeSolve();
477
+ }
478
+ /**
479
+ * Simple readline-based input (no flickering like inquirer)
480
+ */
481
+ function askInput(prompt) {
482
+ const rl = readline.createInterface({
483
+ input: process.stdin,
484
+ output: process.stdout,
485
+ });
486
+ return new Promise((resolve) => {
487
+ rl.question(prompt, (answer) => {
488
+ rl.close();
489
+ resolve(answer.trim());
490
+ });
491
+ });
492
+ }
493
+ async function createRootFiles(cwd) {
494
+ const agentsPath = path.join(cwd, "AGENTS.md");
495
+ // Write AGENTS.md from template
496
+ const agentsWritten = await writeFile(agentsPath, agentsMdContent);
497
+ if (agentsWritten) {
498
+ console.log(chalk.blue("📄 Created AGENTS.md"));
499
+ }
500
+ }
501
+ /**
502
+ * Print "What We Solve" section showing Trellis value proposition
503
+ * Styled like a meme/rant to resonate with developer pain points
504
+ */
505
+ function printWhatWeSolve() {
506
+ console.log(chalk.gray("\nSound familiar? ") +
507
+ chalk.bold("You'll never say these again!!\n"));
508
+ // Pain point 1: Bug loop → Thinking Guides + Ralph Loop
509
+ console.log(chalk.gray("✗ ") + '"Fix A → break B → fix B → break A..."');
510
+ console.log(chalk.green(" ✓ ") +
511
+ chalk.white("Thinking Guides + Ralph Loop: Think first, verify after"));
512
+ // Pain point 2: Instructions ignored/forgotten → Sub-agents + per-agent spec injection
513
+ console.log(chalk.gray("✗ ") +
514
+ '"Wrote CLAUDE.md, AI ignored it. Reminded AI, it forgot 5 turns later."');
515
+ console.log(chalk.green(" ✓ ") +
516
+ chalk.white("Spec Injection: Rules enforced per task, not per chat"));
517
+ // Pain point 3: Missing connections → Cross-Layer Guide
518
+ console.log(chalk.gray("✗ ") + '"Code works but nothing connects..."');
519
+ console.log(chalk.green(" ✓ ") +
520
+ chalk.white("Cross-Layer Guide: Map data flow before coding"));
521
+ // Pain point 4: Code explosion → Plan Agent
522
+ console.log(chalk.gray("✗ ") + '"Asked for a button, got 9000 lines"');
523
+ console.log(chalk.green(" ✓ ") +
524
+ chalk.white("Plan Agent: Rejects and splits oversized tasks"));
525
+ console.log("");
526
+ }
527
+ //# sourceMappingURL=init.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,W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AChE,CAAC;IACF,4CAA4C;IAC5C,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,sCAAsC,CAAC,CAAC;IACvE,OAAO,CAAC,GAAG,CACT,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC;QACjB,KAAK,CAAC,KAAK,CAAC,gDAAgD,CAAC,CAChE,CAAC;IAEF,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AAClB,CAAC"}
@@ -0,0 +1,27 @@
1
+ import type { MigrationItem } from "../types/migration.js";
2
+ export interface UpdateOptions {
3
+ dryRun?: boolean;
4
+ force?: boolean;
5
+ skipAll?: boolean;
6
+ createNew?: boolean;
7
+ allowDowngrade?: boolean;
8
+ migrate?: boolean;
9
+ }
10
+ /**
11
+ * Clean up empty directories after file migration
12
+ * Recursively removes empty parent directories up to .trellis root
13
+ */
14
+ /** @internal Exported for testing only */
15
+ export declare function cleanupEmptyDirs(cwd: string, dirPath: string): void;
16
+ /**
17
+ * Sort migrations for safe execution order
18
+ * - rename-dir with deeper paths first (to handle nested directories)
19
+ * - rename-dir before rename/delete
20
+ */
21
+ /** @internal Exported for testing only */
22
+ export declare function sortMigrationsForExecution(migrations: MigrationItem[]): MigrationItem[];
23
+ /**
24
+ * Main update command
25
+ */
26
+ export declare function update(options: UpdateOptions): Promise<void>;
27
+ //# sourceMappingURL=update.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/commands/update.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EACV,aAAa,EAKd,MAAM,uBAAuB,CAAC;AA8E/B,MAAM,WAAW,aAAa;IAC5B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAouBD;;;GAGG;AACH,0CAA0C;AAC1C,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAgCnE;AAED;;;;GAIG;AACH,0CAA0C;AAC1C,wBAAgB,0BAA0B,CACxC,UAAU,EAAE,aAAa,EAAE,GAC1B,aAAa,EAAE,CAajB;AAsLD;;GAEG;AACH,wBAAsB,MAAM,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAmnBlE"}