@mindfoldhq/trellis 0.3.10 → 0.4.0-beta.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (304) hide show
  1. package/README.md +19 -5
  2. package/dist/cli/index.js +5 -0
  3. package/dist/cli/index.js.map +1 -1
  4. package/dist/commands/init.d.ts +4 -0
  5. package/dist/commands/init.d.ts.map +1 -1
  6. package/dist/commands/init.js +240 -43
  7. package/dist/commands/init.js.map +1 -1
  8. package/dist/commands/update.d.ts.map +1 -1
  9. package/dist/commands/update.js +206 -47
  10. package/dist/commands/update.js.map +1 -1
  11. package/dist/configurators/codebuddy.d.ts +11 -0
  12. package/dist/configurators/codebuddy.d.ts.map +1 -0
  13. package/dist/configurators/codebuddy.js +58 -0
  14. package/dist/configurators/codebuddy.js.map +1 -0
  15. package/dist/configurators/codex.d.ts +7 -4
  16. package/dist/configurators/codex.d.ts.map +1 -1
  17. package/dist/configurators/codex.js +40 -10
  18. package/dist/configurators/codex.js.map +1 -1
  19. package/dist/configurators/copilot.d.ts +9 -0
  20. package/dist/configurators/copilot.d.ts.map +1 -0
  21. package/dist/configurators/copilot.js +34 -0
  22. package/dist/configurators/copilot.js.map +1 -0
  23. package/dist/configurators/index.d.ts +11 -1
  24. package/dist/configurators/index.d.ts.map +1 -1
  25. package/dist/configurators/index.js +72 -4
  26. package/dist/configurators/index.js.map +1 -1
  27. package/dist/configurators/opencode.d.ts +1 -1
  28. package/dist/configurators/opencode.js +1 -1
  29. package/dist/configurators/windsurf.d.ts +8 -0
  30. package/dist/configurators/windsurf.d.ts.map +1 -0
  31. package/dist/configurators/windsurf.js +18 -0
  32. package/dist/configurators/windsurf.js.map +1 -0
  33. package/dist/configurators/workflow.d.ts +6 -2
  34. package/dist/configurators/workflow.d.ts.map +1 -1
  35. package/dist/configurators/workflow.js +90 -58
  36. package/dist/configurators/workflow.js.map +1 -1
  37. package/dist/migrations/index.d.ts +1 -0
  38. package/dist/migrations/index.d.ts.map +1 -1
  39. package/dist/migrations/index.js +2 -0
  40. package/dist/migrations/index.js.map +1 -1
  41. package/dist/migrations/manifests/0.4.0-beta.1.json +228 -0
  42. package/dist/migrations/manifests/0.4.0-beta.10.json +9 -0
  43. package/dist/migrations/manifests/0.4.0-beta.2.json +9 -0
  44. package/dist/migrations/manifests/0.4.0-beta.3.json +9 -0
  45. package/dist/migrations/manifests/0.4.0-beta.4.json +9 -0
  46. package/dist/migrations/manifests/0.4.0-beta.5.json +9 -0
  47. package/dist/migrations/manifests/0.4.0-beta.6.json +9 -0
  48. package/dist/migrations/manifests/0.4.0-beta.7.json +9 -0
  49. package/dist/migrations/manifests/0.4.0-beta.8.json +34 -0
  50. package/dist/migrations/manifests/0.4.0-beta.9.json +9 -0
  51. package/dist/templates/claude/agents/dispatch.md +1 -2
  52. package/dist/templates/claude/agents/implement.md +2 -3
  53. package/dist/templates/claude/commands/trellis/before-dev.md +29 -0
  54. package/dist/templates/claude/commands/trellis/check.md +25 -0
  55. package/dist/templates/claude/commands/trellis/create-command.md +2 -2
  56. package/dist/templates/claude/commands/trellis/onboard.md +13 -13
  57. package/dist/templates/claude/commands/trellis/parallel.md +1 -2
  58. package/dist/templates/claude/commands/trellis/record-session.md +3 -2
  59. package/dist/templates/claude/commands/trellis/start.md +8 -4
  60. package/dist/templates/claude/hooks/inject-subagent-context.py +29 -14
  61. package/dist/templates/claude/hooks/ralph-loop.py +18 -10
  62. package/dist/templates/claude/hooks/session-start.py +201 -9
  63. package/dist/templates/claude/hooks/statusline.py +211 -0
  64. package/dist/templates/claude/settings.json +4 -0
  65. package/dist/templates/codebuddy/commands/trellis/before-dev.md +29 -0
  66. package/dist/templates/codebuddy/commands/trellis/brainstorm.md +487 -0
  67. package/dist/templates/codebuddy/commands/trellis/break-loop.md +107 -0
  68. package/dist/templates/codebuddy/commands/trellis/check-cross-layer.md +153 -0
  69. package/dist/templates/codebuddy/commands/trellis/check.md +25 -0
  70. package/dist/templates/codebuddy/commands/trellis/create-command.md +154 -0
  71. package/dist/templates/codebuddy/commands/trellis/finish-work.md +143 -0
  72. package/dist/templates/codebuddy/commands/trellis/integrate-skill.md +219 -0
  73. package/dist/templates/codebuddy/commands/trellis/onboard.md +358 -0
  74. package/dist/templates/codebuddy/commands/trellis/record-session.md +61 -0
  75. package/dist/templates/codebuddy/commands/trellis/start.md +373 -0
  76. package/dist/templates/codebuddy/commands/trellis/update-spec.md +354 -0
  77. package/dist/templates/codebuddy/index.d.ts +25 -0
  78. package/dist/templates/codebuddy/index.d.ts.map +1 -0
  79. package/dist/templates/codebuddy/index.js +45 -0
  80. package/dist/templates/codebuddy/index.js.map +1 -0
  81. package/dist/templates/codex/agents/check.toml +23 -0
  82. package/dist/templates/codex/agents/implement.toml +19 -0
  83. package/dist/templates/codex/agents/research.toml +26 -0
  84. package/dist/templates/codex/codex-skills/parallel/SKILL.md +194 -0
  85. package/dist/templates/codex/config.toml +5 -0
  86. package/dist/templates/codex/hooks/session-start.py +228 -0
  87. package/dist/templates/codex/hooks.json +16 -0
  88. package/dist/templates/codex/index.d.ts +27 -5
  89. package/dist/templates/codex/index.d.ts.map +1 -1
  90. package/dist/templates/codex/index.js +60 -8
  91. package/dist/templates/codex/index.js.map +1 -1
  92. package/dist/templates/codex/skills/before-dev/SKILL.md +34 -0
  93. package/dist/templates/codex/skills/brainstorm/SKILL.md +1 -1
  94. package/dist/templates/codex/skills/break-loop/SKILL.md +1 -1
  95. package/dist/templates/codex/skills/check/SKILL.md +30 -0
  96. package/dist/templates/codex/skills/check-cross-layer/SKILL.md +1 -1
  97. package/dist/templates/codex/skills/create-command/SKILL.md +3 -3
  98. package/dist/templates/codex/skills/finish-work/SKILL.md +1 -1
  99. package/dist/templates/codex/skills/improve-ut/SKILL.md +69 -0
  100. package/dist/templates/codex/skills/integrate-skill/SKILL.md +1 -1
  101. package/dist/templates/codex/skills/onboard/SKILL.md +12 -12
  102. package/dist/templates/codex/skills/record-session/SKILL.md +4 -3
  103. package/dist/templates/codex/skills/start/SKILL.md +9 -4
  104. package/dist/templates/codex/skills/update-spec/SKILL.md +1 -1
  105. package/dist/templates/copilot/hooks/session-start.py +218 -0
  106. package/dist/templates/copilot/hooks.json +11 -0
  107. package/dist/templates/copilot/index.d.ts +23 -0
  108. package/dist/templates/copilot/index.d.ts.map +1 -0
  109. package/dist/templates/copilot/index.js +54 -0
  110. package/dist/templates/copilot/index.js.map +1 -0
  111. package/dist/templates/copilot/prompts/before-dev.prompt.md +33 -0
  112. package/dist/templates/copilot/prompts/brainstorm.prompt.md +491 -0
  113. package/dist/templates/copilot/prompts/break-loop.prompt.md +129 -0
  114. package/dist/templates/copilot/prompts/check-cross-layer.prompt.md +157 -0
  115. package/dist/templates/copilot/prompts/check.prompt.md +29 -0
  116. package/dist/templates/copilot/prompts/create-command.prompt.md +116 -0
  117. package/dist/templates/copilot/prompts/finish-work.prompt.md +157 -0
  118. package/dist/templates/copilot/prompts/integrate-skill.prompt.md +223 -0
  119. package/dist/templates/copilot/prompts/onboard.prompt.md +362 -0
  120. package/dist/templates/copilot/prompts/parallel.prompt.md +196 -0
  121. package/dist/templates/copilot/prompts/record-session.prompt.md +66 -0
  122. package/dist/templates/copilot/prompts/start.prompt.md +397 -0
  123. package/dist/templates/copilot/prompts/update-spec.prompt.md +358 -0
  124. package/dist/templates/cursor/commands/trellis-before-dev.md +29 -0
  125. package/dist/templates/cursor/commands/trellis-check.md +25 -0
  126. package/dist/templates/cursor/commands/trellis-create-command.md +2 -2
  127. package/dist/templates/cursor/commands/trellis-onboard.md +13 -13
  128. package/dist/templates/cursor/commands/trellis-record-session.md +3 -2
  129. package/dist/templates/cursor/commands/trellis-start.md +7 -16
  130. package/dist/templates/extract.d.ts +36 -0
  131. package/dist/templates/extract.d.ts.map +1 -1
  132. package/dist/templates/extract.js +64 -0
  133. package/dist/templates/extract.js.map +1 -1
  134. package/dist/templates/gemini/commands/trellis/before-dev.toml +33 -0
  135. package/dist/templates/gemini/commands/trellis/check.toml +29 -0
  136. package/dist/templates/gemini/commands/trellis/create-command.toml +2 -2
  137. package/dist/templates/gemini/commands/trellis/onboard.toml +2 -2
  138. package/dist/templates/gemini/commands/trellis/record-session.toml +3 -2
  139. package/dist/templates/gemini/commands/trellis/start.toml +9 -4
  140. package/dist/templates/iflow/agents/dispatch.md +1 -2
  141. package/dist/templates/iflow/agents/implement.md +2 -3
  142. package/dist/templates/iflow/commands/trellis/before-dev.md +29 -0
  143. package/dist/templates/iflow/commands/trellis/check.md +25 -0
  144. package/dist/templates/iflow/commands/trellis/create-command.md +2 -2
  145. package/dist/templates/iflow/commands/trellis/onboard.md +13 -13
  146. package/dist/templates/iflow/commands/trellis/parallel.md +1 -2
  147. package/dist/templates/iflow/commands/trellis/record-session.md +3 -2
  148. package/dist/templates/iflow/commands/trellis/start.md +8 -4
  149. package/dist/templates/iflow/hooks/inject-subagent-context.py +29 -14
  150. package/dist/templates/iflow/hooks/ralph-loop.py +8 -1
  151. package/dist/templates/iflow/hooks/session-start.py +187 -8
  152. package/dist/templates/kilo/workflows/before-dev.md +29 -0
  153. package/dist/templates/kilo/workflows/check.md +25 -0
  154. package/dist/templates/kilo/workflows/create-command.md +2 -2
  155. package/dist/templates/kilo/workflows/onboard.md +13 -13
  156. package/dist/templates/kilo/workflows/parallel.md +1 -2
  157. package/dist/templates/kilo/workflows/record-session.md +3 -2
  158. package/dist/templates/kilo/workflows/start.md +8 -3
  159. package/dist/templates/kiro/skills/before-dev/SKILL.md +34 -0
  160. package/dist/templates/kiro/skills/brainstorm/SKILL.md +1 -1
  161. package/dist/templates/kiro/skills/break-loop/SKILL.md +1 -1
  162. package/dist/templates/kiro/skills/check/SKILL.md +30 -0
  163. package/dist/templates/kiro/skills/check-cross-layer/SKILL.md +1 -1
  164. package/dist/templates/kiro/skills/create-command/SKILL.md +3 -3
  165. package/dist/templates/kiro/skills/finish-work/SKILL.md +1 -1
  166. package/dist/templates/kiro/skills/integrate-skill/SKILL.md +1 -1
  167. package/dist/templates/kiro/skills/onboard/SKILL.md +12 -12
  168. package/dist/templates/kiro/skills/record-session/SKILL.md +4 -3
  169. package/dist/templates/kiro/skills/start/SKILL.md +9 -4
  170. package/dist/templates/kiro/skills/update-spec/SKILL.md +1 -1
  171. package/dist/templates/markdown/agents.md +4 -0
  172. package/dist/templates/markdown/spec/backend/directory-structure.md +1 -1
  173. package/dist/templates/markdown/spec/backend/script-conventions.md +93 -0
  174. package/dist/templates/markdown/workspace-index.md +2 -0
  175. package/dist/templates/opencode/agents/dispatch.md +21 -21
  176. package/dist/templates/opencode/agents/implement.md +2 -2
  177. package/dist/templates/opencode/agents/research.md +1 -2
  178. package/dist/templates/opencode/commands/trellis/before-dev.md +29 -0
  179. package/dist/templates/opencode/commands/trellis/check.md +25 -0
  180. package/dist/templates/opencode/commands/trellis/create-command.md +2 -2
  181. package/dist/templates/opencode/commands/trellis/onboard.md +13 -13
  182. package/dist/templates/opencode/commands/trellis/parallel.md +1 -2
  183. package/dist/templates/opencode/commands/trellis/record-session.md +3 -2
  184. package/dist/templates/opencode/commands/trellis/start.md +8 -3
  185. package/dist/templates/opencode/lib/trellis-context.js +42 -2
  186. package/dist/templates/opencode/{plugin → plugins}/inject-subagent-context.js +45 -18
  187. package/dist/templates/opencode/{plugin → plugins}/session-start.js +156 -28
  188. package/dist/templates/qoder/skills/before-dev/SKILL.md +34 -0
  189. package/dist/templates/qoder/skills/brainstorm/SKILL.md +1 -1
  190. package/dist/templates/qoder/skills/break-loop/SKILL.md +1 -1
  191. package/dist/templates/qoder/skills/check/SKILL.md +30 -0
  192. package/dist/templates/qoder/skills/check-cross-layer/SKILL.md +1 -1
  193. package/dist/templates/qoder/skills/create-command/SKILL.md +3 -3
  194. package/dist/templates/qoder/skills/finish-work/SKILL.md +1 -1
  195. package/dist/templates/qoder/skills/integrate-skill/SKILL.md +1 -1
  196. package/dist/templates/qoder/skills/onboard/SKILL.md +14 -14
  197. package/dist/templates/qoder/skills/record-session/SKILL.md +4 -3
  198. package/dist/templates/qoder/skills/start/SKILL.md +9 -4
  199. package/dist/templates/qoder/skills/update-spec/SKILL.md +1 -1
  200. package/dist/templates/trellis/config.yaml +20 -0
  201. package/dist/templates/trellis/index.d.ts +11 -0
  202. package/dist/templates/trellis/index.d.ts.map +1 -1
  203. package/dist/templates/trellis/index.js +22 -0
  204. package/dist/templates/trellis/index.js.map +1 -1
  205. package/dist/templates/trellis/scripts/add_session.py +111 -13
  206. package/dist/templates/trellis/scripts/common/__init__.py +2 -0
  207. package/dist/templates/trellis/scripts/common/cli_adapter.py +164 -64
  208. package/dist/templates/trellis/scripts/common/config.py +192 -0
  209. package/dist/templates/trellis/scripts/common/developer.py +2 -2
  210. package/dist/templates/trellis/scripts/common/git.py +31 -0
  211. package/dist/templates/trellis/scripts/common/git_context.py +23 -586
  212. package/dist/templates/trellis/scripts/common/io.py +37 -0
  213. package/dist/templates/trellis/scripts/common/log.py +45 -0
  214. package/dist/templates/trellis/scripts/common/packages_context.py +238 -0
  215. package/dist/templates/trellis/scripts/common/paths.py +103 -6
  216. package/dist/templates/trellis/scripts/common/phase.py +50 -49
  217. package/dist/templates/trellis/scripts/common/registry.py +41 -72
  218. package/dist/templates/trellis/scripts/common/session_context.py +562 -0
  219. package/dist/templates/trellis/scripts/common/task_context.py +410 -0
  220. package/dist/templates/trellis/scripts/common/task_queue.py +27 -98
  221. package/dist/templates/trellis/scripts/common/task_store.py +536 -0
  222. package/dist/templates/trellis/scripts/common/task_utils.py +106 -10
  223. package/dist/templates/trellis/scripts/common/tasks.py +109 -0
  224. package/dist/templates/trellis/scripts/common/types.py +112 -0
  225. package/dist/templates/trellis/scripts/create_bootstrap.py +32 -27
  226. package/dist/templates/trellis/scripts/hooks/linear_sync.py +243 -0
  227. package/dist/templates/trellis/scripts/multi_agent/_bootstrap.py +17 -0
  228. package/dist/templates/trellis/scripts/multi_agent/cleanup.py +43 -48
  229. package/dist/templates/trellis/scripts/multi_agent/create_pr.py +336 -45
  230. package/dist/templates/trellis/scripts/multi_agent/plan.py +9 -32
  231. package/dist/templates/trellis/scripts/multi_agent/start.py +142 -68
  232. package/dist/templates/trellis/scripts/multi_agent/status.py +12 -753
  233. package/dist/templates/trellis/scripts/multi_agent/status_display.py +542 -0
  234. package/dist/templates/trellis/scripts/multi_agent/status_monitor.py +225 -0
  235. package/dist/templates/trellis/scripts/task.py +51 -976
  236. package/dist/templates/trellis/scripts-shell-archive/create-bootstrap.sh +1 -1
  237. package/dist/templates/trellis/workflow.md +38 -38
  238. package/dist/templates/windsurf/index.d.ts +21 -0
  239. package/dist/templates/windsurf/index.d.ts.map +1 -0
  240. package/dist/templates/windsurf/index.js +44 -0
  241. package/dist/templates/windsurf/index.js.map +1 -0
  242. package/dist/templates/windsurf/workflows/trellis-before-dev.md +31 -0
  243. package/dist/templates/windsurf/workflows/trellis-brainstorm.md +491 -0
  244. package/dist/templates/windsurf/workflows/trellis-break-loop.md +111 -0
  245. package/dist/templates/windsurf/workflows/trellis-check-cross-layer.md +157 -0
  246. package/dist/templates/windsurf/workflows/trellis-check.md +27 -0
  247. package/dist/templates/windsurf/workflows/trellis-create-command.md +154 -0
  248. package/dist/templates/windsurf/workflows/trellis-finish-work.md +147 -0
  249. package/dist/templates/windsurf/workflows/trellis-integrate-skill.md +220 -0
  250. package/dist/templates/windsurf/workflows/trellis-onboard.md +362 -0
  251. package/dist/templates/windsurf/workflows/trellis-record-session.md +66 -0
  252. package/dist/templates/windsurf/workflows/trellis-start.md +373 -0
  253. package/dist/templates/windsurf/workflows/trellis-update-spec.md +358 -0
  254. package/dist/types/ai-tools.d.ts +15 -3
  255. package/dist/types/ai-tools.d.ts.map +1 -1
  256. package/dist/types/ai-tools.js +42 -2
  257. package/dist/types/ai-tools.js.map +1 -1
  258. package/dist/types/migration.d.ts +3 -1
  259. package/dist/types/migration.d.ts.map +1 -1
  260. package/dist/utils/project-detector.d.ts +28 -0
  261. package/dist/utils/project-detector.d.ts.map +1 -1
  262. package/dist/utils/project-detector.js +371 -0
  263. package/dist/utils/project-detector.js.map +1 -1
  264. package/dist/utils/template-fetcher.d.ts +19 -6
  265. package/dist/utils/template-fetcher.d.ts.map +1 -1
  266. package/dist/utils/template-fetcher.js +99 -17
  267. package/dist/utils/template-fetcher.js.map +1 -1
  268. package/package.json +1 -1
  269. package/dist/templates/claude/commands/trellis/before-backend-dev.md +0 -13
  270. package/dist/templates/claude/commands/trellis/before-frontend-dev.md +0 -13
  271. package/dist/templates/claude/commands/trellis/check-backend.md +0 -13
  272. package/dist/templates/claude/commands/trellis/check-frontend.md +0 -13
  273. package/dist/templates/codex/skills/before-backend-dev/SKILL.md +0 -18
  274. package/dist/templates/codex/skills/before-frontend-dev/SKILL.md +0 -18
  275. package/dist/templates/codex/skills/check-backend/SKILL.md +0 -18
  276. package/dist/templates/codex/skills/check-frontend/SKILL.md +0 -18
  277. package/dist/templates/cursor/commands/trellis-before-backend-dev.md +0 -13
  278. package/dist/templates/cursor/commands/trellis-before-frontend-dev.md +0 -13
  279. package/dist/templates/cursor/commands/trellis-check-backend.md +0 -13
  280. package/dist/templates/cursor/commands/trellis-check-frontend.md +0 -13
  281. package/dist/templates/gemini/commands/trellis/before-backend-dev.toml +0 -17
  282. package/dist/templates/gemini/commands/trellis/before-frontend-dev.toml +0 -17
  283. package/dist/templates/gemini/commands/trellis/check-backend.toml +0 -17
  284. package/dist/templates/gemini/commands/trellis/check-frontend.toml +0 -17
  285. package/dist/templates/iflow/commands/trellis/before-backend-dev.md +0 -13
  286. package/dist/templates/iflow/commands/trellis/before-frontend-dev.md +0 -13
  287. package/dist/templates/iflow/commands/trellis/check-backend.md +0 -13
  288. package/dist/templates/iflow/commands/trellis/check-frontend.md +0 -13
  289. package/dist/templates/kilo/workflows/before-backend-dev.md +0 -13
  290. package/dist/templates/kilo/workflows/before-frontend-dev.md +0 -13
  291. package/dist/templates/kilo/workflows/check-backend.md +0 -13
  292. package/dist/templates/kilo/workflows/check-frontend.md +0 -13
  293. package/dist/templates/kiro/skills/before-backend-dev/SKILL.md +0 -18
  294. package/dist/templates/kiro/skills/before-frontend-dev/SKILL.md +0 -18
  295. package/dist/templates/kiro/skills/check-backend/SKILL.md +0 -18
  296. package/dist/templates/kiro/skills/check-frontend/SKILL.md +0 -18
  297. package/dist/templates/opencode/commands/trellis/before-backend-dev.md +0 -13
  298. package/dist/templates/opencode/commands/trellis/before-frontend-dev.md +0 -13
  299. package/dist/templates/opencode/commands/trellis/check-backend.md +0 -13
  300. package/dist/templates/opencode/commands/trellis/check-frontend.md +0 -13
  301. package/dist/templates/qoder/skills/before-backend-dev/SKILL.md +0 -18
  302. package/dist/templates/qoder/skills/before-frontend-dev/SKILL.md +0 -18
  303. package/dist/templates/qoder/skills/check-backend/SKILL.md +0 -18
  304. package/dist/templates/qoder/skills/check-frontend/SKILL.md +0 -18
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: record-session
3
- description: "Record work progress after human has tested and committed code"
3
+ description: "Records completed work progress to .trellis/workspace/ journal files after human testing and commit. Captures session summaries, commit hashes, and updates developer index files for future session context. Use when a coding session is complete, after the human has committed code, or to persist session knowledge for future AI sessions."
4
4
  ---
5
5
 
6
6
  [!] **Prerequisite**: This command should only be used AFTER the human has tested and committed the code.
@@ -36,7 +36,7 @@ python3 ./.trellis/scripts/add_session.py \
36
36
  --summary "Brief summary of what was done"
37
37
 
38
38
  # Method 2: Pass detailed content via stdin
39
- cat << 'EOF' | python3 ./.trellis/scripts/add_session.py --title "Title" --commit "hash"
39
+ cat << 'EOF' | python3 ./.trellis/scripts/add_session.py --stdin --title "Title" --commit "hash"
40
40
  | Feature | Description |
41
41
  |---------|-------------|
42
42
  | New API | Added user authentication endpoint |
@@ -51,6 +51,7 @@ EOF
51
51
  **Auto-completes**:
52
52
  - [OK] Appends session to journal-N.md
53
53
  - [OK] Auto-detects line count, creates new file if >2000 lines
54
+ - [OK] Auto-detects Branch context (`--branch` override; otherwise Branch = task.json -> current git branch; missing values are omitted gracefully)
54
55
  - [OK] Updates index.md (Total Sessions +1, Last Active, line stats, history)
55
56
  - [OK] Auto-commits .trellis/workspace and .trellis/tasks changes
56
57
 
@@ -61,6 +62,6 @@ EOF
61
62
  | Command | Purpose |
62
63
  |---------|---------|
63
64
  | `python3 ./.trellis/scripts/get_context.py --mode record` | Get context for record-session |
64
- | `python3 ./.trellis/scripts/add_session.py --title "..." --commit "..."` | **One-click add session (recommended)** |
65
+ | `python3 ./.trellis/scripts/add_session.py --title "..." --commit "..."` | **One-click add session (recommended, branch auto-complete)** |
65
66
  | `python3 ./.trellis/scripts/task.py archive <name>` | Archive completed task (auto-commits) |
66
67
  | `python3 ./.trellis/scripts/task.py list` | List active tasks |
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: start
3
- description: "Start Session"
3
+ description: "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."
4
4
  ---
5
5
 
6
6
  # Start Session
@@ -45,9 +45,14 @@ This shows: developer identity, git status, current task (if any), active tasks.
45
45
  ### Step 3: Read Guidelines Index
46
46
 
47
47
  ```bash
48
- cat .trellis/spec/frontend/index.md # Frontend guidelines
49
- cat .trellis/spec/backend/index.md # Backend guidelines
50
- cat .trellis/spec/guides/index.md # Thinking guides
48
+ python3 ./.trellis/scripts/get_context.py --mode packages
49
+ ```
50
+
51
+ This shows available packages and their spec layers. Read the relevant spec indexes:
52
+
53
+ ```bash
54
+ cat .trellis/spec/<package>/<layer>/index.md # Package-specific guidelines
55
+ cat .trellis/spec/guides/index.md # Thinking guides (always read)
51
56
  ```
52
57
 
53
58
  > **Important**: The index files are navigation — they list the actual guideline files (e.g., `error-handling.md`, `conventions.md`, `mock-strategies.md`).
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: update-spec
3
- description: "Update Code-Spec - Capture Executable Contracts"
3
+ description: "Captures executable contracts and coding knowledge into .trellis/spec/ documents after implementation, debugging, or design decisions. Enforces code-spec depth for infra and cross-layer changes with mandatory sections for signatures, contracts, validation matrices, and test points. Use when a feature is implemented, a bug is fixed, a design decision is made, a new pattern is discovered, or cross-layer contracts change."
4
4
  ---
5
5
 
6
6
  # Update Spec - Capture Knowledge into Specifications
@@ -31,3 +31,23 @@ max_journal_lines: 2000
31
31
  # - "echo 'Task finished'"
32
32
  # after_archive:
33
33
  # - "echo 'Task archived'"
34
+
35
+ #-------------------------------------------------------------------------------
36
+ # Monorepo / Packages
37
+ #-------------------------------------------------------------------------------
38
+
39
+ # Declare packages for monorepo projects.
40
+ # Trellis auto-detects workspaces during `trellis init`, but you can also
41
+ # configure them manually here.
42
+ #
43
+ # packages:
44
+ # frontend:
45
+ # path: packages/frontend
46
+ # backend:
47
+ # path: packages/backend
48
+ # docs:
49
+ # path: docs-site
50
+ # type: submodule
51
+
52
+ # Default package used when --package is not specified.
53
+ # default_package: frontend
@@ -29,12 +29,23 @@ export declare const commonPhase: string;
29
29
  export declare const commonRegistry: string;
30
30
  export declare const commonCliAdapter: string;
31
31
  export declare const commonConfig: string;
32
+ export declare const commonIo: string;
33
+ export declare const commonLog: string;
34
+ export declare const commonGit: string;
35
+ export declare const commonTypes: string;
36
+ export declare const commonTasks: string;
37
+ export declare const commonTaskContext: string;
38
+ export declare const commonTaskStore: string;
39
+ export declare const commonSessionContext: string;
40
+ export declare const commonPackagesContext: string;
32
41
  export declare const multiAgentInit: string;
33
42
  export declare const multiAgentStart: string;
34
43
  export declare const multiAgentCleanup: string;
35
44
  export declare const multiAgentStatus: string;
36
45
  export declare const multiAgentCreatePr: string;
37
46
  export declare const multiAgentPlan: string;
47
+ export declare const multiAgentStatusDisplay: string;
48
+ export declare const multiAgentStatusMonitor: string;
38
49
  export declare const getDeveloperScript: string;
39
50
  export declare const initDeveloperScript: string;
40
51
  export declare const taskScript: string;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/trellis/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;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,CAAC;AAC3E,eAAO,MAAM,mBAAmB,QAA4C,CAAC;AAC7E,eAAO,MAAM,UAAU,QAAkC,CAAC;AAC1D,eAAO,MAAM,gBAAgB,QAAyC,CAAC;AACvE,eAAO,MAAM,gBAAgB,QAAyC,CAAC;AACvE,eAAO,MAAM,qBAAqB,QAEjC,CAAC;AAGF,eAAO,MAAM,kBAAkB,QAA8B,CAAC;AAC9D,eAAO,MAAM,kBAAkB,QAA8B,CAAC;AAC9D,eAAO,MAAM,oBAAoB,QAAgC,CAAC;AAClE,eAAO,MAAM,iBAAiB,QAAgC,CAAC;AAE/D;;GAEG;AACH,wBAAgB,aAAa,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CA+CnD"}
@@ -39,6 +39,15 @@ export const commonPhase = readTemplate("scripts/common/phase.py");
39
39
  export const commonRegistry = readTemplate("scripts/common/registry.py");
40
40
  export const commonCliAdapter = readTemplate("scripts/common/cli_adapter.py");
41
41
  export const commonConfig = readTemplate("scripts/common/config.py");
42
+ export const commonIo = readTemplate("scripts/common/io.py");
43
+ export const commonLog = readTemplate("scripts/common/log.py");
44
+ export const commonGit = readTemplate("scripts/common/git.py");
45
+ export const commonTypes = readTemplate("scripts/common/types.py");
46
+ export const commonTasks = readTemplate("scripts/common/tasks.py");
47
+ export const commonTaskContext = readTemplate("scripts/common/task_context.py");
48
+ export const commonTaskStore = readTemplate("scripts/common/task_store.py");
49
+ export const commonSessionContext = readTemplate("scripts/common/session_context.py");
50
+ export const commonPackagesContext = readTemplate("scripts/common/packages_context.py");
42
51
  // Python scripts - multi_agent
43
52
  export const multiAgentInit = readTemplate("scripts/multi_agent/__init__.py");
44
53
  export const multiAgentStart = readTemplate("scripts/multi_agent/start.py");
@@ -46,6 +55,8 @@ export const multiAgentCleanup = readTemplate("scripts/multi_agent/cleanup.py");
46
55
  export const multiAgentStatus = readTemplate("scripts/multi_agent/status.py");
47
56
  export const multiAgentCreatePr = readTemplate("scripts/multi_agent/create_pr.py");
48
57
  export const multiAgentPlan = readTemplate("scripts/multi_agent/plan.py");
58
+ export const multiAgentStatusDisplay = readTemplate("scripts/multi_agent/status_display.py");
59
+ export const multiAgentStatusMonitor = readTemplate("scripts/multi_agent/status_monitor.py");
49
60
  // Python scripts - main
50
61
  export const getDeveloperScript = readTemplate("scripts/get_developer.py");
51
62
  export const initDeveloperScript = readTemplate("scripts/init_developer.py");
@@ -77,6 +88,15 @@ export function getAllScripts() {
77
88
  scripts.set("common/registry.py", commonRegistry);
78
89
  scripts.set("common/cli_adapter.py", commonCliAdapter);
79
90
  scripts.set("common/config.py", commonConfig);
91
+ scripts.set("common/io.py", commonIo);
92
+ scripts.set("common/log.py", commonLog);
93
+ scripts.set("common/git.py", commonGit);
94
+ scripts.set("common/types.py", commonTypes);
95
+ scripts.set("common/tasks.py", commonTasks);
96
+ scripts.set("common/task_context.py", commonTaskContext);
97
+ scripts.set("common/task_store.py", commonTaskStore);
98
+ scripts.set("common/session_context.py", commonSessionContext);
99
+ scripts.set("common/packages_context.py", commonPackagesContext);
80
100
  // Multi-agent
81
101
  scripts.set("multi_agent/__init__.py", multiAgentInit);
82
102
  scripts.set("multi_agent/start.py", multiAgentStart);
@@ -84,6 +104,8 @@ export function getAllScripts() {
84
104
  scripts.set("multi_agent/status.py", multiAgentStatus);
85
105
  scripts.set("multi_agent/create_pr.py", multiAgentCreatePr);
86
106
  scripts.set("multi_agent/plan.py", multiAgentPlan);
107
+ scripts.set("multi_agent/status_display.py", multiAgentStatusDisplay);
108
+ scripts.set("multi_agent/status_monitor.py", multiAgentStatusMonitor);
87
109
  // Main
88
110
  scripts.set("get_developer.py", getDeveloperScript);
89
111
  scripts.set("init_developer.py", initDeveloperScript);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/templates/trellis/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO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4
4
  Add a new session to journal file and update index.md.
5
5
 
6
6
  Usage:
7
- python3 add_session.py --title "Title" --commit "hash" --summary "Summary"
8
- echo "content" | python3 add_session.py --title "Title" --commit "hash"
7
+ python3 add_session.py --title "Title" --commit "hash" --summary "Summary" [--package cli]
8
+ python3 add_session.py --title "Title" --branch "feat/my-branch"
9
+
10
+ # Pipe detailed content via stdin (use --stdin to opt in):
11
+ cat << 'EOF' | python3 add_session.py --stdin --title "Title" --summary "Summary"
12
+ <session content here>
13
+ EOF
14
+
15
+ Branch resolution order:
16
+ 1. --branch CLI arg (explicit)
17
+ 2. task.json branch field (from active task)
18
+ 3. git branch --show-current (auto-detect)
19
+ 4. None (omitted gracefully)
9
20
  """
10
21
 
11
22
  from __future__ import annotations
@@ -20,11 +31,21 @@ from pathlib import Path
20
31
  from common.paths import (
21
32
  FILE_JOURNAL_PREFIX,
22
33
  get_repo_root,
34
+ get_current_task,
23
35
  get_developer,
24
36
  get_workspace_dir,
25
37
  )
26
38
  from common.developer import ensure_developer
27
- from common.config import get_session_commit_message, get_max_journal_lines
39
+ from common.git import run_git
40
+ from common.tasks import load_task
41
+ from common.config import (
42
+ get_packages,
43
+ get_session_commit_message,
44
+ get_max_journal_lines,
45
+ is_monorepo,
46
+ resolve_package,
47
+ validate_package,
48
+ )
28
49
 
29
50
 
30
51
  # =============================================================================
@@ -123,7 +144,9 @@ def generate_session_content(
123
144
  commit: str,
124
145
  summary: str,
125
146
  extra_content: str,
126
- today: str
147
+ today: str,
148
+ package: str | None = None,
149
+ branch: str | None = None,
127
150
  ) -> str:
128
151
  """Generate session content."""
129
152
  if commit and commit != "-":
@@ -135,12 +158,15 @@ def generate_session_content(
135
158
  else:
136
159
  commit_table = "(No commits - planning session)"
137
160
 
161
+ package_line = f"\n**Package**: {package}" if package else ""
162
+ branch_line = f"\n**Branch**: `{branch}`" if branch else ""
163
+
138
164
  return f"""
139
165
 
140
166
  ## Session {session_num}: {title}
141
167
 
142
168
  **Date**: {today}
143
- **Task**: {title}
169
+ **Task**: {title}{package_line}{branch_line}
144
170
 
145
171
  ### Summary
146
172
 
@@ -175,7 +201,8 @@ def update_index(
175
201
  commit: str,
176
202
  new_session: int,
177
203
  active_file: str,
178
- today: str
204
+ today: str,
205
+ branch: str | None = None,
179
206
  ) -> bool:
180
207
  """Update index.md with new session info."""
181
208
  # Format commit for display
@@ -254,10 +281,25 @@ def update_index(
254
281
  continue
255
282
 
256
283
  if in_session_history:
257
- new_lines.append(line)
258
- if re.match(r"^\|\s*-", line) and not header_written:
259
- new_lines.append(f"| {new_session} | {today} | {title} | {commit_display} |")
284
+ # Migrate old 4/6-column headers to 5-column Branch-only history.
285
+ if re.match(
286
+ r"^\|\s*#\s*\|\s*Date\s*\|\s*Title\s*\|\s*Commits\s*\|\s*Branch\s*\|\s*Base Branch\s*\|\s*$",
287
+ line,
288
+ ):
289
+ new_lines.append("| # | Date | Title | Commits | Branch |")
290
+ continue
291
+ if re.match(r"^\|\s*#\s*\|\s*Date\s*\|\s*Title\s*\|\s*Commits\s*\|\s*Branch\s*\|\s*$", line):
292
+ new_lines.append("| # | Date | Title | Commits | Branch |")
293
+ continue
294
+ if re.match(r"^\|\s*#\s*\|\s*Date\s*\|\s*Title\s*\|\s*Commits\s*\|\s*$", line):
295
+ new_lines.append("| # | Date | Title | Commits | Branch |")
296
+ continue
297
+ if re.match(r"^\|[-| ]+\|\s*$", line) and not header_written:
298
+ new_lines.append("|---|------|-------|---------|--------|")
299
+ new_lines.append(f"| {new_session} | {today} | {title} | {commit_display} | `{branch or '-'}` |")
260
300
  header_written = True
301
+ continue
302
+ new_lines.append(line)
261
303
  continue
262
304
 
263
305
  new_lines.append(line)
@@ -274,11 +316,16 @@ def update_index(
274
316
  def _auto_commit_workspace(repo_root: Path) -> None:
275
317
  """Stage .trellis/workspace and .trellis/tasks, then commit with a configured message."""
276
318
  commit_msg = get_session_commit_message(repo_root)
277
- subprocess.run(
319
+ add_result = subprocess.run(
278
320
  ["git", "add", "-A", ".trellis/workspace", ".trellis/tasks"],
279
321
  cwd=repo_root,
280
322
  capture_output=True,
323
+ text=True,
281
324
  )
325
+ if add_result.returncode != 0:
326
+ print(f"[WARN] git add failed (exit {add_result.returncode}): {add_result.stderr.strip()}", file=sys.stderr)
327
+ print("[WARN] Please commit .trellis/ changes manually: git add .trellis && git commit", file=sys.stderr)
328
+ return
282
329
  # Check if there are staged changes
283
330
  result = subprocess.run(
284
331
  ["git", "diff", "--cached", "--quiet", "--", ".trellis/workspace", ".trellis/tasks"],
@@ -305,6 +352,8 @@ def add_session(
305
352
  summary: str = "(Add summary)",
306
353
  extra_content: str = "(Add details)",
307
354
  auto_commit: bool = True,
355
+ package: str | None = None,
356
+ branch: str | None = None,
308
357
  ) -> int:
309
358
  """Add a new session."""
310
359
  repo_root = get_repo_root()
@@ -330,7 +379,8 @@ def add_session(
330
379
  new_session = current_session + 1
331
380
 
332
381
  session_content = generate_session_content(
333
- new_session, title, commit, summary, extra_content, today
382
+ new_session, title, commit, summary, extra_content, today, package,
383
+ branch,
334
384
  )
335
385
  content_lines = len(session_content.splitlines())
336
386
 
@@ -367,7 +417,16 @@ def add_session(
367
417
 
368
418
  # Update index.md
369
419
  active_file = f"{FILE_JOURNAL_PREFIX}{target_num}.md"
370
- if not update_index(index_file, dev_dir, title, commit, new_session, active_file, today):
420
+ if not update_index(
421
+ index_file,
422
+ dev_dir,
423
+ title,
424
+ commit,
425
+ new_session,
426
+ active_file,
427
+ today,
428
+ branch,
429
+ ):
371
430
  return 1
372
431
 
373
432
  print("", file=sys.stderr)
@@ -400,8 +459,12 @@ def main() -> int:
400
459
  parser.add_argument("--commit", default="-", help="Comma-separated commit hashes")
401
460
  parser.add_argument("--summary", default="(Add summary)", help="Brief summary")
402
461
  parser.add_argument("--content-file", help="Path to file with detailed content")
462
+ parser.add_argument("--package", help="Package name tag (e.g., cli, docs-site)")
463
+ parser.add_argument("--branch", help="Branch name (auto-detected if omitted)")
403
464
  parser.add_argument("--no-commit", action="store_true",
404
465
  help="Skip auto-commit of workspace changes")
466
+ parser.add_argument("--stdin", action="store_true",
467
+ help="Read extra content from stdin (explicit opt-in)")
405
468
 
406
469
  args = parser.parse_args()
407
470
 
@@ -410,12 +473,47 @@ def main() -> int:
410
473
  content_path = Path(args.content_file)
411
474
  if content_path.is_file():
412
475
  extra_content = content_path.read_text(encoding="utf-8")
413
- elif not sys.stdin.isatty():
476
+ elif args.stdin:
414
477
  extra_content = sys.stdin.read()
415
478
 
479
+ # Load active task once — shared by package and branch resolution
480
+ repo_root = get_repo_root()
481
+ current = get_current_task(repo_root)
482
+ task_data = load_task(repo_root / current) if current else None
483
+
484
+ package = args.package
485
+ if package:
486
+ # CLI source: fail-fast in monorepo, ignore in single-repo
487
+ if not is_monorepo(repo_root):
488
+ print("Warning: --package ignored in single-repo project", file=sys.stderr)
489
+ package = None
490
+ elif not validate_package(package, repo_root):
491
+ packages = get_packages(repo_root)
492
+ available = ", ".join(sorted(packages.keys())) if packages else "(none)"
493
+ print(f"Error: unknown package '{package}'. Available: {available}", file=sys.stderr)
494
+ return 1
495
+ else:
496
+ # Inferred: active task's task.json.package → default_package → None
497
+ task_package = task_data.package if task_data else None
498
+ package = resolve_package(task_package, repo_root)
499
+
500
+ # Resolve branch: CLI → task.json → git auto-detect → None
501
+ branch = args.branch
502
+
503
+ if not branch:
504
+ if task_data and task_data.raw.get("branch"):
505
+ branch = task_data.raw["branch"]
506
+ else:
507
+ _, branch_out, _ = run_git(["branch", "--show-current"], cwd=repo_root)
508
+ detected = branch_out.strip()
509
+ if detected:
510
+ branch = detected
511
+
416
512
  return add_session(
417
513
  args.title, args.commit, args.summary, extra_content,
418
514
  auto_commit=not args.no_commit,
515
+ package=package,
516
+ branch=branch,
419
517
  )
420
518
 
421
519
 
@@ -75,6 +75,8 @@ from .paths import (
75
75
  count_lines,
76
76
  get_current_task,
77
77
  get_current_task_abs,
78
+ normalize_task_ref,
79
+ resolve_task_ref,
78
80
  set_current_task,
79
81
  clear_current_task,
80
82
  has_current_task,