@mindfoldhq/trellis 0.6.0-beta.2 → 0.6.0-beta.21

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 (331) hide show
  1. package/README.md +1 -1
  2. package/dist/cli/index.d.ts +1 -1
  3. package/dist/cli/index.d.ts.map +1 -1
  4. package/dist/cli/index.js +58 -2
  5. package/dist/cli/index.js.map +1 -1
  6. package/dist/commands/channel/adapters/claude.d.ts +29 -0
  7. package/dist/commands/channel/adapters/claude.d.ts.map +1 -0
  8. package/dist/commands/channel/adapters/claude.js +203 -0
  9. package/dist/commands/channel/adapters/claude.js.map +1 -0
  10. package/dist/commands/channel/adapters/codex.d.ts +85 -0
  11. package/dist/commands/channel/adapters/codex.d.ts.map +1 -0
  12. package/dist/commands/channel/adapters/codex.js +505 -0
  13. package/dist/commands/channel/adapters/codex.js.map +1 -0
  14. package/dist/commands/channel/adapters/index.d.ts +84 -0
  15. package/dist/commands/channel/adapters/index.d.ts.map +1 -0
  16. package/dist/commands/channel/adapters/index.js +115 -0
  17. package/dist/commands/channel/adapters/index.js.map +1 -0
  18. package/dist/commands/channel/adapters/types.d.ts +33 -0
  19. package/dist/commands/channel/adapters/types.d.ts.map +1 -0
  20. package/dist/commands/channel/adapters/types.js +2 -0
  21. package/dist/commands/channel/adapters/types.js.map +1 -0
  22. package/dist/commands/channel/agent-loader.d.ts +32 -0
  23. package/dist/commands/channel/agent-loader.d.ts.map +1 -0
  24. package/dist/commands/channel/agent-loader.js +154 -0
  25. package/dist/commands/channel/agent-loader.js.map +1 -0
  26. package/dist/commands/channel/context-loader.d.ts +26 -0
  27. package/dist/commands/channel/context-loader.d.ts.map +1 -0
  28. package/dist/commands/channel/context-loader.js +290 -0
  29. package/dist/commands/channel/context-loader.js.map +1 -0
  30. package/dist/commands/channel/context.d.ts +16 -0
  31. package/dist/commands/channel/context.d.ts.map +1 -0
  32. package/dist/commands/channel/context.js +83 -0
  33. package/dist/commands/channel/context.js.map +1 -0
  34. package/dist/commands/channel/create.d.ts +27 -0
  35. package/dist/commands/channel/create.d.ts.map +1 -0
  36. package/dist/commands/channel/create.js +39 -0
  37. package/dist/commands/channel/create.js.map +1 -0
  38. package/dist/commands/channel/dev-parse-trace.d.ts +14 -0
  39. package/dist/commands/channel/dev-parse-trace.d.ts.map +1 -0
  40. package/dist/commands/channel/dev-parse-trace.js +70 -0
  41. package/dist/commands/channel/dev-parse-trace.js.map +1 -0
  42. package/dist/commands/channel/guard.d.ts +150 -0
  43. package/dist/commands/channel/guard.d.ts.map +1 -0
  44. package/dist/commands/channel/guard.js +474 -0
  45. package/dist/commands/channel/guard.js.map +1 -0
  46. package/dist/commands/channel/index.d.ts +3 -0
  47. package/dist/commands/channel/index.d.ts.map +1 -0
  48. package/dist/commands/channel/index.js +531 -0
  49. package/dist/commands/channel/index.js.map +1 -0
  50. package/dist/commands/channel/interrupt.d.ts +10 -0
  51. package/dist/commands/channel/interrupt.d.ts.map +1 -0
  52. package/dist/commands/channel/interrupt.js +22 -0
  53. package/dist/commands/channel/interrupt.js.map +1 -0
  54. package/dist/commands/channel/kill.d.ts +7 -0
  55. package/dist/commands/channel/kill.d.ts.map +1 -0
  56. package/dist/commands/channel/kill.js +121 -0
  57. package/dist/commands/channel/kill.js.map +1 -0
  58. package/dist/commands/channel/list.d.ts +17 -0
  59. package/dist/commands/channel/list.d.ts.map +1 -0
  60. package/dist/commands/channel/list.js +233 -0
  61. package/dist/commands/channel/list.js.map +1 -0
  62. package/dist/commands/channel/messages.d.ts +15 -0
  63. package/dist/commands/channel/messages.d.ts.map +1 -0
  64. package/dist/commands/channel/messages.js +245 -0
  65. package/dist/commands/channel/messages.js.map +1 -0
  66. package/dist/commands/channel/rm.d.ts +27 -0
  67. package/dist/commands/channel/rm.d.ts.map +1 -0
  68. package/dist/commands/channel/rm.js +216 -0
  69. package/dist/commands/channel/rm.js.map +1 -0
  70. package/dist/commands/channel/run.d.ts +30 -0
  71. package/dist/commands/channel/run.d.ts.map +1 -0
  72. package/dist/commands/channel/run.js +130 -0
  73. package/dist/commands/channel/run.js.map +1 -0
  74. package/dist/commands/channel/send.d.ts +11 -0
  75. package/dist/commands/channel/send.d.ts.map +1 -0
  76. package/dist/commands/channel/send.js +24 -0
  77. package/dist/commands/channel/send.js.map +1 -0
  78. package/dist/commands/channel/spawn.d.ts +40 -0
  79. package/dist/commands/channel/spawn.d.ts.map +1 -0
  80. package/dist/commands/channel/spawn.js +244 -0
  81. package/dist/commands/channel/spawn.js.map +1 -0
  82. package/dist/commands/channel/store/events.d.ts +39 -0
  83. package/dist/commands/channel/store/events.d.ts.map +1 -0
  84. package/dist/commands/channel/store/events.js +87 -0
  85. package/dist/commands/channel/store/events.js.map +1 -0
  86. package/dist/commands/channel/store/filter.d.ts +3 -0
  87. package/dist/commands/channel/store/filter.d.ts.map +1 -0
  88. package/dist/commands/channel/store/filter.js +2 -0
  89. package/dist/commands/channel/store/filter.js.map +1 -0
  90. package/dist/commands/channel/store/lock.d.ts +23 -0
  91. package/dist/commands/channel/store/lock.d.ts.map +1 -0
  92. package/dist/commands/channel/store/lock.js +99 -0
  93. package/dist/commands/channel/store/lock.js.map +1 -0
  94. package/dist/commands/channel/store/paths.d.ts +63 -0
  95. package/dist/commands/channel/store/paths.d.ts.map +1 -0
  96. package/dist/commands/channel/store/paths.js +246 -0
  97. package/dist/commands/channel/store/paths.js.map +1 -0
  98. package/dist/commands/channel/store/schema.d.ts +27 -0
  99. package/dist/commands/channel/store/schema.d.ts.map +1 -0
  100. package/dist/commands/channel/store/schema.js +34 -0
  101. package/dist/commands/channel/store/schema.js.map +1 -0
  102. package/dist/commands/channel/store/thread-state.d.ts +5 -0
  103. package/dist/commands/channel/store/thread-state.d.ts.map +1 -0
  104. package/dist/commands/channel/store/thread-state.js +16 -0
  105. package/dist/commands/channel/store/thread-state.js.map +1 -0
  106. package/dist/commands/channel/store/watch.d.ts +19 -0
  107. package/dist/commands/channel/store/watch.d.ts.map +1 -0
  108. package/dist/commands/channel/store/watch.js +146 -0
  109. package/dist/commands/channel/store/watch.js.map +1 -0
  110. package/dist/commands/channel/supervisor/idle.d.ts +46 -0
  111. package/dist/commands/channel/supervisor/idle.d.ts.map +1 -0
  112. package/dist/commands/channel/supervisor/idle.js +72 -0
  113. package/dist/commands/channel/supervisor/idle.js.map +1 -0
  114. package/dist/commands/channel/supervisor/inbox.d.ts +30 -0
  115. package/dist/commands/channel/supervisor/inbox.d.ts.map +1 -0
  116. package/dist/commands/channel/supervisor/inbox.js +160 -0
  117. package/dist/commands/channel/supervisor/inbox.js.map +1 -0
  118. package/dist/commands/channel/supervisor/shutdown.d.ts +68 -0
  119. package/dist/commands/channel/supervisor/shutdown.d.ts.map +1 -0
  120. package/dist/commands/channel/supervisor/shutdown.js +146 -0
  121. package/dist/commands/channel/supervisor/shutdown.js.map +1 -0
  122. package/dist/commands/channel/supervisor/stdout.d.ts +51 -0
  123. package/dist/commands/channel/supervisor/stdout.d.ts.map +1 -0
  124. package/dist/commands/channel/supervisor/stdout.js +121 -0
  125. package/dist/commands/channel/supervisor/stdout.js.map +1 -0
  126. package/dist/commands/channel/supervisor/turns.d.ts +31 -0
  127. package/dist/commands/channel/supervisor/turns.d.ts.map +1 -0
  128. package/dist/commands/channel/supervisor/turns.js +45 -0
  129. package/dist/commands/channel/supervisor/turns.js.map +1 -0
  130. package/dist/commands/channel/supervisor/warning.d.ts +48 -0
  131. package/dist/commands/channel/supervisor/warning.d.ts.map +1 -0
  132. package/dist/commands/channel/supervisor/warning.js +77 -0
  133. package/dist/commands/channel/supervisor/warning.js.map +1 -0
  134. package/dist/commands/channel/supervisor.d.ts +59 -0
  135. package/dist/commands/channel/supervisor.d.ts.map +1 -0
  136. package/dist/commands/channel/supervisor.js +344 -0
  137. package/dist/commands/channel/supervisor.js.map +1 -0
  138. package/dist/commands/channel/text-body.d.ts +13 -0
  139. package/dist/commands/channel/text-body.d.ts.map +1 -0
  140. package/dist/commands/channel/text-body.js +47 -0
  141. package/dist/commands/channel/text-body.js.map +1 -0
  142. package/dist/commands/channel/threads.d.ts +39 -0
  143. package/dist/commands/channel/threads.d.ts.map +1 -0
  144. package/dist/commands/channel/threads.js +106 -0
  145. package/dist/commands/channel/threads.js.map +1 -0
  146. package/dist/commands/channel/title.d.ts +12 -0
  147. package/dist/commands/channel/title.d.ts.map +1 -0
  148. package/dist/commands/channel/title.js +24 -0
  149. package/dist/commands/channel/title.js.map +1 -0
  150. package/dist/commands/channel/wait.d.ts +17 -0
  151. package/dist/commands/channel/wait.d.ts.map +1 -0
  152. package/dist/commands/channel/wait.js +75 -0
  153. package/dist/commands/channel/wait.js.map +1 -0
  154. package/dist/commands/init.d.ts +2 -0
  155. package/dist/commands/init.d.ts.map +1 -1
  156. package/dist/commands/init.js +97 -42
  157. package/dist/commands/init.js.map +1 -1
  158. package/dist/commands/mem.d.ts +13 -117
  159. package/dist/commands/mem.d.ts.map +1 -1
  160. package/dist/commands/mem.js +168 -1074
  161. package/dist/commands/mem.js.map +1 -1
  162. package/dist/commands/uninstall.d.ts.map +1 -1
  163. package/dist/commands/uninstall.js +28 -2
  164. package/dist/commands/uninstall.js.map +1 -1
  165. package/dist/commands/update.d.ts.map +1 -1
  166. package/dist/commands/update.js +31 -111
  167. package/dist/commands/update.js.map +1 -1
  168. package/dist/commands/upgrade.d.ts +28 -0
  169. package/dist/commands/upgrade.d.ts.map +1 -0
  170. package/dist/commands/upgrade.js +84 -0
  171. package/dist/commands/upgrade.js.map +1 -0
  172. package/dist/commands/workflow.d.ts +35 -0
  173. package/dist/commands/workflow.d.ts.map +1 -0
  174. package/dist/commands/workflow.js +219 -0
  175. package/dist/commands/workflow.js.map +1 -0
  176. package/dist/configurators/claude.d.ts.map +1 -1
  177. package/dist/configurators/claude.js +1 -0
  178. package/dist/configurators/claude.js.map +1 -1
  179. package/dist/configurators/codex.d.ts.map +1 -1
  180. package/dist/configurators/codex.js +5 -3
  181. package/dist/configurators/codex.js.map +1 -1
  182. package/dist/configurators/shared.js +4 -4
  183. package/dist/configurators/shared.js.map +1 -1
  184. package/dist/configurators/workflow.d.ts +8 -0
  185. package/dist/configurators/workflow.d.ts.map +1 -1
  186. package/dist/configurators/workflow.js +3 -2
  187. package/dist/configurators/workflow.js.map +1 -1
  188. package/dist/migrations/manifests/0.5.10.json +9 -0
  189. package/dist/migrations/manifests/0.5.11.json +16 -0
  190. package/dist/migrations/manifests/0.5.12.json +9 -0
  191. package/dist/migrations/manifests/0.5.13.json +9 -0
  192. package/dist/migrations/manifests/0.5.14.json +9 -0
  193. package/dist/migrations/manifests/0.5.15.json +9 -0
  194. package/dist/migrations/manifests/0.5.16.json +9 -0
  195. package/dist/migrations/manifests/0.5.17.json +9 -0
  196. package/dist/migrations/manifests/0.5.18.json +9 -0
  197. package/dist/migrations/manifests/0.6.0-beta.10.json +9 -0
  198. package/dist/migrations/manifests/0.6.0-beta.11.json +9 -0
  199. package/dist/migrations/manifests/0.6.0-beta.12.json +9 -0
  200. package/dist/migrations/manifests/0.6.0-beta.13.json +9 -0
  201. package/dist/migrations/manifests/0.6.0-beta.14.json +9 -0
  202. package/dist/migrations/manifests/0.6.0-beta.15.json +9 -0
  203. package/dist/migrations/manifests/0.6.0-beta.16.json +9 -0
  204. package/dist/migrations/manifests/0.6.0-beta.17.json +9 -0
  205. package/dist/migrations/manifests/0.6.0-beta.18.json +16 -0
  206. package/dist/migrations/manifests/0.6.0-beta.19.json +9 -0
  207. package/dist/migrations/manifests/0.6.0-beta.20.json +9 -0
  208. package/dist/migrations/manifests/0.6.0-beta.21.json +9 -0
  209. package/dist/migrations/manifests/0.6.0-beta.3.json +9 -0
  210. package/dist/migrations/manifests/0.6.0-beta.4.json +9 -0
  211. package/dist/migrations/manifests/0.6.0-beta.5.json +9 -0
  212. package/dist/migrations/manifests/0.6.0-beta.6.json +16 -0
  213. package/dist/migrations/manifests/0.6.0-beta.7.json +9 -0
  214. package/dist/migrations/manifests/0.6.0-beta.8.json +9 -0
  215. package/dist/migrations/manifests/0.6.0-beta.9.json +9 -0
  216. package/dist/templates/claude/agents/trellis-check.md +13 -7
  217. package/dist/templates/claude/agents/trellis-implement.md +8 -7
  218. package/dist/templates/claude/settings.json +4 -4
  219. package/dist/templates/codebuddy/agents/trellis-check.md +13 -7
  220. package/dist/templates/codebuddy/agents/trellis-implement.md +8 -7
  221. package/dist/templates/codebuddy/settings.json +4 -4
  222. package/dist/templates/codex/agents/trellis-check.toml +4 -4
  223. package/dist/templates/codex/agents/trellis-implement.toml +4 -4
  224. package/dist/templates/codex/config.toml +9 -16
  225. package/dist/templates/codex/hooks/session-start.py +205 -119
  226. package/dist/templates/codex/hooks.json +2 -2
  227. package/dist/templates/codex/skills/before-dev/SKILL.md +12 -6
  228. package/dist/templates/codex/skills/brainstorm/SKILL.md +69 -457
  229. package/dist/templates/codex/skills/check/SKILL.md +86 -18
  230. package/dist/templates/codex/skills/start/SKILL.md +33 -323
  231. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-context-loading.md +7 -4
  232. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-spec-structure.md +1 -1
  233. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-workflow.md +3 -2
  234. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/context-injection.md +5 -5
  235. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/spec-system.md +1 -1
  236. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/task-system.md +35 -6
  237. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/agents.md +5 -4
  238. package/dist/templates/common/bundled-skills/trellis-spec-bootstarp/SKILL.md +41 -0
  239. package/dist/templates/common/bundled-skills/trellis-spec-bootstarp/references/mcp-setup.md +90 -0
  240. package/dist/templates/common/bundled-skills/trellis-spec-bootstarp/references/repository-analysis.md +59 -0
  241. package/dist/templates/common/bundled-skills/trellis-spec-bootstarp/references/spec-task-planning.md +61 -0
  242. package/dist/templates/common/bundled-skills/trellis-spec-bootstarp/references/spec-writing.md +70 -0
  243. package/dist/templates/common/commands/continue.md +6 -5
  244. package/dist/templates/common/commands/start.md +9 -6
  245. package/dist/templates/common/skills/before-dev.md +12 -6
  246. package/dist/templates/common/skills/brainstorm.md +68 -504
  247. package/dist/templates/common/skills/check.md +7 -1
  248. package/dist/templates/copilot/hooks/session-start.py +219 -101
  249. package/dist/templates/copilot/hooks.json +2 -2
  250. package/dist/templates/copilot/prompts/before-dev.prompt.md +12 -6
  251. package/dist/templates/copilot/prompts/brainstorm.prompt.md +69 -457
  252. package/dist/templates/copilot/prompts/check.prompt.md +86 -18
  253. package/dist/templates/copilot/prompts/parallel.prompt.md +16 -8
  254. package/dist/templates/copilot/prompts/start.prompt.md +33 -367
  255. package/dist/templates/cursor/agents/trellis-check.md +13 -7
  256. package/dist/templates/cursor/agents/trellis-implement.md +8 -7
  257. package/dist/templates/cursor/hooks.json +1 -7
  258. package/dist/templates/droid/droids/trellis-check.md +13 -7
  259. package/dist/templates/droid/droids/trellis-implement.md +8 -7
  260. package/dist/templates/droid/settings.json +4 -4
  261. package/dist/templates/gemini/agents/trellis-check.md +11 -5
  262. package/dist/templates/gemini/agents/trellis-implement.md +7 -6
  263. package/dist/templates/gemini/settings.json +2 -2
  264. package/dist/templates/kiro/agents/trellis-check.json +1 -1
  265. package/dist/templates/kiro/agents/trellis-implement.json +1 -1
  266. package/dist/templates/markdown/spec/guides/code-reuse-thinking-guide.md.txt +127 -9
  267. package/dist/templates/markdown/spec/guides/cross-layer-thinking-guide.md.txt +171 -6
  268. package/dist/templates/markdown/spec/guides/cross-platform-thinking-guide.md.txt +333 -43
  269. package/dist/templates/markdown/spec/guides/index.md.txt +18 -0
  270. package/dist/templates/opencode/agents/trellis-check.md +13 -7
  271. package/dist/templates/opencode/agents/trellis-implement.md +9 -8
  272. package/dist/templates/opencode/lib/session-utils.js +212 -123
  273. package/dist/templates/opencode/lib/trellis-context.js +73 -11
  274. package/dist/templates/opencode/plugins/inject-subagent-context.js +131 -29
  275. package/dist/templates/opencode/plugins/inject-workflow-state.js +9 -5
  276. package/dist/templates/opencode/plugins/session-start.js +9 -1
  277. package/dist/templates/pi/agents/trellis-check.md +5 -4
  278. package/dist/templates/pi/agents/trellis-implement.md +5 -4
  279. package/dist/templates/pi/extensions/trellis/index.ts.txt +1357 -754
  280. package/dist/templates/qoder/agents/trellis-check.md +11 -5
  281. package/dist/templates/qoder/agents/trellis-implement.md +7 -6
  282. package/dist/templates/qoder/settings.json +4 -4
  283. package/dist/templates/shared-hooks/index.d.ts.map +1 -1
  284. package/dist/templates/shared-hooks/index.js +0 -1
  285. package/dist/templates/shared-hooks/index.js.map +1 -1
  286. package/dist/templates/shared-hooks/inject-subagent-context.py +36 -14
  287. package/dist/templates/shared-hooks/inject-workflow-state.py +40 -42
  288. package/dist/templates/shared-hooks/session-start.py +222 -171
  289. package/dist/templates/trellis/config.yaml +38 -0
  290. package/dist/templates/trellis/index.d.ts +1 -0
  291. package/dist/templates/trellis/index.d.ts.map +1 -1
  292. package/dist/templates/trellis/index.js +2 -0
  293. package/dist/templates/trellis/index.js.map +1 -1
  294. package/dist/templates/trellis/scripts/add_session.py +50 -24
  295. package/dist/templates/trellis/scripts/common/config.py +57 -1
  296. package/dist/templates/trellis/scripts/common/safe_commit.py +285 -0
  297. package/dist/templates/trellis/scripts/common/session_context.py +384 -137
  298. package/dist/templates/trellis/scripts/common/task_context.py +3 -3
  299. package/dist/templates/trellis/scripts/common/task_store.py +161 -15
  300. package/dist/templates/trellis/scripts/common/workflow_phase.py +7 -10
  301. package/dist/templates/trellis/scripts/task.py +3 -3
  302. package/dist/templates/trellis/workflow.md +119 -98
  303. package/dist/utils/cwd-guard.d.ts +38 -0
  304. package/dist/utils/cwd-guard.d.ts.map +1 -0
  305. package/dist/utils/cwd-guard.js +62 -0
  306. package/dist/utils/cwd-guard.js.map +1 -0
  307. package/dist/utils/file-writer.d.ts +13 -0
  308. package/dist/utils/file-writer.d.ts.map +1 -1
  309. package/dist/utils/file-writer.js +59 -1
  310. package/dist/utils/file-writer.js.map +1 -1
  311. package/dist/utils/manifest-prune.d.ts +61 -0
  312. package/dist/utils/manifest-prune.d.ts.map +1 -0
  313. package/dist/utils/manifest-prune.js +136 -0
  314. package/dist/utils/manifest-prune.js.map +1 -0
  315. package/dist/utils/task-json.d.ts +9 -42
  316. package/dist/utils/task-json.d.ts.map +1 -1
  317. package/dist/utils/task-json.js +8 -45
  318. package/dist/utils/task-json.js.map +1 -1
  319. package/dist/utils/template-hash.d.ts +32 -6
  320. package/dist/utils/template-hash.d.ts.map +1 -1
  321. package/dist/utils/template-hash.js +53 -31
  322. package/dist/utils/template-hash.js.map +1 -1
  323. package/dist/utils/uninstall-scrubbers.d.ts +1 -0
  324. package/dist/utils/uninstall-scrubbers.d.ts.map +1 -1
  325. package/dist/utils/uninstall-scrubbers.js +21 -0
  326. package/dist/utils/uninstall-scrubbers.js.map +1 -1
  327. package/dist/utils/workflow-resolver.d.ts +86 -0
  328. package/dist/utils/workflow-resolver.d.ts.map +1 -0
  329. package/dist/utils/workflow-resolver.js +265 -0
  330. package/dist/utils/workflow-resolver.js.map +1 -0
  331. package/package.json +9 -8
@@ -1,543 +1,107 @@
1
- # Brainstorm - Requirements Discovery (AI Coding Enhanced)
1
+ # Trellis Brainstorm
2
2
 
3
- **CoreRule**: Interview me relentlessly about every aspect of this plan until we reach a shared understanding. Walk down each branch of the design tree, resolving dependencies between decisions one-by-one. For each question, provide your recommended answer.
3
+ ## Non-Negotiable Interview Contract
4
4
 
5
- Ask the questions one at a time.
6
-
7
- If a question can be answered by exploring the codebase, explore the codebase instead.
8
-
9
- ---
10
-
11
- Guide AI through collaborative requirements discovery **before implementation**, optimized for AI coding workflows:
12
-
13
- * **Task-first** (capture ideas immediately)
14
- * **Action-before-asking** (reduce low-value questions)
15
- * **Research-first** for technical choices (avoid asking users to invent options)
16
- * **Diverge → Converge** (expand thinking, then lock MVP)
17
-
18
- ---
19
-
20
- ## When to Use
21
-
22
- Triggered from {{CMD_REF:start}} when the user describes a development task, especially when:
23
-
24
- * requirements are unclear or evolving
25
- * there are multiple valid implementation paths
26
- * trade-offs matter (UX, reliability, maintainability, cost, performance)
27
- * the user might not know the best options up front
28
-
29
- ---
30
-
31
- ## Core Principles (Non-negotiable)
32
-
33
- 1. **Task-first (capture early)**
34
- Always ensure a task exists at the start so the user's ideas are recorded immediately.
35
-
36
- 2. **Action before asking**
37
- If you can derive the answer from repo code, docs, configs, conventions, or quick research — do that first.
38
-
39
- 3. **One question per message**
40
- Never overwhelm the user with a list of questions. Ask one, update PRD, repeat.
41
-
42
- 4. **Prefer concrete options**
43
- For preference/decision questions, present 2–3 feasible, specific approaches with trade-offs.
44
-
45
- 5. **Research-first for technical choices**
46
- If the decision depends on industry conventions / similar tools / established patterns, do research first, then propose options.
47
-
48
- 6. **Diverge → Converge**
49
- After initial understanding, proactively consider future evolution, related scenarios, and failure/edge cases — then converge to an MVP with explicit out-of-scope.
50
-
51
- 7. **No meta questions**
52
- Do not ask "should I search?" or "can you paste the code so I can continue?"
53
- If you need information: search/inspect. If blocked: ask the minimal blocking question.
54
-
55
- ---
56
-
57
- ## Step 0: Ensure Task Exists (ALWAYS)
58
-
59
- Before any Q&A, ensure a task exists. If none exists, create one immediately.
60
-
61
- * Use a **temporary working title** derived from the user's message.
62
- * It's OK if the title is imperfect — refine later in PRD.
63
-
64
- ```bash
65
- TASK_DIR=$(python3 ./.trellis/scripts/task.py create "brainstorm: <short goal>" --slug <auto>)
66
- ```
67
-
68
- Use a slug without a date prefix. `task.py create` adds the `MM-DD-`
69
- directory prefix automatically.
70
-
71
- Create/seed `prd.md` immediately with what you know:
72
-
73
- ```markdown
74
- # brainstorm: <short goal>
75
-
76
- ## Goal
77
-
78
- <one paragraph: what + why>
79
-
80
- ## What I already know
81
-
82
- * <facts from user message>
83
- * <facts discovered from repo/docs>
84
-
85
- ## Assumptions (temporary)
86
-
87
- * <assumptions to validate>
88
-
89
- ## Open Questions
90
-
91
- * <ONLY Blocking / Preference questions; keep list short>
92
-
93
- ## Requirements (evolving)
94
-
95
- * <start with what is known>
96
-
97
- ## Acceptance Criteria (evolving)
98
-
99
- * [ ] <testable criterion>
100
-
101
- ## Definition of Done (team quality bar)
102
-
103
- * Tests added/updated (unit/integration where appropriate)
104
- * Lint / typecheck / CI green
105
- * Docs/notes updated if behavior changes
106
- * Rollout/rollback considered if risky
107
-
108
- ## Out of Scope (explicit)
109
-
110
- * <what we will not do in this task>
111
-
112
- ## Technical Notes
113
-
114
- * <files inspected, constraints, links, references>
115
- * <research notes summary if applicable>
116
- ```
117
-
118
- ---
119
-
120
- ## Step 1: Auto-Context (DO THIS BEFORE ASKING QUESTIONS)
121
-
122
- Before asking questions like "what does the code look like?", gather context yourself:
123
-
124
- ### Repo inspection checklist
125
-
126
- * Identify likely modules/files impacted
127
- * Locate existing patterns (similar features, conventions, error handling style)
128
- * Check configs, scripts, existing command definitions
129
- * Note any constraints (runtime, dependency policy, build tooling)
130
-
131
- ### Documentation checklist
132
-
133
- * Look for existing PRDs/specs/templates
134
- * Look for command usage examples, README, ADRs if any
135
-
136
- Write findings into PRD:
137
-
138
- * Add to `What I already know`
139
- * Add constraints/links to `Technical Notes`
140
-
141
- ---
142
-
143
- ## Step 2: Classify Complexity (still useful, not gating task creation)
144
-
145
- | Complexity | Criteria | Action |
146
- | ------------ | ------------------------------------------------------ | ------------------------------------------- |
147
- | **Trivial** | Single-line fix, typo, obvious change | Skip brainstorm, implement directly |
148
- | **Simple** | Clear goal, 1–2 files, scope well-defined | Ask 1 confirm question, then implement |
149
- | **Moderate** | Multiple files, some ambiguity | Light brainstorm (2–3 high-value questions) |
150
- | **Complex** | Vague goal, architectural choices, multiple approaches | Full brainstorm |
151
-
152
- > Note: Task already exists from Step 0. Classification only affects depth of brainstorming.
153
-
154
- ---
155
-
156
- ## Step 3: Question Gate (Ask ONLY high-value questions)
157
-
158
- Before asking ANY question, run the following gate:
159
-
160
- ### Gate A — Can I derive this without the user?
161
-
162
- If answer is available via:
163
-
164
- * repo inspection (code/config)
165
- * docs/specs/conventions
166
- * quick market/OSS research
167
-
168
- → **Do not ask.** Fetch it, summarize, update PRD.
169
-
170
- ### Gate B — Is this a meta/lazy question?
171
-
172
- Examples:
173
-
174
- * "Should I search?"
175
- * "Can you paste the code so I can proceed?"
176
- * "What does the code look like?" (when repo is available)
177
-
178
- → **Do not ask.** Take action.
179
-
180
- ### Gate C — What type of question is it?
181
-
182
- * **Blocking**: cannot proceed without user input
183
- * **Preference**: multiple valid choices, depends on product/UX/risk preference
184
- * **Derivable**: should be answered by inspection/research
185
-
186
- → Only ask **Blocking** or **Preference**.
187
-
188
- ---
189
-
190
- ## Step 4: Research-first Mode (Mandatory for technical choices)
191
-
192
- ### Trigger conditions (any → research-first)
193
-
194
- * The task involves selecting an approach, library, protocol, framework, template system, plugin mechanism, or CLI UX convention
195
- * The user asks for "best practice", "how others do it", "recommendation"
196
- * The user can't reasonably enumerate options
197
-
198
- ### Delegate to `trellis-research` sub-agent (don't research inline)
199
-
200
- For each research topic, **spawn a `trellis-research` sub-agent via the Task tool** — don't do WebFetch / WebSearch / `gh api` inline in the main conversation.
201
-
202
- Why:
203
- - The sub-agent has its own context window → doesn't pollute brainstorm context with raw tool output
204
- - It persists findings to `{TASK_DIR}/research/<topic>.md` (the contract — see `workflow.md` Phase 1.2)
205
- - It returns only `{file path, one-line summary}` to the main agent
206
- - Independent topics can be **parallelized** — spawn multiple sub-agents in one tool call
207
-
208
- > **Codex exception**: on Codex CLI, do NOT dispatch `trellis-research` for research-first mode — do the research inline (WebFetch / WebSearch in the main session) and write findings to `{TASK_DIR}/research/<topic>.md` yourself. Reason: Codex `spawn_agent` runs sub-agents with `fork_turns="none"` (isolated context, no parent session inheritance), so the research sub-agent cannot resolve the active task path via `task.py current` and silently aborts without producing files. Inline research on Codex avoids this failure mode. The 3+ inline research calls limit (B rule in `workflow.md`) is relaxed for Codex specifically.
209
-
210
- Agent type: `trellis-research`
211
- Task description template: "Research <specific question>; persist findings to `{TASK_DIR}/research/<topic-slug>.md`."
212
-
213
- ❌ Bad (what you must NOT do):
214
- ```
215
- Main agent: WebFetch(url-A) → WebFetch(url-B) → Bash(gh api ...)
216
- → WebSearch(q1) → WebSearch(q2) → ... (10+ inline calls)
217
- → Write(research/topic.md)
218
- ```
219
- → Pollutes main context with raw HTML/JSON, burns tokens.
220
-
221
- ✅ Good:
222
- ```
223
- Main agent: Task(subagent_type="trellis-research",
224
- prompt="Research topic A; persist to research/topic-a.md")
225
- + Task(subagent_type="trellis-research",
226
- prompt="Research topic B; persist to research/topic-b.md")
227
- + Task(subagent_type="trellis-research",
228
- prompt="Research topic C; persist to research/topic-c.md")
229
- → Reads research/topic-{a,b,c}.md after they finish.
230
- ```
5
+ Interview me relentlessly about every aspect of this plan until we reach a shared understanding. Walk down each branch of the design tree, resolving dependencies between decisions one-by-one. For each question, provide your recommended answer.
231
6
 
232
- ### Research steps (to pass into each sub-agent prompt)
233
-
234
- Each `trellis-research` sub-agent should:
235
-
236
- 1. Identify 2–4 comparable tools/patterns for its topic
237
- 2. Summarize common conventions and why they exist
238
- 3. Map conventions onto our repo constraints
239
- 4. Write findings to `{TASK_DIR}/research/<topic>.md`
240
-
241
- Main agent then reads the persisted files and produces **2–3 feasible approaches** in PRD.
242
-
243
- ### Research output format (PRD)
244
-
245
- The PRD itself should only reference the persisted research files, not duplicate their content. Add a `## Research References` section pointing at `research/*.md`.
246
-
247
- Optionally, add a convergence section with feasible approaches derived from the research:
248
-
249
- ```markdown
250
- ## Research References
251
-
252
- * [`research/<topic-a>.md`](research/<topic-a>.md) — <one-line takeaway>
253
- * [`research/<topic-b>.md`](research/<topic-b>.md) — <one-line takeaway>
254
-
255
- ## Research Notes
256
-
257
- ### What similar tools do
258
-
259
- * ...
260
- * ...
261
-
262
- ### Constraints from our repo/project
263
-
264
- * ...
265
-
266
- ### Feasible approaches here
267
-
268
- **Approach A: <name>** (Recommended)
269
-
270
- * How it works:
271
- * Pros:
272
- * Cons:
273
-
274
- **Approach B: <name>**
275
-
276
- * How it works:
277
- * Pros:
278
- * Cons:
279
-
280
- **Approach C: <name>** (optional)
281
-
282
- * ...
283
- ```
284
-
285
- Then ask **one** preference question:
286
-
287
- * "Which approach do you prefer: A / B / C (or other)?"
288
-
289
- ---
290
-
291
- ## Step 5: Expansion Sweep (DIVERGE) — Required after initial understanding
292
-
293
- After you can summarize the goal, proactively broaden thinking before converging.
294
-
295
- ### Expansion categories (keep to 1–2 bullets each)
296
-
297
- 1. **Future evolution**
298
-
299
- * What might this feature become in 1–3 months?
300
- * What extension points are worth preserving now?
301
-
302
- 2. **Related scenarios**
303
-
304
- * What adjacent commands/flows should remain consistent with this?
305
- * Are there parity expectations (create vs update, import vs export, etc.)?
306
-
307
- 3. **Failure & edge cases**
308
-
309
- * Conflicts, offline/network failure, retries, idempotency, compatibility, rollback
310
- * Input validation, security boundaries, permission checks
311
-
312
- ### Expansion message template (to user)
313
-
314
- ```markdown
315
- I understand you want to implement: <current goal>.
316
-
317
- Before diving into design, let me quickly diverge to consider three categories (to avoid rework later):
318
-
319
- 1. Future evolution: <1–2 bullets>
320
- 2. Related scenarios: <1–2 bullets>
321
- 3. Failure/edge cases: <1–2 bullets>
322
-
323
- For this MVP, which would you like to include (or none)?
324
-
325
- 1. Current requirement only (minimal viable)
326
- 2. Add <X> (reserve for future extension)
327
- 3. Add <Y> (improve robustness/consistency)
328
- 4. Other: describe your preference
329
- ```
330
-
331
- Then update PRD:
332
-
333
- * What's in MVP → `Requirements`
334
- * What's excluded → `Out of Scope`
335
-
336
- ---
337
-
338
- ## Step 6: Q&A Loop (CONVERGE)
339
-
340
- ### Rules
341
-
342
- * One question per message
343
- * Prefer multiple-choice when possible
344
- * After each user answer:
345
-
346
- * Update PRD immediately
347
- * Move answered items from `Open Questions` → `Requirements`
348
- * Update `Acceptance Criteria` with testable checkboxes
349
- * Clarify `Out of Scope`
350
-
351
- ### Question priority (recommended)
352
-
353
- 1. **MVP scope boundary** (what is included/excluded)
354
- 2. **Preference decisions** (after presenting concrete options)
355
- 3. **Failure/edge behavior** (only for MVP-critical paths)
356
- 4. **Success metrics & Acceptance Criteria** (what proves it works)
357
-
358
- ### Preferred question format (multiple choice)
359
-
360
- ```markdown
361
- For <topic>, which approach do you prefer?
362
-
363
- 1. **Option A** — <what it means + trade-off>
364
- 2. **Option B** — <what it means + trade-off>
365
- 3. **Option C** — <what it means + trade-off>
366
- 4. **Other** — describe your preference
367
- ```
368
-
369
- ---
370
-
371
- ## Step 7: Propose Approaches + Record Decisions (Complex tasks)
372
-
373
- After requirements are clear enough, propose 2–3 approaches (if not already done via research-first):
374
-
375
- ```markdown
376
- Based on current information, here are 2–3 feasible approaches:
377
-
378
- **Approach A: <name>** (Recommended)
379
-
380
- * How:
381
- * Pros:
382
- * Cons:
383
-
384
- **Approach B: <name>**
385
-
386
- * How:
387
- * Pros:
388
- * Cons:
7
+ Ask the questions one at a time.
389
8
 
390
- Which direction do you prefer?
391
- ```
9
+ ## Non-Negotiable Evidence Rule
392
10
 
393
- Record the outcome in PRD as an ADR-lite section:
11
+ If a question can be answered by exploring the codebase, explore the codebase instead.
394
12
 
395
- ```markdown
396
- ## Decision (ADR-lite)
13
+ This is mandatory. Before asking the user a question, first check whether the answer is already available in code, tests, configs, docs, existing specs, or task history.
397
14
 
398
- **Context**: Why this decision was needed
399
- **Decision**: Which approach was chosen
400
- **Consequences**: Trade-offs, risks, potential future improvements
401
- ```
15
+ Do not ask the user to confirm facts that the repository can answer. Ask only for product intent, preference, scope, risk tolerance, or decisions that remain ambiguous after inspection.
402
16
 
403
17
  ---
404
18
 
405
- ## Step 8: Final Confirmation + Implementation Plan
406
-
407
- When open questions are resolved, confirm complete requirements with a structured summary:
408
-
409
- ### Final confirmation format
410
-
411
- ```markdown
412
- Here's my understanding of the complete requirements:
413
-
414
- **Goal**: <one sentence>
415
-
416
- **Requirements**:
19
+ Use this skill during Phase 1 planning to turn the user's request into clear requirements and planning artifacts.
417
20
 
418
- * ...
419
- * ...
21
+ ## Preconditions
420
22
 
421
- **Acceptance Criteria**:
23
+ Use this skill only after task-creation consent has been given and the user is ready to enter Trellis planning.
422
24
 
423
- * [ ] ...
424
- * [ ] ...
425
-
426
- **Definition of Done**:
427
-
428
- * ...
429
-
430
- **Out of Scope**:
431
-
432
- * ...
433
-
434
- **Technical Approach**:
435
- <brief summary + key decisions>
436
-
437
- **Implementation Plan (small PRs)**:
438
-
439
- * PR1: <scaffolding + tests + minimal plumbing>
440
- * PR2: <core behavior>
441
- * PR3: <edge cases + docs + cleanup>
442
-
443
- Does this look correct? If yes, I'll proceed with implementation.
444
- ```
445
-
446
- ### Subtask Decomposition (Complex Tasks)
447
-
448
- For complex tasks with multiple independent work items, create subtasks:
25
+ If no task exists yet, create one:
449
26
 
450
27
  ```bash
451
- # Create child tasks
452
- CHILD1=$(python3 ./.trellis/scripts/task.py create "Child task 1" --slug child1 --parent "$TASK_DIR")
453
- CHILD2=$(python3 ./.trellis/scripts/task.py create "Child task 2" --slug child2 --parent "$TASK_DIR")
454
-
455
- # Or link existing tasks
456
- python3 ./.trellis/scripts/task.py add-subtask "$TASK_DIR" "$CHILD_DIR"
28
+ TASK_DIR=$({{PYTHON_CMD}} ./.trellis/scripts/task.py create "<short task title>" --slug <slug>)
457
29
  ```
458
30
 
459
- ---
460
-
461
- ## PRD Target Structure (final)
462
-
463
- `prd.md` should converge to:
464
-
465
- ```markdown
466
- # <Task Title>
467
-
468
- ## Goal
469
-
470
- <why + what>
31
+ Use a concise title from the user's request. Use a slug without a date prefix. `task.py create` adds the `MM-DD-` directory prefix automatically.
471
32
 
472
- ## Requirements
33
+ `task.py create` creates the default `prd.md`. Update that file with the current understanding before asking follow-up questions.
473
34
 
474
- * ...
35
+ ## Planning Flow
475
36
 
476
- ## Acceptance Criteria
37
+ 1. Capture the user's request and initial known facts in `prd.md`.
38
+ 2. Inspect available evidence before asking questions:
39
+ - code, tests, fixtures, and configs
40
+ - README files, docs, existing specs, and domain notes
41
+ - related Trellis tasks, research files, and session history when present
42
+ 3. Separate what you found into:
43
+ - confirmed facts
44
+ - product intent still needed from the user
45
+ - scope or risk decisions still needed from the user
46
+ - likely out-of-scope items
47
+ 4. Ask the single highest-value remaining question.
48
+ 5. Include your recommended answer with the question.
49
+ 6. After each user answer, update `prd.md` before continuing.
50
+ 7. For complex tasks, create or update `design.md` and `implement.md` before implementation starts.
477
51
 
478
- * [ ] ...
52
+ Do not invent a project-specific product/spec hierarchy. If the repository already has product, domain, or spec docs, use them. If it does not, proceed with the evidence that exists.
479
53
 
480
- ## Definition of Done
54
+ ## Question Rules
481
55
 
482
- * ...
56
+ Ask only one question per message.
483
57
 
484
- ## Technical Approach
58
+ Each question must include:
485
59
 
486
- <key design + decisions>
60
+ - the decision needed
61
+ - why the answer matters
62
+ - your recommended answer
63
+ - the trade-off if the user chooses differently
487
64
 
488
- ## Decision (ADR-lite)
65
+ Do not ask process questions such as whether to search, inspect files, or continue brainstorming. Do the evidence work directly. Ask the user only when the remaining issue is a product decision, preference, scope boundary, or risk tolerance choice.
489
66
 
490
- Context / Decision / Consequences
67
+ ## Artifact Rules
491
68
 
492
- ## Out of Scope
69
+ `prd.md` records requirements and acceptance:
493
70
 
494
- * ...
71
+ - goal and user value
72
+ - confirmed facts
73
+ - requirements
74
+ - acceptance criteria
75
+ - out of scope
76
+ - open questions that still block planning
495
77
 
496
- ## Technical Notes
78
+ `design.md` records technical design for complex tasks:
497
79
 
498
- <constraints, references, files, research notes>
499
- ```
500
-
501
- ---
80
+ - architecture and boundaries
81
+ - data flow and contracts
82
+ - compatibility and migration notes
83
+ - important trade-offs
84
+ - operational or rollback considerations
502
85
 
503
- ## Anti-Patterns (Hard Avoid)
86
+ `implement.md` records execution planning for complex tasks:
504
87
 
505
- * Asking user for code/context that can be derived from repo
506
- * Asking user to choose an approach before presenting concrete options
507
- * Meta questions about whether to research
508
- * Staying narrowly on the initial request without considering evolution/edges
509
- * Letting brainstorming drift without updating PRD
88
+ - ordered implementation checklist
89
+ - validation commands
90
+ - risky files or rollback points
91
+ - follow-up checks before `task.py start`
510
92
 
511
- ---
93
+ Lightweight tasks may have only `prd.md`. Complex tasks must have `prd.md`, `design.md`, and `implement.md` before `task.py start`.
512
94
 
513
- ## Integration with Start Workflow
514
-
515
- After brainstorm completes (Step 8 confirmation approved), the flow continues to the Task Workflow's **Phase 2: Prepare for Implementation**:
516
-
517
- ```text
518
- Brainstorm
519
- Step 0: Create task directory + seed PRD
520
- Step 1–7: Discover requirements, research, converge
521
- Step 8: Final confirmation → user approves
522
-
523
- Task Workflow Phase 2 (Prepare for Implementation)
524
- Code-Spec Depth Check (if applicable)
525
- → Research codebase (based on confirmed PRD)
526
- → Configure code-spec context (jsonl files)
527
- → Activate task
528
-
529
- Task Workflow Phase 3 (Execute)
530
- Implement → Check → Complete
531
- ```
95
+ `implement.md` is not a replacement for `implement.jsonl`. Use JSONL files only for manifest-style spec and research references when the task needs them.
532
96
 
533
- The task directory and PRD already exist from brainstorm, so Phase 1 of the Task Workflow is skipped entirely.
97
+ ## Quality Bar
534
98
 
535
- ---
99
+ Before declaring planning ready:
536
100
 
537
- ## Related Commands
101
+ - `prd.md` contains testable acceptance criteria.
102
+ - Repository-answerable questions have already been answered through inspection.
103
+ - Remaining open questions are genuinely about user intent or scope.
104
+ - Complex tasks have `design.md` and `implement.md`.
105
+ - The user has reviewed the final planning artifacts or explicitly approved proceeding.
538
106
 
539
- | Command | When to Use |
540
- |---------|-------------|
541
- | `{{CMD_REF:start}}` | Entry point that triggers brainstorm |
542
- | `{{CMD_REF:finish-work}}` | After implementation is complete |
543
- | `{{CMD_REF:update-spec}}` | If new patterns emerge during work |
107
+ Do not start implementation until the user approves or asks for implementation.
@@ -11,7 +11,13 @@ git diff --name-only HEAD
11
11
  git status
12
12
  ```
13
13
 
14
- ## Step 2: Read Applicable Specs
14
+ ## Step 2: Read Task Artifacts and Applicable Specs
15
+
16
+ Read the current task artifacts in order:
17
+
18
+ - `prd.md`
19
+ - `design.md` if present
20
+ - `implement.md` if present
15
21
 
16
22
  ```bash
17
23
  python3 ./.trellis/scripts/get_context.py --mode packages