@mindfoldhq/trellis 0.6.0-beta.9 → 0.6.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 (328) hide show
  1. package/README.md +49 -49
  2. package/dist/cli/index.d.ts.map +1 -1
  3. package/dist/cli/index.js +36 -0
  4. package/dist/cli/index.js.map +1 -1
  5. package/dist/commands/channel/adapters/claude.d.ts +29 -0
  6. package/dist/commands/channel/adapters/claude.d.ts.map +1 -0
  7. package/dist/commands/channel/adapters/claude.js +203 -0
  8. package/dist/commands/channel/adapters/claude.js.map +1 -0
  9. package/dist/commands/channel/adapters/codex.d.ts +85 -0
  10. package/dist/commands/channel/adapters/codex.d.ts.map +1 -0
  11. package/dist/commands/channel/adapters/codex.js +505 -0
  12. package/dist/commands/channel/adapters/codex.js.map +1 -0
  13. package/dist/commands/channel/adapters/index.d.ts +84 -0
  14. package/dist/commands/channel/adapters/index.d.ts.map +1 -0
  15. package/dist/commands/channel/adapters/index.js +115 -0
  16. package/dist/commands/channel/adapters/index.js.map +1 -0
  17. package/dist/commands/channel/adapters/types.d.ts +33 -0
  18. package/dist/commands/channel/adapters/types.d.ts.map +1 -0
  19. package/dist/commands/channel/adapters/types.js +2 -0
  20. package/dist/commands/channel/adapters/types.js.map +1 -0
  21. package/dist/commands/channel/agent-loader.d.ts +32 -0
  22. package/dist/commands/channel/agent-loader.d.ts.map +1 -0
  23. package/dist/commands/channel/agent-loader.js +154 -0
  24. package/dist/commands/channel/agent-loader.js.map +1 -0
  25. package/dist/commands/channel/context-loader.d.ts +26 -0
  26. package/dist/commands/channel/context-loader.d.ts.map +1 -0
  27. package/dist/commands/channel/context-loader.js +290 -0
  28. package/dist/commands/channel/context-loader.js.map +1 -0
  29. package/dist/commands/channel/context.d.ts +16 -0
  30. package/dist/commands/channel/context.d.ts.map +1 -0
  31. package/dist/commands/channel/context.js +83 -0
  32. package/dist/commands/channel/context.js.map +1 -0
  33. package/dist/commands/channel/create.d.ts +27 -0
  34. package/dist/commands/channel/create.d.ts.map +1 -0
  35. package/dist/commands/channel/create.js +39 -0
  36. package/dist/commands/channel/create.js.map +1 -0
  37. package/dist/commands/channel/dev-parse-trace.d.ts +14 -0
  38. package/dist/commands/channel/dev-parse-trace.d.ts.map +1 -0
  39. package/dist/commands/channel/dev-parse-trace.js +70 -0
  40. package/dist/commands/channel/dev-parse-trace.js.map +1 -0
  41. package/dist/commands/channel/guard.d.ts +150 -0
  42. package/dist/commands/channel/guard.d.ts.map +1 -0
  43. package/dist/commands/channel/guard.js +474 -0
  44. package/dist/commands/channel/guard.js.map +1 -0
  45. package/dist/commands/channel/index.d.ts +3 -0
  46. package/dist/commands/channel/index.d.ts.map +1 -0
  47. package/dist/commands/channel/index.js +531 -0
  48. package/dist/commands/channel/index.js.map +1 -0
  49. package/dist/commands/channel/interrupt.d.ts +10 -0
  50. package/dist/commands/channel/interrupt.d.ts.map +1 -0
  51. package/dist/commands/channel/interrupt.js +22 -0
  52. package/dist/commands/channel/interrupt.js.map +1 -0
  53. package/dist/commands/channel/kill.d.ts +7 -0
  54. package/dist/commands/channel/kill.d.ts.map +1 -0
  55. package/dist/commands/channel/kill.js +121 -0
  56. package/dist/commands/channel/kill.js.map +1 -0
  57. package/dist/commands/channel/list.d.ts +17 -0
  58. package/dist/commands/channel/list.d.ts.map +1 -0
  59. package/dist/commands/channel/list.js +233 -0
  60. package/dist/commands/channel/list.js.map +1 -0
  61. package/dist/commands/channel/messages.d.ts +15 -0
  62. package/dist/commands/channel/messages.d.ts.map +1 -0
  63. package/dist/commands/channel/messages.js +245 -0
  64. package/dist/commands/channel/messages.js.map +1 -0
  65. package/dist/commands/channel/rm.d.ts +27 -0
  66. package/dist/commands/channel/rm.d.ts.map +1 -0
  67. package/dist/commands/channel/rm.js +216 -0
  68. package/dist/commands/channel/rm.js.map +1 -0
  69. package/dist/commands/channel/run.d.ts +30 -0
  70. package/dist/commands/channel/run.d.ts.map +1 -0
  71. package/dist/commands/channel/run.js +130 -0
  72. package/dist/commands/channel/run.js.map +1 -0
  73. package/dist/commands/channel/send.d.ts +11 -0
  74. package/dist/commands/channel/send.d.ts.map +1 -0
  75. package/dist/commands/channel/send.js +24 -0
  76. package/dist/commands/channel/send.js.map +1 -0
  77. package/dist/commands/channel/spawn.d.ts +40 -0
  78. package/dist/commands/channel/spawn.d.ts.map +1 -0
  79. package/dist/commands/channel/spawn.js +244 -0
  80. package/dist/commands/channel/spawn.js.map +1 -0
  81. package/dist/commands/channel/store/events.d.ts +39 -0
  82. package/dist/commands/channel/store/events.d.ts.map +1 -0
  83. package/dist/commands/channel/store/events.js +87 -0
  84. package/dist/commands/channel/store/events.js.map +1 -0
  85. package/dist/commands/channel/store/filter.d.ts +3 -0
  86. package/dist/commands/channel/store/filter.d.ts.map +1 -0
  87. package/dist/commands/channel/store/filter.js +2 -0
  88. package/dist/commands/channel/store/filter.js.map +1 -0
  89. package/dist/commands/channel/store/lock.d.ts +23 -0
  90. package/dist/commands/channel/store/lock.d.ts.map +1 -0
  91. package/dist/commands/channel/store/lock.js +99 -0
  92. package/dist/commands/channel/store/lock.js.map +1 -0
  93. package/dist/commands/channel/store/paths.d.ts +63 -0
  94. package/dist/commands/channel/store/paths.d.ts.map +1 -0
  95. package/dist/commands/channel/store/paths.js +246 -0
  96. package/dist/commands/channel/store/paths.js.map +1 -0
  97. package/dist/commands/channel/store/schema.d.ts +27 -0
  98. package/dist/commands/channel/store/schema.d.ts.map +1 -0
  99. package/dist/commands/channel/store/schema.js +34 -0
  100. package/dist/commands/channel/store/schema.js.map +1 -0
  101. package/dist/commands/channel/store/thread-state.d.ts +5 -0
  102. package/dist/commands/channel/store/thread-state.d.ts.map +1 -0
  103. package/dist/commands/channel/store/thread-state.js +16 -0
  104. package/dist/commands/channel/store/thread-state.js.map +1 -0
  105. package/dist/commands/channel/store/watch.d.ts +19 -0
  106. package/dist/commands/channel/store/watch.d.ts.map +1 -0
  107. package/dist/commands/channel/store/watch.js +146 -0
  108. package/dist/commands/channel/store/watch.js.map +1 -0
  109. package/dist/commands/channel/supervisor/idle.d.ts +46 -0
  110. package/dist/commands/channel/supervisor/idle.d.ts.map +1 -0
  111. package/dist/commands/channel/supervisor/idle.js +72 -0
  112. package/dist/commands/channel/supervisor/idle.js.map +1 -0
  113. package/dist/commands/channel/supervisor/inbox.d.ts +30 -0
  114. package/dist/commands/channel/supervisor/inbox.d.ts.map +1 -0
  115. package/dist/commands/channel/supervisor/inbox.js +160 -0
  116. package/dist/commands/channel/supervisor/inbox.js.map +1 -0
  117. package/dist/commands/channel/supervisor/shutdown.d.ts +68 -0
  118. package/dist/commands/channel/supervisor/shutdown.d.ts.map +1 -0
  119. package/dist/commands/channel/supervisor/shutdown.js +146 -0
  120. package/dist/commands/channel/supervisor/shutdown.js.map +1 -0
  121. package/dist/commands/channel/supervisor/stdout.d.ts +51 -0
  122. package/dist/commands/channel/supervisor/stdout.d.ts.map +1 -0
  123. package/dist/commands/channel/supervisor/stdout.js +121 -0
  124. package/dist/commands/channel/supervisor/stdout.js.map +1 -0
  125. package/dist/commands/channel/supervisor/turns.d.ts +31 -0
  126. package/dist/commands/channel/supervisor/turns.d.ts.map +1 -0
  127. package/dist/commands/channel/supervisor/turns.js +45 -0
  128. package/dist/commands/channel/supervisor/turns.js.map +1 -0
  129. package/dist/commands/channel/supervisor/warning.d.ts +48 -0
  130. package/dist/commands/channel/supervisor/warning.d.ts.map +1 -0
  131. package/dist/commands/channel/supervisor/warning.js +77 -0
  132. package/dist/commands/channel/supervisor/warning.js.map +1 -0
  133. package/dist/commands/channel/supervisor.d.ts +59 -0
  134. package/dist/commands/channel/supervisor.d.ts.map +1 -0
  135. package/dist/commands/channel/supervisor.js +344 -0
  136. package/dist/commands/channel/supervisor.js.map +1 -0
  137. package/dist/commands/channel/text-body.d.ts +13 -0
  138. package/dist/commands/channel/text-body.d.ts.map +1 -0
  139. package/dist/commands/channel/text-body.js +47 -0
  140. package/dist/commands/channel/text-body.js.map +1 -0
  141. package/dist/commands/channel/threads.d.ts +39 -0
  142. package/dist/commands/channel/threads.d.ts.map +1 -0
  143. package/dist/commands/channel/threads.js +106 -0
  144. package/dist/commands/channel/threads.js.map +1 -0
  145. package/dist/commands/channel/title.d.ts +12 -0
  146. package/dist/commands/channel/title.d.ts.map +1 -0
  147. package/dist/commands/channel/title.js +24 -0
  148. package/dist/commands/channel/title.js.map +1 -0
  149. package/dist/commands/channel/wait.d.ts +17 -0
  150. package/dist/commands/channel/wait.d.ts.map +1 -0
  151. package/dist/commands/channel/wait.js +75 -0
  152. package/dist/commands/channel/wait.js.map +1 -0
  153. package/dist/commands/init.d.ts +3 -0
  154. package/dist/commands/init.d.ts.map +1 -1
  155. package/dist/commands/init.js +162 -43
  156. package/dist/commands/init.js.map +1 -1
  157. package/dist/commands/mem.d.ts +13 -217
  158. package/dist/commands/mem.d.ts.map +1 -1
  159. package/dist/commands/mem.js +142 -1587
  160. package/dist/commands/mem.js.map +1 -1
  161. package/dist/commands/uninstall.d.ts.map +1 -1
  162. package/dist/commands/uninstall.js +28 -2
  163. package/dist/commands/uninstall.js.map +1 -1
  164. package/dist/commands/update.d.ts.map +1 -1
  165. package/dist/commands/update.js +102 -5
  166. package/dist/commands/update.js.map +1 -1
  167. package/dist/commands/workflow.d.ts +35 -0
  168. package/dist/commands/workflow.d.ts.map +1 -0
  169. package/dist/commands/workflow.js +232 -0
  170. package/dist/commands/workflow.js.map +1 -0
  171. package/dist/configurators/claude.d.ts.map +1 -1
  172. package/dist/configurators/claude.js +1 -0
  173. package/dist/configurators/claude.js.map +1 -1
  174. package/dist/configurators/index.d.ts.map +1 -1
  175. package/dist/configurators/index.js +5 -0
  176. package/dist/configurators/index.js.map +1 -1
  177. package/dist/configurators/reasonix.d.ts +23 -0
  178. package/dist/configurators/reasonix.d.ts.map +1 -0
  179. package/dist/configurators/reasonix.js +60 -0
  180. package/dist/configurators/reasonix.js.map +1 -0
  181. package/dist/configurators/shared.d.ts.map +1 -1
  182. package/dist/configurators/shared.js +8 -0
  183. package/dist/configurators/shared.js.map +1 -1
  184. package/dist/configurators/workflow.d.ts +8 -0
  185. package/dist/configurators/workflow.d.ts.map +1 -1
  186. package/dist/configurators/workflow.js +14 -3
  187. package/dist/configurators/workflow.js.map +1 -1
  188. package/dist/constants/paths.d.ts +4 -0
  189. package/dist/constants/paths.d.ts.map +1 -1
  190. package/dist/constants/paths.js +4 -0
  191. package/dist/constants/paths.js.map +1 -1
  192. package/dist/migrations/manifests/0.5.14.json +9 -0
  193. package/dist/migrations/manifests/0.5.15.json +9 -0
  194. package/dist/migrations/manifests/0.5.16.json +9 -0
  195. package/dist/migrations/manifests/0.5.17.json +9 -0
  196. package/dist/migrations/manifests/0.5.18.json +9 -0
  197. package/dist/migrations/manifests/0.5.19.json +9 -0
  198. package/dist/migrations/manifests/0.6.0-beta.10.json +9 -0
  199. package/dist/migrations/manifests/0.6.0-beta.11.json +9 -0
  200. package/dist/migrations/manifests/0.6.0-beta.12.json +9 -0
  201. package/dist/migrations/manifests/0.6.0-beta.13.json +9 -0
  202. package/dist/migrations/manifests/0.6.0-beta.14.json +9 -0
  203. package/dist/migrations/manifests/0.6.0-beta.15.json +9 -0
  204. package/dist/migrations/manifests/0.6.0-beta.16.json +9 -0
  205. package/dist/migrations/manifests/0.6.0-beta.17.json +9 -0
  206. package/dist/migrations/manifests/0.6.0-beta.18.json +16 -0
  207. package/dist/migrations/manifests/0.6.0-beta.19.json +9 -0
  208. package/dist/migrations/manifests/0.6.0-beta.20.json +9 -0
  209. package/dist/migrations/manifests/0.6.0-beta.21.json +9 -0
  210. package/dist/migrations/manifests/0.6.0-beta.22.json +9 -0
  211. package/dist/migrations/manifests/0.6.0-beta.23.json +88 -0
  212. package/dist/migrations/manifests/0.6.0-rc.0.json +9 -0
  213. package/dist/migrations/manifests/0.6.0.json +1 -0
  214. package/dist/templates/claude/agents/trellis-check.md +12 -6
  215. package/dist/templates/claude/agents/trellis-implement.md +1 -1
  216. package/dist/templates/claude/agents/trellis-research.md +1 -1
  217. package/dist/templates/codebuddy/agents/trellis-check.md +12 -6
  218. package/dist/templates/codebuddy/agents/trellis-implement.md +1 -1
  219. package/dist/templates/codebuddy/agents/trellis-research.md +1 -1
  220. package/dist/templates/codex/agents/trellis-check.toml +0 -25
  221. package/dist/templates/codex/agents/trellis-implement.toml +0 -25
  222. package/dist/templates/codex/config.toml +9 -16
  223. package/dist/templates/codex/hooks/session-start.py +22 -0
  224. package/dist/templates/codex/hooks.json +1 -1
  225. package/dist/templates/common/bundled-skills/trellis-channel/SKILL.md +67 -0
  226. package/dist/templates/common/bundled-skills/trellis-channel/references/command-reference.md +480 -0
  227. package/dist/templates/common/bundled-skills/trellis-channel/references/forum.md +233 -0
  228. package/dist/templates/common/bundled-skills/trellis-channel/references/progress-debugging.md +226 -0
  229. package/dist/templates/common/bundled-skills/trellis-channel/references/workers.md +276 -0
  230. package/dist/templates/common/bundled-skills/trellis-channel/references/workflows.md +128 -0
  231. package/dist/templates/common/bundled-skills/trellis-meta/SKILL.md +46 -34
  232. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-skills-or-commands.md +47 -3
  233. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/bundled-skills.md +146 -0
  234. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/multi-agent-channel.md +69 -0
  235. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/task-system.md +27 -0
  236. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/platform-map.md +11 -1
  237. package/dist/templates/common/bundled-skills/trellis-session-insight/SKILL.md +81 -0
  238. package/dist/templates/common/bundled-skills/trellis-session-insight/references/cli-quick-reference.md +66 -0
  239. package/dist/templates/common/bundled-skills/trellis-session-insight/references/triggering-patterns.md +93 -0
  240. package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/SKILL.md +41 -0
  241. package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/references/mcp-setup.md +90 -0
  242. package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/references/repository-analysis.md +59 -0
  243. package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/references/spec-task-planning.md +61 -0
  244. package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/references/spec-writing.md +70 -0
  245. package/dist/templates/copilot/hooks/session-start.py +24 -0
  246. package/dist/templates/cursor/agents/trellis-check.md +12 -6
  247. package/dist/templates/cursor/agents/trellis-implement.md +1 -1
  248. package/dist/templates/cursor/agents/trellis-research.md +1 -1
  249. package/dist/templates/cursor/hooks.json +0 -6
  250. package/dist/templates/droid/droids/trellis-check.md +12 -6
  251. package/dist/templates/droid/droids/trellis-implement.md +1 -1
  252. package/dist/templates/droid/droids/trellis-research.md +1 -1
  253. package/dist/templates/gemini/agents/trellis-check.md +11 -5
  254. package/dist/templates/kiro/agents/trellis-check.json +1 -1
  255. package/dist/templates/markdown/spec/guides/code-reuse-thinking-guide.md.txt +127 -9
  256. package/dist/templates/markdown/spec/guides/cross-layer-thinking-guide.md.txt +130 -0
  257. package/dist/templates/markdown/spec/guides/cross-platform-thinking-guide.md.txt +38 -0
  258. package/dist/templates/markdown/spec/guides/index.md.txt +18 -0
  259. package/dist/templates/opencode/agents/trellis-check.md +11 -5
  260. package/dist/templates/pi/agents/trellis-check.md +5 -4
  261. package/dist/templates/pi/agents/trellis-implement.md +5 -4
  262. package/dist/templates/pi/extensions/trellis/index.ts.txt +1339 -913
  263. package/dist/templates/pi/settings.json +0 -9
  264. package/dist/templates/qoder/agents/trellis-check.md +12 -6
  265. package/dist/templates/qoder/agents/trellis-implement.md +1 -1
  266. package/dist/templates/qoder/agents/trellis-research.md +1 -1
  267. package/dist/templates/reasonix/agents/trellis-check.md +36 -0
  268. package/dist/templates/reasonix/agents/trellis-implement.md +41 -0
  269. package/dist/templates/reasonix/index.d.ts +13 -0
  270. package/dist/templates/reasonix/index.d.ts.map +1 -0
  271. package/dist/templates/reasonix/index.js +16 -0
  272. package/dist/templates/reasonix/index.js.map +1 -0
  273. package/dist/templates/shared-hooks/index.d.ts.map +1 -1
  274. package/dist/templates/shared-hooks/index.js +0 -1
  275. package/dist/templates/shared-hooks/index.js.map +1 -1
  276. package/dist/templates/shared-hooks/inject-workflow-state.py +22 -0
  277. package/dist/templates/shared-hooks/session-start.py +25 -8
  278. package/dist/templates/trellis/agents/check.md +70 -0
  279. package/dist/templates/trellis/agents/implement.md +71 -0
  280. package/dist/templates/trellis/config.yaml +20 -0
  281. package/dist/templates/trellis/index.d.ts +13 -0
  282. package/dist/templates/trellis/index.d.ts.map +1 -1
  283. package/dist/templates/trellis/index.js +22 -0
  284. package/dist/templates/trellis/index.js.map +1 -1
  285. package/dist/templates/trellis/scripts/common/safe_commit.py +49 -19
  286. package/dist/templates/trellis/scripts/common/task_store.py +94 -16
  287. package/dist/templates/trellis/workflow.md +21 -0
  288. package/dist/types/ai-tools.d.ts +4 -4
  289. package/dist/types/ai-tools.d.ts.map +1 -1
  290. package/dist/types/ai-tools.js +16 -0
  291. package/dist/types/ai-tools.js.map +1 -1
  292. package/dist/utils/agent-refs.d.ts +31 -0
  293. package/dist/utils/agent-refs.d.ts.map +1 -0
  294. package/dist/utils/agent-refs.js +63 -0
  295. package/dist/utils/agent-refs.js.map +1 -0
  296. package/dist/utils/cwd-guard.d.ts +38 -0
  297. package/dist/utils/cwd-guard.d.ts.map +1 -0
  298. package/dist/utils/cwd-guard.js +62 -0
  299. package/dist/utils/cwd-guard.js.map +1 -0
  300. package/dist/utils/file-writer.d.ts +13 -0
  301. package/dist/utils/file-writer.d.ts.map +1 -1
  302. package/dist/utils/file-writer.js +59 -1
  303. package/dist/utils/file-writer.js.map +1 -1
  304. package/dist/utils/manifest-prune.d.ts +61 -0
  305. package/dist/utils/manifest-prune.d.ts.map +1 -0
  306. package/dist/utils/manifest-prune.js +136 -0
  307. package/dist/utils/manifest-prune.js.map +1 -0
  308. package/dist/utils/registry-config.d.ts +7 -0
  309. package/dist/utils/registry-config.d.ts.map +1 -0
  310. package/dist/utils/registry-config.js +171 -0
  311. package/dist/utils/registry-config.js.map +1 -0
  312. package/dist/utils/task-json.d.ts +9 -42
  313. package/dist/utils/task-json.d.ts.map +1 -1
  314. package/dist/utils/task-json.js +8 -45
  315. package/dist/utils/task-json.js.map +1 -1
  316. package/dist/utils/template-fetcher.d.ts +11 -0
  317. package/dist/utils/template-fetcher.d.ts.map +1 -1
  318. package/dist/utils/template-fetcher.js +51 -2
  319. package/dist/utils/template-fetcher.js.map +1 -1
  320. package/dist/utils/template-hash.d.ts +32 -6
  321. package/dist/utils/template-hash.d.ts.map +1 -1
  322. package/dist/utils/template-hash.js +53 -31
  323. package/dist/utils/template-hash.js.map +1 -1
  324. package/dist/utils/workflow-resolver.d.ts +86 -0
  325. package/dist/utils/workflow-resolver.d.ts.map +1 -0
  326. package/dist/utils/workflow-resolver.js +265 -0
  327. package/dist/utils/workflow-resolver.js.map +1 -0
  328. package/package.json +9 -8
@@ -0,0 +1,90 @@
1
+ # MCP Setup
2
+
3
+ GitNexus and ABCoder are recommended when bootstrapping Trellis specs because they expose architecture and AST context to the agent. They are tool choices, not platform requirements. Configure them through whatever MCP mechanism your agent host provides.
4
+
5
+ ## GitNexus
6
+
7
+ GitNexus builds a code knowledge graph from the repository. Use it for module boundaries, execution flows, dependency relationships, blast radius, and graph queries.
8
+
9
+ ### Install and Index
10
+
11
+ ```bash
12
+ # Run from the repository root.
13
+ npx gitnexus analyze
14
+
15
+ # Check index status.
16
+ npx gitnexus status
17
+
18
+ # Re-index after code changes when the analysis is stale.
19
+ npx gitnexus analyze
20
+ ```
21
+
22
+ The index is written to `.gitnexus/`. Keep embeddings only if the project already uses them; otherwise a normal index is enough for spec bootstrapping.
23
+
24
+ ### MCP Server Command
25
+
26
+ Use this server command in the host's MCP configuration:
27
+
28
+ ```bash
29
+ npx -y gitnexus mcp
30
+ ```
31
+
32
+ ### Useful Tools
33
+
34
+ | Tool | Purpose |
35
+ |------|---------|
36
+ | `gitnexus_query` | Find execution flows and functional areas by concept |
37
+ | `gitnexus_context` | Inspect callers, callees, references, and process participation for a symbol |
38
+ | `gitnexus_impact` | Understand blast radius before changing a symbol |
39
+ | `gitnexus_detect_changes` | Check changed symbols and affected flows before finishing |
40
+ | `gitnexus_cypher` | Run direct graph queries |
41
+ | `gitnexus_list_repos` | List indexed repositories |
42
+
43
+ ## ABCoder
44
+
45
+ ABCoder parses code into UniAST and gives precise package, file, and node-level structure. Use it for signatures, type shapes, implementations, dependencies, and reverse references.
46
+
47
+ ### Install
48
+
49
+ ```bash
50
+ go install github.com/cloudwego/abcoder@latest
51
+ abcoder --help
52
+ ```
53
+
54
+ ### Parse Repositories
55
+
56
+ ```bash
57
+ abcoder parse /absolute/path/to/package \
58
+ --lang typescript \
59
+ --name package-name \
60
+ --output ~/abcoder-asts
61
+ ```
62
+
63
+ For monorepos, parse each package with a stable `--name` so task notes can reference the same repository names.
64
+
65
+ ### MCP Server Command
66
+
67
+ Use this server command in the host's MCP configuration:
68
+
69
+ ```bash
70
+ abcoder mcp ~/abcoder-asts
71
+ ```
72
+
73
+ ### Useful Tools
74
+
75
+ | Tool | Layer | Purpose |
76
+ |------|-------|---------|
77
+ | `list_repos` | 1 | List parsed repositories |
78
+ | `get_repo_structure` | 2 | Inspect packages and files |
79
+ | `get_package_structure` | 3 | Inspect nodes within a package |
80
+ | `get_file_structure` | 3 | Inspect functions, classes, types, and signatures in a file |
81
+ | `get_ast_node` | 4 | Retrieve code, dependencies, references, and implementations |
82
+
83
+ ## Verification
84
+
85
+ After configuration, verify from the agent host that both MCP servers are visible. Then run one simple query against each server before starting the spec writing pass.
86
+
87
+ ```bash
88
+ ls .gitnexus/meta.json
89
+ ls ~/abcoder-asts/*.json
90
+ ```
@@ -0,0 +1,59 @@
1
+ # Repository Analysis
2
+
3
+ The goal is to discover the project's real architecture before writing rules. Do not start from generic spec templates and fill blanks. Start from the code, then let the spec structure follow.
4
+
5
+ ## Analysis Order
6
+
7
+ 1. Read the existing `.trellis/spec/` tree and note which files are templates, outdated, or already project-specific.
8
+ 2. Inspect package manifests, build scripts, workspace config, and top-level documentation to identify packages and runtime layers.
9
+ 3. Use GitNexus for execution flows, module clusters, dependency hubs, and impact-sensitive areas.
10
+ 4. Use ABCoder or language-native tooling for exact signatures, types, class boundaries, and implementation examples.
11
+ 5. Read representative source and test files directly before turning any finding into a spec rule.
12
+
13
+ ## What To Capture
14
+
15
+ | Area | Questions |
16
+ |------|-----------|
17
+ | Package boundaries | What does each package own? What imports cross boundaries? |
18
+ | Runtime layers | Which code is CLI, backend, frontend, worker, shared library, test-only, or tooling? |
19
+ | Core abstractions | Which types, services, stores, commands, routes, or adapters define the system shape? |
20
+ | Data flow | Where does user input enter, how is it validated, and where does state persist? |
21
+ | Error handling | How are failures represented, logged, surfaced, and tested? |
22
+ | Configuration | Where do defaults, environment config, generated files, and templates live? |
23
+ | Tests | Which test styles are trusted examples for new work? |
24
+
25
+ ## GitNexus Usage
26
+
27
+ Start broad, then inspect specific symbols:
28
+
29
+ ```text
30
+ gitnexus_query({query: "CLI command execution flow"})
31
+ gitnexus_query({query: "template generation and migration"})
32
+ gitnexus_context({name: "SymbolName"})
33
+ gitnexus_cypher({query: "MATCH (n)-[r]->(m) RETURN n.name, type(r), m.name LIMIT 30"})
34
+ ```
35
+
36
+ Use GitNexus results to find important files and flows. Do not quote graph output as the final authority until you have checked the relevant source files.
37
+
38
+ ## ABCoder Usage
39
+
40
+ Use ABCoder when the spec needs exact code shapes:
41
+
42
+ ```text
43
+ list_repos()
44
+ get_repo_structure({repo_name: "package-name"})
45
+ get_file_structure({repo_name: "package-name", file_path: "src/example.ts"})
46
+ get_ast_node({repo_name: "package-name", node_ids: [{mod_path: "...", pkg_path: "...", name: "SymbolName"}]})
47
+ ```
48
+
49
+ ABCoder is most valuable for documenting constructor patterns, function signatures, type contracts, and reference chains.
50
+
51
+ ## Analysis Notes
52
+
53
+ Keep short notes while analyzing. The notes should include:
54
+
55
+ - Package or layer name.
56
+ - Files that define the local pattern.
57
+ - Rules the spec should teach.
58
+ - Anti-patterns found in old code, comments, tests, or migration paths.
59
+ - Spec files that should be created, deleted, renamed, or merged.
@@ -0,0 +1,61 @@
1
+ # Spec Task Planning
2
+
3
+ Use a single agent as the default execution model. The agent may create Trellis tasks for traceability, but the skill should not require a specific platform, CLI, or parallel worker model.
4
+
5
+ ## Decomposition
6
+
7
+ Create spec work units around real ownership boundaries:
8
+
9
+ - One package when a package has its own conventions.
10
+ - One layer when the same package has distinct frontend, backend, CLI, worker, or shared-library rules.
11
+ - One cross-cutting guide when a pattern spans packages and is not owned by one layer.
12
+
13
+ Avoid artificial decomposition. A small library usually needs one focused spec pass, not several tasks.
14
+
15
+ ## Task Shape
16
+
17
+ When a Trellis task is useful, write a concise PRD with these sections:
18
+
19
+ ```markdown
20
+ # Fill <package-or-layer> Trellis Specs
21
+
22
+ ## Goal
23
+ Write project-specific `.trellis/spec/` guidance for <scope>.
24
+
25
+ ## Scope
26
+ - Spec directory:
27
+ - Source directories to inspect:
28
+ - Tests to inspect:
29
+ - Out of scope:
30
+
31
+ ## Architecture Context
32
+ Summarize the concrete findings from repository analysis.
33
+
34
+ ## Files To Create Or Update
35
+ - `.trellis/spec/.../index.md`
36
+ - `.trellis/spec/.../<topic>.md`
37
+
38
+ ## Rules
39
+ - Adapt the spec file set to the real codebase.
40
+ - Use real source examples with file paths.
41
+ - Remove template-only sections that do not apply.
42
+ - Do not modify product source code unless the task explicitly asks for it.
43
+
44
+ ## Acceptance Criteria
45
+ - [ ] Specs contain concrete examples and anti-patterns from the repository.
46
+ - [ ] No placeholder text remains.
47
+ - [ ] Index files match the final spec files.
48
+ - [ ] Claims are backed by source files, tests, or project docs.
49
+ ```
50
+
51
+ ## Optional Helper Agents
52
+
53
+ If the host supports subagents, helpers can inspect independent packages or run verification. They are optional. The main agent still owns integration and final quality.
54
+
55
+ Helper tasks must have clear ownership:
56
+
57
+ - Read-only research tasks may inspect any source needed for the assigned scope.
58
+ - Write tasks should own disjoint spec directories.
59
+ - Verification tasks should check placeholder removal, broken links, and consistency.
60
+
61
+ Do not encode helper-agent names, vendor-specific commands, or platform-specific routing in the skill. Put only the required work and acceptance criteria in the task.
@@ -0,0 +1,70 @@
1
+ # Spec Writing
2
+
3
+ Trellis specs are coding guidance for future agents. They should explain how to work in this repository, not how a generic project might be organized.
4
+
5
+ ## Write From Evidence
6
+
7
+ Each important rule should be backed by one of these:
8
+
9
+ - A source file that demonstrates the preferred pattern.
10
+ - A test file that shows expected behavior.
11
+ - A project document that defines the convention.
12
+ - A repeated pattern across multiple files.
13
+
14
+ Use short snippets only when they make the rule clearer. Prefer linking to the file path and naming the symbol or behavior.
15
+
16
+ ## File Structure
17
+
18
+ Keep the spec tree aligned with the project:
19
+
20
+ - Keep `index.md` as the navigation file for the spec directory.
21
+ - Split topics when developers would look for them independently.
22
+ - Merge topics when separate files would repeat the same rule.
23
+ - Delete template files that do not apply.
24
+ - Add new files for important local patterns the template missed.
25
+
26
+ ## Content Standards
27
+
28
+ Good spec sections include:
29
+
30
+ - When the rule applies.
31
+ - The local pattern to follow.
32
+ - The source or test files that prove the pattern.
33
+ - Common mistakes or anti-patterns.
34
+ - Verification commands or checks when they are specific and reliable.
35
+
36
+ Avoid:
37
+
38
+ - Placeholder prose.
39
+ - Generic framework advice.
40
+ - Tool instructions that only work in one agent host.
41
+ - Long copied code blocks.
42
+ - Rules based on a single accidental implementation detail.
43
+
44
+ ## Example Shape
45
+
46
+ ```markdown
47
+ ## Command Handlers
48
+
49
+ Command handlers should keep argument parsing, validation, and side effects separate. The local pattern is:
50
+
51
+ - Parse CLI flags at the command boundary.
52
+ - Convert raw inputs into typed task options before invoking core logic.
53
+ - Keep filesystem writes in the command or service layer, not in template helpers.
54
+
55
+ Reference files:
56
+ - `packages/cli/src/commands/example.ts`
57
+ - `packages/cli/test/commands/example.test.ts`
58
+
59
+ Avoid passing raw `process.argv` or unvalidated config objects into shared helpers.
60
+ ```
61
+
62
+ ## Final Pass
63
+
64
+ Before finishing:
65
+
66
+ ```bash
67
+ grep -R "To be filled\\|TODO: fill\\|placeholder" .trellis/spec
68
+ ```
69
+
70
+ Also check links, index files, and whether any spec still describes a template rather than this repository.
@@ -17,6 +17,30 @@ breadcrumbs remain available as a per-turn complement.
17
17
 
18
18
  from __future__ import annotations
19
19
 
20
+ import sys
21
+
22
+ # Force UTF-8 on stdin/stdout/stderr on Windows. Default codepage there is
23
+ # cp936 / cp1252 / etc. — non-ASCII content (Chinese task names, prd snippets)
24
+ # both in stdin (hook payload from host CLI) and stdout (our emitted blocks)
25
+ # raises UnicodeDecodeError / UnicodeEncodeError. Equivalent to `python -X utf8`
26
+ # but applied per-stream so we don't depend on host CLI's command wiring.
27
+ if sys.platform.startswith("win"):
28
+ import io as _io
29
+ for _stream_name in ("stdin", "stdout", "stderr"):
30
+ _stream = getattr(sys, _stream_name, None)
31
+ if _stream is None:
32
+ continue
33
+ if hasattr(_stream, "reconfigure"):
34
+ try:
35
+ _stream.reconfigure(encoding="utf-8", errors="replace") # type: ignore[union-attr]
36
+ except Exception:
37
+ pass
38
+ elif hasattr(_stream, "detach"):
39
+ try:
40
+ setattr(sys, _stream_name, _io.TextIOWrapper(_stream.detach(), encoding="utf-8", errors="replace"))
41
+ except Exception:
42
+ pass
43
+
20
44
  import json
21
45
  import os
22
46
  import re
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: trellis-check
3
3
  description: Trellis quality check agent. Use this exact agent for Trellis task verification, check.jsonl context injection, and self-fixing code review. Do not use generic/default/generalPurpose agents for Trellis checks.
4
- tools: Read, Write, Edit, Bash, Glob, Grep, mcp__exa__web_search_exa, mcp__exa__get_code_context_exa
4
+ tools: Read, Write, Edit, Bash, Glob, Grep
5
5
  ---
6
6
  # Check Agent
7
7
 
@@ -26,14 +26,18 @@ Look for the `<!-- trellis-hook-injected -->` marker in your input above.
26
26
 
27
27
  Before checking, read:
28
28
  - `.trellis/spec/` - Development guidelines
29
+ - Task `prd.md` - Requirements document
30
+ - Task `design.md` - Technical design (if exists)
31
+ - Task `implement.md` - Execution plan (if exists)
29
32
  - Pre-commit checklist for quality standards
30
33
 
31
34
  ## Core Responsibilities
32
35
 
33
36
  1. **Get code changes** - Use git diff to get uncommitted code
34
- 2. **Check against specs** - Verify code follows guidelines
35
- 3. **Self-fix** - Fix issues yourself, not just report them
36
- 4. **Run verification** - typecheck and lint
37
+ 2. **Review task artifacts** - Check changes against prd.md, design.md if present, and implement.md if present
38
+ 3. **Check against specs** - Verify code follows guidelines
39
+ 4. **Self-fix** - Fix issues yourself, not just report them
40
+ 5. **Run verification** - typecheck and lint
37
41
 
38
42
  ## Important
39
43
 
@@ -52,10 +56,12 @@ git diff --name-only # List changed files
52
56
  git diff # View specific changes
53
57
  ```
54
58
 
55
- ### Step 2: Check Against Specs
59
+ ### Step 2: Check Against Specs and Task Artifacts
56
60
 
57
- Read relevant specs in `.trellis/spec/` to check code:
61
+ Read the task's prd.md, design.md if present, and implement.md if present, then read relevant specs in `.trellis/spec/` to check code:
58
62
 
63
+ - Does it satisfy the task requirements
64
+ - Does it follow the technical design and implementation plan when present
59
65
  - Does it follow directory structure conventions
60
66
  - Does it follow naming conventions
61
67
  - Does it follow code patterns
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: trellis-implement
3
3
  description: Trellis implementation agent. Use this exact agent for Trellis task implementation, implement.jsonl context injection, and hook-injection tests. Do not use generic/default/generalPurpose agents for Trellis implementation. No git commit allowed.
4
- tools: Read, Write, Edit, Bash, Glob, Grep, mcp__exa__web_search_exa, mcp__exa__get_code_context_exa
4
+ tools: Read, Write, Edit, Bash, Glob, Grep
5
5
  ---
6
6
  # Implement Agent
7
7
 
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: trellis-research
3
3
  description: Trellis research agent. Use this exact agent for Trellis task research and research/ persistence. Do not use generic/default/generalPurpose agents for Trellis research.
4
- tools: Read, Write, Glob, Grep, Bash, mcp__exa__web_search_exa, mcp__exa__get_code_context_exa, Skill, mcp__chrome-devtools__*
4
+ tools: Read, Write, Glob, Grep, Bash, Skill, mcp__*
5
5
  ---
6
6
  # Research Agent
7
7
 
@@ -14,12 +14,6 @@
14
14
  "timeout": 30
15
15
  }
16
16
  ],
17
- "beforeSubmitPrompt": [
18
- {
19
- "command": "{{PYTHON_CMD}} .cursor/hooks/inject-workflow-state.py",
20
- "timeout": 15
21
- }
22
- ],
23
17
  "beforeShellExecution": [
24
18
  {
25
19
  "command": "{{PYTHON_CMD}} .cursor/hooks/inject-shell-session-context.py",
@@ -2,7 +2,7 @@
2
2
  name: trellis-check
3
3
  description: |
4
4
  Code quality check expert. Reviews code changes against specs and self-fixes issues.
5
- tools: Read, Write, Edit, Bash, Glob, Grep, mcp__exa__web_search_exa, mcp__exa__get_code_context_exa
5
+ tools: Read, Write, Edit, Bash, Glob, Grep
6
6
  ---
7
7
  # Check Agent
8
8
 
@@ -19,14 +19,18 @@ Look for the `<!-- trellis-hook-injected -->` marker in your input above.
19
19
 
20
20
  Before checking, read:
21
21
  - `.trellis/spec/` - Development guidelines
22
+ - Task `prd.md` - Requirements document
23
+ - Task `design.md` - Technical design (if exists)
24
+ - Task `implement.md` - Execution plan (if exists)
22
25
  - Pre-commit checklist for quality standards
23
26
 
24
27
  ## Core Responsibilities
25
28
 
26
29
  1. **Get code changes** - Use git diff to get uncommitted code
27
- 2. **Check against specs** - Verify code follows guidelines
28
- 3. **Self-fix** - Fix issues yourself, not just report them
29
- 4. **Run verification** - typecheck and lint
30
+ 2. **Review task artifacts** - Check changes against prd.md, design.md if present, and implement.md if present
31
+ 3. **Check against specs** - Verify code follows guidelines
32
+ 4. **Self-fix** - Fix issues yourself, not just report them
33
+ 5. **Run verification** - typecheck and lint
30
34
 
31
35
  ## Important
32
36
 
@@ -45,10 +49,12 @@ git diff --name-only # List changed files
45
49
  git diff # View specific changes
46
50
  ```
47
51
 
48
- ### Step 2: Check Against Specs
52
+ ### Step 2: Check Against Specs and Task Artifacts
49
53
 
50
- Read relevant specs in `.trellis/spec/` to check code:
54
+ Read the task's prd.md, design.md if present, and implement.md if present, then read relevant specs in `.trellis/spec/` to check code:
51
55
 
56
+ - Does it satisfy the task requirements
57
+ - Does it follow the technical design and implementation plan when present
52
58
  - Does it follow directory structure conventions
53
59
  - Does it follow naming conventions
54
60
  - Does it follow code patterns
@@ -2,7 +2,7 @@
2
2
  name: trellis-implement
3
3
  description: |
4
4
  Code implementation expert. Understands specs and requirements, then implements features. No git commit allowed.
5
- tools: Read, Write, Edit, Bash, Glob, Grep, mcp__exa__web_search_exa, mcp__exa__get_code_context_exa
5
+ tools: Read, Write, Edit, Bash, Glob, Grep
6
6
  ---
7
7
  # Implement Agent
8
8
 
@@ -2,7 +2,7 @@
2
2
  name: trellis-research
3
3
  description: |
4
4
  Code and tech search expert. Finds files, patterns, and tech solutions, and PERSISTS every finding to the current task's research/ directory. No code modifications outside that directory.
5
- tools: Read, Write, Glob, Grep, Bash, mcp__exa__web_search_exa, mcp__exa__get_code_context_exa, Skill, mcp__chrome-devtools__*
5
+ tools: Read, Write, Glob, Grep, Bash, Skill, mcp__*
6
6
  ---
7
7
  # Research Agent
8
8
 
@@ -19,14 +19,18 @@ You are already the `trellis-check` sub-agent that the main session dispatched.
19
19
 
20
20
  Before checking, read:
21
21
  - `.trellis/spec/` - Development guidelines
22
+ - Task `prd.md` - Requirements document
23
+ - Task `design.md` - Technical design (if exists)
24
+ - Task `implement.md` - Execution plan (if exists)
22
25
  - Pre-commit checklist for quality standards
23
26
 
24
27
  ## Core Responsibilities
25
28
 
26
29
  1. **Get code changes** - Use git diff to get uncommitted code
27
- 2. **Check against specs** - Verify code follows guidelines
28
- 3. **Self-fix** - Fix issues yourself, not just report them
29
- 4. **Run verification** - typecheck and lint
30
+ 2. **Review task artifacts** - Check changes against prd.md, design.md if present, and implement.md if present
31
+ 3. **Check against specs** - Verify code follows guidelines
32
+ 4. **Self-fix** - Fix issues yourself, not just report them
33
+ 5. **Run verification** - typecheck and lint
30
34
 
31
35
  ## Important
32
36
 
@@ -45,10 +49,12 @@ git diff --name-only # List changed files
45
49
  git diff # View specific changes
46
50
  ```
47
51
 
48
- ### Step 2: Check Against Specs
52
+ ### Step 2: Check Against Specs and Task Artifacts
49
53
 
50
- Read relevant specs in `.trellis/spec/` to check code:
54
+ Read the task's prd.md, design.md if present, and implement.md if present, then read relevant specs in `.trellis/spec/` to check code:
51
55
 
56
+ - Does it satisfy the task requirements
57
+ - Does it follow the technical design and implementation plan when present
52
58
  - Does it follow directory structure conventions
53
59
  - Does it follow naming conventions
54
60
  - Does it follow code patterns
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "trellis-check",
3
3
  "description": "Code quality check expert. Reviews code changes against specs and self-fixes issues.",
4
- "prompt": "# Check Agent\n\nYou are the Check Agent in the Trellis workflow.\n\n## Recursion Guard\n\nYou are already the `trellis-check` sub-agent that the main session dispatched. Do the review and fixes directly.\n\n- Do NOT spawn another `trellis-check` or `trellis-implement` sub-agent.\n- If SessionStart context, workflow-state breadcrumbs, or workflow.md say to dispatch `trellis-implement` / `trellis-check`, treat that as a main-session instruction that is already satisfied by your current role.\n- Only the main session may dispatch Trellis implement/check agents. If more implementation work is needed, report that recommendation instead of spawning.\n\n## Trellis Context Loading Protocol\n\nLook for the `<!-- trellis-hook-injected -->` marker in your input above.\n\n- **If the marker is present**: task artifacts, spec, and research files have already been auto-loaded for you above. Proceed with the check work directly.\n- **If the marker is absent**: hook injection didn't fire (Windows + Claude Code, `--continue` resume, fork distribution, hooks disabled, etc.). Find the active task path from your dispatch prompt's first line `Active task: <path>`, then Read `<task-path>/check.jsonl`, each listed file, `<task-path>/prd.md`, `<task-path>/design.md` if present, and `<task-path>/implement.md` if present before doing the work.\n\n## Context\n\nBefore checking, read:\n- `.trellis/spec/` - Development guidelines\n- Pre-commit checklist for quality standards\n\n## Core Responsibilities\n\n1. **Get code changes** - Use git diff to get uncommitted code\n2. **Check against specs** - Verify code follows guidelines\n3. **Self-fix** - Fix issues yourself, not just report them\n4. **Run verification** - typecheck and lint\n\n## Important\n\n**Fix issues yourself**, don't just report them.\n\nYou have write and edit tools, you can modify code directly.\n\n---\n\n## Workflow\n\n### Step 1: Get Changes\n\n```bash\ngit diff --name-only # List changed files\ngit diff # View specific changes\n```\n\n### Step 2: Check Against Specs\n\nRead relevant specs in `.trellis/spec/` to check code:\n\n- Does it follow directory structure conventions\n- Does it follow naming conventions\n- Does it follow code patterns\n- Are there missing types\n- Are there potential bugs\n\n### Step 3: Self-Fix\n\nAfter finding issues:\n\n1. Fix the issue directly (use edit tool)\n2. Record what was fixed\n3. Continue checking other issues\n\n### Step 4: Run Verification\n\nRun project's lint and typecheck commands to verify changes.\n\nIf failed, fix issues and re-run.\n\n---\n\n## Report Format\n\n```markdown\n## Self-Check Complete\n\n### Files Checked\n\n- src/components/Feature.tsx\n- src/hooks/useFeature.ts\n\n### Issues Found and Fixed\n\n1. `<file>:<line>` - <what was fixed>\n2. `<file>:<line>` - <what was fixed>\n\n### Issues Not Fixed\n\n(If there are issues that cannot be self-fixed, list them here with reasons)\n\n### Verification Results\n\n- TypeCheck: Passed\n- Lint: Passed\n\n### Summary\n\nChecked X files, found Y issues, all fixed.\n```",
4
+ "prompt": "# Check Agent\n\nYou are the Check Agent in the Trellis workflow.\n\n## Recursion Guard\n\nYou are already the `trellis-check` sub-agent that the main session dispatched. Do the review and fixes directly.\n\n- Do NOT spawn another `trellis-check` or `trellis-implement` sub-agent.\n- If SessionStart context, workflow-state breadcrumbs, or workflow.md say to dispatch `trellis-implement` / `trellis-check`, treat that as a main-session instruction that is already satisfied by your current role.\n- Only the main session may dispatch Trellis implement/check agents. If more implementation work is needed, report that recommendation instead of spawning.\n\n## Trellis Context Loading Protocol\n\nLook for the `<!-- trellis-hook-injected -->` marker in your input above.\n\n- **If the marker is present**: task artifacts, spec, and research files have already been auto-loaded for you above. Proceed with the check work directly.\n- **If the marker is absent**: hook injection didn't fire (Windows + Claude Code, `--continue` resume, fork distribution, hooks disabled, etc.). Find the active task path from your dispatch prompt's first line `Active task: <path>`, then Read `<task-path>/check.jsonl`, each listed file, `<task-path>/prd.md`, `<task-path>/design.md` if present, and `<task-path>/implement.md` if present before doing the work.\n\n## Context\n\nBefore checking, read:\n- `.trellis/spec/` - Development guidelines\n- Task `prd.md` - Requirements document\n- Task `design.md` - Technical design (if exists)\n- Task `implement.md` - Execution plan (if exists)\n- Pre-commit checklist for quality standards\n\n## Core Responsibilities\n\n1. **Get code changes** - Use git diff to get uncommitted code\n2. **Review task artifacts** - Check changes against prd.md, design.md if present, and implement.md if present\n3. **Check against specs** - Verify code follows guidelines\n4. **Self-fix** - Fix issues yourself, not just report them\n5. **Run verification** - typecheck and lint\n\n## Important\n\n**Fix issues yourself**, don't just report them.\n\nYou have write and edit tools, you can modify code directly.\n\n---\n\n## Workflow\n\n### Step 1: Get Changes\n\n```bash\ngit diff --name-only # List changed files\ngit diff # View specific changes\n```\n\n### Step 2: Check Against Specs and Task Artifacts\n\nRead the task's prd.md, design.md if present, and implement.md if present, then read relevant specs in `.trellis/spec/` to check code:\n\n- Does it satisfy the task requirements\n- Does it follow the technical design and implementation plan when present\n- Does it follow directory structure conventions\n- Does it follow naming conventions\n- Does it follow code patterns\n- Are there missing types\n- Are there potential bugs\n\n### Step 3: Self-Fix\n\nAfter finding issues:\n\n1. Fix the issue directly (use edit tool)\n2. Record what was fixed\n3. Continue checking other issues\n\n### Step 4: Run Verification\n\nRun project's lint and typecheck commands to verify changes.\n\nIf failed, fix issues and re-run.\n\n---\n\n## Report Format\n\n```markdown\n## Self-Check Complete\n\n### Files Checked\n\n- src/components/Feature.tsx\n- src/hooks/useFeature.ts\n\n### Issues Found and Fixed\n\n1. `<file>:<line>` - <what was fixed>\n2. `<file>:<line>` - <what was fixed>\n\n### Issues Not Fixed\n\n(If there are issues that cannot be self-fixed, list them here with reasons)\n\n### Verification Results\n\n- TypeCheck: Passed\n- Lint: Passed\n\n### Summary\n\nChecked X files, found Y issues, all fixed.\n```",
5
5
  "tools": [
6
6
  "read",
7
7
  "write",