@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,500 +1,112 @@
1
1
  ---
2
2
  name: brainstorm
3
- description: "Collaborative requirements discovery session optimized for AI coding workflows. Creates task directories, seeds PRDs, runs codebase research, proposes concrete implementation approaches with trade-offs, and converges on MVP scope through structured Q&A. Use when requirements are unclear, multiple implementation paths exist, trade-offs need evaluation, or a complex feature needs scoping before development."
3
+ description: "Guide requirements discovery for a Trellis task after task-creation consent. Use when the user is ready to clarify requirements before implementation."
4
4
  ---
5
5
 
6
- # Brainstorm - Requirements Discovery (AI Coding Enhanced)
6
+ # Trellis Brainstorm
7
7
 
8
- **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.
8
+ ## Non-Negotiable Interview Contract
9
9
 
10
- Ask the questions one at a time.
11
-
12
- If a question can be answered by exploring the codebase, explore the codebase instead.
13
-
14
- ---
15
-
16
- Guide AI through collaborative requirements discovery **before implementation**, optimized for AI coding workflows:
17
-
18
- * **Task-first** (capture ideas immediately)
19
- * **Action-before-asking** (reduce low-value questions)
20
- * **Research-first** for technical choices (avoid asking users to invent options)
21
- * **Diverge → Converge** (expand thinking, then lock MVP)
22
-
23
- ---
24
-
25
- ## When to Use
26
-
27
- Triggered from `$start` when the user describes a development task, especially when:
28
-
29
- * requirements are unclear or evolving
30
- * there are multiple valid implementation paths
31
- * trade-offs matter (UX, reliability, maintainability, cost, performance)
32
- * the user might not know the best options up front
33
-
34
- ---
35
-
36
- ## Core Principles (Non-negotiable)
37
-
38
- 1. **Task-first (capture early)**
39
- Always ensure a task exists at the start so the user's ideas are recorded immediately.
40
-
41
- 2. **Action before asking**
42
- If you can derive the answer from repo code, docs, configs, conventions, or quick research — do that first.
43
-
44
- 3. **One question per message**
45
- Never overwhelm the user with a list of questions. Ask one, update PRD, repeat.
46
-
47
- 4. **Prefer concrete options**
48
- For preference/decision questions, present 2–3 feasible, specific approaches with trade-offs.
49
-
50
- 5. **Research-first for technical choices**
51
- If the decision depends on industry conventions / similar tools / established patterns, do research first, then propose options.
52
-
53
- 6. **Diverge → Converge**
54
- After initial understanding, proactively consider future evolution, related scenarios, and failure/edge cases — then converge to an MVP with explicit out-of-scope.
55
-
56
- 7. **No meta questions**
57
- Do not ask "should I search?" or "can you paste the code so I can continue?"
58
- If you need information: search/inspect. If blocked: ask the minimal blocking question.
59
-
60
- ---
61
-
62
- ## Step 0: Ensure Task Exists (ALWAYS)
63
-
64
- Before any Q&A, ensure a task exists. If none exists, create one immediately.
65
-
66
- * Use a **temporary working title** derived from the user's message.
67
- * It's OK if the title is imperfect — refine later in PRD.
68
-
69
- ```bash
70
- TASK_DIR=$(python3 ./.trellis/scripts/task.py create "brainstorm: <short goal>" --slug <auto>)
71
- ```
72
-
73
- Create/seed `prd.md` immediately with what you know:
74
-
75
- ```markdown
76
- # brainstorm: <short goal>
77
-
78
- ## Goal
79
-
80
- <one paragraph: what + why>
81
-
82
- ## What I already know
83
-
84
- * <facts from user message>
85
- * <facts discovered from repo/docs>
86
-
87
- ## Assumptions (temporary)
88
-
89
- * <assumptions to validate>
90
-
91
- ## Open Questions
92
-
93
- * <ONLY Blocking / Preference questions; keep list short>
94
-
95
- ## Requirements (evolving)
96
-
97
- * <start with what is known>
98
-
99
- ## Acceptance Criteria (evolving)
100
-
101
- * [ ] <testable criterion>
102
-
103
- ## Definition of Done (team quality bar)
104
-
105
- * Tests added/updated (unit/integration where appropriate)
106
- * Lint / typecheck / CI green
107
- * Docs/notes updated if behavior changes
108
- * Rollout/rollback considered if risky
109
-
110
- ## Out of Scope (explicit)
111
-
112
- * <what we will not do in this task>
113
-
114
- ## Technical Notes
115
-
116
- * <files inspected, constraints, links, references>
117
- * <research notes summary if applicable>
118
- ```
119
-
120
- ---
121
-
122
- ## Step 1: Auto-Context (DO THIS BEFORE ASKING QUESTIONS)
123
-
124
- Before asking questions like "what does the code look like?", gather context yourself:
125
-
126
- ### Repo inspection checklist
127
-
128
- * Identify likely modules/files impacted
129
- * Locate existing patterns (similar features, conventions, error handling style)
130
- * Check configs, scripts, existing command definitions
131
- * Note any constraints (runtime, dependency policy, build tooling)
132
-
133
- ### Documentation checklist
134
-
135
- * Look for existing PRDs/specs/templates
136
- * Look for command usage examples, README, ADRs if any
137
-
138
- Write findings into PRD:
139
-
140
- * Add to `What I already know`
141
- * Add constraints/links to `Technical Notes`
142
-
143
- ---
144
-
145
- ## Step 2: Classify Complexity (still useful, not gating task creation)
146
-
147
- | Complexity | Criteria | Action |
148
- | ------------ | ------------------------------------------------------ | ------------------------------------------- |
149
- | **Trivial** | Single-line fix, typo, obvious change | Skip brainstorm, implement directly |
150
- | **Simple** | Clear goal, 1–2 files, scope well-defined | Ask 1 confirm question, then implement |
151
- | **Moderate** | Multiple files, some ambiguity | Light brainstorm (2–3 high-value questions) |
152
- | **Complex** | Vague goal, architectural choices, multiple approaches | Full brainstorm |
153
-
154
- > Note: Task already exists from Step 0. Classification only affects depth of brainstorming.
155
-
156
- ---
157
-
158
- ## Step 3: Question Gate (Ask ONLY high-value questions)
159
-
160
- Before asking ANY question, run the following gate:
161
-
162
- ### Gate A — Can I derive this without the user?
163
-
164
- If answer is available via:
165
-
166
- * repo inspection (code/config)
167
- * docs/specs/conventions
168
- * quick market/OSS research
169
-
170
- → **Do not ask.** Fetch it, summarize, update PRD.
171
-
172
- ### Gate B — Is this a meta/lazy question?
173
-
174
- Examples:
175
-
176
- * "Should I search?"
177
- * "Can you paste the code so I can proceed?"
178
- * "What does the code look like?" (when repo is available)
179
-
180
- → **Do not ask.** Take action.
181
-
182
- ### Gate C — What type of question is it?
183
-
184
- * **Blocking**: cannot proceed without user input
185
- * **Preference**: multiple valid choices, depends on product/UX/risk preference
186
- * **Derivable**: should be answered by inspection/research
187
-
188
- → Only ask **Blocking** or **Preference**.
189
-
190
- ---
191
-
192
- ## Step 4: Research-first Mode (Mandatory for technical choices)
193
-
194
- ### Trigger conditions (any → research-first)
195
-
196
- * The task involves selecting an approach, library, protocol, framework, template system, plugin mechanism, or CLI UX convention
197
- * The user asks for "best practice", "how others do it", "recommendation"
198
- * The user can't reasonably enumerate options
199
-
200
- ### Research steps
201
-
202
- 1. Identify 2–4 comparable tools/patterns
203
- 2. Summarize common conventions and why they exist
204
- 3. Map conventions onto our repo constraints
205
- 4. Produce **2–3 feasible approaches** for our project
206
-
207
- ### Research output format (PRD)
10
+ 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.
208
11
 
209
- Add a section in PRD (either within Technical Notes or as its own):
210
-
211
- ```markdown
212
- ## Research Notes
213
-
214
- ### What similar tools do
215
-
216
- * ...
217
- * ...
218
-
219
- ### Constraints from our repo/project
220
-
221
- * ...
222
-
223
- ### Feasible approaches here
224
-
225
- **Approach A: <name>** (Recommended)
226
-
227
- * How it works:
228
- * Pros:
229
- * Cons:
230
-
231
- **Approach B: <name>**
232
-
233
- * How it works:
234
- * Pros:
235
- * Cons:
236
-
237
- **Approach C: <name>** (optional)
238
-
239
- * ...
240
- ```
241
-
242
- Then ask **one** preference question:
243
-
244
- * "Which approach do you prefer: A / B / C (or other)?"
245
-
246
- ---
247
-
248
- ## Step 5: Expansion Sweep (DIVERGE) — Required after initial understanding
249
-
250
- After you can summarize the goal, proactively broaden thinking before converging.
251
-
252
- ### Expansion categories (keep to 1–2 bullets each)
253
-
254
- 1. **Future evolution**
255
-
256
- * What might this feature become in 1–3 months?
257
- * What extension points are worth preserving now?
258
-
259
- 2. **Related scenarios**
260
-
261
- * What adjacent commands/flows should remain consistent with this?
262
- * Are there parity expectations (create vs update, import vs export, etc.)?
263
-
264
- 3. **Failure & edge cases**
265
-
266
- * Conflicts, offline/network failure, retries, idempotency, compatibility, rollback
267
- * Input validation, security boundaries, permission checks
268
-
269
- ### Expansion message template (to user)
270
-
271
- ```markdown
272
- I understand you want to implement: <current goal>.
273
-
274
- Before diving into design, let me quickly diverge to consider three categories (to avoid rework later):
275
-
276
- 1. Future evolution: <1–2 bullets>
277
- 2. Related scenarios: <1–2 bullets>
278
- 3. Failure/edge cases: <1–2 bullets>
279
-
280
- For this MVP, which would you like to include (or none)?
281
-
282
- 1. Current requirement only (minimal viable)
283
- 2. Add <X> (reserve for future extension)
284
- 3. Add <Y> (improve robustness/consistency)
285
- 4. Other: describe your preference
286
- ```
287
-
288
- Then update PRD:
289
-
290
- * What's in MVP → `Requirements`
291
- * What's excluded → `Out of Scope`
292
-
293
- ---
294
-
295
- ## Step 6: Q&A Loop (CONVERGE)
296
-
297
- ### Rules
298
-
299
- * One question per message
300
- * Prefer multiple-choice when possible
301
- * After each user answer:
302
-
303
- * Update PRD immediately
304
- * Move answered items from `Open Questions` → `Requirements`
305
- * Update `Acceptance Criteria` with testable checkboxes
306
- * Clarify `Out of Scope`
307
-
308
- ### Question priority (recommended)
309
-
310
- 1. **MVP scope boundary** (what is included/excluded)
311
- 2. **Preference decisions** (after presenting concrete options)
312
- 3. **Failure/edge behavior** (only for MVP-critical paths)
313
- 4. **Success metrics & Acceptance Criteria** (what proves it works)
314
-
315
- ### Preferred question format (multiple choice)
316
-
317
- ```markdown
318
- For <topic>, which approach do you prefer?
319
-
320
- 1. **Option A** — <what it means + trade-off>
321
- 2. **Option B** — <what it means + trade-off>
322
- 3. **Option C** — <what it means + trade-off>
323
- 4. **Other** — describe your preference
324
- ```
325
-
326
- ---
327
-
328
- ## Step 7: Propose Approaches + Record Decisions (Complex tasks)
329
-
330
- After requirements are clear enough, propose 2–3 approaches (if not already done via research-first):
331
-
332
- ```markdown
333
- Based on current information, here are 2–3 feasible approaches:
334
-
335
- **Approach A: <name>** (Recommended)
336
-
337
- * How:
338
- * Pros:
339
- * Cons:
340
-
341
- **Approach B: <name>**
342
-
343
- * How:
344
- * Pros:
345
- * Cons:
12
+ Ask the questions one at a time.
346
13
 
347
- Which direction do you prefer?
348
- ```
14
+ ## Non-Negotiable Evidence Rule
349
15
 
350
- Record the outcome in PRD as an ADR-lite section:
16
+ If a question can be answered by exploring the codebase, explore the codebase instead.
351
17
 
352
- ```markdown
353
- ## Decision (ADR-lite)
18
+ 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.
354
19
 
355
- **Context**: Why this decision was needed
356
- **Decision**: Which approach was chosen
357
- **Consequences**: Trade-offs, risks, potential future improvements
358
- ```
20
+ 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.
359
21
 
360
22
  ---
361
23
 
362
- ## Step 8: Final Confirmation + Implementation Plan
363
-
364
- When open questions are resolved, confirm complete requirements with a structured summary:
365
-
366
- ### Final confirmation format
367
-
368
- ```markdown
369
- Here's my understanding of the complete requirements:
370
-
371
- **Goal**: <one sentence>
372
-
373
- **Requirements**:
374
-
375
- * ...
376
- * ...
377
-
378
- **Acceptance Criteria**:
24
+ Use this skill during Phase 1 planning to turn the user's request into clear requirements and planning artifacts.
379
25
 
380
- * [ ] ...
381
- * [ ] ...
26
+ ## Preconditions
382
27
 
383
- **Definition of Done**:
28
+ Use this skill only after task-creation consent has been given and the user is ready to enter Trellis planning.
384
29
 
385
- * ...
386
-
387
- **Out of Scope**:
388
-
389
- * ...
390
-
391
- **Technical Approach**:
392
- <brief summary + key decisions>
393
-
394
- **Implementation Plan (small PRs)**:
395
-
396
- * PR1: <scaffolding + tests + minimal plumbing>
397
- * PR2: <core behavior>
398
- * PR3: <edge cases + docs + cleanup>
399
-
400
- Does this look correct? If yes, I'll proceed with implementation.
401
- ```
402
-
403
- ### Subtask Decomposition (Complex Tasks)
404
-
405
- For complex tasks with multiple independent work items, create subtasks:
30
+ If no task exists yet, create one:
406
31
 
407
32
  ```bash
408
- # Create child tasks
409
- CHILD1=$(python3 ./.trellis/scripts/task.py create "Child task 1" --slug child1 --parent "$TASK_DIR")
410
- CHILD2=$(python3 ./.trellis/scripts/task.py create "Child task 2" --slug child2 --parent "$TASK_DIR")
411
-
412
- # Or link existing tasks
413
- python3 ./.trellis/scripts/task.py add-subtask "$TASK_DIR" "$CHILD_DIR"
33
+ TASK_DIR=$({{PYTHON_CMD}} ./.trellis/scripts/task.py create "<short task title>" --slug <slug>)
414
34
  ```
415
35
 
416
- ---
417
-
418
- ## PRD Target Structure (final)
419
-
420
- `prd.md` should converge to:
421
-
422
- ```markdown
423
- # <Task Title>
36
+ 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.
424
37
 
425
- ## Goal
38
+ `task.py create` creates the default `prd.md`. Update that file with the current understanding before asking follow-up questions.
426
39
 
427
- <why + what>
40
+ ## Planning Flow
428
41
 
429
- ## Requirements
42
+ 1. Capture the user's request and initial known facts in `prd.md`.
43
+ 2. Inspect available evidence before asking questions:
44
+ - code, tests, fixtures, and configs
45
+ - README files, docs, existing specs, and domain notes
46
+ - related Trellis tasks, research files, and session history when present
47
+ 3. Separate what you found into:
48
+ - confirmed facts
49
+ - product intent still needed from the user
50
+ - scope or risk decisions still needed from the user
51
+ - likely out-of-scope items
52
+ 4. Ask the single highest-value remaining question.
53
+ 5. Include your recommended answer with the question.
54
+ 6. After each user answer, update `prd.md` before continuing.
55
+ 7. For complex tasks, create or update `design.md` and `implement.md` before implementation starts.
430
56
 
431
- * ...
57
+ 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.
432
58
 
433
- ## Acceptance Criteria
59
+ ## Question Rules
434
60
 
435
- * [ ] ...
61
+ Ask only one question per message.
436
62
 
437
- ## Definition of Done
63
+ Each question must include:
438
64
 
439
- * ...
65
+ - the decision needed
66
+ - why the answer matters
67
+ - your recommended answer
68
+ - the trade-off if the user chooses differently
440
69
 
441
- ## Technical Approach
70
+ 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.
442
71
 
443
- <key design + decisions>
72
+ ## Artifact Rules
444
73
 
445
- ## Decision (ADR-lite)
74
+ `prd.md` records requirements and acceptance:
446
75
 
447
- Context / Decision / Consequences
76
+ - goal and user value
77
+ - confirmed facts
78
+ - requirements
79
+ - acceptance criteria
80
+ - out of scope
81
+ - open questions that still block planning
448
82
 
449
- ## Out of Scope
83
+ `design.md` records technical design for complex tasks:
450
84
 
451
- * ...
85
+ - architecture and boundaries
86
+ - data flow and contracts
87
+ - compatibility and migration notes
88
+ - important trade-offs
89
+ - operational or rollback considerations
452
90
 
453
- ## Technical Notes
91
+ `implement.md` records execution planning for complex tasks:
454
92
 
455
- <constraints, references, files, research notes>
456
- ```
93
+ - ordered implementation checklist
94
+ - validation commands
95
+ - risky files or rollback points
96
+ - follow-up checks before `task.py start`
457
97
 
458
- ---
98
+ Lightweight tasks may have only `prd.md`. Complex tasks must have `prd.md`, `design.md`, and `implement.md` before `task.py start`.
459
99
 
460
- ## Anti-Patterns (Hard Avoid)
100
+ `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.
461
101
 
462
- * Asking user for code/context that can be derived from repo
463
- * Asking user to choose an approach before presenting concrete options
464
- * Meta questions about whether to research
465
- * Staying narrowly on the initial request without considering evolution/edges
466
- * Letting brainstorming drift without updating PRD
102
+ ## Quality Bar
467
103
 
468
- ---
469
-
470
- ## Integration with Start Workflow
471
-
472
- After brainstorm completes (Step 8 confirmation approved), the flow continues to the Task Workflow's **Phase 2: Prepare for Implementation**:
473
-
474
- ```text
475
- Brainstorm
476
- Step 0: Create task directory + seed PRD
477
- Step 1–7: Discover requirements, research, converge
478
- Step 8: Final confirmation → user approves
479
-
480
- Task Workflow Phase 2 (Prepare for Implementation)
481
- Code-Spec Depth Check (if applicable)
482
- → Research codebase (based on confirmed PRD)
483
- → Configure code-spec context (jsonl files)
484
- → Activate task
485
-
486
- Task Workflow Phase 3 (Execute)
487
- Implement → Check → Complete
488
- ```
489
-
490
- The task directory and PRD already exist from brainstorm, so Phase 1 of the Task Workflow is skipped entirely.
491
-
492
- ---
104
+ Before declaring planning ready:
493
105
 
494
- ## Related Commands
106
+ - `prd.md` contains testable acceptance criteria.
107
+ - Repository-answerable questions have already been answered through inspection.
108
+ - Remaining open questions are genuinely about user intent or scope.
109
+ - Complex tasks have `design.md` and `implement.md`.
110
+ - The user has reviewed the final planning artifacts or explicitly approved proceeding.
495
111
 
496
- | Command | When to Use |
497
- |---------|-------------|
498
- | `$start` | Entry point that triggers brainstorm |
499
- | `$finish-work` | After implementation is complete |
500
- | `$update-spec` | If new patterns emerge during work |
112
+ Do not start implementation until the user approves or asks for implementation.
@@ -3,28 +3,96 @@ name: check
3
3
  description: "Validates recently written code against project-specific development guidelines from .trellis/spec/. Identifies changed files via git diff, discovers applicable spec modules, runs lint and typecheck, and reports guideline violations. Use when code is written and needs quality verification, to catch context drift during long sessions, or before committing changes."
4
4
  ---
5
5
 
6
- Check if the code you just wrote follows the development guidelines.
6
+ # Code Quality Check
7
7
 
8
- Execute these steps:
8
+ Comprehensive quality verification for recently written code. Combines spec compliance, cross-layer safety, and pre-commit checks.
9
9
 
10
- 1. **Identify changed files**:
11
- ```bash
12
- git diff --name-only HEAD
13
- ```
10
+ ---
11
+
12
+ ## Step 1: Identify What Changed
13
+
14
+ ```bash
15
+ git diff --name-only HEAD
16
+ git status
17
+ ```
18
+
19
+ ## Step 2: Read Task Artifacts and Applicable Specs
20
+
21
+ Read the current task artifacts in order:
22
+
23
+ - `prd.md`
24
+ - `design.md` if present
25
+ - `implement.md` if present
26
+
27
+ ```bash
28
+ python3 ./.trellis/scripts/get_context.py --mode packages
29
+ ```
30
+
31
+ For each changed package/layer, read the spec index and follow its **Quality Check** section:
32
+
33
+ ```bash
34
+ cat .trellis/spec/<package>/<layer>/index.md
35
+ ```
36
+
37
+ Read the specific guideline files referenced — the index is a pointer, not the goal.
38
+
39
+ ## Step 3: Run Project Checks
40
+
41
+ Run the project's lint, type-check, and test commands. Fix any failures before proceeding.
42
+
43
+ ## Step 4: Review Against Checklist
44
+
45
+ ### Code Quality
46
+
47
+ - [ ] Linter passes?
48
+ - [ ] Type checker passes (if applicable)?
49
+ - [ ] Tests pass?
50
+ - [ ] No debug logging left in?
51
+ - [ ] No suppressed warnings or type-safety bypasses?
14
52
 
15
- 2. **Determine which spec modules apply** based on the changed file paths:
16
- ```bash
17
- python3 ./.trellis/scripts/get_context.py --mode packages
18
- ```
53
+ ### Test Coverage
19
54
 
20
- 3. **Read the spec index** for each relevant module:
21
- ```bash
22
- cat .trellis/spec/<package>/<layer>/index.md
23
- ```
24
- Follow the **"Quality Check"** section in the index.
55
+ - [ ] New function unit test added?
56
+ - [ ] Bug fix → regression test added?
57
+ - [ ] Changed behavior → existing tests updated?
25
58
 
26
- 4. **Read the specific guideline files** referenced in the Quality Check section (e.g., `quality-guidelines.md`, `conventions.md`). The index is NOT the goal — it points you to the actual guideline files. Read those files and review your code against them.
59
+ ### Spec Sync
60
+
61
+ - [ ] Does `.trellis/spec/` need updates? (new patterns, conventions, lessons learned)
62
+
63
+ > "If I fixed a bug or discovered something non-obvious, should I document it so future me won't hit the same issue?" → If YES, update the relevant spec doc.
64
+
65
+ ## Step 5: Cross-Layer Dimensions (if applicable)
66
+
67
+ Skip this step if your change is confined to a single layer.
68
+
69
+ ### A. Data Flow (changes touch 3+ layers)
70
+
71
+ - [ ] Read flow traces correctly: Storage → Service → API → UI
72
+ - [ ] Write flow traces correctly: UI → API → Service → Storage
73
+ - [ ] Types/schemas correctly passed between layers?
74
+ - [ ] Errors properly propagated to caller?
75
+
76
+ ### B. Code Reuse (modifying constants, creating utilities)
77
+
78
+ - [ ] Searched for existing similar code before creating new?
79
+ ```bash
80
+ grep -r "pattern" src/
81
+ ```
82
+ - [ ] If 2+ places define same value → extracted to shared constant?
83
+ - [ ] After batch modification, all occurrences updated?
84
+
85
+ ### C. Import/Dependency (creating new files)
86
+
87
+ - [ ] Correct import paths (relative vs absolute)?
88
+ - [ ] No circular dependencies?
89
+
90
+ ### D. Same-Layer Consistency
91
+
92
+ - [ ] Other places using the same concept are consistent?
93
+
94
+ ---
27
95
 
28
- 5. **Run lint and typecheck** for the affected package.
96
+ ## Step 6: Report and Fix
29
97
 
30
- 6. **Report any violations** and fix them if found.
98
+ Report violations found and fix them directly. Re-run project checks after fixes.