@blxzer/cursor-trellis 0.1.0

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 (687) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/LICENSE +235 -0
  3. package/README.md +9 -0
  4. package/bin/smart-search.js +79 -0
  5. package/bin/trellis.js +3 -0
  6. package/dist/cli/index.d.ts +3 -0
  7. package/dist/cli/index.d.ts.map +1 -0
  8. package/dist/cli/index.js +258 -0
  9. package/dist/cli/index.js.map +1 -0
  10. package/dist/commands/channel/adapters/claude.d.ts +29 -0
  11. package/dist/commands/channel/adapters/claude.d.ts.map +1 -0
  12. package/dist/commands/channel/adapters/claude.js +203 -0
  13. package/dist/commands/channel/adapters/claude.js.map +1 -0
  14. package/dist/commands/channel/adapters/codex.d.ts +85 -0
  15. package/dist/commands/channel/adapters/codex.d.ts.map +1 -0
  16. package/dist/commands/channel/adapters/codex.js +505 -0
  17. package/dist/commands/channel/adapters/codex.js.map +1 -0
  18. package/dist/commands/channel/adapters/index.d.ts +84 -0
  19. package/dist/commands/channel/adapters/index.d.ts.map +1 -0
  20. package/dist/commands/channel/adapters/index.js +115 -0
  21. package/dist/commands/channel/adapters/index.js.map +1 -0
  22. package/dist/commands/channel/adapters/types.d.ts +33 -0
  23. package/dist/commands/channel/adapters/types.d.ts.map +1 -0
  24. package/dist/commands/channel/adapters/types.js +2 -0
  25. package/dist/commands/channel/adapters/types.js.map +1 -0
  26. package/dist/commands/channel/agent-loader.d.ts +32 -0
  27. package/dist/commands/channel/agent-loader.d.ts.map +1 -0
  28. package/dist/commands/channel/agent-loader.js +154 -0
  29. package/dist/commands/channel/agent-loader.js.map +1 -0
  30. package/dist/commands/channel/context-loader.d.ts +26 -0
  31. package/dist/commands/channel/context-loader.d.ts.map +1 -0
  32. package/dist/commands/channel/context-loader.js +290 -0
  33. package/dist/commands/channel/context-loader.js.map +1 -0
  34. package/dist/commands/channel/context.d.ts +16 -0
  35. package/dist/commands/channel/context.d.ts.map +1 -0
  36. package/dist/commands/channel/context.js +83 -0
  37. package/dist/commands/channel/context.js.map +1 -0
  38. package/dist/commands/channel/create.d.ts +27 -0
  39. package/dist/commands/channel/create.d.ts.map +1 -0
  40. package/dist/commands/channel/create.js +39 -0
  41. package/dist/commands/channel/create.js.map +1 -0
  42. package/dist/commands/channel/dev-parse-trace.d.ts +14 -0
  43. package/dist/commands/channel/dev-parse-trace.d.ts.map +1 -0
  44. package/dist/commands/channel/dev-parse-trace.js +70 -0
  45. package/dist/commands/channel/dev-parse-trace.js.map +1 -0
  46. package/dist/commands/channel/guard.d.ts +150 -0
  47. package/dist/commands/channel/guard.d.ts.map +1 -0
  48. package/dist/commands/channel/guard.js +474 -0
  49. package/dist/commands/channel/guard.js.map +1 -0
  50. package/dist/commands/channel/index.d.ts +3 -0
  51. package/dist/commands/channel/index.d.ts.map +1 -0
  52. package/dist/commands/channel/index.js +531 -0
  53. package/dist/commands/channel/index.js.map +1 -0
  54. package/dist/commands/channel/interrupt.d.ts +10 -0
  55. package/dist/commands/channel/interrupt.d.ts.map +1 -0
  56. package/dist/commands/channel/interrupt.js +22 -0
  57. package/dist/commands/channel/interrupt.js.map +1 -0
  58. package/dist/commands/channel/kill.d.ts +7 -0
  59. package/dist/commands/channel/kill.d.ts.map +1 -0
  60. package/dist/commands/channel/kill.js +121 -0
  61. package/dist/commands/channel/kill.js.map +1 -0
  62. package/dist/commands/channel/list.d.ts +17 -0
  63. package/dist/commands/channel/list.d.ts.map +1 -0
  64. package/dist/commands/channel/list.js +233 -0
  65. package/dist/commands/channel/list.js.map +1 -0
  66. package/dist/commands/channel/messages.d.ts +15 -0
  67. package/dist/commands/channel/messages.d.ts.map +1 -0
  68. package/dist/commands/channel/messages.js +245 -0
  69. package/dist/commands/channel/messages.js.map +1 -0
  70. package/dist/commands/channel/rm.d.ts +27 -0
  71. package/dist/commands/channel/rm.d.ts.map +1 -0
  72. package/dist/commands/channel/rm.js +216 -0
  73. package/dist/commands/channel/rm.js.map +1 -0
  74. package/dist/commands/channel/run.d.ts +30 -0
  75. package/dist/commands/channel/run.d.ts.map +1 -0
  76. package/dist/commands/channel/run.js +130 -0
  77. package/dist/commands/channel/run.js.map +1 -0
  78. package/dist/commands/channel/send.d.ts +11 -0
  79. package/dist/commands/channel/send.d.ts.map +1 -0
  80. package/dist/commands/channel/send.js +24 -0
  81. package/dist/commands/channel/send.js.map +1 -0
  82. package/dist/commands/channel/spawn.d.ts +40 -0
  83. package/dist/commands/channel/spawn.d.ts.map +1 -0
  84. package/dist/commands/channel/spawn.js +244 -0
  85. package/dist/commands/channel/spawn.js.map +1 -0
  86. package/dist/commands/channel/store/events.d.ts +39 -0
  87. package/dist/commands/channel/store/events.d.ts.map +1 -0
  88. package/dist/commands/channel/store/events.js +87 -0
  89. package/dist/commands/channel/store/events.js.map +1 -0
  90. package/dist/commands/channel/store/filter.d.ts +3 -0
  91. package/dist/commands/channel/store/filter.d.ts.map +1 -0
  92. package/dist/commands/channel/store/filter.js +2 -0
  93. package/dist/commands/channel/store/filter.js.map +1 -0
  94. package/dist/commands/channel/store/lock.d.ts +23 -0
  95. package/dist/commands/channel/store/lock.d.ts.map +1 -0
  96. package/dist/commands/channel/store/lock.js +99 -0
  97. package/dist/commands/channel/store/lock.js.map +1 -0
  98. package/dist/commands/channel/store/paths.d.ts +63 -0
  99. package/dist/commands/channel/store/paths.d.ts.map +1 -0
  100. package/dist/commands/channel/store/paths.js +246 -0
  101. package/dist/commands/channel/store/paths.js.map +1 -0
  102. package/dist/commands/channel/store/schema.d.ts +27 -0
  103. package/dist/commands/channel/store/schema.d.ts.map +1 -0
  104. package/dist/commands/channel/store/schema.js +34 -0
  105. package/dist/commands/channel/store/schema.js.map +1 -0
  106. package/dist/commands/channel/store/thread-state.d.ts +5 -0
  107. package/dist/commands/channel/store/thread-state.d.ts.map +1 -0
  108. package/dist/commands/channel/store/thread-state.js +16 -0
  109. package/dist/commands/channel/store/thread-state.js.map +1 -0
  110. package/dist/commands/channel/store/watch.d.ts +19 -0
  111. package/dist/commands/channel/store/watch.d.ts.map +1 -0
  112. package/dist/commands/channel/store/watch.js +146 -0
  113. package/dist/commands/channel/store/watch.js.map +1 -0
  114. package/dist/commands/channel/supervisor/idle.d.ts +46 -0
  115. package/dist/commands/channel/supervisor/idle.d.ts.map +1 -0
  116. package/dist/commands/channel/supervisor/idle.js +72 -0
  117. package/dist/commands/channel/supervisor/idle.js.map +1 -0
  118. package/dist/commands/channel/supervisor/inbox.d.ts +30 -0
  119. package/dist/commands/channel/supervisor/inbox.d.ts.map +1 -0
  120. package/dist/commands/channel/supervisor/inbox.js +160 -0
  121. package/dist/commands/channel/supervisor/inbox.js.map +1 -0
  122. package/dist/commands/channel/supervisor/shutdown.d.ts +68 -0
  123. package/dist/commands/channel/supervisor/shutdown.d.ts.map +1 -0
  124. package/dist/commands/channel/supervisor/shutdown.js +146 -0
  125. package/dist/commands/channel/supervisor/shutdown.js.map +1 -0
  126. package/dist/commands/channel/supervisor/stdout.d.ts +51 -0
  127. package/dist/commands/channel/supervisor/stdout.d.ts.map +1 -0
  128. package/dist/commands/channel/supervisor/stdout.js +121 -0
  129. package/dist/commands/channel/supervisor/stdout.js.map +1 -0
  130. package/dist/commands/channel/supervisor/turns.d.ts +31 -0
  131. package/dist/commands/channel/supervisor/turns.d.ts.map +1 -0
  132. package/dist/commands/channel/supervisor/turns.js +45 -0
  133. package/dist/commands/channel/supervisor/turns.js.map +1 -0
  134. package/dist/commands/channel/supervisor/warning.d.ts +48 -0
  135. package/dist/commands/channel/supervisor/warning.d.ts.map +1 -0
  136. package/dist/commands/channel/supervisor/warning.js +77 -0
  137. package/dist/commands/channel/supervisor/warning.js.map +1 -0
  138. package/dist/commands/channel/supervisor.d.ts +59 -0
  139. package/dist/commands/channel/supervisor.d.ts.map +1 -0
  140. package/dist/commands/channel/supervisor.js +344 -0
  141. package/dist/commands/channel/supervisor.js.map +1 -0
  142. package/dist/commands/channel/text-body.d.ts +13 -0
  143. package/dist/commands/channel/text-body.d.ts.map +1 -0
  144. package/dist/commands/channel/text-body.js +47 -0
  145. package/dist/commands/channel/text-body.js.map +1 -0
  146. package/dist/commands/channel/threads.d.ts +39 -0
  147. package/dist/commands/channel/threads.d.ts.map +1 -0
  148. package/dist/commands/channel/threads.js +106 -0
  149. package/dist/commands/channel/threads.js.map +1 -0
  150. package/dist/commands/channel/title.d.ts +12 -0
  151. package/dist/commands/channel/title.d.ts.map +1 -0
  152. package/dist/commands/channel/title.js +24 -0
  153. package/dist/commands/channel/title.js.map +1 -0
  154. package/dist/commands/channel/wait.d.ts +17 -0
  155. package/dist/commands/channel/wait.d.ts.map +1 -0
  156. package/dist/commands/channel/wait.js +75 -0
  157. package/dist/commands/channel/wait.js.map +1 -0
  158. package/dist/commands/init.d.ts +62 -0
  159. package/dist/commands/init.d.ts.map +1 -0
  160. package/dist/commands/init.js +1656 -0
  161. package/dist/commands/init.js.map +1 -0
  162. package/dist/commands/mem.d.ts +30 -0
  163. package/dist/commands/mem.d.ts.map +1 -0
  164. package/dist/commands/mem.js +424 -0
  165. package/dist/commands/mem.js.map +1 -0
  166. package/dist/commands/rollout.d.ts +34 -0
  167. package/dist/commands/rollout.d.ts.map +1 -0
  168. package/dist/commands/rollout.js +102 -0
  169. package/dist/commands/rollout.js.map +1 -0
  170. package/dist/commands/uninstall.d.ts +27 -0
  171. package/dist/commands/uninstall.d.ts.map +1 -0
  172. package/dist/commands/uninstall.js +339 -0
  173. package/dist/commands/uninstall.js.map +1 -0
  174. package/dist/commands/update.d.ts +80 -0
  175. package/dist/commands/update.d.ts.map +1 -0
  176. package/dist/commands/update.js +2185 -0
  177. package/dist/commands/update.js.map +1 -0
  178. package/dist/commands/upgrade.d.ts +28 -0
  179. package/dist/commands/upgrade.d.ts.map +1 -0
  180. package/dist/commands/upgrade.js +84 -0
  181. package/dist/commands/upgrade.js.map +1 -0
  182. package/dist/commands/workflow.d.ts +35 -0
  183. package/dist/commands/workflow.d.ts.map +1 -0
  184. package/dist/commands/workflow.js +219 -0
  185. package/dist/commands/workflow.js.map +1 -0
  186. package/dist/configurators/antigravity.d.ts +7 -0
  187. package/dist/configurators/antigravity.d.ts.map +1 -0
  188. package/dist/configurators/antigravity.js +19 -0
  189. package/dist/configurators/antigravity.js.map +1 -0
  190. package/dist/configurators/claude.d.ts +9 -0
  191. package/dist/configurators/claude.d.ts.map +1 -0
  192. package/dist/configurators/claude.js +72 -0
  193. package/dist/configurators/claude.js.map +1 -0
  194. package/dist/configurators/codebuddy.d.ts +10 -0
  195. package/dist/configurators/codebuddy.d.ts.map +1 -0
  196. package/dist/configurators/codebuddy.js +30 -0
  197. package/dist/configurators/codebuddy.js.map +1 -0
  198. package/dist/configurators/codex.d.ts +8 -0
  199. package/dist/configurators/codex.d.ts.map +1 -0
  200. package/dist/configurators/codex.js +87 -0
  201. package/dist/configurators/codex.js.map +1 -0
  202. package/dist/configurators/copilot.d.ts +10 -0
  203. package/dist/configurators/copilot.d.ts.map +1 -0
  204. package/dist/configurators/copilot.js +51 -0
  205. package/dist/configurators/copilot.js.map +1 -0
  206. package/dist/configurators/cursor.d.ts +20 -0
  207. package/dist/configurators/cursor.d.ts.map +1 -0
  208. package/dist/configurators/cursor.js +49 -0
  209. package/dist/configurators/cursor.js.map +1 -0
  210. package/dist/configurators/cursor2plus-local.d.ts +6 -0
  211. package/dist/configurators/cursor2plus-local.d.ts.map +1 -0
  212. package/dist/configurators/cursor2plus-local.js +20 -0
  213. package/dist/configurators/cursor2plus-local.js.map +1 -0
  214. package/dist/configurators/droid.d.ts +10 -0
  215. package/dist/configurators/droid.d.ts.map +1 -0
  216. package/dist/configurators/droid.js +30 -0
  217. package/dist/configurators/droid.js.map +1 -0
  218. package/dist/configurators/gemini.d.ts +16 -0
  219. package/dist/configurators/gemini.d.ts.map +1 -0
  220. package/dist/configurators/gemini.js +38 -0
  221. package/dist/configurators/gemini.js.map +1 -0
  222. package/dist/configurators/index.d.ts +69 -0
  223. package/dist/configurators/index.d.ts.map +1 -0
  224. package/dist/configurators/index.js +395 -0
  225. package/dist/configurators/index.js.map +1 -0
  226. package/dist/configurators/kilo.d.ts +7 -0
  227. package/dist/configurators/kilo.d.ts.map +1 -0
  228. package/dist/configurators/kilo.js +19 -0
  229. package/dist/configurators/kilo.js.map +1 -0
  230. package/dist/configurators/kiro.d.ts +8 -0
  231. package/dist/configurators/kiro.d.ts.map +1 -0
  232. package/dist/configurators/kiro.js +24 -0
  233. package/dist/configurators/kiro.js.map +1 -0
  234. package/dist/configurators/opencode.d.ts +14 -0
  235. package/dist/configurators/opencode.d.ts.map +1 -0
  236. package/dist/configurators/opencode.js +96 -0
  237. package/dist/configurators/opencode.js.map +1 -0
  238. package/dist/configurators/pi.d.ts +3 -0
  239. package/dist/configurators/pi.d.ts.map +1 -0
  240. package/dist/configurators/pi.js +45 -0
  241. package/dist/configurators/pi.js.map +1 -0
  242. package/dist/configurators/qoder.d.ts +11 -0
  243. package/dist/configurators/qoder.d.ts.map +1 -0
  244. package/dist/configurators/qoder.js +31 -0
  245. package/dist/configurators/qoder.js.map +1 -0
  246. package/dist/configurators/shared.d.ts +183 -0
  247. package/dist/configurators/shared.d.ts.map +1 -0
  248. package/dist/configurators/shared.js +557 -0
  249. package/dist/configurators/shared.js.map +1 -0
  250. package/dist/configurators/windsurf.d.ts +7 -0
  251. package/dist/configurators/windsurf.d.ts.map +1 -0
  252. package/dist/configurators/windsurf.js +19 -0
  253. package/dist/configurators/windsurf.js.map +1 -0
  254. package/dist/configurators/workflow.d.ts +46 -0
  255. package/dist/configurators/workflow.d.ts.map +1 -0
  256. package/dist/configurators/workflow.js +180 -0
  257. package/dist/configurators/workflow.js.map +1 -0
  258. package/dist/constants/paths.d.ts +70 -0
  259. package/dist/constants/paths.d.ts.map +1 -0
  260. package/dist/constants/paths.js +79 -0
  261. package/dist/constants/paths.js.map +1 -0
  262. package/dist/constants/version.d.ts +9 -0
  263. package/dist/constants/version.d.ts.map +1 -0
  264. package/dist/constants/version.js +15 -0
  265. package/dist/constants/version.js.map +1 -0
  266. package/dist/index.d.ts +9 -0
  267. package/dist/index.d.ts.map +1 -0
  268. package/dist/index.js +9 -0
  269. package/dist/index.js.map +1 -0
  270. package/dist/migrations/index.d.ts +62 -0
  271. package/dist/migrations/index.d.ts.map +1 -0
  272. package/dist/migrations/index.js +187 -0
  273. package/dist/migrations/index.js.map +1 -0
  274. package/dist/migrations/manifests/0.1.0.json +9 -0
  275. package/dist/templates/claude/agents/trellis-check.md +124 -0
  276. package/dist/templates/claude/agents/trellis-implement.md +110 -0
  277. package/dist/templates/claude/agents/trellis-research.md +137 -0
  278. package/dist/templates/claude/index.d.ts +22 -0
  279. package/dist/templates/claude/index.d.ts.map +1 -0
  280. package/dist/templates/claude/index.js +46 -0
  281. package/dist/templates/claude/index.js.map +1 -0
  282. package/dist/templates/claude/settings.json +84 -0
  283. package/dist/templates/codebuddy/agents/trellis-check.md +115 -0
  284. package/dist/templates/codebuddy/agents/trellis-implement.md +110 -0
  285. package/dist/templates/codebuddy/agents/trellis-research.md +137 -0
  286. package/dist/templates/codebuddy/index.d.ts +15 -0
  287. package/dist/templates/codebuddy/index.d.ts.map +1 -0
  288. package/dist/templates/codebuddy/index.js +15 -0
  289. package/dist/templates/codebuddy/index.js.map +1 -0
  290. package/dist/templates/codebuddy/settings.json +70 -0
  291. package/dist/templates/codex/agents/trellis-check.toml +67 -0
  292. package/dist/templates/codex/agents/trellis-implement.toml +40 -0
  293. package/dist/templates/codex/agents/trellis-research.toml +73 -0
  294. package/dist/templates/codex/config.toml +28 -0
  295. package/dist/templates/codex/hooks/session-start.py +575 -0
  296. package/dist/templates/codex/hooks.json +15 -0
  297. package/dist/templates/codex/index.d.ts +39 -0
  298. package/dist/templates/codex/index.d.ts.map +1 -0
  299. package/dist/templates/codex/index.js +85 -0
  300. package/dist/templates/codex/index.js.map +1 -0
  301. package/dist/templates/codex/skills/before-dev/SKILL.md +40 -0
  302. package/dist/templates/codex/skills/brainstorm/SKILL.md +112 -0
  303. package/dist/templates/codex/skills/break-loop/SKILL.md +130 -0
  304. package/dist/templates/codex/skills/check/SKILL.md +98 -0
  305. package/dist/templates/codex/skills/check-cross-layer/SKILL.md +158 -0
  306. package/dist/templates/codex/skills/create-command/SKILL.md +101 -0
  307. package/dist/templates/codex/skills/finish-work/SKILL.md +90 -0
  308. package/dist/templates/codex/skills/improve-ut/SKILL.md +69 -0
  309. package/dist/templates/codex/skills/integrate-skill/SKILL.md +221 -0
  310. package/dist/templates/codex/skills/onboard/SKILL.md +363 -0
  311. package/dist/templates/codex/skills/record-session/SKILL.md +67 -0
  312. package/dist/templates/codex/skills/start/SKILL.md +66 -0
  313. package/dist/templates/codex/skills/update-spec/SKILL.md +335 -0
  314. package/dist/templates/common/bundled-skills/smart-search-cli/SKILL.md +388 -0
  315. package/dist/templates/common/bundled-skills/smart-search-cli/agents/openai.yaml +3 -0
  316. package/dist/templates/common/bundled-skills/smart-search-cli/examples/batch-search.md +98 -0
  317. package/dist/templates/common/bundled-skills/smart-search-cli/examples/evidence-gathering.md +89 -0
  318. package/dist/templates/common/bundled-skills/smart-search-cli/references/cli-contract.md +337 -0
  319. package/dist/templates/common/bundled-skills/trellis-cursor2plus-setup/SKILL.md +62 -0
  320. package/dist/templates/common/bundled-skills/trellis-meta/SKILL.md +73 -0
  321. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/add-project-local-conventions.md +83 -0
  322. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-agents.md +54 -0
  323. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-context-loading.md +84 -0
  324. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-hooks.md +57 -0
  325. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-skills-or-commands.md +80 -0
  326. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-spec-structure.md +83 -0
  327. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-task-lifecycle.md +88 -0
  328. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-workflow.md +65 -0
  329. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/overview.md +55 -0
  330. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/context-injection.md +68 -0
  331. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/generated-files.md +80 -0
  332. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/overview.md +51 -0
  333. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/spec-system.md +102 -0
  334. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/task-system.md +133 -0
  335. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/workflow.md +75 -0
  336. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/workspace-memory.md +71 -0
  337. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/agents.md +80 -0
  338. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/hooks-and-settings.md +69 -0
  339. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/overview.md +61 -0
  340. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/platform-map.md +76 -0
  341. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/skills-and-commands.md +128 -0
  342. package/dist/templates/common/bundled-skills/trellis-micro-grill/SKILL.md +47 -0
  343. package/dist/templates/common/bundled-skills/trellis-skill-creator/SKILL.md +44 -0
  344. package/dist/templates/common/bundled-skills/trellis-skill-creator/references/authoring-rules.md +97 -0
  345. package/dist/templates/common/bundled-skills/trellis-skill-creator/references/review-checklist.md +47 -0
  346. package/dist/templates/common/bundled-skills/trellis-skill-creator/references/trellis-skill-locations.md +52 -0
  347. package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/SKILL.md +41 -0
  348. package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/references/mcp-setup.md +90 -0
  349. package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/references/repository-analysis.md +59 -0
  350. package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/references/spec-task-planning.md +61 -0
  351. package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/references/spec-writing.md +70 -0
  352. package/dist/templates/common/commands/continue.md +63 -0
  353. package/dist/templates/common/commands/finish-work.md +68 -0
  354. package/dist/templates/common/commands/start.md +69 -0
  355. package/dist/templates/common/index.d.ts +48 -0
  356. package/dist/templates/common/index.d.ts.map +1 -0
  357. package/dist/templates/common/index.js +104 -0
  358. package/dist/templates/common/index.js.map +1 -0
  359. package/dist/templates/common/skills/before-dev.md +35 -0
  360. package/dist/templates/common/skills/brainstorm.md +164 -0
  361. package/dist/templates/common/skills/break-loop.md +125 -0
  362. package/dist/templates/common/skills/check.md +106 -0
  363. package/dist/templates/common/skills/update-spec.md +364 -0
  364. package/dist/templates/copilot/hooks/session-start.py +557 -0
  365. package/dist/templates/copilot/hooks.json +19 -0
  366. package/dist/templates/copilot/index.d.ts +23 -0
  367. package/dist/templates/copilot/index.d.ts.map +1 -0
  368. package/dist/templates/copilot/index.js +54 -0
  369. package/dist/templates/copilot/index.js.map +1 -0
  370. package/dist/templates/copilot/prompts/before-dev.prompt.md +39 -0
  371. package/dist/templates/copilot/prompts/brainstorm.prompt.md +111 -0
  372. package/dist/templates/copilot/prompts/break-loop.prompt.md +129 -0
  373. package/dist/templates/copilot/prompts/check-cross-layer.prompt.md +157 -0
  374. package/dist/templates/copilot/prompts/check.prompt.md +97 -0
  375. package/dist/templates/copilot/prompts/create-command.prompt.md +116 -0
  376. package/dist/templates/copilot/prompts/finish-work.prompt.md +99 -0
  377. package/dist/templates/copilot/prompts/integrate-skill.prompt.md +223 -0
  378. package/dist/templates/copilot/prompts/onboard.prompt.md +362 -0
  379. package/dist/templates/copilot/prompts/parallel.prompt.md +204 -0
  380. package/dist/templates/copilot/prompts/record-session.prompt.md +66 -0
  381. package/dist/templates/copilot/prompts/start.prompt.md +63 -0
  382. package/dist/templates/copilot/prompts/update-spec.prompt.md +358 -0
  383. package/dist/templates/cursor/agents/trellis-check.md +139 -0
  384. package/dist/templates/cursor/agents/trellis-implement.md +119 -0
  385. package/dist/templates/cursor/agents/trellis-research.md +147 -0
  386. package/dist/templates/cursor/commands/cursor2plus-setup.md +82 -0
  387. package/dist/templates/cursor/hooks.json +30 -0
  388. package/dist/templates/cursor/index.d.ts +19 -0
  389. package/dist/templates/cursor/index.d.ts.map +1 -0
  390. package/dist/templates/cursor/index.js +19 -0
  391. package/dist/templates/cursor/index.js.map +1 -0
  392. package/dist/templates/cursor/rules/trellis-triage.mdc +38 -0
  393. package/dist/templates/cursor/worktrees.json +11 -0
  394. package/dist/templates/droid/droids/trellis-check.md +107 -0
  395. package/dist/templates/droid/droids/trellis-implement.md +102 -0
  396. package/dist/templates/droid/droids/trellis-research.md +137 -0
  397. package/dist/templates/droid/index.d.ts +15 -0
  398. package/dist/templates/droid/index.d.ts.map +1 -0
  399. package/dist/templates/droid/index.js +15 -0
  400. package/dist/templates/droid/index.js.map +1 -0
  401. package/dist/templates/droid/settings.json +70 -0
  402. package/dist/templates/extract.d.ts +40 -0
  403. package/dist/templates/extract.d.ts.map +1 -0
  404. package/dist/templates/extract.js +106 -0
  405. package/dist/templates/extract.js.map +1 -0
  406. package/dist/templates/gemini/agents/trellis-check.md +107 -0
  407. package/dist/templates/gemini/agents/trellis-implement.md +102 -0
  408. package/dist/templates/gemini/agents/trellis-research.md +136 -0
  409. package/dist/templates/gemini/index.d.ts +13 -0
  410. package/dist/templates/gemini/index.d.ts.map +1 -0
  411. package/dist/templates/gemini/index.js +13 -0
  412. package/dist/templates/gemini/index.js.map +1 -0
  413. package/dist/templates/gemini/settings.json +28 -0
  414. package/dist/templates/kiro/agents/trellis-check.json +26 -0
  415. package/dist/templates/kiro/agents/trellis-implement.json +26 -0
  416. package/dist/templates/kiro/agents/trellis-research.json +30 -0
  417. package/dist/templates/kiro/index.d.ts +18 -0
  418. package/dist/templates/kiro/index.d.ts.map +1 -0
  419. package/dist/templates/kiro/index.js +18 -0
  420. package/dist/templates/kiro/index.js.map +1 -0
  421. package/dist/templates/markdown/agents.md +32 -0
  422. package/dist/templates/markdown/gitignore.txt +15 -0
  423. package/dist/templates/markdown/index.d.ts +30 -0
  424. package/dist/templates/markdown/index.d.ts.map +1 -0
  425. package/dist/templates/markdown/index.js +55 -0
  426. package/dist/templates/markdown/index.js.map +1 -0
  427. package/dist/templates/markdown/spec/backend/database-guidelines.md.txt +51 -0
  428. package/dist/templates/markdown/spec/backend/directory-structure.md.txt +54 -0
  429. package/dist/templates/markdown/spec/backend/error-handling.md.txt +51 -0
  430. package/dist/templates/markdown/spec/backend/index.md.txt +38 -0
  431. package/dist/templates/markdown/spec/backend/logging-guidelines.md.txt +51 -0
  432. package/dist/templates/markdown/spec/backend/quality-guidelines.md.txt +51 -0
  433. package/dist/templates/markdown/spec/frontend/component-guidelines.md.txt +59 -0
  434. package/dist/templates/markdown/spec/frontend/directory-structure.md.txt +54 -0
  435. package/dist/templates/markdown/spec/frontend/hook-guidelines.md.txt +51 -0
  436. package/dist/templates/markdown/spec/frontend/index.md.txt +39 -0
  437. package/dist/templates/markdown/spec/frontend/quality-guidelines.md.txt +51 -0
  438. package/dist/templates/markdown/spec/frontend/state-management.md.txt +51 -0
  439. package/dist/templates/markdown/spec/frontend/type-safety.md.txt +51 -0
  440. package/dist/templates/markdown/spec/guides/code-reuse-thinking-guide.md.txt +223 -0
  441. package/dist/templates/markdown/spec/guides/cross-layer-thinking-guide.md.txt +259 -0
  442. package/dist/templates/markdown/spec/guides/cross-platform-thinking-guide.md.txt +633 -0
  443. package/dist/templates/markdown/spec/guides/cursor-context-injection-guide.md.txt +65 -0
  444. package/dist/templates/markdown/spec/guides/cursor-subagent-policy.md.txt +382 -0
  445. package/dist/templates/markdown/spec/guides/durable-learning-decision-guide.md.txt +76 -0
  446. package/dist/templates/markdown/spec/guides/index.md.txt +101 -0
  447. package/dist/templates/markdown/spec/guides/retrieval-daily-guide.md.txt +92 -0
  448. package/dist/templates/markdown/workspace-index.md +125 -0
  449. package/dist/templates/markdown/worktree.yaml.txt +58 -0
  450. package/dist/templates/opencode/agents/trellis-check.md +122 -0
  451. package/dist/templates/opencode/agents/trellis-implement.md +118 -0
  452. package/dist/templates/opencode/agents/trellis-research.md +145 -0
  453. package/dist/templates/opencode/lib/session-utils.js +667 -0
  454. package/dist/templates/opencode/lib/trellis-context.js +336 -0
  455. package/dist/templates/opencode/package.json +5 -0
  456. package/dist/templates/opencode/plugins/inject-subagent-context.js +495 -0
  457. package/dist/templates/opencode/plugins/inject-workflow-state.js +159 -0
  458. package/dist/templates/opencode/plugins/session-start.js +101 -0
  459. package/dist/templates/pi/agents/trellis-check.md +37 -0
  460. package/dist/templates/pi/agents/trellis-implement.md +42 -0
  461. package/dist/templates/pi/agents/trellis-research.md +25 -0
  462. package/dist/templates/pi/extensions/trellis/index.ts.txt +1600 -0
  463. package/dist/templates/pi/index.d.ts +5 -0
  464. package/dist/templates/pi/index.d.ts.map +1 -0
  465. package/dist/templates/pi/index.js +12 -0
  466. package/dist/templates/pi/index.js.map +1 -0
  467. package/dist/templates/pi/settings.json +12 -0
  468. package/dist/templates/qoder/agents/trellis-check.md +108 -0
  469. package/dist/templates/qoder/agents/trellis-implement.md +103 -0
  470. package/dist/templates/qoder/agents/trellis-research.md +137 -0
  471. package/dist/templates/qoder/index.d.ts +15 -0
  472. package/dist/templates/qoder/index.d.ts.map +1 -0
  473. package/dist/templates/qoder/index.js +15 -0
  474. package/dist/templates/qoder/index.js.map +1 -0
  475. package/dist/templates/qoder/settings.json +47 -0
  476. package/dist/templates/shared-hooks/index.d.ts +50 -0
  477. package/dist/templates/shared-hooks/index.d.ts.map +1 -0
  478. package/dist/templates/shared-hooks/index.js +92 -0
  479. package/dist/templates/shared-hooks/index.js.map +1 -0
  480. package/dist/templates/shared-hooks/inject-shell-session-context.py +183 -0
  481. package/dist/templates/shared-hooks/inject-subagent-context.py +774 -0
  482. package/dist/templates/shared-hooks/inject-workflow-state.py +366 -0
  483. package/dist/templates/shared-hooks/research-end-retrieval-pack.py +220 -0
  484. package/dist/templates/shared-hooks/session-start.py +873 -0
  485. package/dist/templates/template-utils.d.ts +28 -0
  486. package/dist/templates/template-utils.d.ts.map +1 -0
  487. package/dist/templates/template-utils.js +83 -0
  488. package/dist/templates/template-utils.js.map +1 -0
  489. package/dist/templates/trellis/config.yaml +132 -0
  490. package/dist/templates/trellis/gitignore.txt +39 -0
  491. package/dist/templates/trellis/index.d.ts +80 -0
  492. package/dist/templates/trellis/index.d.ts.map +1 -0
  493. package/dist/templates/trellis/index.js +171 -0
  494. package/dist/templates/trellis/index.js.map +1 -0
  495. package/dist/templates/trellis/local/README.md +59 -0
  496. package/dist/templates/trellis/local/config.local.json.example +6 -0
  497. package/dist/templates/trellis/local/index.d.ts +7 -0
  498. package/dist/templates/trellis/local/index.d.ts.map +1 -0
  499. package/dist/templates/trellis/local/index.js +14 -0
  500. package/dist/templates/trellis/local/index.js.map +1 -0
  501. package/dist/templates/trellis/local/patch_wpelc8.py +297 -0
  502. package/dist/templates/trellis/local/subagent-models.json.example +4 -0
  503. package/dist/templates/trellis/local/trellis-task-models.json.example +10 -0
  504. package/dist/templates/trellis/local/trellis-task-models.json5.example +45 -0
  505. package/dist/templates/trellis/local/trellis_task_models_config.py +200 -0
  506. package/dist/templates/trellis/scripts/__init__.py +5 -0
  507. package/dist/templates/trellis/scripts/add_session.py +547 -0
  508. package/dist/templates/trellis/scripts/build_context_pack.py +12 -0
  509. package/dist/templates/trellis/scripts/build_retrieval_pack.py +12 -0
  510. package/dist/templates/trellis/scripts/common/__init__.py +103 -0
  511. package/dist/templates/trellis/scripts/common/active_task.py +607 -0
  512. package/dist/templates/trellis/scripts/common/artifact_search.py +587 -0
  513. package/dist/templates/trellis/scripts/common/cli_adapter.py +811 -0
  514. package/dist/templates/trellis/scripts/common/cli_environment.py +155 -0
  515. package/dist/templates/trellis/scripts/common/codebase_retrieval_router.py +902 -0
  516. package/dist/templates/trellis/scripts/common/config.py +458 -0
  517. package/dist/templates/trellis/scripts/common/context_pack.py +371 -0
  518. package/dist/templates/trellis/scripts/common/developer.py +190 -0
  519. package/dist/templates/trellis/scripts/common/git.py +31 -0
  520. package/dist/templates/trellis/scripts/common/git_context.py +149 -0
  521. package/dist/templates/trellis/scripts/common/io.py +37 -0
  522. package/dist/templates/trellis/scripts/common/log.py +45 -0
  523. package/dist/templates/trellis/scripts/common/packages_context.py +239 -0
  524. package/dist/templates/trellis/scripts/common/parent_orchestration.py +691 -0
  525. package/dist/templates/trellis/scripts/common/paths.py +457 -0
  526. package/dist/templates/trellis/scripts/common/retrieval_adapter_metadata.py +889 -0
  527. package/dist/templates/trellis/scripts/common/retrieval_evidence.py +917 -0
  528. package/dist/templates/trellis/scripts/common/retrieval_pack.py +425 -0
  529. package/dist/templates/trellis/scripts/common/retrieval_pack_context.py +126 -0
  530. package/dist/templates/trellis/scripts/common/safe_commit.py +285 -0
  531. package/dist/templates/trellis/scripts/common/session_context.py +1159 -0
  532. package/dist/templates/trellis/scripts/common/session_memory.py +360 -0
  533. package/dist/templates/trellis/scripts/common/smart_search_evidence.py +479 -0
  534. package/dist/templates/trellis/scripts/common/smart_search_resolve.py +125 -0
  535. package/dist/templates/trellis/scripts/common/task_context.py +223 -0
  536. package/dist/templates/trellis/scripts/common/task_dashboard.py +140 -0
  537. package/dist/templates/trellis/scripts/common/task_gates.py +1735 -0
  538. package/dist/templates/trellis/scripts/common/task_map.py +586 -0
  539. package/dist/templates/trellis/scripts/common/task_queue.py +188 -0
  540. package/dist/templates/trellis/scripts/common/task_store.py +1533 -0
  541. package/dist/templates/trellis/scripts/common/task_utils.py +274 -0
  542. package/dist/templates/trellis/scripts/common/tasks.py +231 -0
  543. package/dist/templates/trellis/scripts/common/test_retrieval_arbitration.py +333 -0
  544. package/dist/templates/trellis/scripts/common/trellis_config.py +131 -0
  545. package/dist/templates/trellis/scripts/common/types.py +110 -0
  546. package/dist/templates/trellis/scripts/common/workflow_phase.py +212 -0
  547. package/dist/templates/trellis/scripts/get_context.py +17 -0
  548. package/dist/templates/trellis/scripts/get_developer.py +26 -0
  549. package/dist/templates/trellis/scripts/hooks/linear_sync.py +243 -0
  550. package/dist/templates/trellis/scripts/init_developer.py +51 -0
  551. package/dist/templates/trellis/scripts/route_codebase_retrieval.py +77 -0
  552. package/dist/templates/trellis/scripts/run_smart_search.py +12 -0
  553. package/dist/templates/trellis/scripts/search_artifacts.py +13 -0
  554. package/dist/templates/trellis/scripts/search_memory.py +12 -0
  555. package/dist/templates/trellis/scripts/task.py +851 -0
  556. package/dist/templates/trellis/tasks/.gitkeep +0 -0
  557. package/dist/templates/trellis/tasks/templates/release-execution/design.md +61 -0
  558. package/dist/templates/trellis/tasks/templates/release-execution/handoff-template.md +29 -0
  559. package/dist/templates/trellis/tasks/templates/release-execution/implement.md +29 -0
  560. package/dist/templates/trellis/tasks/templates/release-execution/prd.md +31 -0
  561. package/dist/templates/trellis/tasks/templates/release-readiness/design.md +50 -0
  562. package/dist/templates/trellis/tasks/templates/release-readiness/handoff-template.md +39 -0
  563. package/dist/templates/trellis/tasks/templates/release-readiness/implement.md +29 -0
  564. package/dist/templates/trellis/tasks/templates/release-readiness/prd.md +31 -0
  565. package/dist/templates/trellis/workflow.md +960 -0
  566. package/dist/types/ai-tools.d.ts +106 -0
  567. package/dist/types/ai-tools.d.ts.map +1 -0
  568. package/dist/types/ai-tools.js +294 -0
  569. package/dist/types/ai-tools.js.map +1 -0
  570. package/dist/types/migration.d.ts +125 -0
  571. package/dist/types/migration.d.ts.map +1 -0
  572. package/dist/types/migration.js +8 -0
  573. package/dist/types/migration.js.map +1 -0
  574. package/dist/utils/codebase-retrieval-router.d.ts +77 -0
  575. package/dist/utils/codebase-retrieval-router.d.ts.map +1 -0
  576. package/dist/utils/codebase-retrieval-router.js +767 -0
  577. package/dist/utils/codebase-retrieval-router.js.map +1 -0
  578. package/dist/utils/compare-versions.d.ts +12 -0
  579. package/dist/utils/compare-versions.d.ts.map +1 -0
  580. package/dist/utils/compare-versions.js +86 -0
  581. package/dist/utils/compare-versions.js.map +1 -0
  582. package/dist/utils/cwd-guard.d.ts +38 -0
  583. package/dist/utils/cwd-guard.d.ts.map +1 -0
  584. package/dist/utils/cwd-guard.js +62 -0
  585. package/dist/utils/cwd-guard.js.map +1 -0
  586. package/dist/utils/file-writer.d.ts +36 -0
  587. package/dist/utils/file-writer.d.ts.map +1 -0
  588. package/dist/utils/file-writer.js +203 -0
  589. package/dist/utils/file-writer.js.map +1 -0
  590. package/dist/utils/manifest-prune.d.ts +61 -0
  591. package/dist/utils/manifest-prune.d.ts.map +1 -0
  592. package/dist/utils/manifest-prune.js +136 -0
  593. package/dist/utils/manifest-prune.js.map +1 -0
  594. package/dist/utils/posix.d.ts +13 -0
  595. package/dist/utils/posix.d.ts.map +1 -0
  596. package/dist/utils/posix.js +15 -0
  597. package/dist/utils/posix.js.map +1 -0
  598. package/dist/utils/post-update-smoke.d.ts +7 -0
  599. package/dist/utils/post-update-smoke.d.ts.map +1 -0
  600. package/dist/utils/post-update-smoke.js +40 -0
  601. package/dist/utils/post-update-smoke.js.map +1 -0
  602. package/dist/utils/project-capabilities.d.ts +54 -0
  603. package/dist/utils/project-capabilities.d.ts.map +1 -0
  604. package/dist/utils/project-capabilities.js +515 -0
  605. package/dist/utils/project-capabilities.js.map +1 -0
  606. package/dist/utils/project-detector.d.ts +46 -0
  607. package/dist/utils/project-detector.d.ts.map +1 -0
  608. package/dist/utils/project-detector.js +666 -0
  609. package/dist/utils/project-detector.js.map +1 -0
  610. package/dist/utils/proxy.d.ts +25 -0
  611. package/dist/utils/proxy.d.ts.map +1 -0
  612. package/dist/utils/proxy.js +60 -0
  613. package/dist/utils/proxy.js.map +1 -0
  614. package/dist/utils/readiness.d.ts +20 -0
  615. package/dist/utils/readiness.d.ts.map +1 -0
  616. package/dist/utils/readiness.js +430 -0
  617. package/dist/utils/readiness.js.map +1 -0
  618. package/dist/utils/retrieval-execution-telemetry.d.ts +162 -0
  619. package/dist/utils/retrieval-execution-telemetry.d.ts.map +1 -0
  620. package/dist/utils/retrieval-execution-telemetry.js +288 -0
  621. package/dist/utils/retrieval-execution-telemetry.js.map +1 -0
  622. package/dist/utils/retrieval-result-ranking.d.ts +40 -0
  623. package/dist/utils/retrieval-result-ranking.d.ts.map +1 -0
  624. package/dist/utils/retrieval-result-ranking.js +162 -0
  625. package/dist/utils/retrieval-result-ranking.js.map +1 -0
  626. package/dist/utils/task-json.d.ts +13 -0
  627. package/dist/utils/task-json.d.ts.map +1 -0
  628. package/dist/utils/task-json.js +12 -0
  629. package/dist/utils/task-json.js.map +1 -0
  630. package/dist/utils/template-fetcher.d.ts +150 -0
  631. package/dist/utils/template-fetcher.d.ts.map +1 -0
  632. package/dist/utils/template-fetcher.js +907 -0
  633. package/dist/utils/template-fetcher.js.map +1 -0
  634. package/dist/utils/template-hash.d.ts +123 -0
  635. package/dist/utils/template-hash.d.ts.map +1 -0
  636. package/dist/utils/template-hash.js +334 -0
  637. package/dist/utils/template-hash.js.map +1 -0
  638. package/dist/utils/uninstall-scrubbers.d.ts +66 -0
  639. package/dist/utils/uninstall-scrubbers.d.ts.map +1 -0
  640. package/dist/utils/uninstall-scrubbers.js +342 -0
  641. package/dist/utils/uninstall-scrubbers.js.map +1 -0
  642. package/dist/utils/update-rollout-report.d.ts +137 -0
  643. package/dist/utils/update-rollout-report.d.ts.map +1 -0
  644. package/dist/utils/update-rollout-report.js +108 -0
  645. package/dist/utils/update-rollout-report.js.map +1 -0
  646. package/dist/utils/workflow-resolver.d.ts +86 -0
  647. package/dist/utils/workflow-resolver.d.ts.map +1 -0
  648. package/dist/utils/workflow-resolver.js +265 -0
  649. package/dist/utils/workflow-resolver.js.map +1 -0
  650. package/package.json +137 -0
  651. package/scripts/postinstall.js +45 -0
  652. package/vendor/smart-search/LICENSE +21 -0
  653. package/vendor/smart-search/README.md +412 -0
  654. package/vendor/smart-search/README.zh-CN.md +430 -0
  655. package/vendor/smart-search/npm/bin/smart-search.js +63 -0
  656. package/vendor/smart-search/npm/scripts/postinstall.js +87 -0
  657. package/vendor/smart-search/npm/scripts/resolve-prerelease-version.js +108 -0
  658. package/vendor/smart-search/npm/scripts/set-package-version.js +35 -0
  659. package/vendor/smart-search/npm/scripts/sync-python-version.js +22 -0
  660. package/vendor/smart-search/npm/scripts/test-wrapper-repair.js +99 -0
  661. package/vendor/smart-search/npm/scripts/test.js +85 -0
  662. package/vendor/smart-search/package.json +42 -0
  663. package/vendor/smart-search/pyproject.toml +37 -0
  664. package/vendor/smart-search/skills/smart-search-cli/SKILL.md +387 -0
  665. package/vendor/smart-search/skills/smart-search-cli/agents/openai.yaml +3 -0
  666. package/vendor/smart-search/skills/smart-search-cli/examples/batch-search.md +98 -0
  667. package/vendor/smart-search/skills/smart-search-cli/examples/evidence-gathering.md +89 -0
  668. package/vendor/smart-search/skills/smart-search-cli/references/cli-contract.md +337 -0
  669. package/vendor/smart-search/src/smart_search/__init__.py +1 -0
  670. package/vendor/smart-search/src/smart_search/assets/skills/smart-search-cli/SKILL.md +387 -0
  671. package/vendor/smart-search/src/smart_search/assets/skills/smart-search-cli/agents/openai.yaml +3 -0
  672. package/vendor/smart-search/src/smart_search/assets/skills/smart-search-cli/examples/batch-search.md +98 -0
  673. package/vendor/smart-search/src/smart_search/assets/skills/smart-search-cli/examples/evidence-gathering.md +89 -0
  674. package/vendor/smart-search/src/smart_search/assets/skills/smart-search-cli/references/cli-contract.md +337 -0
  675. package/vendor/smart-search/src/smart_search/cli.py +2003 -0
  676. package/vendor/smart-search/src/smart_search/config.py +580 -0
  677. package/vendor/smart-search/src/smart_search/logger.py +43 -0
  678. package/vendor/smart-search/src/smart_search/providers/__init__.py +16 -0
  679. package/vendor/smart-search/src/smart_search/providers/base.py +41 -0
  680. package/vendor/smart-search/src/smart_search/providers/context7.py +141 -0
  681. package/vendor/smart-search/src/smart_search/providers/exa.py +206 -0
  682. package/vendor/smart-search/src/smart_search/providers/jina.py +136 -0
  683. package/vendor/smart-search/src/smart_search/providers/openai_compatible.py +370 -0
  684. package/vendor/smart-search/src/smart_search/providers/zhipu.py +143 -0
  685. package/vendor/smart-search/src/smart_search/service.py +2865 -0
  686. package/vendor/smart-search/src/smart_search/sources.py +429 -0
  687. package/vendor/smart-search/src/smart_search/utils.py +220 -0
@@ -0,0 +1,960 @@
1
+ # Development Workflow
2
+
3
+ ---
4
+
5
+ ## Core Principles
6
+
7
+ 1. **Plan before code** — figure out what to do before you start
8
+ 2. **Specs injected, not remembered** — guidelines are injected via hook/skill, not recalled from memory
9
+ 3. **Persist everything** — research, decisions, and lessons all go to files; conversations get compacted, files don't
10
+ 4. **Incremental development** — one task at a time
11
+ 5. **Capture learnings** — after each task, review and write new knowledge back to spec
12
+
13
+ ---
14
+
15
+ ## Trellis System
16
+
17
+ ### Developer Identity
18
+
19
+ On first use, initialize your identity:
20
+
21
+ ```bash
22
+ python3 ./.trellis/scripts/init_developer.py <your-name>
23
+ ```
24
+
25
+ Creates `.trellis/.developer` (gitignored) + `.trellis/workspace/<your-name>/`.
26
+
27
+ ### Spec System
28
+
29
+ `.trellis/spec/` holds coding guidelines organized by package and layer.
30
+
31
+ - `.trellis/spec/<package>/<layer>/index.md` — entry point with **Pre-Development Checklist** + **Quality Check**. Actual guidelines live in the `.md` files it points to.
32
+ - `.trellis/spec/guides/index.md` — cross-package thinking guides.
33
+
34
+ ```bash
35
+ python3 ./.trellis/scripts/get_context.py --mode packages # list packages / layers
36
+ ```
37
+
38
+ **When to update spec**: new pattern/convention found · bug-fix prevention to codify · new technical decision.
39
+
40
+ ### Task System
41
+
42
+ Every task has its own directory under `.trellis/tasks/{MM-DD-name}/` holding `task.json`, `prd.md`, optional `design.md`, optional `implement.md`, optional `research/`, and context manifests (`implement.jsonl`, `check.jsonl`) for sub-agent-capable platforms.
43
+
44
+ Optional copied templates live under `.trellis/tasks/templates/` (for example `release-readiness/` and `release-execution/`). `task.py create` does not auto-apply them; copy files into a new task when starting that workflow.
45
+
46
+ ```bash
47
+ # Task lifecycle
48
+ python3 ./.trellis/scripts/task.py create "<title>" [--slug <name>] [--parent <dir>]
49
+ python3 ./.trellis/scripts/task.py dashboard # show Task Dashboard without mutating state
50
+ python3 ./.trellis/scripts/task.py select <name> # select task for this live session
51
+ python3 ./.trellis/scripts/task.py selected --source # show selected task and source
52
+ python3 ./.trellis/scripts/task.py start-execution <name> --check
53
+ python3 ./.trellis/scripts/task.py start-execution <name> --approved
54
+ python3 ./.trellis/scripts/task.py exit # clear selected task without changing status
55
+ python3 ./.trellis/scripts/task.py archive <name> # move to archive/{year-month}/
56
+ python3 ./.trellis/scripts/task.py list [--mine] [--status <s>]
57
+ python3 ./.trellis/scripts/task.py list-archive
58
+ python3 ./.trellis/scripts/task.py add-subtask <parent> <child>
59
+ python3 ./.trellis/scripts/task.py set-child-state <parent> <child> review --evidence verify.md
60
+ python3 ./.trellis/scripts/task.py prepare-child-worktree <parent> <child> --branch <child-branch>
61
+ python3 ./.trellis/scripts/task.py integrate-child <parent> <child> accepted --evidence handoff.md --ref <child-ref>
62
+
63
+ # Code-spec context (injected into implement/check agents via JSONL).
64
+ # `implement.jsonl` / `check.jsonl` are seeded on `task create` for sub-agent-capable
65
+ # platforms; the AI curates real spec + research entries during planning when needed.
66
+ python3 ./.trellis/scripts/task.py add-context <name> <action> <file> <reason>
67
+ python3 ./.trellis/scripts/task.py list-context <name> [action]
68
+ python3 ./.trellis/scripts/task.py validate <name>
69
+
70
+ # Task metadata
71
+ python3 ./.trellis/scripts/task.py set-branch <name> <branch>
72
+ python3 ./.trellis/scripts/task.py set-base-branch <name> <branch> # PR target
73
+ python3 ./.trellis/scripts/task.py set-scope <name> <scope>
74
+
75
+ # Hierarchy (parent/child)
76
+ python3 ./.trellis/scripts/task.py add-subtask <parent> <child>
77
+ python3 ./.trellis/scripts/task.py remove-subtask <parent> <child>
78
+
79
+ # PR creation
80
+ python3 ./.trellis/scripts/task.py create-pr [name] [--dry-run]
81
+ ```
82
+
83
+ > Run `python3 ./.trellis/scripts/task.py --help` to see the authoritative, up-to-date list.
84
+
85
+ **Selected-task mechanism**: entering a Trellis project activates framework context, but every new live session starts with `Selected task: none`. `task.py create` creates artifacts only. `task.py select <task>` writes a per-session `selected_task` pointer without changing `task.json.status`. `task.py selected --source` reports that pointer. `task.py exit` clears it without changing status. `task.py start-execution <task> --check` verifies execution readiness without mutation; `task.py start-execution <task> --approved` is the explicit execution boundary and may flip `planning` to `in_progress`. `task.py archive <task>` writes `status=completed`, moves the directory to `archive/`, and deletes runtime session files that still point at the archived task.
86
+
87
+ ### Workspace System
88
+
89
+ Records every AI session for cross-session tracking under `.trellis/workspace/<developer>/`.
90
+
91
+ - `journal-N.md` — session log. **Max 2000 lines per file**; a new `journal-(N+1).md` is auto-created when exceeded.
92
+ - `index.md` — personal index (total sessions, last active).
93
+
94
+ ```bash
95
+ python3 ./.trellis/scripts/add_session.py --title "Title" --commit "hash" --summary "Summary"
96
+ ```
97
+
98
+ ### Context Script
99
+
100
+ ```bash
101
+ python3 ./.trellis/scripts/get_context.py # full session runtime
102
+ python3 ./.trellis/scripts/get_context.py --mode packages # available packages + spec layers
103
+ python3 ./.trellis/scripts/get_context.py --mode phase --step <X.Y> # detailed guide for a workflow step
104
+ python3 ./.trellis/scripts/get_context.py --mode retrieval-pack --json --input <evidence.json> # score collected evidence (not default --json)
105
+ python3 ./.trellis/scripts/get_context.py --mode retrieval-pack --platform cursor --json # platform-adaptive routing
106
+ ```
107
+
108
+ **Platform-adaptive routing:** pass `--platform <name>` (cursor, claude-code, codex) when calling `--mode retrieval-pack`. This enables platform-specific tool recommendations (e.g., Cursor uses `@codebase` instead of `fast-context`). Hooks auto-detect the platform; manual calls should include it when the agent knows the host platform.
109
+
110
+ **Evidence scoring:** default `--json` returns `retrievalGuide` only. After collecting artifact search, session memory, smart-search manifests under `{TASK}/research/smart-search/`, or codebase candidates, run **`--mode retrieval-pack`** with `--input` or stdin JSON. See `research/evidence-scoring-integration.md` in the active task or archived `06-15-child-phase2-evidence-scoring`.
111
+
112
+ **Research-end hook (Cursor `stop` / Claude `Stop`):** when the selected task has `{TASK}/research/*.md` or `research/smart-search/`, `.cursor/hooks/research-end-retrieval-pack.py` (or `.claude/hooks/…`) may write `{TASK}/research/retrieval-pack-latest.json` via `get_context --mode retrieval-pack --platform <auto-detected>`. Default session JSON is unchanged; use the file when closing research or before Phase 3.1.
113
+
114
+ **Retrieval daily guide:** `.trellis/spec/guides/retrieval-daily-guide.md` — when to use rg, codegraph, fast-context-mcp, smart-search-cli (and Cursor web fallback), artifact/session memory, codebase router (suggest-only), and explicit retrieval-pack scoring.
115
+
116
+ **Cursor subagent dispatch:** `.trellis/spec/guides/cursor-subagent-policy.md` — `trellis-research` / `trellis-implement` / `trellis-check`; Parent child default **Task** `trellis-implement` from Parent session (`generate-child-prompt --mode subagent`). **Cursor++ BYOK:** per-type models via `.trellis/local/cursor2plus/` + user/project JSON maps (not committed slugs). **Native Cursor API:** frontmatter `model:` on agents still works. PRD Grill stays in `trellis-brainstorm`, not a subagent. **Cursor++:** compatible v0.0.11+ (SubAgent readonly bug fixed).
117
+
118
+ ---
119
+
120
+ <!--
121
+ WORKFLOW-STATE BREADCRUMB CONTRACT (read this before editing the tag blocks below)
122
+
123
+ The [workflow-state:STATUS] blocks embedded in the ## Phase Index section
124
+ below are the SINGLE source of truth for the per-turn `<workflow-state>`
125
+ breadcrumb that every supported AI platform's UserPromptSubmit hook
126
+ reads. inject-workflow-state.py (Python platforms) and
127
+ inject-workflow-state.js (OpenCode plugin) only parse them — there is no
128
+ fallback dict baked into the scripts after v0.5.0-rc.0.
129
+
130
+ STATUS charset: [A-Za-z0-9_-]+. When the hook can't find a tag, it
131
+ degrades to a generic "Refer to workflow.md for current step." line —
132
+ intentionally visible so users notice and fix a broken workflow.md.
133
+
134
+ INVARIANT (test/regression.test.ts):
135
+ Every workflow-walkthrough step marked `[required · once]` must have a
136
+ matching enforcement line in its phase's [workflow-state:*] block. The
137
+ breadcrumb is the only per-turn channel; if a mandatory step isn't
138
+ mentioned there, the AI silently skips it (Phase 1 planning gate
139
+ skip and Phase 3.4 commit skip both manifested via this gap).
140
+
141
+ TAG ↔ PHASE scoping:
142
+ [workflow-state:no_task] → framework active, selected task none; before Phase 1
143
+ [workflow-state:planning] → all of Phase 1 (status='planning')
144
+ [workflow-state:planning-inline] → Codex inline variant of Phase 1
145
+ [workflow-state:in_progress] → Phase 2 + Phase 3.1-3.4
146
+ (status stays 'in_progress' from
147
+ start-execution --approved until task.py archive)
148
+ [workflow-state:in_progress-inline] → Codex inline variant of Phase 2/3
149
+ [workflow-state:completed] → currently DEAD: cmd_archive flips
150
+ status and moves the dir in the same
151
+ call, so the resolver loses the
152
+ pointer (block kept for a future
153
+ explicit in_progress→completed
154
+ transition)
155
+
156
+ Editing checklist:
157
+ - When you change a [workflow-state:STATUS] block, also check the
158
+ matching phase's `[required · once]` walkthrough steps for sync
159
+ - Run `trellis update` after editing to push the new bodies to
160
+ downstream user projects (block-level managed replacement)
161
+ - Full runtime contract:
162
+ .trellis/spec/cli/backend/workflow-state-contract.md
163
+ -->
164
+
165
+ ## Phase Index
166
+
167
+ ```
168
+ Phase 1: Plan → classify, get task-creation consent, then write planning artifacts
169
+ Phase 2: Execute → implement only after task status is in_progress
170
+ Phase 3: Finish → verify, record learning decision, commit, and guarded archive
171
+ ```
172
+
173
+ ### Request Triage (mandatory before any work)
174
+
175
+ **Every turn that could produce work must be classified before acting.** This is a hard gate, not a suggestion. Resolve the request against the Task Ladder decision tree below, then emit the classification mark. If you cannot classify, you have not understood the request — ask a clarifying question instead of starting work.
176
+
177
+ Decision tree (first match wins):
178
+
179
+ 1. **No durable project change** (conversation, status, explanation, read-only lookup, tiny one-turn action) → `No Task`.
180
+ 2. **Underspecified small request, no task yet** (needs focused clarification or decision pressure before work exists) → `Micro-Grill` (load `trellis-micro-grill`).
181
+ 3. **Low-risk durable work, narrow scope, local validation, no shared contract** → `Lite Task`.
182
+ 4. **Durable code/template/runtime/workflow/cross-file behavior, or framework semantics** → `Full Task`.
183
+ 5. **Multiple independent deliverables, staged/parallel execution, or final integration authority** → `Parent Task / Child Tasks`.
184
+
185
+ Classification mark (R2 — visible audit trail). Start your reply with one line in this exact shape:
186
+
187
+ ```
188
+ [Triage: <Mode>] <one-sentence reason citing the trigger signal>
189
+ ```
190
+
191
+ - `<Mode>` ∈ `No Task | Micro-Grill | Lite | Full | Parent`.
192
+ - The reason must reference the trigger signal from the Task Ladder table (e.g. "cross-file workflow change", "read-only explanation"). Vague reasons like "looks complex" are not acceptable.
193
+ - For `No Task` turns the mark is still required — it is how the user audits that you actually classified rather than skipped.
194
+
195
+ Consent gate. After classifying into any mode that creates a task, ask the user for task-creation consent before creating any Trellis artifact. User approval to create a task is **not** approval to start implementation — planning still happens first. If the user declines a task for a simple request, skip Trellis for this session.
196
+
197
+ Selected-task continuity. When a `selected_task` already exists, do not rerun global classification on every follow-up; continue inside the selected task unless a strong conflict exists (explicit exit/switch/create language, out-of-scope request, different artifact/archive target, new independent deliverable, contract-changing request, or evidence pollution risk).
198
+
199
+ ### Task Ladder And Routing
200
+
201
+ Classify by risk and persistence, not raw effort size. A short change to durable framework semantics can require a Full Task; a long conversation can remain No Task when it leaves no durable project state.
202
+
203
+ | Mode | Use when | Trigger signals | Durable artifacts |
204
+ | --- | --- | --- | --- |
205
+ | No Task | Conversation, status, explanation, read-only lookup, or a tiny one-turn action with no durable project change. | explain / status / lookup / read-only / one-liner | None. No archive unless upgraded. |
206
+ | Micro-Grill | The user needs focused clarification, decision pressure, or a small requirement interrogation before deciding whether work exists. | small + underspecified / "depends" / needs clarification / decision tree first | Usually none. Upgrade before durable edits, validation, gates, or archive evidence. |
207
+ | Lite Task | Low-risk durable work with narrow scope, local validation, and no shared contract change. | low-risk / single file / local validation / no contract / narrow scope | `task.json`, `prd.md`, `verify.md`, and archive evidence. |
208
+ | Full Task | Durable code, template, runtime, workflow, or cross-file behavior where design, execution strategy, validation, or reviewer gates matter. | cross-file / framework semantics / contract change / template / runtime / workflow / multi-file behavior | `prd.md`, `design.md`, `implement.md`, `verify.md`, Development Strategy Contract, `verification_profile`, `quality_gates`, and archive evidence. |
209
+ | Parent Task / Child Tasks | One request contains independent deliverables, staged execution, parallel execution, or final integration authority that must be owned by a Parent. | multiple independent deliverables / staged / parallel / integration authority | Parent `task-map.md`, Child task artifacts, Child handoff evidence, Parent final integration evidence. |
210
+
211
+ Default Trellis framework semantics, task model, platform adapters, MCP/capability setup, runtime integration, retrieval/graph tooling, Parent/Child orchestration, and quality-gate work to Full Task or higher.
212
+
213
+ When `Selected task: none`, enter repo-first routing: read local instructions/workflow evidence, run `task.py dashboard` when useful, classify the request on the ladder, and ask for task-creation consent before creating artifacts. Do not auto-select an existing task.
214
+
215
+ When a `selected_task` already exists, do not rerun global classification on every follow-up. Continue inside the selected task unless a strong conflict exists: explicit exit/switch/create language, an out-of-scope request, a different task artifact or archive target, a new independent deliverable, a contract-changing request, or evidence pollution risk. A contract-changing request under `selected_task` routes to that selected task's Planning flow unless the user explicitly switches or creates another task.
216
+
217
+ ### Upgrade / Downgrade Rules
218
+
219
+ - No Task -> Micro-Grill when the turn needs structured clarification or a decision tree before work can be safely classified.
220
+ - Micro-Grill -> Lite/Full when the outcome needs persistent task artifacts, repo edits, validation evidence, quality gates, or archive.
221
+ - Lite -> Full when scope touches shared contracts, multi-file behavior, framework semantics, platform/runtime/capability assumptions, `verification_profile`, `quality_gates`, or rollback-sensitive validation.
222
+ - Full -> Parent/Child only when the work has independent deliverables, staged execution, parallel execution, or Parent-controlled final integration needs.
223
+
224
+ Before executing an upgrade that creates artifacts, changes task mode, adds gates, changes `verification_profile` or capabilities, or changes approval requirements, get explicit user confirmation. Every downgrade needs explicit user confirmation because it reduces artifact, gate, validation, or approval rigor.
225
+
226
+ ### Task Ladder quick routing
227
+
228
+ | Situation | Action |
229
+ |-----------|--------|
230
+ | No selected task + small unclear ask | `trellis-micro-grill` |
231
+ | No selected task + need dashboard | `trellis-start` |
232
+ | Selected task + resume step | `trellis-continue` |
233
+ | Planning / PRD | `trellis-brainstorm` |
234
+ | Parent with parallel children | `generate-child-prompt --mode subagent`; writable Agent; see `.trellis/spec/guides/cursor-subagent-policy.md` |
235
+
236
+ Details: archived `06-15-child-phase3-task-ladder` → `research/task-ladder-iteration.md`.
237
+
238
+ ### Planning Artifacts
239
+
240
+ - `prd.md` — requirements, constraints, and acceptance criteria. Do not put technical design or execution checklists here.
241
+ - `design.md` — technical design for complex tasks: boundaries, contracts, data flow, tradeoffs, compatibility, rollout / rollback shape.
242
+ - `implement.md` — execution plan for complex tasks: ordered checklist, Development Strategy Contract, validation commands, review gates, and rollback points.
243
+ - `implement.jsonl` / `check.jsonl` — spec and research manifests for sub-agent context. They do not replace `implement.md`.
244
+ - `verification_profile` / `quality_gates` — gate policy belongs in task artifacts and `task.json`; `task.json.quality_gate_results` is compact machine-checkable state, not human review prose.
245
+ - Lightweight tasks may be PRD-only. Complex tasks must have `prd.md`, `design.md`, and `implement.md` before `task.py start-execution --check`.
246
+ - `start-execution` planning gates (`requirements-review`, `architecture-review` when enabled) auto-record on `--approved` when artifacts pass CLI checks; use `record-gate` only as a manual override.
247
+
248
+ ### Parent / Child Task Trees
249
+
250
+ Use a parent task when one user request contains several independently verifiable deliverables. The parent task owns the source requirement set, the task map, cross-child acceptance criteria, and final integration review; it normally should not be the implementation target unless it also has direct work.
251
+
252
+ Use child tasks for deliverables that can be planned, implemented, checked, and archived independently. Parent/child structure is not a dependency system: if one child must wait for another, write that ordering in the child `prd.md` / `implement.md` and keep each child's acceptance criteria testable.
253
+
254
+ Create new children with `task.py create "<title>" --slug <name> --parent <parent-dir>`. Link existing tasks with `task.py add-subtask <parent> <child>`, and unlink mistakes with `task.py remove-subtask <parent> <child>`.
255
+
256
+ Child Workers report only Child-owned progress states with `task.py set-child-state`: `open`, `working`, `blocked`, or `review`. Parent-controlled setup and decisions use `task.py prepare-child-worktree` and `task.py integrate-child`: `changes`, `accepted`, `integrating`, `integrated`, or `cancelled`. Parent integration requires reviewed evidence, Child `verify.md` / `handoff.md`, and a short `--ref` for accepted/integrating/integrated states. Default Parent `merge_limit: 1` blocks more than one Child from being `integrating` at the same time.
257
+
258
+ Integration is Parent/Child-only. Ordinary Lite and Full Tasks skip Integration and go from Verification / Review to Archive / Learning checks. A Child can provide evidence and request review, but cannot mark itself `changes`, `accepted`, `integrating`, `integrated`, or `cancelled`; only the Parent has integration authority. Parent integration is serial Git-ref integration by default: Child worktrees are prepared explicitly, Child decisions carry refs, `integrate-child ... integrated --execute-merge` runs an explicit no-commit merge when requested, and every decision respects `merge_limit: 1` and writes conflicts, merge decisions, and acceptance rationale to `task-map.md` Event Log.
259
+
260
+ ### Parent reviewer orchestration (inline or optional subagent)
261
+
262
+ Parent sessions can productize child dispatch and review without a new agent runtime:
263
+
264
+ ```bash
265
+ python3 ./.trellis/scripts/task.py parent-status <parent-task>
266
+ python3 ./.trellis/scripts/task.py generate-child-prompt <parent-task> <child-task> --mode inline
267
+ python3 ./.trellis/scripts/task.py review-child <parent-task> <child-task> --check --decision accept --ref <child-ref>
268
+ python3 ./.trellis/scripts/task.py review-child <parent-task> <child-task> --decision accept --ref <child-ref>
269
+ python3 ./.trellis/scripts/task.py review-child <parent-task> <child-task> --decision integrate-through --ref <child-ref>
270
+ ```
271
+
272
+ - `generate-child-prompt` reads parent `task-map.md` for `depends_on` and `touches`, child artifacts, and optional parent `child-prompts.md`. Use `--mode subagent` only as a delivery hint when the platform can spawn subagents; inline mode remains the portable default.
273
+ - `review-child` summarizes child `verify.md` / `handoff.md`, appends notes to parent `verify.md`, and can advance `accepted` / `integrating` / `integrated` in one flow (`--decision integrate-through`) while still using the same Stage 0 integration guards as `integrate-child`.
274
+ - Reviewer quality gates (`child-review`, `parent-accepted`, `parent-integrated`) are **not** auto-recorded; the command prints optional `record-gate` hints only.
275
+
276
+ <!-- Per-turn breadcrumb: shown when no task is selected (before Phase 1) -->
277
+
278
+ [workflow-state:no_task]
279
+ Trellis framework active. Selected task: none. Use `task.py dashboard` for routing; do not auto-select an existing task.
280
+ MANDATORY TRIAGE (hard gate, not optional): every work-capable turn must be classified FIRST, before any action, into No Task / Micro-Grill / Lite Task / Full Task / Parent Task — see "Request Triage" in workflow.md for the decision tree. Emit the classification as the first line of your reply: `[Triage: <Mode>] <one-sentence reason citing the trigger signal>`. If you cannot classify, you have not understood the request — ask a clarifying question instead of starting work.
281
+ After classifying into any mode that creates a task, ask the user for task-creation consent before creating any Trellis artifact. User consent to create a task is NOT consent to start implementation — planning still happens first.
282
+ Underspecified small request with no task: load `trellis-micro-grill` before creating artifacts or upgrading the ladder.
283
+ Framework refresh with no selected task: load `trellis-start` once; after the user selects a task, use `trellis-continue` for step-level resume—not `trellis-start`.
284
+ [/workflow-state:no_task]
285
+
286
+ ### Phase 1: Plan
287
+ - 1.0 Create task `[required · once]` (only after task-creation consent)
288
+ - 1.1 Requirement exploration `[required · repeatable]` (`prd.md`; complex tasks also need `design.md` + `implement.md`)
289
+ - 1.2 Research `[optional · repeatable]`
290
+ - 1.3 Configure context `[conditional · once]` — Claude Code, Cursor, OpenCode, Codex, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi
291
+ - 1.4 Execution gate `[required · once]` (`task.py start-execution <task> --check`, explicit approval, then `--approved`; status → in_progress)
292
+ - 1.5 Completion criteria
293
+
294
+ <!-- Per-turn breadcrumb: shown throughout Phase 1 (status='planning') -->
295
+
296
+ [workflow-state:planning]
297
+ Load `trellis-brainstorm`; stay in planning.
298
+ Lightweight: `prd.md` can be enough. Complex: finish `prd.md`, `design.md`, and `implement.md`; run `task.py start-execution <task> --check`, report PASS with task plus current contract/fingerprint context, and ask for explicit execution approval before `--approved`.
299
+ Multi-deliverable scope: consider a parent task plus independently verifiable child tasks; dependencies must be written in child artifacts, not implied by tree position.
300
+ Sub-agent mode: curate `implement.jsonl` and `check.jsonl` as spec/research manifests before start.
301
+ [/workflow-state:planning]
302
+
303
+ <!-- Per-turn breadcrumb: shown throughout Phase 1 when codex.dispatch_mode=inline.
304
+ Codex-only opt-in alternate to [workflow-state:planning]. The main agent
305
+ edits code directly in Phase 2, so jsonl curation is skipped —
306
+ the inline workflow loads `trellis-before-dev` instead of injecting JSONL
307
+ into a sub-agent. -->
308
+
309
+ [workflow-state:planning-inline]
310
+ Load `trellis-brainstorm`; stay in planning.
311
+ Lightweight: `prd.md` can be enough. Complex: finish `prd.md`, `design.md`, and `implement.md`; run `task.py start-execution <task> --check`, report PASS with task plus current contract/fingerprint context, and ask for explicit execution approval before `--approved`.
312
+ Multi-deliverable scope: consider a parent task plus independently verifiable child tasks; dependencies must be written in child artifacts, not implied by tree position.
313
+ Inline mode: skip jsonl curation; Phase 2 reads artifacts/specs via `trellis-before-dev`.
314
+ [/workflow-state:planning-inline]
315
+
316
+ ### Phase 2: Execute
317
+ - 2.1 Implement `[required · repeatable]`
318
+ - 2.2 Quality check `[required · repeatable]`
319
+ - 2.3 Rollback `[on demand]`
320
+
321
+ <!-- Per-turn breadcrumb: shown while status='in_progress'.
322
+ Scope: all of Phase 2 + Phase 3.1-3.4 (status stays 'in_progress' from
323
+ start-execution --approved until task.py archive; only archive flips it). The body
324
+ therefore must cover every required step from implementation through
325
+ commit, including Phase 3.3 learning decision and Phase 3.4 commit. -->
326
+
327
+ Sub-agent dispatch protocol applies to all platforms and all sub-agents, including class-2 Codex/Copilot/Gemini/Qoder and `trellis-research`: every dispatch prompt starts with `Selected task: <task path from task.py selected>` before role-specific instructions.
328
+
329
+ [workflow-state:in_progress]
330
+ Tools: `trellis-implement` / `trellis-research` are sub-agent types only (Task/Agent tool, NOT Skill; there is no skill by these names). `trellis-update-spec` is a skill for durable learning only. `trellis-check` exists as both; prefer the Agent form when verifying after code changes.
331
+ Flow: `trellis-implement` -> `trellis-check` -> validation/evidence in `verify.md` -> learning decision -> commit (Phase 3.4) -> `task.py archive <task> --check` -> `/trellis:finish-work`.
332
+ Execution boundary: implement only inside approved `prd.md`, `design.md`, `implement.md`, and Development Strategy Contract; stop and Return-to-Planning for scope, contract, gate, capability/runtime, Parent `contract_epoch`, Child boundary, selected-task fit, or non-implementation reviewer-gate changes.
333
+ Main-session default: dispatch implement/check sub-agents. Sub-agent self-exemption: if already running as `trellis-implement`, do NOT spawn another `trellis-implement` or `trellis-check`; if already running as `trellis-check`, do NOT spawn another `trellis-check` or `trellis-implement`. Dispatch is main session only.
334
+ Class-2 platforms (Codex, Copilot, Gemini, Qoder) use the same dispatch prefix because they may not receive selected-task context through a pre-tool hook.
335
+ Dispatch prompt starts with `Selected task: <task path from task.py selected>`. Read context: jsonl entries -> `prd.md` -> `design.md if present` -> `implement.md if present`.
336
+ [/workflow-state:in_progress]
337
+
338
+ <!-- Per-turn breadcrumb: shown while status='in_progress' when
339
+ codex.dispatch_mode=inline. Codex-only opt-in alternate to
340
+ [workflow-state:in_progress]. The main session edits code directly
341
+ instead of dispatching sub-agents. -->
342
+
343
+ [workflow-state:in_progress-inline]
344
+ Flow: `trellis-before-dev` -> edit -> `trellis-check` -> validation/evidence in `verify.md` -> learning decision -> commit (Phase 3.4) -> `task.py archive <task> --check` -> `/trellis:finish-work`.
345
+ Execution boundary: edit only inside approved `prd.md`, `design.md`, `implement.md`, and Development Strategy Contract; stop and Return-to-Planning for scope, contract, gate, capability/runtime, Parent `contract_epoch`, Child boundary, selected-task fit, or non-implementation reviewer-gate changes.
346
+ Do not dispatch implement/check sub-agents in inline mode.
347
+ Read context: `prd.md` -> `design.md if present` -> `implement.md if present`, plus relevant spec/research loaded by skills.
348
+ [/workflow-state:in_progress-inline]
349
+
350
+ ### Phase 3: Finish
351
+ - 3.1 Quality verification `[required · repeatable]`
352
+ - 3.2 Debug retrospective `[on demand]`
353
+ - 3.3 Learning decision `[required · once]`
354
+ - 3.4 Commit changes `[required · once]`
355
+ - 3.5 Wrap-up reminder
356
+
357
+ <!-- Per-turn breadcrumb: shown while status='completed'.
358
+ Currently DEAD in normal flow: cmd_archive writes status='completed' in
359
+ the same call that moves the task dir to archive/, so the selected-task
360
+ resolver loses the pointer and the hook never fires on archived tasks.
361
+ Block preserved for a future status-transition redesign (e.g. an
362
+ explicit in_progress→completed command). Edit through the same spec
363
+ channel as the live blocks. -->
364
+
365
+ [workflow-state:completed]
366
+ Code committed. Run `/trellis:finish-work`; if dirty, return to Phase 3.4 first.
367
+ [/workflow-state:completed]
368
+
369
+ ### Rules
370
+
371
+ 1. Identify which Phase you're in, then continue from the next step there
372
+ 2. Run steps in order inside each Phase; `[required]` steps can't be skipped
373
+ 3. Phases can roll back (e.g., Execute reveals a prd defect → return to Plan to fix, then re-enter Execute)
374
+ 4. Steps tagged `[once]` are skipped if the output already exists; don't re-run
375
+ 5. Artifact presence informs the next step; missing `design.md` / `implement.md` is valid for lightweight tasks and incomplete planning for complex tasks.
376
+ 6. Return-to-Planning triggers must refresh affected artifacts, gates, fingerprints, and explicit execution approval before Execution resumes.
377
+
378
+ ### Active Task Routing
379
+
380
+ When a user request matches one of these intents inside a selected task, route first, then load the detailed phase step if needed.
381
+
382
+ [Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi]
383
+
384
+ - Planning or unclear requirements -> `trellis-brainstorm`.
385
+ - `in_progress` implementation/check -> dispatch `trellis-implement` / `trellis-check`.
386
+ - Repeated debugging -> `trellis-break-loop`; spec updates -> `trellis-update-spec`.
387
+
388
+ [/Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi]
389
+
390
+ [codex-inline, Kilo, Antigravity, Windsurf]
391
+
392
+ - Planning or unclear requirements -> `trellis-brainstorm`.
393
+ - Before editing -> `trellis-before-dev`; after editing -> `trellis-check`.
394
+ - Repeated debugging -> `trellis-break-loop`; spec updates -> `trellis-update-spec`.
395
+
396
+ [/codex-inline, Kilo, Antigravity, Windsurf]
397
+
398
+ ### Guardrails
399
+
400
+ - Task creation approval is not implementation approval; implementation waits for passing `task.py start-execution <task> --check`, explicit user execution approval, and `task.py start-execution <task> --approved`.
401
+ - Planning stops at `task.py start-execution <task> --check` plus an explicit execution-approval request. Planning may not perform implementation edits, mutate execution status, start child execution, integrate children, archive, or claim completion.
402
+ - Ordinary conversational confirmations such as "confirm", "agree", "ok", or "start" are not execution authorization unless they answer the explicit execution-approval prompt after a passing `--check`.
403
+ - PRD-only is valid for lightweight tasks; complex tasks need `design.md` + `implement.md`.
404
+ - Planning must be persisted to task artifacts; checks must run before reporting completion.
405
+ - `verify.md` is the human-readable evidence center. `task.json.quality_gate_results` stores compact machine-checkable gate summaries and references only.
406
+
407
+ ### Return-to-Planning
408
+
409
+ Return to Planning when continued execution would change the approved contract: PRD scope or acceptance criteria, design boundary, dependency, rollback, or validation strategy, Development Strategy Contract, `quality_gates`, `verification_profile`, capability/runtime assumptions, Parent `contract_epoch`, Child boundary, selected-task fit, or a non-implementation reviewer-gate root cause.
410
+
411
+ When returning to Planning, update the affected planning artifacts, refresh gate records or fingerprints that depend on them, rerun `task.py start-execution <task> --check`, report the new task and contract/fingerprint context, and ask for explicit execution approval again before `--approved`.
412
+
413
+ Implementation defects inside the already approved contract route back to Execution, not Planning. Validation environment blockers stay in Verification / Review until the environment or evidence path is resolved. Repeated same-issue review/gate loops require escalation to the user instead of silent retries.
414
+
415
+ ### Loading Step Detail
416
+
417
+ At each step, run this to fetch detailed guidance:
418
+
419
+ ```bash
420
+ python3 ./.trellis/scripts/get_context.py --mode phase --step <step>
421
+ # e.g. python3 ./.trellis/scripts/get_context.py --mode phase --step 1.1
422
+ ```
423
+
424
+ ---
425
+
426
+ ## Phase 1: Plan
427
+
428
+ Goal: classify the request, get task-creation consent when a task is needed, and produce the planning artifacts required before implementation.
429
+
430
+ #### 1.0 Create task `[required · once]`
431
+
432
+ Create the task directory only after task-creation consent. The command sets status to `planning`, writes `task.json`, and creates a default `prd.md`. It does not select the task, start execution, or approve execution:
433
+
434
+ ```bash
435
+ python3 ./.trellis/scripts/task.py create "<task title>" --slug <name>
436
+ ```
437
+
438
+ `--slug` is the human-readable name only. Do **not** include the `MM-DD-` date prefix; `task.py create` adds that prefix automatically.
439
+
440
+ For task trees, create the parent task first and then create each child with `--parent <parent-dir>`. Do not start the parent just because children exist; start the child that owns the next independently verifiable deliverable.
441
+
442
+ After creation, select the task only when the user has chosen it for this live session:
443
+
444
+ ```bash
445
+ python3 ./.trellis/scripts/task.py select <task-dir>
446
+ ```
447
+
448
+ After selection, the per-turn breadcrumb switches to `[workflow-state:planning]`, telling the AI to stay in planning.
449
+
450
+ Run only `create` and, when appropriate, `select` here. Do not run `start-execution --approved` until step 1.4 passes its non-mutating `--check` and the user gives explicit execution approval.
451
+
452
+ Skip when the user has already explicitly selected an appropriate task with `python3 ./.trellis/scripts/task.py select <task>`.
453
+
454
+ #### 1.1 Requirement exploration `[required · repeatable]`
455
+
456
+ Load the `trellis-brainstorm` skill and explore requirements interactively with the user per the skill's guidance.
457
+
458
+ The brainstorm skill will guide you to:
459
+ - Ask one question at a time
460
+ - Prefer researching over asking the user
461
+ - Prefer offering options over open-ended questions
462
+ - Update `prd.md` immediately after each user answer
463
+ - Split large scopes into a parent task plus child tasks when the deliverables can be verified independently
464
+ - Keep `prd.md` focused on requirements and acceptance criteria
465
+ - For complex tasks, produce `design.md` and `implement.md` before implementation starts
466
+
467
+ When considering a parent/child split:
468
+ - Use a parent task when one request contains several independently verifiable deliverables.
469
+ - Parent tasks own source requirements, child-task mapping, cross-child acceptance criteria, and final integration review.
470
+ - Child tasks own actual deliverables that can be planned, implemented, checked, and archived independently.
471
+ - Parent/child structure is not a dependency system. If child B depends on child A, write that ordering in child B's `prd.md` / `implement.md`.
472
+ - Start the child task that owns the next deliverable. Do not start the parent unless the parent itself has direct implementation work.
473
+
474
+ Return to this step whenever requirements change and revise the relevant artifact.
475
+
476
+ #### 1.2 Research `[optional · repeatable]`
477
+
478
+ Research can happen at any time during requirement exploration. It isn't limited to local code — you can use any available tool (MCP servers, skills, web search, etc.) to look up external information, including third-party library docs, industry practices, API references, etc.
479
+
480
+ [Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi]
481
+
482
+ Spawn the research sub-agent:
483
+
484
+ - **Agent type**: `trellis-research`
485
+ - **Task description**: Research <specific question>
486
+ - **Key requirement**: Research output MUST be persisted to `{TASK_DIR}/research/`
487
+
488
+ [/Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi]
489
+
490
+ [codex-inline, Kilo, Antigravity, Windsurf]
491
+
492
+ Do the research in the main session directly and write findings into `{TASK_DIR}/research/`. (For `codex-inline` this avoids the `fork_turns="none"` isolation that prevents `trellis-research` sub-agents from resolving the selected task path.)
493
+
494
+ [/codex-inline, Kilo, Antigravity, Windsurf]
495
+
496
+ **Retrieval during research**:
497
+ - Use `python3 ./.trellis/scripts/search_artifacts.py --query "<topic>" --json` to find durable Trellis specs, prior tasks, research, verification notes, and workspace journals before re-discovering framework context.
498
+ - Use `codebase-retrieval` evidence levels for source-code questions: adapter output is candidate evidence until current source, Git, or validation confirms it.
499
+ - Persist useful exploratory retrieval chains, adapter availability, and competing hypotheses under `{TASK_DIR}/research/`.
500
+
501
+ **Research artifact conventions**:
502
+ - One file per research topic (e.g. `research/auth-library-comparison.md`)
503
+ - Record third-party library usage examples, API references, version constraints in files
504
+ - Note relevant spec file paths you discovered for later reference
505
+ - Optional reusable-research frontmatter can make findings easier to rediscover:
506
+ ```markdown
507
+ ---
508
+ doc_type: research
509
+ status: active
510
+ confidence: medium
511
+ scope: authentication
512
+ related_files:
513
+ - src/auth/login.ts
514
+ ---
515
+ ```
516
+ - Recommended reusable-research sections: Quick Answer, Key Evidence, Details, Risks / Open Questions, Next Steps
517
+ - Evidence claims should include file paths, commands, URLs, or validation output when available
518
+
519
+ Brainstorm and research can interleave freely — pause to research a technical question, then return to talk with the user.
520
+
521
+ **Key principle**: Research output must be written to files, not left only in the chat. Conversations get compacted; files don't.
522
+
523
+ #### 1.3 Configure context `[required · once]`
524
+
525
+ [Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi]
526
+
527
+ Curate `implement.jsonl` and `check.jsonl` so the Phase 2 sub-agents get the right spec/research context. These files were seeded on `task create` with a single self-describing `_example` line; your job here is to fill in real entries.
528
+
529
+ **Location**: `{TASK_DIR}/implement.jsonl` and `{TASK_DIR}/check.jsonl` (already exist).
530
+
531
+ **Format**: one JSON object per line — `{"file": "<path>", "reason": "<why>"}`. Paths are repo-root relative.
532
+
533
+ **What to put in**:
534
+ - **Spec files** — `.trellis/spec/<package>/<layer>/index.md` and any specific guideline files (`error-handling.md`, `conventions.md`, etc.) relevant to this task
535
+ - **Research files** — `{TASK_DIR}/research/*.md` that the sub-agent will need to consult
536
+
537
+ **What NOT to put in**:
538
+ - Code files (`src/**`, `packages/**/*.ts`, etc.) — those are read by the sub-agent during implementation, not pre-registered here
539
+ - Files you're about to modify — same reason
540
+
541
+ **Split between the two files**:
542
+ - `implement.jsonl` → specs + research the implement sub-agent needs to write code correctly
543
+ - `check.jsonl` → specs for the check sub-agent (quality guidelines, check conventions, same research if needed)
544
+
545
+ These manifests do not replace `implement.md`. `implement.md` is the human-readable execution plan for a complex task; jsonl files only list context files to inject or load.
546
+
547
+ **How to discover relevant specs**:
548
+
549
+ ```bash
550
+ python3 ./.trellis/scripts/get_context.py --mode packages
551
+ ```
552
+
553
+ Lists every package + its spec layers with paths. Pick the entries that match this task's domain.
554
+
555
+ Use artifact search when prior task/research evidence is likely relevant:
556
+
557
+ ```bash
558
+ python3 ./.trellis/scripts/search_artifacts.py --query "<topic>" --json
559
+ ```
560
+
561
+ Add any reusable `{TASK_DIR}/research/*.md` files you discovered when sub-agents need them.
562
+
563
+ **How to append entries**:
564
+
565
+ Either edit the jsonl file directly in your editor, or use:
566
+
567
+ ```bash
568
+ python3 ./.trellis/scripts/task.py add-context "$TASK_DIR" implement "<path>" "<reason>"
569
+ python3 ./.trellis/scripts/task.py add-context "$TASK_DIR" check "<path>" "<reason>"
570
+ ```
571
+
572
+ Delete the seed `_example` line once real entries exist (optional — it's skipped automatically by consumers).
573
+
574
+ Skip when: `implement.jsonl` and `check.jsonl` have agent-curated entries (the seed row alone doesn't count).
575
+
576
+ [/Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi]
577
+
578
+ [codex-inline, Kilo, Antigravity, Windsurf]
579
+
580
+ Skip this step. Context is loaded directly by the `trellis-before-dev` skill in Phase 2.
581
+
582
+ [/codex-inline, Kilo, Antigravity, Windsurf]
583
+
584
+ #### 1.4 Execution gate `[required · once]`
585
+
586
+ After artifact review, run the non-mutating execution preflight:
587
+
588
+ ```bash
589
+ python3 ./.trellis/scripts/task.py start-execution <task-dir> --check
590
+ ```
591
+
592
+ For lightweight tasks, `prd.md` can be enough. For complex tasks, `prd.md`, `design.md`, and `implement.md` must exist and be reviewed before execution approval. On sub-agent-capable platforms, curate jsonl manifests when extra spec or research context is needed; seed-only manifests are tolerated by consumers.
593
+
594
+ If `--check` passes, report that artifact gates are ready and include the task name/path plus current contract/fingerprint context. Then ask the user for explicit execution approval and state that approval permits `task.py start-execution <task-dir> --approved`. Ordinary agreement such as "confirm", "agree", "ok", or "start" before this preflight is not execution approval.
595
+
596
+ Only after the user approves execution in that context, run:
597
+
598
+ ```bash
599
+ python3 ./.trellis/scripts/task.py start-execution <task-dir> --approved
600
+ ```
601
+
602
+ After this command succeeds, the breadcrumb switches to `[workflow-state:in_progress]`, and the rest of Phase 2 / 3 follows.
603
+
604
+ #### 1.5 Completion criteria
605
+
606
+ | Condition | Required |
607
+ |------|:---:|
608
+ | `prd.md` exists | ✅ |
609
+ | `task.py start-execution <task> --check` passes | ✅ |
610
+ | User explicitly approves execution after the passing preflight is reported | ✅ |
611
+ | `task.py start-execution <task> --approved` has been run (status = in_progress) | ✅ |
612
+ | `research/` has artifacts (complex tasks) | recommended |
613
+ | `design.md` exists (complex tasks) | ✅ |
614
+ | `implement.md` exists (complex tasks) | ✅ |
615
+
616
+ [Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi]
617
+
618
+ | `implement.jsonl` / `check.jsonl` curated when extra spec or research context is needed | recommended |
619
+
620
+ [/Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi]
621
+
622
+ ---
623
+
624
+ ## Phase 2: Execute
625
+
626
+ Goal: turn reviewed planning artifacts into code that passes quality checks.
627
+
628
+ Execution is bounded by the approved `prd.md`, `design.md`, `implement.md`, and Development Strategy Contract. Follow the contract's `execution_mode`, `verification_profile`, and `quality_gates`; do not global-reclassify the request, auto-switch selected tasks, auto-create new task scope, or edit planning artifacts to change scope, design, or contract while pretending execution is still approved.
629
+
630
+ Stop Execution and Return-to-Planning for PRD scope/acceptance changes, design boundary/dependency/rollback/validation changes, Development Strategy Contract changes, quality gate changes, capability/runtime assumption changes, Parent `contract_epoch` changes, Child boundary changes, selected-task scope mismatch, or non-implementation reviewer-gate failures. Refresh gates/fingerprints and get explicit approval before continuing.
631
+
632
+ Implementation defects inside the approved contract remain Execution work: fix them in Phase 2, update `verify.md` evidence, and re-run validation without changing the approved contract.
633
+
634
+ #### 2.1 Implement `[required · repeatable]`
635
+
636
+ Use retrieval layers before and during implementation when context is incomplete:
637
+ - `python3 ./.trellis/scripts/search_artifacts.py --query "<topic>" --json` for durable Trellis specs, prior task artifacts, research, verification notes, and journals.
638
+ - `codebase-retrieval` evidence levels for source claims: candidate -> corroborated candidate -> verified claim; unresolved or unavailable adapters must be reported instead of treated as proof.
639
+ - Record exploratory chains in `{TASK_DIR}/research/` and final source/Git/test proof in `verify.md`.
640
+
641
+ [Claude Code, Cursor, OpenCode, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi]
642
+
643
+ Spawn the implement sub-agent:
644
+
645
+ - **Agent type**: `trellis-implement`
646
+ - **Task description**: Implement the reviewed task artifacts, consulting materials under `{TASK_DIR}/research/`; finish by running project lint and type-check
647
+ - **Dispatch prompt guard**: Tell the spawned agent it is already the `trellis-implement` sub-agent and must implement directly, not spawn another `trellis-implement` / `trellis-check`.
648
+
649
+ The platform hook/plugin auto-handles:
650
+ - Reads `implement.jsonl` and injects referenced spec/research files into the agent prompt
651
+ - Injects `prd.md`, `design.md` if present, and `implement.md` if present
652
+
653
+ [/Claude Code, Cursor, OpenCode, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi]
654
+
655
+ [codex-sub-agent]
656
+
657
+ Spawn the implement sub-agent:
658
+
659
+ - **Agent type**: `trellis-implement`
660
+ - **Task description**: Implement the reviewed task artifacts, consulting materials under `{TASK_DIR}/research/`; finish by running project lint and type-check
661
+ - **Dispatch prompt guard**: The prompt MUST start with `Selected task: <task path>`, then explicitly say the spawned agent is already `trellis-implement` and must implement directly without spawning another `trellis-implement` / `trellis-check`.
662
+
663
+ The Codex sub-agent definition auto-handles the context load requirement:
664
+ - Resolves the selected task with `task.py selected --source`, then reads `prd.md`, `design.md` if present, and `implement.md` if present
665
+ - Reads `implement.jsonl` and requires the agent to load each referenced spec/research file before coding
666
+
667
+ [/codex-sub-agent]
668
+
669
+ [Kiro]
670
+
671
+ Spawn the implement sub-agent:
672
+
673
+ - **Agent type**: `trellis-implement`
674
+ - **Task description**: Implement the reviewed task artifacts, consulting materials under `{TASK_DIR}/research/`; finish by running project lint and type-check
675
+ - **Dispatch prompt guard**: Tell the spawned agent it is already the `trellis-implement` sub-agent and must implement directly, not spawn another `trellis-implement` / `trellis-check`.
676
+
677
+ The platform prelude auto-handles the context load requirement:
678
+ - Reads `implement.jsonl` and injects referenced spec/research files into the agent prompt
679
+ - Injects `prd.md`, `design.md` if present, and `implement.md` if present
680
+
681
+ [/Kiro]
682
+
683
+ [codex-inline, Kilo, Antigravity, Windsurf]
684
+
685
+ 1. Load the `trellis-before-dev` skill to read project guidelines
686
+ 2. Read `{TASK_DIR}/prd.md`, then `design.md` if present, then `implement.md` if present
687
+ 3. Consult materials under `{TASK_DIR}/research/`
688
+ 4. Implement the code per reviewed artifacts
689
+ 5. Run project lint and type-check
690
+
691
+ [/codex-inline, Kilo, Antigravity, Windsurf]
692
+
693
+ #### 2.2 Quality check `[required · repeatable]`
694
+
695
+ [Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi]
696
+
697
+ Spawn the check sub-agent:
698
+
699
+ - **Agent type**: `trellis-check`
700
+ - **Task description**: Review all code changes against specs and task artifacts; fix implementation defects only inside the approved contract; route contract-changing findings instead of silently expanding scope; ensure lint and type-check pass
701
+ - **Dispatch prompt guard**: Tell the spawned agent it is already the `trellis-check` sub-agent and must review/fix only inside the approved contract, not spawn another `trellis-check` / `trellis-implement`.
702
+
703
+ The check agent's job:
704
+ - Review code changes against specs
705
+ - Review code changes against `prd.md`, `design.md` if present, and `implement.md` if present
706
+ - Fix implementation defects only when they stay inside the approved contract
707
+ - Route requirement, design, contract, scope, gate, capability, runtime, Parent `contract_epoch`, or Child boundary defects to Return-to-Planning
708
+ - Run lint and typecheck to verify
709
+
710
+ [/Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi]
711
+
712
+ [codex-inline, Kilo, Antigravity, Windsurf]
713
+
714
+ Load the `trellis-check` skill and verify the code per its guidance:
715
+ - Spec compliance
716
+ - lint / type-check / tests
717
+ - Cross-layer consistency (when changes span layers)
718
+
719
+ If implementation defects are found inside the approved contract -> fix in Execution -> re-check. If findings change requirements, design, contract, scope, gates, or capability/runtime assumptions -> Return-to-Planning.
720
+
721
+ [/codex-inline, Kilo, Antigravity, Windsurf]
722
+
723
+ #### 2.3 Rollback `[on demand]`
724
+
725
+ - `check` reveals a PRD, design, contract, scope, gate, capability/runtime, Parent `contract_epoch`, or Child boundary defect → Return-to-Planning, refresh gates/fingerprints, and get explicit approval again
726
+ - Implementation went wrong → revert code, redo 2.1
727
+ - Need more research → research (same as Phase 1.2), write findings into `research/`
728
+
729
+ ---
730
+
731
+ ## Phase 3: Finish
732
+
733
+ Goal: ensure code quality, capture lessons, record the work.
734
+
735
+ #### Evidence scoring (retrieval-pack, explicit)
736
+
737
+ For **complex** tasks, optionally before 3.1 when you have collected retrieval evidence JSON (e.g. after Phase 1.2 smart-search manifests in `{TASK}/research/smart-search/`):
738
+
739
+ `python3 ./.trellis/scripts/get_context.py --mode retrieval-pack --json --input <path-to-evidence.json>`
740
+
741
+ Use `contextPack.selected` / `scoredEvidence` to order citations in `verify.md`. Do **not** expect scoring in default `get_context --json`.
742
+
743
+ #### 3.1 Quality verification `[required · repeatable]`
744
+
745
+ Verification / Review is evidence and judgment, not a hidden implementation loop. Load the `trellis-check` skill or agent and do a final review:
746
+ - Spec compliance
747
+ - lint / type-check / tests
748
+ - Cross-layer consistency (when changes span layers)
749
+ - Retrieval evidence: final claims must cite current source, Git, or validation proof; unresolved adapter or artifact-search gaps belong in `verify.md`
750
+ - Reviewer gate evidence via `task.py record-gate <task> <transition> <gate> <PASS|FAIL|SKIPPED>` when a configured gate applies
751
+ - Human-readable validation, review, and acceptance evidence in `verify.md`
752
+
753
+ Do not silently implement fixes, expand scope, or edit planning artifacts during Verification / Review. Review-found implementation defects inside the approved contract route back to Execution. Requirement, design, contract, scope, gate-configuration, capability/runtime, Parent `contract_epoch`, or Child boundary defects route back to Planning. Validation environment blockers stay in Verification / Review with explicit blocker evidence.
754
+
755
+ `verify.md` is the evidence center for humans. `task.json.quality_gate_results` should contain only compact machine-checkable results, fingerprints, timestamps, reviewer ids, evidence references, and root-cause metadata.
756
+
757
+ #### 3.2 Debug retrospective `[on demand]`
758
+
759
+ If this task involved repeated debugging (the same issue was fixed multiple times), load the `trellis-break-loop` skill to:
760
+ - Classify the root cause
761
+ - Explain why earlier fixes failed
762
+ - Propose prevention
763
+
764
+ The goal is to capture debugging lessons so the same class of issue doesn't recur.
765
+
766
+ #### 3.3 Learning decision `[required · once]`
767
+
768
+ Review whether this task produced durable learning worth recording:
769
+ - repeated failure loops or debugging lessons;
770
+ - requirement drift, architecture decisions, reusable conventions, or toolchain pitfalls;
771
+ - new project-local patterns that should affect future work.
772
+
773
+ If durable learning exists, load `trellis-update-spec` and update `.trellis/spec/` or write a focused `retrospective.md`, then link that evidence from `verify.md`.
774
+
775
+ If no durable learning exists, write an explicit `No durable learning` decision in `verify.md`. Do not run a spec update only to satisfy ceremony.
776
+
777
+ Before archive, `verify.md` must contain validation evidence, final acceptance evidence, gate/review references when applicable, and the durable-learning decision. Parent tasks with children must also include final integration evidence.
778
+
779
+ #### 3.4 Commit changes `[required · once]`
780
+
781
+ The AI drives a batched commit of this task's code changes so `/finish-work` can run cleanly afterwards. Goal: produce work commits FIRST, then bookkeeping (archive + journal) commits land after — never interleaved.
782
+
783
+ **Step-by-step**:
784
+
785
+ 1. **Inspect dirty state**:
786
+ ```bash
787
+ git status --porcelain
788
+ ```
789
+ Snapshot every dirty path. If the working tree is clean, skip to 3.5.
790
+
791
+ 2. **Learn commit style** from recent history (so drafted messages blend in):
792
+ ```bash
793
+ git log --oneline -5
794
+ ```
795
+ Note the prefix convention (`feat:` / `fix:` / `chore:` / `docs:` ...), language (中文/English), and length style.
796
+
797
+ 3. **Classify dirty files into two groups**:
798
+ - **AI-edited this session** — files you wrote/edited via Edit/Write/Bash tool calls in this session. You know what changed and why.
799
+ - **Unrecognized** — dirty files you did NOT touch this session (could be the user's manual edits, leftover WIP from a previous session, or unrelated work). Do NOT silently include these.
800
+
801
+ 4. **Draft a commit plan**. Group AI-edited files into logical commits (1 commit per coherent change unit, not 1 commit per file). Each entry: `<commit message>` + file list. List unrecognized files separately at the bottom.
802
+
803
+ 5. **Present the plan once, ask for one-shot confirmation**. Format:
804
+ ```
805
+ Proposed commits (in order):
806
+ 1. <message>
807
+ - <file>
808
+ - <file>
809
+ 2. <message>
810
+ - <file>
811
+
812
+ Unrecognized dirty files (NOT in any commit — confirm include/exclude):
813
+ - <file>
814
+ - <file>
815
+
816
+ Reply 'ok' / '行' to execute. Reply with edits, or '我自己来' / 'manual' to abort.
817
+ ```
818
+
819
+ 6. **On confirmation**: run `git add <files>` + `git commit -m "<msg>"` for each batch in order. Do not amend. Do not push.
820
+
821
+ 7. **On rejection** (user replies "不行" / "我自己来" / "manual" / any pushback on the plan): stop. Do not attempt a second plan. The user will commit by hand; you skip ahead to 3.5 once they confirm.
822
+
823
+ **Rules**:
824
+ - No `git commit --amend` anywhere — three-stage three-commit flow (work commits → archive commit → journal commit).
825
+ - Never push to remote in this step.
826
+ - If the user wants different message wording but accepts the file grouping, edit the message and re-confirm once — but if they reject the grouping, exit to manual mode.
827
+ - The batched plan is one prompt; do not prompt per commit.
828
+
829
+ #### 3.5 Archive / Learning
830
+
831
+ Run `task.py archive <task> --check` before the real archive. The check must pass without moving files, changing status, clearing selected-task state, staging or committing, or running hooks.
832
+
833
+ Real completion is only `task.py archive <task>`. It writes `status=completed`, moves the task to `archive/<YYYY-MM>/`, clears selected-task pointers for that task, and runs archive hooks. Passing validation, user acceptance, reviewer gates, or writing `verify.md` alone does not complete the task.
834
+
835
+ Archive readiness by mode:
836
+
837
+ | Mode | Archive readiness |
838
+ |---|---|
839
+ | No Task | No archive; upgrade to a durable task mode before archive is possible. |
840
+ | Micro-Grill | No archive unless upgraded into Lite, Full, or Parent/Child. |
841
+ | Lite | `verify.md` has validation evidence, final acceptance evidence, and durable-learning decision evidence. |
842
+ | Full | Lite evidence plus required completion gates, fresh fingerprints, and no unresolved required `FAIL` gates. |
843
+ | Child | Lite/Full evidence plus Parent task-map marks the Child `integrated` or `cancelled`; integrated Children include `handoff.md`. |
844
+ | Parent | Full evidence plus every Child is `integrated` or `cancelled`, with final integration evidence. |
845
+
846
+ Archive / Learning is terminal. After archive, do not silently mutate archived task artifacts; follow-up work requires a new task unless the user explicitly approves an archive amendment.
847
+
848
+ If archive is not being run in this session, report the passing or failing archive check and the remaining evidence gaps.
849
+
850
+ ---
851
+
852
+ ## Release readiness and release execution
853
+
854
+ Package and CLI releases use **two tasks** (or two explicit phases with separate evidence). Readiness is non-mutating; execution requires explicit user approval before any remote mutation.
855
+
856
+ ### When to split
857
+
858
+ | Task type | Purpose | Remote mutations |
859
+ | --- | --- | --- |
860
+ | **Release readiness** | Version recommendation, changelog, manifest notes, build/test/typecheck, pack dry-run, prepublish blockers | **None** — no publish, tag, push, or version bump |
861
+ | **Release execution** | Preflight immediately before publish; run approved `release.js` / `npm publish` / tag / push; post-publish smoke | **Only after explicit user approval** in the execution task |
862
+
863
+ Templates: `.trellis/tasks/templates/release-readiness/` and `.trellis/tasks/templates/release-execution/`. Copy `prd.md`, `design.md`, and `implement.md` into a new task directory; use `handoff-template.md` as the outline for `handoff.md`.
864
+
865
+ ### Release status vocabulary (handoff / verify)
866
+
867
+ These labels describe **release posture** in `handoff.md` and `verify.md`. They are not `task.json.status` values (contract epoch 1).
868
+
869
+ | Label | Typical task |
870
+ | --- | --- |
871
+ | **ready to publish** | Readiness — evidence complete; operator may proceed after approval |
872
+ | **not published** | Readiness or aborted execution — no remote release in this task |
873
+ | **published** | Execution — registry and/or git remote actions completed |
874
+ | **blocked** | Required gate failed; do not publish until fixed or waived |
875
+ | **waived** | User explicitly accepted a known blocker (name approver + rationale) |
876
+ | **deferred** | Publish postponed by user (e.g. wait for dogfood / another child) |
877
+
878
+ Readiness `handoff.md` must include **Ready to publish**, **Not published**, and **Blockers**. Execution `handoff.md` must include **Published** (or **Not published** if aborted) and **Publish approval evidence** in `verify.md`.
879
+
880
+ ### Standard evidence (readiness `verify.md`)
881
+
882
+ - Version recommendation (current → proposed; channel; npm dist-tag expectation)
883
+ - Changelog / release notes (draft)
884
+ - Migration manifest (id or none)
885
+ - Build evidence, test evidence, pack dry-run evidence
886
+ - Prepublish blockers with disposition: `blocking` / `fixed` / `waived` / `deferred`
887
+
888
+ Dry-run examples for `@blxzer/cursor-trellis` (from `packages/cli`): `check-manifest-continuity.js`, `release-preflight.js check-versions`, `publish-plan`, `verify-packed-cli`, `npm pack --dry-run`. Do not run `release.js`, `npm publish`, or `git push` during readiness.
889
+
890
+ ### Execution approval gate
891
+
892
+ Before `release.js`, `npm publish`, `git tag`, `git push`, or GitHub release creation, stop and obtain **explicit user approval**. Record in execution `verify.md` under **Publish approval evidence** (approved version, dist-tag, and which remote actions are allowed). Passing preflight is not approval.
893
+
894
+ See also `.trellis/spec/Trellis/cli/release-and-vendor.md`.
895
+
896
+ ---
897
+
898
+ ## Customizing Trellis (for forks)
899
+
900
+ This section is for developers who want to modify the Trellis workflow itself. All customization is done by editing this file; the scripts are parsers only.
901
+
902
+ ### Changing what a step means
903
+
904
+ Edit the corresponding step's walkthrough body in the Phase 1 / 2 / 3 sections above. Critical invariants:
905
+ - No selected task must use framework/dashboard routing, then triage and ask for task-creation consent before creating a Trellis task.
906
+ - Planning must distinguish lightweight PRD-only tasks from complex tasks that require `prd.md`, `design.md`, and `implement.md` before start.
907
+ - Every required execution path must keep the Phase 3.4 commit reminder reachable before `/trellis:finish-work`.
908
+
909
+ All tag blocks live in the `## Phase Index` section above, immediately after each phase summary:
910
+
911
+ | Scope | Corresponding tag |
912
+ |---|---|
913
+ | No selected task (before Phase 1) | `[workflow-state:no_task]` (after the Phase Index ASCII art) |
914
+ | All of Phase 1 (task created → ready for implementation) | `[workflow-state:planning]` (after Phase 1 summary) |
915
+ | Codex inline Phase 1 | `[workflow-state:planning-inline]` |
916
+ | Phase 2 + Phase 3.1–3.4 (implementation + check + wrap-up) | `[workflow-state:in_progress]` (after Phase 2 summary) |
917
+ | Codex inline Phase 2 + Phase 3.1–3.4 | `[workflow-state:in_progress-inline]` |
918
+ | After Phase 3.5 (archived) | `[workflow-state:completed]` (after Phase 3 summary; **currently DEAD**) |
919
+
920
+ ### Changing the per-turn prompt text
921
+
922
+ Directly edit the body of the corresponding `[workflow-state:STATUS]` block. After editing, run `trellis update` (if you're a template maintainer) or restart your AI session (if you're customizing your own project) — no script changes required.
923
+
924
+ ### Adding a custom status
925
+
926
+ Add a new block:
927
+
928
+ ```
929
+ [workflow-state:my-status]
930
+ your per-turn prompt text
931
+ [/workflow-state:my-status]
932
+ ```
933
+
934
+ Constraints:
935
+ - STATUS charset: `[A-Za-z0-9_-]+` (underscores and hyphens allowed, e.g. `in-review`, `blocked-by-team`)
936
+ - A lifecycle hook must write `task.json.status` to your custom value, otherwise the tag is never read
937
+ - Lifecycle hooks live in `task.json.hooks.after_*` and bind to one of `after_create / after_start / after_finish / after_archive`
938
+
939
+ ### Adding a lifecycle hook
940
+
941
+ Add a `hooks` field to your `task.json`:
942
+
943
+ ```json
944
+ {
945
+ "hooks": {
946
+ "after_archive": [
947
+ "your-script-or-command-here"
948
+ ]
949
+ }
950
+ }
951
+ ```
952
+
953
+ Supported events: `after_create / after_start / after_archive`. Use `after_archive` for "task is done" notifications. Historical `after_finish` hooks are not part of the selected-task workflow because `task.py finish` no longer exists.
954
+
955
+ ### Full contract
956
+
957
+ For the workflow state machine's runtime contract, the locations of all status writers, pseudo-statuses (`no_task` / `stale_<source_type>`), the hook reachability matrix, and other deep details, see:
958
+
959
+ - `.trellis/spec/cli/backend/workflow-state-contract.md` — runtime contract + writer table + test invariants
960
+ - `.trellis/scripts/inject-workflow-state.py` — actual parser (reads workflow.md only, no embedded text)