@blulotus/trellis 0.7.0 → 0.7.2

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 (343) hide show
  1. package/README.md +2 -2
  2. package/dist/cli/index.js +2 -29
  3. package/dist/cli/index.js.map +1 -1
  4. package/dist/commands/init.d.ts +0 -22
  5. package/dist/commands/init.d.ts.map +1 -1
  6. package/dist/commands/init.js +5 -12
  7. package/dist/commands/init.js.map +1 -1
  8. package/dist/commands/mem.d.ts +2 -2
  9. package/dist/commands/mem.d.ts.map +1 -1
  10. package/dist/commands/mem.js +7 -40
  11. package/dist/commands/mem.js.map +1 -1
  12. package/dist/commands/uninstall.d.ts +1 -1
  13. package/dist/commands/uninstall.d.ts.map +1 -1
  14. package/dist/commands/uninstall.js +4 -34
  15. package/dist/commands/uninstall.js.map +1 -1
  16. package/dist/commands/update.d.ts.map +1 -1
  17. package/dist/commands/update.js +2 -28
  18. package/dist/commands/update.js.map +1 -1
  19. package/dist/configurators/index.d.ts.map +1 -1
  20. package/dist/configurators/index.js +7 -73
  21. package/dist/configurators/index.js.map +1 -1
  22. package/dist/configurators/shared.d.ts +18 -70
  23. package/dist/configurators/shared.d.ts.map +1 -1
  24. package/dist/configurators/shared.js +20 -299
  25. package/dist/configurators/shared.js.map +1 -1
  26. package/dist/configurators/workflow.d.ts +0 -14
  27. package/dist/configurators/workflow.d.ts.map +1 -1
  28. package/dist/configurators/workflow.js +1 -37
  29. package/dist/configurators/workflow.js.map +1 -1
  30. package/dist/migrations/manifests/0.1.9.json +0 -12
  31. package/dist/migrations/manifests/0.2.14.json +0 -84
  32. package/dist/migrations/manifests/0.3.0-beta.0.json +0 -87
  33. package/dist/migrations/manifests/0.3.4.json +1 -13
  34. package/dist/migrations/manifests/0.4.0-beta.1.json +24 -176
  35. package/dist/migrations/manifests/0.5.0-beta.0.json +67 -1203
  36. package/dist/migrations/manifests/0.5.0-beta.15.json +0 -96
  37. package/dist/migrations/manifests/0.5.0-beta.5.json +0 -168
  38. package/dist/migrations/manifests/0.5.0-beta.9.json +0 -20
  39. package/dist/migrations/manifests/0.6.0-beta.23.json +0 -66
  40. package/dist/migrations/manifests/0.6.3.json +1 -16
  41. package/dist/migrations/manifests/0.6.6.json +1 -9
  42. package/dist/migrations/manifests/0.7.0.json +9 -0
  43. package/dist/migrations/manifests/0.7.1.json +9 -0
  44. package/dist/migrations/manifests/0.7.2.json +9 -0
  45. package/dist/migrations/manifests/0.8.0.json +9 -0
  46. package/dist/templates/codex/hooks/session-start.py +37 -13
  47. package/dist/templates/codex/hooks.json +5 -0
  48. package/dist/templates/common/bundled-skills/trellis-meta/SKILL.md +5 -5
  49. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-agents.md +0 -10
  50. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-hooks.md +1 -1
  51. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-skills-or-commands.md +1 -13
  52. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/overview.md +2 -2
  53. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/bundled-skills.md +9 -28
  54. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/generated-files.md +5 -5
  55. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/overview.md +1 -1
  56. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/agents.md +1 -17
  57. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/hooks-and-settings.md +4 -12
  58. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/overview.md +6 -6
  59. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/platform-map.md +5 -75
  60. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/skills-and-commands.md +0 -16
  61. package/dist/templates/common/bundled-skills/trellis-session-insight/SKILL.md +1 -1
  62. package/dist/templates/common/bundled-skills/trellis-session-insight/references/cli-quick-reference.md +2 -3
  63. package/dist/templates/common/commands/continue.md +24 -4
  64. package/dist/templates/common/commands/finish-work.md +19 -9
  65. package/dist/templates/common/commands/start.md +38 -29
  66. package/dist/templates/extract.d.ts +0 -10
  67. package/dist/templates/extract.d.ts.map +1 -1
  68. package/dist/templates/extract.js +0 -24
  69. package/dist/templates/extract.js.map +1 -1
  70. package/dist/templates/markdown/spec/guides/code-reuse-thinking-guide.md.txt +7 -9
  71. package/dist/templates/markdown/spec/guides/cross-layer-thinking-guide.md.txt +4 -8
  72. package/dist/templates/markdown/spec/guides/cross-platform-thinking-guide.md.txt +5 -5
  73. package/dist/templates/shared-hooks/index.d.ts +11 -43
  74. package/dist/templates/shared-hooks/index.d.ts.map +1 -1
  75. package/dist/templates/shared-hooks/index.js +9 -86
  76. package/dist/templates/shared-hooks/index.js.map +1 -1
  77. package/dist/templates/shared-hooks/inject-spec-context.py +1 -1
  78. package/dist/templates/shared-hooks/inject-subagent-context.py +23 -85
  79. package/dist/templates/shared-hooks/inject-workflow-state.py +56 -86
  80. package/dist/templates/shared-hooks/session-start.py +76 -98
  81. package/dist/templates/trellis/config.yaml +8 -8
  82. package/dist/templates/trellis/index.d.ts +1 -4
  83. package/dist/templates/trellis/index.d.ts.map +1 -1
  84. package/dist/templates/trellis/index.js +1 -5
  85. package/dist/templates/trellis/index.js.map +1 -1
  86. package/dist/templates/trellis/scripts/add_session.py +12 -11
  87. package/dist/templates/trellis/scripts/common/__init__.py +2 -0
  88. package/dist/templates/trellis/scripts/common/active_task.py +80 -152
  89. package/dist/templates/trellis/scripts/common/config.py +7 -7
  90. package/dist/templates/trellis/scripts/common/git_context.py +1 -1
  91. package/dist/templates/trellis/scripts/common/session_context.py +2 -2
  92. package/dist/templates/trellis/scripts/common/spec_inject.py +2 -2
  93. package/dist/templates/trellis/scripts/common/task_store.py +8 -28
  94. package/dist/templates/trellis/scripts/common/workflow_phase.py +4 -8
  95. package/dist/templates/trellis/scripts/get_context.py +2 -2
  96. package/dist/templates/trellis/scripts/init_developer.py +1 -1
  97. package/dist/templates/trellis/scripts/task.py +90 -57
  98. package/dist/templates/trellis/workflow.md +44 -66
  99. package/dist/types/ai-tools.d.ts +10 -10
  100. package/dist/types/ai-tools.d.ts.map +1 -1
  101. package/dist/types/ai-tools.js +3 -434
  102. package/dist/types/ai-tools.js.map +1 -1
  103. package/dist/utils/uninstall-scrubbers.d.ts +3 -18
  104. package/dist/utils/uninstall-scrubbers.d.ts.map +1 -1
  105. package/dist/utils/uninstall-scrubbers.js +24 -154
  106. package/dist/utils/uninstall-scrubbers.js.map +1 -1
  107. package/package.json +2 -2
  108. package/dist/configurators/antigravity.d.ts +0 -7
  109. package/dist/configurators/antigravity.d.ts.map +0 -1
  110. package/dist/configurators/antigravity.js +0 -11
  111. package/dist/configurators/antigravity.js.map +0 -1
  112. package/dist/configurators/codebuddy.d.ts +0 -10
  113. package/dist/configurators/codebuddy.d.ts.map +0 -1
  114. package/dist/configurators/codebuddy.js +0 -24
  115. package/dist/configurators/codebuddy.js.map +0 -1
  116. package/dist/configurators/copilot.d.ts +0 -14
  117. package/dist/configurators/copilot.d.ts.map +0 -1
  118. package/dist/configurators/copilot.js +0 -46
  119. package/dist/configurators/copilot.js.map +0 -1
  120. package/dist/configurators/cursor.d.ts +0 -10
  121. package/dist/configurators/cursor.d.ts.map +0 -1
  122. package/dist/configurators/cursor.js +0 -23
  123. package/dist/configurators/cursor.js.map +0 -1
  124. package/dist/configurators/devin.d.ts +0 -8
  125. package/dist/configurators/devin.d.ts.map +0 -1
  126. package/dist/configurators/devin.js +0 -12
  127. package/dist/configurators/devin.js.map +0 -1
  128. package/dist/configurators/droid.d.ts +0 -10
  129. package/dist/configurators/droid.d.ts.map +0 -1
  130. package/dist/configurators/droid.js +0 -24
  131. package/dist/configurators/droid.js.map +0 -1
  132. package/dist/configurators/dsh.d.ts +0 -26
  133. package/dist/configurators/dsh.d.ts.map +0 -1
  134. package/dist/configurators/dsh.js +0 -76
  135. package/dist/configurators/dsh.js.map +0 -1
  136. package/dist/configurators/gemini.d.ts +0 -18
  137. package/dist/configurators/gemini.d.ts.map +0 -1
  138. package/dist/configurators/gemini.js +0 -39
  139. package/dist/configurators/gemini.js.map +0 -1
  140. package/dist/configurators/grok.d.ts +0 -17
  141. package/dist/configurators/grok.d.ts.map +0 -1
  142. package/dist/configurators/grok.js +0 -38
  143. package/dist/configurators/grok.js.map +0 -1
  144. package/dist/configurators/kilo.d.ts +0 -7
  145. package/dist/configurators/kilo.d.ts.map +0 -1
  146. package/dist/configurators/kilo.js +0 -11
  147. package/dist/configurators/kilo.js.map +0 -1
  148. package/dist/configurators/kimi.d.ts +0 -26
  149. package/dist/configurators/kimi.d.ts.map +0 -1
  150. package/dist/configurators/kimi.js +0 -74
  151. package/dist/configurators/kimi.js.map +0 -1
  152. package/dist/configurators/kiro.d.ts +0 -11
  153. package/dist/configurators/kiro.d.ts.map +0 -1
  154. package/dist/configurators/kiro.js +0 -30
  155. package/dist/configurators/kiro.js.map +0 -1
  156. package/dist/configurators/omp.d.ts +0 -6
  157. package/dist/configurators/omp.d.ts.map +0 -1
  158. package/dist/configurators/omp.js +0 -28
  159. package/dist/configurators/omp.js.map +0 -1
  160. package/dist/configurators/opencode.d.ts +0 -5
  161. package/dist/configurators/opencode.d.ts.map +0 -1
  162. package/dist/configurators/opencode.js +0 -84
  163. package/dist/configurators/opencode.js.map +0 -1
  164. package/dist/configurators/pi.d.ts +0 -5
  165. package/dist/configurators/pi.d.ts.map +0 -1
  166. package/dist/configurators/pi.js +0 -39
  167. package/dist/configurators/pi.js.map +0 -1
  168. package/dist/configurators/qoder.d.ts +0 -12
  169. package/dist/configurators/qoder.d.ts.map +0 -1
  170. package/dist/configurators/qoder.js +0 -30
  171. package/dist/configurators/qoder.js.map +0 -1
  172. package/dist/configurators/reasonix.d.ts +0 -17
  173. package/dist/configurators/reasonix.d.ts.map +0 -1
  174. package/dist/configurators/reasonix.js +0 -37
  175. package/dist/configurators/reasonix.js.map +0 -1
  176. package/dist/configurators/snow.d.ts +0 -25
  177. package/dist/configurators/snow.d.ts.map +0 -1
  178. package/dist/configurators/snow.js +0 -69
  179. package/dist/configurators/snow.js.map +0 -1
  180. package/dist/configurators/trae.d.ts +0 -16
  181. package/dist/configurators/trae.d.ts.map +0 -1
  182. package/dist/configurators/trae.js +0 -34
  183. package/dist/configurators/trae.js.map +0 -1
  184. package/dist/configurators/zcode.d.ts +0 -23
  185. package/dist/configurators/zcode.d.ts.map +0 -1
  186. package/dist/configurators/zcode.js +0 -63
  187. package/dist/configurators/zcode.js.map +0 -1
  188. package/dist/templates/codebuddy/agents/trellis-check.md +0 -115
  189. package/dist/templates/codebuddy/agents/trellis-implement.md +0 -115
  190. package/dist/templates/codebuddy/agents/trellis-research.md +0 -137
  191. package/dist/templates/codebuddy/index.d.ts +0 -15
  192. package/dist/templates/codebuddy/index.d.ts.map +0 -1
  193. package/dist/templates/codebuddy/index.js +0 -15
  194. package/dist/templates/codebuddy/index.js.map +0 -1
  195. package/dist/templates/codebuddy/settings.json +0 -69
  196. package/dist/templates/copilot/copilot-instructions.md +0 -11
  197. package/dist/templates/copilot/hooks/session-start.py +0 -564
  198. package/dist/templates/copilot/hooks.json +0 -19
  199. package/dist/templates/copilot/index.d.ts +0 -28
  200. package/dist/templates/copilot/index.d.ts.map +0 -1
  201. package/dist/templates/copilot/index.js +0 -61
  202. package/dist/templates/copilot/index.js.map +0 -1
  203. package/dist/templates/copilot/prompts/before-dev.prompt.md +0 -39
  204. package/dist/templates/copilot/prompts/brainstorm.prompt.md +0 -173
  205. package/dist/templates/copilot/prompts/break-loop.prompt.md +0 -129
  206. package/dist/templates/copilot/prompts/check-cross-layer.prompt.md +0 -170
  207. package/dist/templates/copilot/prompts/check.prompt.md +0 -110
  208. package/dist/templates/copilot/prompts/create-command.prompt.md +0 -116
  209. package/dist/templates/copilot/prompts/finish-work.prompt.md +0 -99
  210. package/dist/templates/copilot/prompts/integrate-skill.prompt.md +0 -223
  211. package/dist/templates/copilot/prompts/onboard.prompt.md +0 -362
  212. package/dist/templates/copilot/prompts/parallel.prompt.md +0 -204
  213. package/dist/templates/copilot/prompts/record-session.prompt.md +0 -66
  214. package/dist/templates/copilot/prompts/start.prompt.md +0 -63
  215. package/dist/templates/copilot/prompts/update-spec.prompt.md +0 -358
  216. package/dist/templates/cursor/agents/trellis-check.md +0 -114
  217. package/dist/templates/cursor/agents/trellis-implement.md +0 -114
  218. package/dist/templates/cursor/agents/trellis-research.md +0 -136
  219. package/dist/templates/cursor/hooks.json +0 -24
  220. package/dist/templates/cursor/index.d.ts +0 -13
  221. package/dist/templates/cursor/index.d.ts.map +0 -1
  222. package/dist/templates/cursor/index.js +0 -13
  223. package/dist/templates/cursor/index.js.map +0 -1
  224. package/dist/templates/droid/droids/trellis-check.md +0 -107
  225. package/dist/templates/droid/droids/trellis-implement.md +0 -107
  226. package/dist/templates/droid/droids/trellis-research.md +0 -137
  227. package/dist/templates/droid/index.d.ts +0 -15
  228. package/dist/templates/droid/index.d.ts.map +0 -1
  229. package/dist/templates/droid/index.js +0 -15
  230. package/dist/templates/droid/index.js.map +0 -1
  231. package/dist/templates/droid/settings.json +0 -69
  232. package/dist/templates/dsh/DSH.md +0 -80
  233. package/dist/templates/dsh/agents/trellis-check.md +0 -99
  234. package/dist/templates/dsh/agents/trellis-implement.md +0 -106
  235. package/dist/templates/dsh/agents/trellis-research.md +0 -134
  236. package/dist/templates/dsh/index.d.ts +0 -22
  237. package/dist/templates/dsh/index.d.ts.map +0 -1
  238. package/dist/templates/dsh/index.js +0 -27
  239. package/dist/templates/dsh/index.js.map +0 -1
  240. package/dist/templates/gemini/agents/trellis-check.md +0 -107
  241. package/dist/templates/gemini/agents/trellis-implement.md +0 -107
  242. package/dist/templates/gemini/agents/trellis-research.md +0 -136
  243. package/dist/templates/gemini/index.d.ts +0 -13
  244. package/dist/templates/gemini/index.d.ts.map +0 -1
  245. package/dist/templates/gemini/index.js +0 -13
  246. package/dist/templates/gemini/index.js.map +0 -1
  247. package/dist/templates/gemini/settings.json +0 -40
  248. package/dist/templates/grok/agents/trellis-check.md +0 -106
  249. package/dist/templates/grok/agents/trellis-implement.md +0 -121
  250. package/dist/templates/grok/agents/trellis-research.md +0 -146
  251. package/dist/templates/grok/index.d.ts +0 -16
  252. package/dist/templates/grok/index.d.ts.map +0 -1
  253. package/dist/templates/grok/index.js +0 -19
  254. package/dist/templates/grok/index.js.map +0 -1
  255. package/dist/templates/kimi/agents/trellis-check.md +0 -104
  256. package/dist/templates/kimi/agents/trellis-implement.md +0 -120
  257. package/dist/templates/kimi/agents/trellis-research.md +0 -144
  258. package/dist/templates/kimi/index.d.ts +0 -20
  259. package/dist/templates/kimi/index.d.ts.map +0 -1
  260. package/dist/templates/kimi/index.js +0 -23
  261. package/dist/templates/kimi/index.js.map +0 -1
  262. package/dist/templates/kiro/agents/trellis-check.json +0 -26
  263. package/dist/templates/kiro/agents/trellis-implement.json +0 -26
  264. package/dist/templates/kiro/agents/trellis-research.json +0 -30
  265. package/dist/templates/kiro/agents/trellis.json +0 -34
  266. package/dist/templates/kiro/hooks/trellis-workflow-state.kiro.hook +0 -14
  267. package/dist/templates/kiro/index.d.ts +0 -32
  268. package/dist/templates/kiro/index.d.ts.map +0 -1
  269. package/dist/templates/kiro/index.js +0 -28
  270. package/dist/templates/kiro/index.js.map +0 -1
  271. package/dist/templates/omp/agents/trellis-check.md +0 -41
  272. package/dist/templates/omp/agents/trellis-implement.md +0 -55
  273. package/dist/templates/omp/agents/trellis-research.md +0 -30
  274. package/dist/templates/omp/extensions/trellis/index.ts.txt +0 -592
  275. package/dist/templates/omp/index.d.ts +0 -4
  276. package/dist/templates/omp/index.d.ts.map +0 -1
  277. package/dist/templates/omp/index.js +0 -9
  278. package/dist/templates/omp/index.js.map +0 -1
  279. package/dist/templates/opencode/agents/trellis-check.md +0 -122
  280. package/dist/templates/opencode/agents/trellis-implement.md +0 -123
  281. package/dist/templates/opencode/agents/trellis-research.md +0 -145
  282. package/dist/templates/opencode/lib/context-visibility.js +0 -86
  283. package/dist/templates/opencode/lib/session-utils.js +0 -526
  284. package/dist/templates/opencode/lib/trellis-context.js +0 -627
  285. package/dist/templates/opencode/package.json +0 -5
  286. package/dist/templates/opencode/plugins/inject-spec-context.js +0 -121
  287. package/dist/templates/opencode/plugins/inject-subagent-context.js +0 -569
  288. package/dist/templates/opencode/plugins/inject-workflow-state.js +0 -340
  289. package/dist/templates/opencode/plugins/session-start.js +0 -74
  290. package/dist/templates/pi/agents/trellis-check.md +0 -37
  291. package/dist/templates/pi/agents/trellis-implement.md +0 -52
  292. package/dist/templates/pi/agents/trellis-research.md +0 -25
  293. package/dist/templates/pi/extensions/trellis/index.ts.txt +0 -2033
  294. package/dist/templates/pi/index.d.ts +0 -5
  295. package/dist/templates/pi/index.d.ts.map +0 -1
  296. package/dist/templates/pi/index.js +0 -12
  297. package/dist/templates/pi/index.js.map +0 -1
  298. package/dist/templates/pi/settings.json +0 -9
  299. package/dist/templates/qoder/agents/trellis-check.md +0 -108
  300. package/dist/templates/qoder/agents/trellis-implement.md +0 -108
  301. package/dist/templates/qoder/agents/trellis-research.md +0 -137
  302. package/dist/templates/qoder/index.d.ts +0 -15
  303. package/dist/templates/qoder/index.d.ts.map +0 -1
  304. package/dist/templates/qoder/index.js +0 -15
  305. package/dist/templates/qoder/index.js.map +0 -1
  306. package/dist/templates/qoder/settings.json +0 -59
  307. package/dist/templates/reasonix/agents/trellis-check.md +0 -36
  308. package/dist/templates/reasonix/agents/trellis-implement.md +0 -51
  309. package/dist/templates/reasonix/index.d.ts +0 -13
  310. package/dist/templates/reasonix/index.d.ts.map +0 -1
  311. package/dist/templates/reasonix/index.js +0 -16
  312. package/dist/templates/reasonix/index.js.map +0 -1
  313. package/dist/templates/shared-hooks/inject-shell-session-context.py +0 -292
  314. package/dist/templates/snow/SNOW.md +0 -86
  315. package/dist/templates/snow/agents/trellis-check.md +0 -136
  316. package/dist/templates/snow/agents/trellis-implement.md +0 -158
  317. package/dist/templates/snow/agents/trellis-research.md +0 -114
  318. package/dist/templates/snow/hooks/beforeSubAgentStart.json +0 -15
  319. package/dist/templates/snow/hooks/onSessionStart.json +0 -15
  320. package/dist/templates/snow/hooks/onUserMessage.json +0 -15
  321. package/dist/templates/snow/hooks/write-trellis-context.py +0 -644
  322. package/dist/templates/snow/index.d.ts +0 -26
  323. package/dist/templates/snow/index.d.ts.map +0 -1
  324. package/dist/templates/snow/index.js +0 -36
  325. package/dist/templates/snow/index.js.map +0 -1
  326. package/dist/templates/trae/agents/trellis-check.md +0 -108
  327. package/dist/templates/trae/agents/trellis-implement.md +0 -108
  328. package/dist/templates/trae/agents/trellis-research.md +0 -137
  329. package/dist/templates/trae/hooks.json +0 -39
  330. package/dist/templates/trae/index.d.ts +0 -15
  331. package/dist/templates/trae/index.d.ts.map +0 -1
  332. package/dist/templates/trae/index.js +0 -15
  333. package/dist/templates/trae/index.js.map +0 -1
  334. package/dist/templates/trellis/gitattributes.txt +0 -9
  335. package/dist/templates/trellis/scripts/common/cli_adapter.py +0 -982
  336. package/dist/templates/zcode/agents/trellis-check.md +0 -110
  337. package/dist/templates/zcode/agents/trellis-implement.md +0 -116
  338. package/dist/templates/zcode/agents/trellis-research.md +0 -133
  339. package/dist/templates/zcode/config.json +0 -52
  340. package/dist/templates/zcode/index.d.ts +0 -25
  341. package/dist/templates/zcode/index.d.ts.map +0 -1
  342. package/dist/templates/zcode/index.js +0 -29
  343. package/dist/templates/zcode/index.js.map +0 -1
@@ -1,292 +0,0 @@
1
- #!/usr/bin/env python3
2
- """Pre-shell hook: bridge the host's session identity into task.py.
3
-
4
- No researched platform exports a session id into its shell tool's child
5
- process, but every hook-capable one puts that id on hook stdin. So the hook
6
- that fires just before a shell command writes a short-lived runtime ticket
7
- whenever the pending command calls `task.py start/current/finish`, and the
8
- task script consumes it when it has no native session environment.
9
-
10
- Registered on whichever pre-shell event the host provides — Cursor's
11
- `beforeShellExecution`, Claude-shaped `PreToolUse`, Gemini's `BeforeTool` —
12
- which is why the only thing here that knows about payload variation is
13
- `_pending_shell_command`.
14
- """
15
- from __future__ import annotations
16
-
17
- import hashlib
18
- import json
19
- import os
20
- import shlex
21
- import sys
22
- import time
23
- from pathlib import Path
24
- from typing import Any
25
-
26
- # Hook hosts send UTF-8 JSON regardless of the process locale.
27
- _stdin_reconfigure = getattr(sys.stdin, "reconfigure", None)
28
- if callable(_stdin_reconfigure):
29
- try:
30
- _stdin_reconfigure(encoding="utf-8", errors="replace")
31
- except (OSError, ValueError):
32
- pass
33
-
34
-
35
- DIR_WORKFLOW = ".trellis"
36
- DIR_RUNTIME = ".runtime"
37
- DIR_SHELL_TICKETS = "shell-tickets"
38
- SESSION_SUBCOMMANDS = {"start", "current", "finish"}
39
- TICKET_TTL_SECONDS = 30
40
- CONTEXT_IDENTITY_KEYS = (
41
- "session_id",
42
- "sessionId",
43
- "sessionID",
44
- "conversation_id",
45
- "conversationId",
46
- "conversationID",
47
- "transcript_path",
48
- "transcriptPath",
49
- "transcript",
50
- )
51
- # Tool-call payloads nest the command one level down; same casing spread as
52
- # CONTEXT_IDENTITY_KEYS above.
53
- TOOL_INPUT_KEYS = ("tool_input", "toolInput")
54
- # Answering a shell-execution event with an explicit allow is what keeps
55
- # Cursor from re-prompting for a command Trellis itself asked for. Tool-call
56
- # hosts read a different response schema, so they get no answer at all rather
57
- # than a key they would have to ignore.
58
- SHELL_EVENT_RESPONSE = {"permission": "allow"}
59
-
60
-
61
- def _string_value(value: Any) -> str | None:
62
- if isinstance(value, str):
63
- stripped = value.strip()
64
- return stripped or None
65
- return None
66
-
67
-
68
- def _resolve_trellis_root(hook_input: dict[str, Any]) -> Path | None:
69
- """Locate the project root, trying the payload cwd and then our own.
70
-
71
- Hosts disagree about what `cwd` means. CodeBuddy IDE 4.10.4 sends `"/"` for
72
- every PreToolUse event, so trusting the payload alone finds no `.trellis`
73
- and the bridge silently does nothing — the hook is invoked, writes no
74
- ticket, and `task.py start` degrades. Observed with a wildcard probe:
75
-
76
- {"cwd": "/", "tool_name": "Bash", "tool_input": {"command": "ls …"}}
77
-
78
- The hook's own cwd is reliable where the payload is not: hosts launch it
79
- from the project root, which is why a relative `command` in settings.json
80
- resolves at all. Try the payload first (it is right on hosts that set it,
81
- and survives a host that runs hooks from elsewhere), then fall back.
82
- """
83
- candidates: list[Path] = []
84
- payload_cwd = _string_value(hook_input.get("cwd"))
85
- if payload_cwd:
86
- candidates.append(Path(payload_cwd))
87
- try:
88
- candidates.append(Path(os.getcwd()))
89
- except OSError:
90
- pass
91
-
92
- for candidate in candidates:
93
- root = _find_trellis_root(candidate)
94
- if root is not None:
95
- return root
96
- return None
97
-
98
-
99
- def _find_trellis_root(start: Path) -> Path | None:
100
- current = start.resolve()
101
- while True:
102
- if (current / DIR_WORKFLOW).is_dir():
103
- return current
104
- if current == current.parent:
105
- return None
106
- current = current.parent
107
-
108
-
109
- def _runtime_ticket_dir(root: Path) -> Path:
110
- return root / DIR_WORKFLOW / DIR_RUNTIME / DIR_SHELL_TICKETS
111
-
112
-
113
- def _pending_shell_command(hook_input: dict[str, Any]) -> tuple[str, dict[str, Any] | None]:
114
- """Read the pending shell command out of either hook payload shape.
115
-
116
- Returns the command plus the response envelope that shape expects:
117
-
118
- - shell-execution event (Cursor `beforeShellExecution`) — the command sits
119
- at the top level and the host wants a permission decision back;
120
- - tool-call event (`PreToolUse`, `BeforeTool`) — the command sits under
121
- `tool_input`, and the host reads a schema this hook has no opinion on.
122
-
123
- An ordered fallback, not a platform switch: a third payload shape extends
124
- the same function. Anything else yields ("", None) so main() no-ops.
125
- """
126
- command = _string_value(hook_input.get("command"))
127
- if command:
128
- return command, SHELL_EVENT_RESPONSE
129
-
130
- for key in TOOL_INPUT_KEYS:
131
- tool_input = hook_input.get(key)
132
- if not isinstance(tool_input, dict):
133
- continue
134
- command = _string_value(tool_input.get("command"))
135
- if command:
136
- return command, None
137
-
138
- return "", None
139
-
140
-
141
- def _host_platform_name() -> str | None:
142
- """Name the host from the config directory this hook was installed into.
143
-
144
- Every platform puts its hooks under its own dotted directory
145
- (`.cursor/hooks/`, `.factory/hooks/`, …), so the deepest dotted path
146
- segment identifies the host without a table of platform names here. It
147
- matters because the context key must agree with the one the platform's
148
- other hooks compute — a ticket keyed differently would write a session
149
- file no later hook ever reads.
150
- """
151
- for part in reversed(Path(sys.argv[0]).parts):
152
- if part.startswith(".") and part not in (".", "..") and len(part) > 1:
153
- return part[1:]
154
- return None
155
-
156
-
157
- def _load_active_task_resolver(root: Path):
158
- scripts_dir = root / DIR_WORKFLOW / "scripts"
159
- if str(scripts_dir) not in sys.path:
160
- sys.path.insert(0, str(scripts_dir))
161
- from common.active_task import resolve_context_key # type: ignore[import-not-found]
162
-
163
- return resolve_context_key
164
-
165
-
166
- def _extract_task_subcommands(command: str) -> list[dict[str, str]]:
167
- try:
168
- tokens = shlex.split(command, posix=os.name != "nt")
169
- except ValueError:
170
- return []
171
-
172
- subcommands: list[dict[str, str]] = []
173
- for index, token in enumerate(tokens[:-1]):
174
- if Path(token.strip("\"'")).name != "task.py":
175
- continue
176
- name = tokens[index + 1]
177
- if name not in SESSION_SUBCOMMANDS:
178
- continue
179
- item = {"name": name}
180
- if name == "start" and index + 2 < len(tokens):
181
- item["task_ref"] = tokens[index + 2]
182
- subcommands.append(item)
183
- return subcommands
184
-
185
-
186
- def _cleanup_expired_tickets(ticket_dir: Path, now: float) -> None:
187
- if not ticket_dir.is_dir():
188
- return
189
- for ticket_path in ticket_dir.glob("*.json"):
190
- try:
191
- data = json.loads(ticket_path.read_text(encoding="utf-8"))
192
- except (json.JSONDecodeError, OSError):
193
- continue
194
- expires_at = data.get("expires_at_epoch")
195
- if isinstance(expires_at, (int, float)) and expires_at < now:
196
- try:
197
- ticket_path.unlink()
198
- except OSError:
199
- pass
200
-
201
-
202
- def _has_context_identity(hook_input: dict[str, Any]) -> bool:
203
- return any(_string_value(hook_input.get(key)) for key in CONTEXT_IDENTITY_KEYS)
204
-
205
-
206
- def _write_ticket(
207
- root: Path,
208
- hook_input: dict[str, Any],
209
- context_key: str,
210
- command: str,
211
- platform_name: str | None,
212
- subcommands: list[dict[str, str]],
213
- ) -> None:
214
- now = time.time()
215
- ticket_dir = _runtime_ticket_dir(root)
216
- ticket_dir.mkdir(parents=True, exist_ok=True)
217
- _cleanup_expired_tickets(ticket_dir, now)
218
-
219
- digest = hashlib.sha256(
220
- f"{context_key}\0{command}\0{now}".encode("utf-8"),
221
- ).hexdigest()[:16]
222
- ticket_path = ticket_dir / f"{int(now * 1000)}-{digest}.json"
223
-
224
- payload = {
225
- # Debugging metadata. The consumer accepts a ticket on freshness, repo
226
- # and subcommand — never on this field.
227
- "platform": platform_name,
228
- "context_key": context_key,
229
- "conversation_id": _string_value(hook_input.get("conversation_id")),
230
- "session_id": _string_value(hook_input.get("session_id")),
231
- "generation_id": _string_value(hook_input.get("generation_id")),
232
- # The resolved project root, not the payload's cwd. The consumer
233
- # rejects a ticket whose cwd is outside the repo, and CodeBuddy IDE
234
- # 4.10.4 reports "/" for every PreToolUse event — a ticket carrying
235
- # that is written correctly and then discarded on arrival. Recording
236
- # the root we actually resolved keeps the containment check meaningful
237
- # without trusting a field the host may not populate.
238
- "cwd": str(root),
239
- # Kept separately so a wrong host cwd stays visible when debugging.
240
- "host_cwd": _string_value(hook_input.get("cwd")),
241
- "command": command,
242
- "subcommands": subcommands,
243
- "created_at_epoch": now,
244
- "expires_at_epoch": now + TICKET_TTL_SECONDS,
245
- }
246
- ticket_path.write_text(
247
- json.dumps(payload, indent=2, ensure_ascii=False) + "\n",
248
- encoding="utf-8",
249
- )
250
-
251
-
252
- def main() -> int:
253
- if os.environ.get("TRELLIS_HOOKS") == "0" or os.environ.get("TRELLIS_DISABLE_HOOKS") == "1":
254
- return 0
255
-
256
- try:
257
- hook_input = json.loads(sys.stdin.read())
258
- except (json.JSONDecodeError, ValueError):
259
- hook_input = {}
260
- if not isinstance(hook_input, dict):
261
- hook_input = {}
262
-
263
- command, response = _pending_shell_command(hook_input)
264
- subcommands = _extract_task_subcommands(command)
265
- if not subcommands:
266
- return 0
267
-
268
- root = _resolve_trellis_root(hook_input)
269
- if root is None:
270
- return 0
271
-
272
- if not _has_context_identity(hook_input):
273
- return 0
274
-
275
- platform_name = _host_platform_name()
276
- resolve_context_key = _load_active_task_resolver(root)
277
- context_key = resolve_context_key(hook_input, platform=platform_name)
278
- if not context_key:
279
- return 0
280
-
281
- try:
282
- _write_ticket(root, hook_input, context_key, command, platform_name, subcommands)
283
- except OSError:
284
- return 0
285
-
286
- if response is not None:
287
- print(json.dumps(response, ensure_ascii=False))
288
- return 0
289
-
290
-
291
- if __name__ == "__main__":
292
- sys.exit(main())
@@ -1,86 +0,0 @@
1
- # Trellis on Snow CLI
2
-
3
- Snow is a **class-1** Trellis host: auto context inject + project agent discovery +
4
- `beforeSubAgentStart` prompt enrichment.
5
-
6
- | Capability | Status |
7
- | ------------------------------------------------- | ---------------------------------------------------------------------------- |
8
- | Skills (`.snow/skills/trellis-*/SKILL.md`) | Works |
9
- | Prompt commands (`.snow/commands/trellis-*.json`) | Works (`/trellis-continue`, `/trellis-finish-work`, …) |
10
- | Context hooks (`.snow/hooks/`) | Inject model context via stdout JSON + write `.snow/log/trellis-context.txt` |
11
- | Project agents (`.snow/agents/*.md`) | Auto-discovered by Snow (`#trellis-implement`, …) |
12
- | `beforeSubAgentStart` | Injects active-task breadcrumb into sub-agent prompts |
13
- | `trellis-start` | Optional — session hooks replace the old manual ritual |
14
-
15
- ## Quick start
16
-
17
- ```bash
18
- trellis init --snow -u your-name
19
- snow
20
- ```
21
-
22
- In Snow:
23
-
24
- 1. Open a session in the project root — `onSessionStart` injects Trellis context automatically.
25
- 2. Dispatch implement/check/research (project agents under `.snow/agents/`). Prefer prompt first line:
26
-
27
- ```text
28
- Active task: .trellis/tasks/<id>
29
- ```
30
-
31
- 3. Optional: `/trellis-continue` / `/trellis-finish-work`, or `skill-execute` on `trellis-*` skills.
32
- 4. Debug injects: set `SNOW_DEBUG_HOOKS=1` and inspect `.snow/log/hooks-inject.txt`.
33
-
34
- ## Agents
35
-
36
- Snow loads project agents from `.snow/agents/**/*.md` (priority over `~/.snow/sub-agents.json`).
37
- Primary path: project agent discovery — no manual merge required. Do not use legacy sub-agent JSON merge files.
38
-
39
- Context loading is class-1 hook inject (`beforeSubAgentStart` / session / user). Agents are **not** shipped with class-2 pull-based prelude text. Hooks already inject context; agents still re-read task artifacts for correctness.
40
-
41
- ## Tool names (Snow-native)
42
-
43
- - `filesystem-read` / `filesystem-create` / `filesystem-replaceedit` / `filesystem-edit`
44
- - `terminal-execute`
45
- - `ace-search` / `codebase-search`
46
- - `todo-manage` / `notebook-manage`
47
- - `skill-execute`
48
- - `websearch-search` / `websearch-fetch` (research)
49
- - `ide-get_diagnostics`
50
-
51
- ## Hook protocol
52
-
53
- Session / user / sub-agent hooks emit:
54
-
55
- ```json
56
- { "additionalContext": "...", "display": "..." }
57
- ```
58
-
59
- - exit 0 + JSON → inject (prepend); UI bubble keeps user original text
60
- - exit 1 on `onUserMessage` → replace (not used by Trellis)
61
- - non-JSON stdout → ignored
62
-
63
- Hook modes (same script, different depth):
64
-
65
- | Hook | argv mode | Payload |
66
- | --------------------- | ---------- | ---------------------------------------------------------------- |
67
- | `onSessionStart` | `session` | full (~7.5KB): task.py, artifacts, prd summary, workflow/session |
68
- | `onUserMessage` | `user` | compact (~2.8KB): task.py + artifact presence only |
69
- | `beforeSubAgentStart` | `subagent` | full + agent-kind tailoring (implement/check/research) |
70
-
71
- ## Session identity (multi-session)
72
-
73
- Snow injects these env vars into hook commands, `terminal-execute`, bash mode, and sub-agent children:
74
-
75
- | Variable | Example | Purpose |
76
- | -------------------- | ------------------- | ----------------------------------------- |
77
- | `SNOW_SESSION_ID` | `c2343752-...` | Native Snow session uuid |
78
- | `TRELLIS_CONTEXT_ID` | `snow-c2343752-...` | Preferred Trellis active-task context key |
79
- | `SNOW_CWD` | project root | Working directory for hooks/tools |
80
- | `SNOW_PLATFORM` | `snow` | Platform tag |
81
-
82
- Notes:
83
-
84
- - `TRELLIS_CONTEXT_ID` wins when already set (explicit override).
85
- - Otherwise Trellis resolves `SNOW_SESSION_ID` via `active_task.py` as platform `snow`.
86
- - Hook stdin may also include dual keys: `sessionId` / `session_id`.
@@ -1,136 +0,0 @@
1
- ---
2
- name: trellis-check
3
- id: trellis-check
4
- description: |
5
- Code quality check expert for Trellis. Reviews code changes against specs
6
- and self-fixes issues. On Snow CLI, auto-loaded from `.snow/agents/`; first
7
- prompt line should be Active task: <path>.
8
- tools:
9
- - filesystem-read
10
- - filesystem-create
11
- - filesystem-replaceedit
12
- - filesystem-edit
13
- - terminal-execute
14
- - ace-search
15
- - codebase-search
16
- - todo-manage
17
- - notebook-manage
18
- - skill-execute
19
- - ide-get_diagnostics
20
- ---
21
-
22
- # Check Agent
23
-
24
- You are the Check Agent in the Trellis workflow on **Snow CLI**.
25
-
26
- ## Snow tool map
27
-
28
- | Need | Tool |
29
- | ----------------------------- | -------------------------------------------- |
30
- | Read files | `filesystem-read` |
31
- | Fix code | `filesystem-replaceedit` / `filesystem-edit` |
32
- | `git diff` / lint / typecheck | `terminal-execute` |
33
- | Search | `ace-search` / `codebase-search` |
34
- | Diagnostics | `ide-get_diagnostics` |
35
-
36
- ## Recursion Guard
37
-
38
- You are already the `trellis-check` sub-agent that the main session dispatched. Do the review and fixes directly.
39
-
40
- - Do NOT spawn another `trellis-check` or `trellis-implement` sub-agent.
41
- - If workflow.md, skills, or the parent prompt say to dispatch `trellis-implement` / `trellis-check`, treat that as a main-session instruction that is already satisfied by your current role.
42
- - Only the main session may dispatch Trellis implement/check agents. If more implementation work is needed, report that recommendation instead of spawning.
43
-
44
- ## Dispatch note (main session)
45
-
46
- On Snow CLI (class-1), the main session launches this agent with a full-context prompt. Always start the prompt with:
47
-
48
- ```text
49
- Active task: <path from task.py current>
50
- ```
51
-
52
- - Session/user hooks inject Trellis context into the main session.
53
- - `beforeSubAgentStart` injects Trellis task context into this sub-agent prompt.
54
- - Still re-read prd/design/implement as required below (hook inject is a breadcrumb, not a full substitute).
55
- - Optionally Read `.snow/log/trellis-context.txt`.
56
-
57
- ## Context
58
-
59
- Before checking, read:
60
-
61
- - `.trellis/spec/` - Development guidelines
62
- - Pre-commit checklist for quality standards
63
- - Task `prd.md` / `design.md` / `implement.md` if present
64
- - `check.jsonl` when curated (skip `_example` seed rows)
65
- - `.snow/log/trellis-context.txt` if present
66
-
67
- ## Core Responsibilities
68
-
69
- 1. **Get code changes** - Use `terminal-execute` with `git diff` to get uncommitted code
70
- 2. **Check against specs** - Verify code follows guidelines
71
- 3. **Check the red-evidence trail** - Every completed `implement.md` slice records the red output it started from, and for `meta.kind=bug` the Phase 1.2 repro command has been re-run green against the full scenario. A slice claiming green with no recorded red is a finding, not a pass.
72
- 4. **Self-fix** - Fix issues yourself, not just report them
73
- 5. **Run verification** - typecheck and lint
74
-
75
- ## Important
76
-
77
- **Fix issues yourself**, don't just report them.
78
-
79
- You have write and edit tools (`filesystem-replaceedit` / `filesystem-edit`), you can modify code directly.
80
-
81
- ---
82
-
83
- ## Workflow
84
-
85
- ### Step 1: Get Changes
86
-
87
- ```bash
88
- git diff --name-only
89
- git diff
90
- ```
91
-
92
- ### Step 2: Check Against Specs and Task Artifacts
93
-
94
- Read the task's prd.md, design.md if present, and implement.md if present, then read relevant specs in `.trellis/spec/` to check code.
95
-
96
- ### Step 3: Self-Fix
97
-
98
- After finding issues:
99
-
100
- 1. Fix the issue directly
101
- 2. Record what was fixed
102
- 3. Continue checking other issues
103
-
104
- ### Step 4: Run Verification
105
-
106
- Run project's lint and typecheck commands via `terminal-execute` to verify changes.
107
- If failed, fix issues and re-run.
108
-
109
- ---
110
-
111
- ## Report Format
112
-
113
- ```markdown
114
- ## Self-Check Complete
115
-
116
- ### Files Checked
117
-
118
- - src/components/Feature.tsx
119
-
120
- ### Issues Found and Fixed
121
-
122
- 1. `<file>:<line>` - <what was fixed>
123
-
124
- ### Issues Not Fixed
125
-
126
- (If any)
127
-
128
- ### Verification Results
129
-
130
- - TypeCheck: Passed
131
- - Lint: Passed
132
-
133
- ### Summary
134
-
135
- Checked X files, found Y issues, all fixed.
136
- ```
@@ -1,158 +0,0 @@
1
- ---
2
- name: trellis-implement
3
- id: trellis-implement
4
- description: |
5
- Code implementation expert for Trellis. Understands specs and requirements,
6
- then implements features. No git commit allowed. On Snow CLI, auto-loaded from
7
- `.snow/agents/`; first prompt line should be Active task: <path>.
8
- tools:
9
- - filesystem-read
10
- - filesystem-create
11
- - filesystem-replaceedit
12
- - filesystem-edit
13
- - terminal-execute
14
- - ace-search
15
- - codebase-search
16
- - todo-manage
17
- - notebook-manage
18
- - skill-execute
19
- - ide-get_diagnostics
20
- ---
21
-
22
- # Implement Agent
23
-
24
- You are the Implement Agent in the Trellis workflow on **Snow CLI**.
25
-
26
- ## Snow tool map
27
-
28
- Use Snow-native tool ids (not Claude `Read`/`Edit`/`Bash` names):
29
-
30
- | Need | Tool |
31
- | ------------------------- | --------------------------------------------- |
32
- | Read files / dirs | `filesystem-read` |
33
- | Create file | `filesystem-create` |
34
- | Edit existing file | `filesystem-replaceedit` or `filesystem-edit` |
35
- | Shell / tests | `terminal-execute` |
36
- | Symbol / text search | `ace-search` |
37
- | Semantic codebase search | `codebase-search` |
38
- | Track multi-step work | `todo-manage` |
39
- | Persist non-obvious notes | `notebook-manage` |
40
- | Run a Trellis skill | `skill-execute` |
41
- | IDE errors | `ide-get_diagnostics` |
42
-
43
- Prefer batch `filesystem-read` when loading several task artifacts.
44
-
45
- ## Recursion Guard
46
-
47
- You are already the `trellis-implement` sub-agent that the main session dispatched. Do the implementation work directly.
48
-
49
- - Do NOT spawn another `trellis-implement` or `trellis-check` sub-agent.
50
- - If workflow.md, skills, or the parent prompt say to dispatch `trellis-implement` / `trellis-check`, treat that as a main-session instruction that is already satisfied by your current role.
51
- - Only the main session may dispatch Trellis implement/check agents. If more parallel work is needed, report that recommendation instead of spawning.
52
-
53
- ## Dispatch note (main session)
54
-
55
- On Snow CLI (class-1), project agents under `.snow/agents/` are auto-discovered. Prefer starting the prompt with:
56
-
57
- ```text
58
- Active task: <path from task.py current>
59
- ```
60
-
61
- - Session/user hooks inject Trellis context into the main session.
62
- - `beforeSubAgentStart` injects Trellis breadcrumb into this sub-agent prompt.
63
- - Still re-read task artifacts below (hook inject is a breadcrumb, not a substitute for prd/design/implement).
64
- - Optionally Read `.snow/log/trellis-context.txt` if present.
65
- - Main session also receives session/user injects (class-1 hook path; no class-2 pull prelude).
66
-
67
- ## Context
68
-
69
- Before implementing, read:
70
-
71
- - `.trellis/workflow.md` - Project workflow
72
- - `.trellis/spec/` - Development guidelines
73
- - Task `prd.md` - Requirements document
74
- - Task `design.md` / `implement.md` if present
75
- - `implement.jsonl` when curated (skip `_example` seed rows)
76
- - `.snow/log/trellis-context.txt` if present (breadcrumb from inject hooks)
77
-
78
- ## Core Responsibilities
79
-
80
- 1. **Understand specs** - Read relevant spec files in `.trellis/spec/`
81
- 2. **Understand requirements** - Read prd.md and design/implement artifacts
82
- 3. **Implement features** - Write code following specs and design
83
- 4. **Self-check** - Ensure code quality (`terminal-execute` lint/typecheck)
84
- 5. **Report results** - Report completion status
85
-
86
- ## Forbidden Operations
87
-
88
- **Do NOT execute these git commands:**
89
-
90
- - `git commit`
91
- - `git push`
92
- - `git merge`
93
-
94
- ---
95
-
96
- ## Workflow
97
-
98
- ### 1. Understand Specs
99
-
100
- Read relevant specs based on task type:
101
-
102
- - Spec layers: `.trellis/spec/<package>/<layer>/`
103
- - Shared guides: `.trellis/spec/guides/`
104
-
105
- ### 2. Understand Requirements
106
-
107
- Read the task's prd.md and design/implement files:
108
-
109
- - What are the core requirements
110
- - Key points of technical design
111
- - Which files to modify/create
112
-
113
- ### 3. Implement Features — Red Before Green
114
-
115
- Work the `implement.md` slice checklist one slice at a time. Per slice: write the test at a seam confirmed in `design.md`, run it, paste the redacted red output into that slice's entry, then write the minimum code to make it pass.
116
-
117
- - Do not invent a seam that is not in `design.md` — a missing seam is a planning defect. Report it instead of improvising one.
118
- - No horizontal slicing, no testing of internals, no tautological assertions, no refactoring inside a red-green cycle.
119
- - `meta.kind=bug`: slice 1 is the minimised reproduction from `research/` turned into a regression test at a seam that reaches the real failing path; re-run the original repro command afterwards.
120
- - `meta.kind=chore`, or a repo with no runnable harness: state that in the slice entry with the reason. Never skip the cycle silently.
121
- - Load the `trellis-tdd` skill for the full contract.
122
- - Otherwise: follow specs and task artifacts, follow existing code patterns, only do what's required, no over-engineering.
123
-
124
- ### 4. Verify
125
-
126
- Run project's lint and typecheck commands via `terminal-execute` to verify changes.
127
-
128
- ---
129
-
130
- ## Report Format
131
-
132
- ```markdown
133
- ## Implementation Complete
134
-
135
- ### Files Modified
136
-
137
- - `src/components/Feature.tsx` - New component
138
- - `src/hooks/useFeature.ts` - New hook
139
-
140
- ### Implementation Summary
141
-
142
- 1. Created Feature component...
143
- 2. Added useFeature hook...
144
-
145
- ### Verification Results
146
-
147
- - Lint: Passed
148
- - TypeCheck: Passed
149
- ```
150
-
151
- ---
152
-
153
- ## Code Standards
154
-
155
- - Follow existing code patterns
156
- - Don't add unnecessary abstractions
157
- - Only do what's required, no over-engineering
158
- - Keep code readable