@blxzer/cursor-trellis 0.1.0 → 0.1.1

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 (279) hide show
  1. package/README.md +124 -5
  2. package/README.zh-CN.md +170 -0
  3. package/dist/cli/index.d.ts.map +1 -1
  4. package/dist/cli/index.js +1 -33
  5. package/dist/cli/index.js.map +1 -1
  6. package/dist/commands/init.d.ts +0 -13
  7. package/dist/commands/init.d.ts.map +1 -1
  8. package/dist/commands/init.js +7 -14
  9. package/dist/commands/init.js.map +1 -1
  10. package/dist/commands/uninstall.d.ts.map +1 -1
  11. package/dist/commands/uninstall.js +3 -32
  12. package/dist/commands/uninstall.js.map +1 -1
  13. package/dist/commands/update.d.ts.map +1 -1
  14. package/dist/commands/update.js +7 -84
  15. package/dist/commands/update.js.map +1 -1
  16. package/dist/configurators/index.d.ts +7 -8
  17. package/dist/configurators/index.d.ts.map +1 -1
  18. package/dist/configurators/index.js +11 -236
  19. package/dist/configurators/index.js.map +1 -1
  20. package/dist/configurators/workflow.d.ts.map +1 -1
  21. package/dist/configurators/workflow.js +5 -1
  22. package/dist/configurators/workflow.js.map +1 -1
  23. package/dist/templates/common/bundled-skills/smart-search-cli/SKILL.md +3 -3
  24. package/dist/templates/common/bundled-skills/trellis-meta/SKILL.md +4 -2
  25. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-agents.md +8 -15
  26. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-hooks.md +7 -7
  27. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-skills-or-commands.md +18 -21
  28. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/overview.md +2 -2
  29. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/generated-files.md +10 -7
  30. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/overview.md +4 -4
  31. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/agents.md +20 -31
  32. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/hooks-and-settings.md +20 -31
  33. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/overview.md +24 -40
  34. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/platform-map.md +28 -59
  35. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/skills-and-commands.md +12 -28
  36. package/dist/templates/common/bundled-skills/trellis-skill-creator/references/trellis-skill-locations.md +2 -2
  37. package/dist/templates/cursor/hooks.json +6 -0
  38. package/dist/templates/cursor/rules/retrieval-routing.mdc +57 -0
  39. package/dist/templates/extract.d.ts +0 -14
  40. package/dist/templates/extract.d.ts.map +1 -1
  41. package/dist/templates/extract.js +0 -34
  42. package/dist/templates/extract.js.map +1 -1
  43. package/dist/templates/markdown/agents.md +2 -6
  44. package/dist/templates/markdown/index.d.ts +1 -0
  45. package/dist/templates/markdown/index.d.ts.map +1 -1
  46. package/dist/templates/markdown/index.js +1 -0
  47. package/dist/templates/markdown/index.js.map +1 -1
  48. package/dist/templates/markdown/prompts/run-semantic-slice-12.md.txt +41 -0
  49. package/dist/templates/markdown/spec/guides/code-reuse-thinking-guide.md.txt +14 -14
  50. package/dist/templates/markdown/spec/guides/cross-layer-thinking-guide.md.txt +8 -20
  51. package/dist/templates/markdown/spec/guides/cross-platform-thinking-guide.md.txt +15 -14
  52. package/dist/templates/markdown/spec/guides/cursor-context-injection-guide.md.txt +2 -1
  53. package/dist/templates/markdown/spec/guides/cursor-semantic-compliance.md.txt +49 -0
  54. package/dist/templates/markdown/spec/guides/cursor-subagent-policy.md.txt +2 -2
  55. package/dist/templates/markdown/spec/guides/retrieval-daily-guide.md.txt +68 -20
  56. package/dist/templates/shared-hooks/index.d.ts +1 -1
  57. package/dist/templates/shared-hooks/index.d.ts.map +1 -1
  58. package/dist/templates/shared-hooks/index.js +1 -0
  59. package/dist/templates/shared-hooks/index.js.map +1 -1
  60. package/dist/templates/shared-hooks/inject-retrieval-plan.py +163 -0
  61. package/dist/templates/shared-hooks/research-end-retrieval-pack.py +2 -11
  62. package/dist/templates/trellis/index.d.ts +11 -0
  63. package/dist/templates/trellis/index.d.ts.map +1 -1
  64. package/dist/templates/trellis/index.js +22 -0
  65. package/dist/templates/trellis/index.js.map +1 -1
  66. package/dist/templates/trellis/scripts/aggregate_retrieval_telemetry.py +342 -0
  67. package/dist/templates/trellis/scripts/batch_plan_envelope.py +105 -0
  68. package/dist/templates/trellis/scripts/codegraph_session_smoke.py +76 -0
  69. package/dist/templates/trellis/scripts/common/active_task.py +116 -147
  70. package/dist/templates/trellis/scripts/common/cli_adapter.py +34 -710
  71. package/dist/templates/trellis/scripts/common/codebase_retrieval_router.py +49 -106
  72. package/dist/templates/trellis/scripts/common/git_context.py +17 -2
  73. package/dist/templates/trellis/scripts/common/project_file_stats.py +91 -0
  74. package/dist/templates/trellis/scripts/common/retrieval_adapter_metadata.py +9 -11
  75. package/dist/templates/trellis/scripts/common/retrieval_agent_instructions.py +313 -0
  76. package/dist/templates/trellis/scripts/common/retrieval_pack.py +0 -6
  77. package/dist/templates/trellis/scripts/common/retrieval_pack_context.py +0 -4
  78. package/dist/templates/trellis/scripts/common/retrieval_plan_gate.py +76 -0
  79. package/dist/templates/trellis/scripts/common/retrieval_result_ranking.py +253 -0
  80. package/dist/templates/trellis/scripts/common/retrieval_tool_classification.py +157 -0
  81. package/dist/templates/trellis/scripts/common/semantic_plan_gate.py +52 -0
  82. package/dist/templates/trellis/scripts/common/workflow_phase.py +3 -24
  83. package/dist/templates/trellis/scripts/rank_retrieval_candidates.py +80 -0
  84. package/dist/templates/trellis/scripts/route_codebase_retrieval.py +38 -11
  85. package/dist/templates/trellis/scripts/score_evidence.py +112 -0
  86. package/dist/templates/trellis/workflow.md +861 -960
  87. package/dist/types/ai-tools.d.ts +13 -16
  88. package/dist/types/ai-tools.d.ts.map +1 -1
  89. package/dist/types/ai-tools.js +5 -238
  90. package/dist/types/ai-tools.js.map +1 -1
  91. package/dist/utils/codebase-retrieval-router.d.ts +1 -8
  92. package/dist/utils/codebase-retrieval-router.d.ts.map +1 -1
  93. package/dist/utils/codebase-retrieval-router.js +39 -180
  94. package/dist/utils/codebase-retrieval-router.js.map +1 -1
  95. package/dist/utils/project-capabilities.d.ts.map +1 -1
  96. package/dist/utils/project-capabilities.js +10 -24
  97. package/dist/utils/project-capabilities.js.map +1 -1
  98. package/dist/utils/retrieval-agent-instructions.d.ts +14 -0
  99. package/dist/utils/retrieval-agent-instructions.d.ts.map +1 -0
  100. package/dist/utils/retrieval-agent-instructions.js +221 -0
  101. package/dist/utils/retrieval-agent-instructions.js.map +1 -0
  102. package/dist/utils/retrieval-execution-telemetry.d.ts +43 -85
  103. package/dist/utils/retrieval-execution-telemetry.d.ts.map +1 -1
  104. package/dist/utils/retrieval-execution-telemetry.js +289 -22
  105. package/dist/utils/retrieval-execution-telemetry.js.map +1 -1
  106. package/dist/utils/retrieval-result-ranking.js +1 -1
  107. package/dist/utils/retrieval-result-ranking.js.map +1 -1
  108. package/dist/utils/retrieval-tool-classification.d.ts +32 -0
  109. package/dist/utils/retrieval-tool-classification.d.ts.map +1 -0
  110. package/dist/utils/retrieval-tool-classification.js +113 -0
  111. package/dist/utils/retrieval-tool-classification.js.map +1 -0
  112. package/dist/utils/uninstall-scrubbers.d.ts +0 -36
  113. package/dist/utils/uninstall-scrubbers.d.ts.map +1 -1
  114. package/dist/utils/uninstall-scrubbers.js +0 -184
  115. package/dist/utils/uninstall-scrubbers.js.map +1 -1
  116. package/package.json +4 -2
  117. package/dist/commands/mem.d.ts +0 -30
  118. package/dist/commands/mem.d.ts.map +0 -1
  119. package/dist/commands/mem.js +0 -424
  120. package/dist/commands/mem.js.map +0 -1
  121. package/dist/configurators/antigravity.d.ts +0 -7
  122. package/dist/configurators/antigravity.d.ts.map +0 -1
  123. package/dist/configurators/antigravity.js +0 -19
  124. package/dist/configurators/antigravity.js.map +0 -1
  125. package/dist/configurators/claude.d.ts +0 -9
  126. package/dist/configurators/claude.d.ts.map +0 -1
  127. package/dist/configurators/claude.js +0 -72
  128. package/dist/configurators/claude.js.map +0 -1
  129. package/dist/configurators/codebuddy.d.ts +0 -10
  130. package/dist/configurators/codebuddy.d.ts.map +0 -1
  131. package/dist/configurators/codebuddy.js +0 -30
  132. package/dist/configurators/codebuddy.js.map +0 -1
  133. package/dist/configurators/codex.d.ts +0 -8
  134. package/dist/configurators/codex.d.ts.map +0 -1
  135. package/dist/configurators/codex.js +0 -87
  136. package/dist/configurators/codex.js.map +0 -1
  137. package/dist/configurators/copilot.d.ts +0 -10
  138. package/dist/configurators/copilot.d.ts.map +0 -1
  139. package/dist/configurators/copilot.js +0 -51
  140. package/dist/configurators/copilot.js.map +0 -1
  141. package/dist/configurators/droid.d.ts +0 -10
  142. package/dist/configurators/droid.d.ts.map +0 -1
  143. package/dist/configurators/droid.js +0 -30
  144. package/dist/configurators/droid.js.map +0 -1
  145. package/dist/configurators/gemini.d.ts +0 -16
  146. package/dist/configurators/gemini.d.ts.map +0 -1
  147. package/dist/configurators/gemini.js +0 -38
  148. package/dist/configurators/gemini.js.map +0 -1
  149. package/dist/configurators/kilo.d.ts +0 -7
  150. package/dist/configurators/kilo.d.ts.map +0 -1
  151. package/dist/configurators/kilo.js +0 -19
  152. package/dist/configurators/kilo.js.map +0 -1
  153. package/dist/configurators/kiro.d.ts +0 -8
  154. package/dist/configurators/kiro.d.ts.map +0 -1
  155. package/dist/configurators/kiro.js +0 -24
  156. package/dist/configurators/kiro.js.map +0 -1
  157. package/dist/configurators/opencode.d.ts +0 -14
  158. package/dist/configurators/opencode.d.ts.map +0 -1
  159. package/dist/configurators/opencode.js +0 -96
  160. package/dist/configurators/opencode.js.map +0 -1
  161. package/dist/configurators/pi.d.ts +0 -3
  162. package/dist/configurators/pi.d.ts.map +0 -1
  163. package/dist/configurators/pi.js +0 -45
  164. package/dist/configurators/pi.js.map +0 -1
  165. package/dist/configurators/qoder.d.ts +0 -11
  166. package/dist/configurators/qoder.d.ts.map +0 -1
  167. package/dist/configurators/qoder.js +0 -31
  168. package/dist/configurators/qoder.js.map +0 -1
  169. package/dist/configurators/windsurf.d.ts +0 -7
  170. package/dist/configurators/windsurf.d.ts.map +0 -1
  171. package/dist/configurators/windsurf.js +0 -19
  172. package/dist/configurators/windsurf.js.map +0 -1
  173. package/dist/templates/claude/agents/trellis-check.md +0 -124
  174. package/dist/templates/claude/agents/trellis-implement.md +0 -110
  175. package/dist/templates/claude/agents/trellis-research.md +0 -137
  176. package/dist/templates/claude/index.d.ts +0 -22
  177. package/dist/templates/claude/index.d.ts.map +0 -1
  178. package/dist/templates/claude/index.js +0 -46
  179. package/dist/templates/claude/index.js.map +0 -1
  180. package/dist/templates/claude/settings.json +0 -84
  181. package/dist/templates/codebuddy/agents/trellis-check.md +0 -115
  182. package/dist/templates/codebuddy/agents/trellis-implement.md +0 -110
  183. package/dist/templates/codebuddy/agents/trellis-research.md +0 -137
  184. package/dist/templates/codebuddy/index.d.ts +0 -15
  185. package/dist/templates/codebuddy/index.d.ts.map +0 -1
  186. package/dist/templates/codebuddy/index.js +0 -15
  187. package/dist/templates/codebuddy/index.js.map +0 -1
  188. package/dist/templates/codebuddy/settings.json +0 -70
  189. package/dist/templates/codex/agents/trellis-check.toml +0 -67
  190. package/dist/templates/codex/agents/trellis-implement.toml +0 -40
  191. package/dist/templates/codex/agents/trellis-research.toml +0 -73
  192. package/dist/templates/codex/config.toml +0 -28
  193. package/dist/templates/codex/hooks/session-start.py +0 -575
  194. package/dist/templates/codex/hooks.json +0 -15
  195. package/dist/templates/codex/index.d.ts +0 -39
  196. package/dist/templates/codex/index.d.ts.map +0 -1
  197. package/dist/templates/codex/index.js +0 -85
  198. package/dist/templates/codex/index.js.map +0 -1
  199. package/dist/templates/codex/skills/before-dev/SKILL.md +0 -40
  200. package/dist/templates/codex/skills/brainstorm/SKILL.md +0 -112
  201. package/dist/templates/codex/skills/break-loop/SKILL.md +0 -130
  202. package/dist/templates/codex/skills/check/SKILL.md +0 -98
  203. package/dist/templates/codex/skills/check-cross-layer/SKILL.md +0 -158
  204. package/dist/templates/codex/skills/create-command/SKILL.md +0 -101
  205. package/dist/templates/codex/skills/finish-work/SKILL.md +0 -90
  206. package/dist/templates/codex/skills/improve-ut/SKILL.md +0 -69
  207. package/dist/templates/codex/skills/integrate-skill/SKILL.md +0 -221
  208. package/dist/templates/codex/skills/onboard/SKILL.md +0 -363
  209. package/dist/templates/codex/skills/record-session/SKILL.md +0 -67
  210. package/dist/templates/codex/skills/start/SKILL.md +0 -66
  211. package/dist/templates/codex/skills/update-spec/SKILL.md +0 -335
  212. package/dist/templates/copilot/hooks/session-start.py +0 -557
  213. package/dist/templates/copilot/hooks.json +0 -19
  214. package/dist/templates/copilot/index.d.ts +0 -23
  215. package/dist/templates/copilot/index.d.ts.map +0 -1
  216. package/dist/templates/copilot/index.js +0 -54
  217. package/dist/templates/copilot/index.js.map +0 -1
  218. package/dist/templates/copilot/prompts/before-dev.prompt.md +0 -39
  219. package/dist/templates/copilot/prompts/brainstorm.prompt.md +0 -111
  220. package/dist/templates/copilot/prompts/break-loop.prompt.md +0 -129
  221. package/dist/templates/copilot/prompts/check-cross-layer.prompt.md +0 -157
  222. package/dist/templates/copilot/prompts/check.prompt.md +0 -97
  223. package/dist/templates/copilot/prompts/create-command.prompt.md +0 -116
  224. package/dist/templates/copilot/prompts/finish-work.prompt.md +0 -99
  225. package/dist/templates/copilot/prompts/integrate-skill.prompt.md +0 -223
  226. package/dist/templates/copilot/prompts/onboard.prompt.md +0 -362
  227. package/dist/templates/copilot/prompts/parallel.prompt.md +0 -204
  228. package/dist/templates/copilot/prompts/record-session.prompt.md +0 -66
  229. package/dist/templates/copilot/prompts/start.prompt.md +0 -63
  230. package/dist/templates/copilot/prompts/update-spec.prompt.md +0 -358
  231. package/dist/templates/droid/droids/trellis-check.md +0 -107
  232. package/dist/templates/droid/droids/trellis-implement.md +0 -102
  233. package/dist/templates/droid/droids/trellis-research.md +0 -137
  234. package/dist/templates/droid/index.d.ts +0 -15
  235. package/dist/templates/droid/index.d.ts.map +0 -1
  236. package/dist/templates/droid/index.js +0 -15
  237. package/dist/templates/droid/index.js.map +0 -1
  238. package/dist/templates/droid/settings.json +0 -70
  239. package/dist/templates/gemini/agents/trellis-check.md +0 -107
  240. package/dist/templates/gemini/agents/trellis-implement.md +0 -102
  241. package/dist/templates/gemini/agents/trellis-research.md +0 -136
  242. package/dist/templates/gemini/index.d.ts +0 -13
  243. package/dist/templates/gemini/index.d.ts.map +0 -1
  244. package/dist/templates/gemini/index.js +0 -13
  245. package/dist/templates/gemini/index.js.map +0 -1
  246. package/dist/templates/gemini/settings.json +0 -28
  247. package/dist/templates/kiro/agents/trellis-check.json +0 -26
  248. package/dist/templates/kiro/agents/trellis-implement.json +0 -26
  249. package/dist/templates/kiro/agents/trellis-research.json +0 -30
  250. package/dist/templates/kiro/index.d.ts +0 -18
  251. package/dist/templates/kiro/index.d.ts.map +0 -1
  252. package/dist/templates/kiro/index.js +0 -18
  253. package/dist/templates/kiro/index.js.map +0 -1
  254. package/dist/templates/opencode/agents/trellis-check.md +0 -122
  255. package/dist/templates/opencode/agents/trellis-implement.md +0 -118
  256. package/dist/templates/opencode/agents/trellis-research.md +0 -145
  257. package/dist/templates/opencode/lib/session-utils.js +0 -667
  258. package/dist/templates/opencode/lib/trellis-context.js +0 -336
  259. package/dist/templates/opencode/package.json +0 -5
  260. package/dist/templates/opencode/plugins/inject-subagent-context.js +0 -495
  261. package/dist/templates/opencode/plugins/inject-workflow-state.js +0 -159
  262. package/dist/templates/opencode/plugins/session-start.js +0 -101
  263. package/dist/templates/pi/agents/trellis-check.md +0 -37
  264. package/dist/templates/pi/agents/trellis-implement.md +0 -42
  265. package/dist/templates/pi/agents/trellis-research.md +0 -25
  266. package/dist/templates/pi/extensions/trellis/index.ts.txt +0 -1600
  267. package/dist/templates/pi/index.d.ts +0 -5
  268. package/dist/templates/pi/index.d.ts.map +0 -1
  269. package/dist/templates/pi/index.js +0 -12
  270. package/dist/templates/pi/index.js.map +0 -1
  271. package/dist/templates/pi/settings.json +0 -12
  272. package/dist/templates/qoder/agents/trellis-check.md +0 -108
  273. package/dist/templates/qoder/agents/trellis-implement.md +0 -103
  274. package/dist/templates/qoder/agents/trellis-research.md +0 -137
  275. package/dist/templates/qoder/index.d.ts +0 -15
  276. package/dist/templates/qoder/index.d.ts.map +0 -1
  277. package/dist/templates/qoder/index.js +0 -15
  278. package/dist/templates/qoder/index.js.map +0 -1
  279. package/dist/templates/qoder/settings.json +0 -47
@@ -35,15 +35,18 @@ This page only describes files that are visible and editable inside the user pro
35
35
 
36
36
  ## Platform Directories
37
37
 
38
- Different platforms generate different directories. Common categories:
38
+ On a fresh `trellis init --cursor`, the only platform directory created is `.cursor/`. Trellis previously generated per-platform directories for many AI tools (`.claude/`, `.codex/`, `.opencode/`, etc.); those legacy directories are preserved by `trellis update` but new Trellis behavior ships to `.cursor/` only.
39
39
 
40
- | Category | Example paths | Purpose |
40
+ Common categories inside `.cursor/`:
41
+
42
+ | Category | Path | Purpose |
41
43
  | --- | --- | --- |
42
- | hooks | `.claude/hooks/`, `.codex/hooks/`, `.cursor/hooks/` | Inject session context, workflow-state, and sub-agent context. |
43
- | settings | `.claude/settings.json`, `.codex/hooks.json`, `.qoder/settings.json` | Tell the platform when to run hooks or plugins. |
44
- | agents | `.claude/agents/`, `.codex/agents/`, `.kiro/agents/` | Define agents such as `trellis-research`, `trellis-implement`, and `trellis-check`. |
45
- | skills | `.claude/skills/`, `.agents/skills/`, `.qoder/skills/` | Skills that auto-trigger or can be read by AI. |
46
- | commands/prompts/workflows | `.cursor/commands/`, `.github/prompts/`, `.windsurf/workflows/` | Explicit user-invoked command or workflow entry points. |
44
+ | hooks | `.cursor/hooks/` | Hook scripts invoked from `.cursor/hooks.json`. Inject session context, workflow-state, and sub-agent context. |
45
+ | settings/registration | `.cursor/hooks.json` | Registers which scripts run on which Cursor events. |
46
+ | rules | `.cursor/rules/*.mdc` (`alwaysApply: true`) | Per-turn policy prepended before every prompt. |
47
+ | agents | `.cursor/agents/` | Define agents such as `trellis-research`, `trellis-implement`, and `trellis-check`. |
48
+ | skills | `.cursor/skills/` | Skills that auto-trigger or can be read by AI. |
49
+ | commands | `.cursor/commands/` | Legacy compatibility-only user-invoked entry points. |
47
50
 
48
51
  When modifying a platform directory, also confirm whether `.trellis/workflow.md` still describes the same flow.
49
52
 
@@ -5,8 +5,8 @@
5
5
  Therefore, when an AI uses this skill, the default customization target is local files inside the user project:
6
6
 
7
7
  - `.trellis/`: workflow, tasks, specs, memory, scripts, and runtime state.
8
- - Platform directories: `.claude/`, `.codex/`, `.cursor/`, `.opencode/`, `.kiro/`, `.gemini/`, `.qoder/`, `.codebuddy/`, `.github/`, `.factory/`, `.pi/`, `.kilocode/`, `.agent/`, `.windsurf/`, and similar directories.
9
- - Shared skill layer: `.agents/skills/`.
8
+ - Platform directory: `.cursor/` skills, agents, hooks, commands, rules.
9
+ - Shared skill layer: `.agents/skills/` (industry skill-sharing path; kept when present but not extended by new Trellis behavior).
10
10
 
11
11
  Do not default to guiding the user to fork the Trellis CLI repository. Treat upstream source code as the operating target only when the user explicitly says they want to change Trellis upstream source, publish an npm package, or contribute a PR.
12
12
 
@@ -30,7 +30,7 @@ All three layers live inside the user project, so an AI can read and modify them
30
30
  | `.trellis/tasks/` | Each task's PRD, technical notes, research files, and JSONL context. |
31
31
  | `.trellis/workspace/` | Per-developer journals and cross-session memory. |
32
32
  | `.trellis/scripts/` | Local Python runtime used by commands, hooks, and context injection. |
33
- | `.trellis/.runtime/` | Session-level runtime state, such as the selected task pointer. |
33
+ | `.trellis/.runtime/` | Session-level runtime state, such as the selected task pointer. |
34
34
  | `.trellis/.template-hashes.json` | Template hashes for Trellis-managed files, used by update to determine whether local files were modified by the user. |
35
35
 
36
36
  ## AI Customization Principles
@@ -45,7 +45,7 @@ All three layers live inside the user project, so an AI can read and modify them
45
45
 
46
46
  - To understand which files exist after init, read `generated-files.md`.
47
47
  - To change phases, routing, or next actions, read `workflow.md`.
48
- - To change the task model, JSONL context, or selected task behavior, read `task-system.md`.
48
+ - To change the task model, JSONL context, or selected task behavior, read `task-system.md`.
49
49
  - To change coding convention injection, read `spec-system.md`.
50
50
  - To understand journals and cross-session memory, read `workspace-memory.md`.
51
51
  - To change hooks or sub-agent context loading, read `context-injection.md`.
@@ -6,75 +6,64 @@ Trellis agent files define specialized roles. Common Trellis agents in a user pr
6
6
  - `trellis-implement`
7
7
  - `trellis-check`
8
8
 
9
- File locations and formats differ by platform, but responsibility boundaries should stay consistent.
9
+ Responsibility boundaries should stay consistent regardless of file format.
10
+
11
+ > Trellis previously shipped agent files in per-platform directories for many AI tools (`.claude/agents/`, `.codex/agents/`, `.kiro/agents/`, etc.). The project has converged on **Cursor-only**. New agent definitions ship into `.cursor/agents/`; legacy agent directories in upgraded projects are preserved but not extended.
10
12
 
11
13
  ## Agent Responsibilities
12
14
 
13
15
  | Agent | Responsibility |
14
16
  | --- | --- |
15
- | `trellis-research` | Investigate the question and write findings into the selected task's `research/`. |
17
+ | `trellis-research` | Investigate the question and write findings into the selected task's `research/`. |
16
18
  | `trellis-implement` | Implement against `prd.md`, optional `design.md` / `implement.md`, `implement.jsonl`, and related spec/research. |
17
19
  | `trellis-check` | Review changes, fix discovered issues, and run necessary checks. |
18
20
 
19
21
  Agent files should not become generic chat prompts. They should define input sources, write boundaries, whether code may be changed, and how results are reported.
20
22
 
21
- ## Common Paths
23
+ ## Common Paths (Cursor)
22
24
 
23
25
  | Platform | Agent path |
24
26
  | --- | --- |
25
- | Claude Code | `.claude/agents/trellis-*.md` |
26
27
  | Cursor | `.cursor/agents/trellis-*.md` |
27
- | OpenCode | `.opencode/agents/trellis-*.md` |
28
- | Codex | `.codex/agents/trellis-*.toml` |
29
- | Kiro | `.kiro/agents/trellis-*.json` |
30
- | Gemini CLI | `.gemini/agents/trellis-*.md` |
31
- | Qoder | `.qoder/agents/trellis-*.md` |
32
- | CodeBuddy | `.codebuddy/agents/trellis-*.md` |
33
- | Factory Droid | `.factory/droids/trellis-*.md` |
34
- | Pi Agent | `.pi/agents/trellis-*.md` |
35
-
36
- GitHub Copilot agent/prompt support is provided by a combination of directories such as `.github/agents/`, `.github/prompts/`, and `.github/skills/`; inspect the files actually generated in the user project.
37
28
 
38
- Main-session workflow platforms such as Kilo, Antigravity, and Windsurf may not have Trellis sub-agent files. They usually rely on workflows/skills to guide the main session.
29
+ Agent files are dispatched via the Cursor Task tool, opened as Agent sessions, or invoked inline as Skill forms depending on the entry point. See `cursor-subagent-policy.md.txt` for the full entry-point matrix and Method 1–2.6 model dispatch strategy.
39
30
 
40
31
  ## Two Context Loading Modes
41
32
 
42
33
  ### hook push
43
34
 
44
- The platform hook injects task context before the agent starts. The agent file itself can focus more on responsibilities and boundaries.
45
-
46
- Common on platforms that support agent hooks.
35
+ The Cursor hook (`inject-subagent-context.py`, registered in `.cursor/hooks.json`) injects task context before the agent starts. The agent file itself can focus more on responsibilities and boundaries.
47
36
 
48
37
  ### agent pull
49
38
 
50
39
  The agent file instructs the agent to read after startup:
51
40
 
52
- - `python3 ./.trellis/scripts/task.py selected --source`
53
- - `implement.jsonl` or `check.jsonl`
54
- - spec/research files referenced by JSONL
55
- - selected task `prd.md`
41
+ - `python3 ./.trellis/scripts/task.py selected --source`
42
+ - `implement.jsonl` or `check.jsonl`
43
+ - spec/research files referenced by JSONL
44
+ - selected task `prd.md`
56
45
  - `design.md` if present
57
46
  - `implement.md` if present
58
47
 
59
- This mode fits platforms whose hooks cannot reliably rewrite sub-agent prompts.
48
+ This mode fits cases where the hook cannot reliably rewrite the sub-agent prompt or the entry point is an Agent session that bypasses the Task hook path.
60
49
 
61
50
  ## Local Change Scenarios
62
51
 
63
52
  | User need | Edit location |
64
53
  | --- | --- |
65
- | Implement agent must follow extra restrictions | The platform's `trellis-implement` agent file. |
66
- | Check agent must run project-specific commands | `trellis-check` agent file, and `.trellis/spec/` if needed. |
67
- | Research agent must output a fixed format | `trellis-research` agent file. |
68
- | Agent cannot read task context | Agent prelude or `inject-subagent-context` hook. |
69
- | Add a project-specific agent | Platform agent directory + related workflow/command/skill entry point. |
54
+ | Implement agent must follow extra restrictions | `.cursor/agents/trellis-implement.md`. |
55
+ | Check agent must run project-specific commands | `.cursor/agents/trellis-check.md`, and `.trellis/spec/` if needed. |
56
+ | Research agent must output a fixed format | `.cursor/agents/trellis-research.md`. |
57
+ | Agent cannot read task context | Agent prelude in the agent file, or the `inject-subagent-context` hook registration in `.cursor/hooks.json`. |
58
+ | Add a project-specific agent | `.cursor/agents/` + related skill/command entry point that invokes it. |
70
59
 
71
60
  ## Modification Principles
72
61
 
73
62
  1. **Keep responsibilities single-purpose**. Do not mix research, implement, and check responsibilities into one agent.
74
- 2. **Specify the read order**. Agents must know to start from the selected task, read jsonl/spec context, then read `prd.md`, `design.md` if present, and `implement.md` if present.
63
+ 2. **Specify the read order**. Agents must know to start from the selected task, read jsonl/spec context, then read `prd.md`, `design.md` if present, and `implement.md` if present.
75
64
  3. **Specify write boundaries**. Research usually only writes `research/`; implement can write code; check can fix issues.
76
- 4. **Keep semantics synchronized in multi-platform projects**. If the user configured Claude, Codex, and Cursor together, decide whether changes to one platform's agent also need to be applied to others.
65
+ 4. **Treat dogfood + published copies consistently**. `.cursor/agents/trellis-*.md` (dogfooded) and `packages/cli/src/templates/cursor/agents/trellis-*.md` (published template) must stay in sync see `cross-layer-thinking-guide.md.txt` Cross-Package Template Consistency.
77
66
 
78
67
  ## Do Not Default To Editing Upstream Templates
79
68
 
80
- Local AI should default to modifying platform agent files inside the user project. Discuss upstream template source only when the user explicitly wants to contribute the change back to Trellis.
69
+ Local AI should default to modifying agent files inside the user project's `.cursor/agents/`. Discuss upstream template source (`packages/cli/src/templates/cursor/agents/`) only when the user explicitly wants to contribute the change back to Trellis.
@@ -1,60 +1,49 @@
1
1
  # Hooks And Settings
2
2
 
3
- Hooks/settings are the entry layer that connects a platform to Trellis. They decide which scripts, plugins, or extensions a platform runs for which events.
3
+ Hooks/settings are the entry layer that connects Cursor to Trellis. They decide which scripts run on which Cursor events.
4
4
 
5
5
  ## Settings Responsibilities
6
6
 
7
- settings/config files usually register:
7
+ `.cursor/hooks.json` registers:
8
8
 
9
- - session-start hook: injects a Trellis overview when a new session starts or context resets.
10
- - workflow-state hook: parses `[workflow-state:STATUS]` blocks from `.trellis/workflow.md` and emits the body matching the selected task `status` on each user input. Parser-only; the script does not embed fallback content.
9
+ - session-start hook: injects a Trellis overview when a new session starts or context resets (note the Cursor `additional_context` bug #158452 — see `cursor-context-injection-guide.md.txt`).
10
+ - workflow-state hook: parses `[workflow-state:STATUS]` blocks from `.trellis/workflow.md` and emits the body matching the selected task `status` on each user input. Parser-only; the script does not embed fallback content.
11
11
  - sub-agent context hook: injects task context when implementation/check/research agents start.
12
12
  - shell/session bridge: lets shell commands see the same Trellis session identity.
13
- - platform plugin or extension entry points.
14
13
 
15
- Common files:
14
+ > Trellis previously shipped settings/config files for many platforms (`.claude/settings.json`, `.codex/hooks.json`, `.gemini/settings.json`, etc.). The project has converged on **Cursor-only**. New Trellis features ship into `.cursor/hooks.json` + `.cursor/hooks/`.
15
+
16
+ Whether legacy settings/config files exist in a project depends on which historical `trellis init --<platform>` flags the user previously ran; `trellis update` preserves them.
16
17
 
17
18
  | Platform | settings/config |
18
19
  | --- | --- |
19
- | Claude Code | `.claude/settings.json` |
20
20
  | Cursor | `.cursor/hooks.json` |
21
- | Codex | `.codex/hooks.json`, `.codex/config.toml` |
22
- | OpenCode | `.opencode/package.json`, `.opencode/plugins/*` |
23
- | Kiro | `.kiro/hooks/` + platform config |
24
- | Gemini CLI | `.gemini/settings.json` |
25
- | Qoder | `.qoder/settings.json` |
26
- | CodeBuddy | `.codebuddy/settings.json` |
27
- | GitHub Copilot | `.github/copilot/hooks.json` |
28
- | Factory Droid | `.factory/settings.json` |
29
- | Pi Agent | `.pi/settings.json`, `.pi/extensions/trellis/` |
30
-
31
- Whether these files exist in a project depends on which `trellis init --<platform>` flags the user ran.
32
21
 
33
22
  ## Hook Script Types
34
23
 
35
24
  | Script | Purpose |
36
25
  | --- | --- |
37
26
  | `session-start.py` | Generates session-start context. |
38
- | `inject-workflow-state.py` | Parses `[workflow-state:STATUS]` blocks in `.trellis/workflow.md` and emits the body matching the selected task status. Falls back to `Refer to workflow.md for current step.` when no matching block exists. |
27
+ | `inject-workflow-state.py` | Parses `[workflow-state:STATUS]` blocks in `.trellis/workflow.md` and emits the body matching the selected task status. Falls back to `Refer to workflow.md for current step.` when no matching block exists. |
39
28
  | `inject-subagent-context.py` | Injects PRD, JSONL context, and related spec/research into sub-agents. |
40
29
  | `inject-shell-session-context.py` | Lets shell commands inherit Trellis session identity. |
41
30
 
42
- Not every platform has every hook. Do not copy files from another platform just because a platform lacks a hook; first confirm whether that platform supports the corresponding event.
31
+ Cursor exposes sessionStart, preToolUse on Task/Subagent, beforeShellExecution, and stop events. Confirm against the current Cursor release before wiring a new event name; the available event surface has evolved over time and historical platform documentation may be stale.
43
32
 
44
33
  ## Local Change Scenarios
45
34
 
46
35
  | User need | Edit location |
47
36
  | --- | --- |
48
- | AI should see more/less context in a new session | Platform `session-start` hook. |
37
+ | AI should see more/less context in a new session | `.cursor/hooks.json` `session-start` hook (or `.cursor/rules/*.mdc` for content the model must see every turn — see `cursor-context-injection-guide.md.txt`). |
49
38
  | Per-turn hint policy should change | `[workflow-state:STATUS]` block in `.trellis/workflow.md`. The hook parses workflow.md verbatim — no script edit required. |
50
- | Sub-agent cannot read PRD/spec | `inject-subagent-context` hook or agent prelude. |
51
- | `task.py selected` in shell has no selected task | Shell/session bridge hook or platform environment variable configuration. |
52
- | Disable an automatic injection | The corresponding hook registration in settings/config. |
39
+ | Sub-agent cannot read PRD/spec | `inject-subagent-context.py` hook or agent prelude in `.cursor/agents/*.md`. |
40
+ | `task.py selected` in shell has no selected task | `inject-shell-session-context.py` hook or environment-variable configuration. |
41
+ | Disable an automatic injection | The corresponding hook registration in `.cursor/hooks.json`. |
53
42
 
54
43
  ## Modification Principles
55
44
 
56
- 1. **Settings wire things up; hooks define behavior**. If only the hook changes, the platform may never call it. If only settings change, behavior may not change.
57
- 2. **Confirm platform event names first**. Different platforms use different names for SessionStart, UserPromptSubmit, AgentSpawn, shell execution, and similar events.
45
+ 1. **Settings wire things up; hooks define behavior**. If only the hook changes, Cursor may never call it. If only settings change, behavior may not change.
46
+ 2. **Confirm Cursor event names first**. Cursor's hook event surface has changed between releases; what an older guide calls `UserPromptSubmit` may now be modeled by `beforeSubmitPrompt` instead.
58
47
  3. **Hooks read local `.trellis/`, not upstream source**. `.trellis/scripts/` and `.trellis/workflow.md` in the user project are the default targets.
59
48
  4. **Errors must be visible**. Hook failures should tell the user what was not injected instead of silently leaving the AI without context.
60
49
 
@@ -62,8 +51,8 @@ Not every platform has every hook. Do not copy files from another platform just
62
51
 
63
52
  If the user says "AI did not read Trellis state":
64
53
 
65
- 1. Check whether the platform settings register the hook.
66
- 2. Check whether the hook file exists.
67
- 3. Manually run the `.trellis/scripts/get_context.py` or `task.py selected --source` command that the hook depends on.
68
- 4. Check whether selected task state exists in `.trellis/.runtime/sessions/`.
69
- 5. Check whether the platform shell passes session identity.
54
+ 1. Check whether `.cursor/hooks.json` registers the hook.
55
+ 2. Check whether the hook file exists under `.cursor/hooks/`.
56
+ 3. Manually run the `.trellis/scripts/get_context.py` or `task.py selected --source` command that the hook depends on.
57
+ 4. Check whether selected task state exists in `.trellis/.runtime/sessions/`.
58
+ 5. Check whether the Cursor shell passes session identity.
@@ -1,60 +1,44 @@
1
1
  # Platform Files Overview
2
2
 
3
- Trellis connects the same local architecture to different AI tools. `.trellis/` stores the shared runtime; platform directories store adapter files that define how each AI tool enters Trellis.
3
+ Trellis connects the same local architecture to **Cursor**. `.trellis/` stores the shared runtime; `.cursor/` stores adapter files that define how Cursor enters Trellis.
4
4
 
5
- When a local AI modifies Trellis, it should distinguish two file categories first:
6
-
7
- - **Shared files**: `.trellis/workflow.md`, `.trellis/tasks/`, `.trellis/spec/`, `.trellis/scripts/`.
8
- - **Platform files**: first-class `.claude/`, `.codex/`, `.cursor/`; legacy adapter directories such as `.opencode/`, `.kiro/`, `.gemini/`, `.qoder/`, `.codebuddy/`, `.github/`, `.factory/`, `.pi/`, `.kilocode/`, `.agent/`, `.windsurf/`, and similar directories.
9
-
10
- Platform files do not store business state. They let the corresponding AI tool read Trellis state, call Trellis scripts, and load Trellis skills/agents/hooks.
11
-
12
- This fork actively targets Claude Code, Codex, and Cursor as first-class platform surfaces. Other adapter directories may still exist when explicitly selected or already configured, but new workflow/runtime behavior should not assume they are equally verified without a dedicated compatibility pass.
5
+ When a local AI modifies Trellis, it should distinguish two file categories first:
13
6
 
14
- ## Platform File Categories
7
+ - **Shared files**: `.trellis/workflow.md`, `.trellis/tasks/`, `.trellis/spec/`, `.trellis/scripts/`.
8
+ - **Platform files**: `.cursor/` (settings, hooks, agents, skills, commands, rules).
15
9
 
16
- | Category | Common paths | Purpose |
17
- | --- | --- | --- |
18
- | settings/config | `.claude/settings.json`, `.codex/hooks.json`, `.qoder/settings.json` | Register hooks, plugins, extensions, or platform behavior. |
19
- | hooks/plugins/extensions | `.claude/hooks/`, `.opencode/plugins/`, `.pi/extensions/` | Inject context at session start, user input, agent startup, shell execution, and similar events. |
20
- | agents | `.claude/agents/`, `.codex/agents/`, `.kiro/agents/` | Define `trellis-research`, `trellis-implement`, and `trellis-check`. |
21
- | skills | `.claude/skills/`, `.agents/skills/`, `.qoder/skills/` | Capability descriptions that auto-trigger or can be read on demand. |
22
- | commands/prompts/workflows | `.cursor/commands/`, `.github/prompts/`, `.windsurf/workflows/` | Entry points explicitly invoked by the user. |
23
-
24
- ## Three Platform Integration Modes
25
-
26
- ### 1. Hook / Extension Driven
27
-
28
- These platforms can trigger scripts or plugins on specific events and actively inject Trellis context into AI.
10
+ Platform files do not store business state. They let Cursor read Trellis state, call Trellis scripts, and load Trellis skills/agents/hooks.
29
11
 
30
- Common capabilities:
12
+ > **Historical note**: Trellis previously shipped adapter directories for many AI tools (`.claude/`, `.codex/`, `.opencode/`, etc.). The project has converged on **Cursor-only**. Legacy adapter directories may still exist in upgraded projects (`trellis update` preserves user files), but new framework/runtime behavior targets Cursor exclusively.
31
13
 
32
- - session-start injection of a `.trellis/` overview.
33
- - workflow-state hints for each user turn.
34
- - PRD/spec/research injection when sub-agents start.
35
- - Shell commands inheriting session identity.
14
+ ## Platform File Categories (Cursor)
36
15
 
37
- To change "when the AI knows what," inspect hooks/plugins/extensions and settings first.
38
-
39
- ### 2. Agent Prelude / Pull-Based
40
-
41
- Some platforms cannot reliably let hooks rewrite sub-agent prompts, so the agent file itself instructs the agent to read the selected task, PRD, and JSONL context after startup.
16
+ | Category | Common paths | Purpose |
17
+ | --- | --- | --- |
18
+ | settings/config | `.cursor/hooks.json` | Register hooks and platform behavior. |
19
+ | hooks | `.cursor/hooks/` | Inject context at session start, pre-tool-use on Task/Subagent, before-shell-execution, and stop events. |
20
+ | rules | `.cursor/rules/*.mdc` (`alwaysApply: true`) | Per-turn policy prepended before every prompt (e.g. Request Triage, retrieval routing). See `cursor-context-injection-guide.md.txt` for the channel-reliability matrix. |
21
+ | agents | `.cursor/agents/` | Define `trellis-research`, `trellis-implement`, and `trellis-check` for Task / Agent-session dispatch. |
22
+ | skills | `.cursor/skills/` | Capability descriptions that auto-trigger or can be read on demand. |
23
+ | commands | `.cursor/commands/` | User-invocable `/slash` entry points (e.g. `trellis-continue`, `record-session`). |
42
24
 
43
- To change how sub-agents load context, inspect the agent files themselves.
25
+ ## Cursor Integration Mode
44
26
 
45
- ### 3. Main-Session Workflow
27
+ Cursor combines three integration styles:
46
28
 
47
- Some platforms do not have Trellis sub-agent or hook capabilities. They rely on workflows/skills/commands to guide the main-session AI to read files, run scripts, and move tasks forward.
29
+ 1. **Hook / Extension Driven** `.cursor/hooks.json` + `.cursor/hooks/` fire on sessionStart, pre-tool-use on Task/Subagent, beforeShellExecution, and stop. Common capabilities: session-start Task Dashboard + Phase Index injection (note the `additional_context` Cursor bug #158452 — use `.cursor/rules` or `AGENTS.md` for must-always-be-visible content), PRD/jsonl injection when sub-agents start, shell commands inheriting session identity.
30
+ 2. **Agent Prelude / Pull-Based** — `.cursor/agents/*.md` instruct each custom Task subagent to read the selected task, PRD, and JSONL context after startup (the `<!-- trellis-hook-injected -->` marker confirms injected context).
31
+ 3. **Main-Session Workflow** — `.cursor/commands/*.md` and `.cursor/skills/*.md` guide the main-session AI to read files, run scripts, and move tasks forward; `.cursor/rules/*.mdc` enforce per-turn policy.
48
32
 
49
- To change behavior, inspect platform workflows/skills/commands and `.trellis/workflow.md`.
33
+ To change "when the AI knows what," inspect `.cursor/hooks.json` and `.cursor/rules/` first. To change how sub-agents load context, inspect `.cursor/agents/`. To change user-invocable entry points, inspect `.cursor/commands/` and `.cursor/skills/`.
50
34
 
51
35
  ## Local Modification Order
52
36
 
53
- When the user asks to customize behavior for a platform, the AI should inspect files in this order:
37
+ When the user asks to customize behavior:
54
38
 
55
39
  1. Read `.trellis/workflow.md` to confirm the shared flow.
56
- 2. Read the target platform's settings/config to see which hooks/agents/skills/commands are registered.
57
- 3. Read the target platform's agents/skills/commands/hooks.
40
+ 2. Read `.cursor/hooks.json` to see which hooks are registered.
41
+ 3. Read the relevant `.cursor/agents/*.md`, `.cursor/skills/*/SKILL.md`, `.cursor/commands/*.md`, and `.cursor/rules/*.mdc`.
58
42
  4. Modify the local file closest to the user's need.
59
43
  5. If the change affects the shared flow, synchronize `.trellis/workflow.md` or `.trellis/spec/`.
60
44
 
@@ -1,76 +1,45 @@
1
1
  # Platform File Map
2
2
 
3
- This page lists common Trellis file locations in a user project by platform. Whether a platform directory exists in an actual project depends on which `trellis init --<platform>` commands the user ran.
4
-
5
- This fork's first-class platform surfaces are Claude Code, Codex, and Cursor. Other rows are legacy adapters: keep them working when explicitly configured, but do not treat them as equal targets for new framework/runtime behavior without a compatibility pass.
3
+ This page lists Trellis file locations in a user project on **Cursor**.
6
4
 
7
- ## Matrix
8
-
9
- | Platform | Tier | CLI flag | Main directory | Skill directory | Agent directory | Hooks/extensions |
10
- | --- | --- | --- | --- | --- | --- | --- |
11
- | Claude Code | First-class | `--claude` | `.claude/` | `.claude/skills/` | `.claude/agents/` | `.claude/hooks/` + `.claude/settings.json` |
12
- | Cursor | First-class | `--cursor` | `.cursor/` | `.cursor/skills/` | `.cursor/agents/` | `.cursor/hooks.json` + `.cursor/hooks/` |
13
- | Codex | First-class | `--codex` | `.codex/` | `.agents/skills/` | `.codex/agents/` | `.codex/hooks/` + `.codex/hooks.json` |
14
- | OpenCode | Legacy adapter | `--opencode` | `.opencode/` | `.opencode/skills/` | `.opencode/agents/` | `.opencode/plugins/` |
15
- | Kilo | Legacy adapter | `--kilo` | `.kilocode/` | `.kilocode/skills/` | Usually none | `.kilocode/workflows/` |
16
- | Kiro | Legacy adapter | `--kiro` | `.kiro/` | `.kiro/skills/` | `.kiro/agents/` | `.kiro/hooks/` |
17
- | Gemini CLI | Legacy adapter | `--gemini` | `.gemini/` | `.agents/skills/` | `.gemini/agents/` | `.gemini/settings.json` + `.gemini/hooks/` |
18
- | Antigravity | Legacy adapter | `--antigravity` | `.agent/` | `.agent/skills/` | Usually none | `.agent/workflows/` |
19
- | Windsurf | Legacy adapter | `--windsurf` | `.windsurf/` | `.windsurf/skills/` | Usually none | `.windsurf/workflows/` |
20
- | Qoder | Legacy adapter | `--qoder` | `.qoder/` | `.qoder/skills/` | `.qoder/agents/` | `.qoder/hooks/` + `.qoder/settings.json` |
21
- | CodeBuddy | Legacy adapter | `--codebuddy` | `.codebuddy/` | `.codebuddy/skills/` | `.codebuddy/agents/` | `.codebuddy/hooks/` + `.codebuddy/settings.json` |
22
- | GitHub Copilot | Legacy adapter | `--copilot` | `.github/` | `.github/skills/` | `.github/agents/` | `.github/copilot/hooks/` + prompts |
23
- | Factory Droid | Legacy adapter | `--droid` | `.factory/` | `.factory/skills/` | `.factory/droids/` | `.factory/hooks/` + settings |
24
- | Pi Agent | Legacy adapter | `--pi` | `.pi/` | `.pi/skills/` | `.pi/agents/` | `.pi/extensions/trellis/` + `.pi/settings.json` |
25
-
26
- ## Capability Groups
27
-
28
- ### Trellis Sub-Agent Support
29
-
30
- These platforms usually have `trellis-research`, `trellis-implement`, and `trellis-check` files:
31
-
32
- - Claude Code
33
- - Cursor
34
- - OpenCode
35
- - Codex
36
- - Kiro
37
- - Gemini CLI
38
- - Qoder
39
- - CodeBuddy
40
- - GitHub Copilot
41
- - Factory Droid
42
- - Pi Agent
43
-
44
- When changing implementation/check/research behavior, look for the corresponding platform agent files first.
5
+ Trellis originally supported multiple AI platforms (Claude Code, Codex, OpenCode, Kilo, Kiro, Gemini, Antigravity, Windsurf, Qoder, CodeBuddy, GitHub Copilot, Factory Droid, Pi Agent). The project has since converged on **Cursor-only**. Legacy adapter directories may still exist in upgraded projects (`trellis update` preserves user files), but new framework/runtime behavior targets Cursor exclusively.
45
6
 
46
- ### Main-Session Workflow Platforms
47
-
48
- These platforms rely more on workflows/skills to guide the main session:
49
-
50
- - Kilo
51
- - Antigravity
52
- - Windsurf
7
+ ## Matrix
53
8
 
54
- When changing behavior, inspect workflows and skills first. Do not assume Trellis sub-agents exist.
9
+ | Platform | CLI flag | Main directory | Skill directory | Agent directory | Hooks/extensions |
10
+ | --- | --- | --- | --- | --- | --- |
11
+ | Cursor | `--cursor` | `.cursor/` | `.cursor/skills/` | `.cursor/agents/` | `.cursor/hooks.json` + `.cursor/hooks/` |
55
12
 
56
- ### Shared `.agents/skills/`
13
+ ## Capability Reference (Cursor)
57
14
 
58
- Codex writes the shared `.agents/skills/` layer. Some tools that support agentskills.io can also read this directory. If the user wants multiple compatible tools to share one skill, consider `.agents/skills/` first, but do not assume every platform reads it.
15
+ - **Skills** auto-trigger via the workflow matcher and can be read on demand. They live in `.cursor/skills/`.
16
+ - **Agents** (`trellis-research`, `trellis-implement`, `trellis-check`) live in `.cursor/agents/` and are dispatched via the Task tool or opened as Agent sessions / Skill forms depending on the entry point (see `cursor-subagent-policy.md.txt`).
17
+ - **Commands** (e.g. `record-session`, `trellis-continue`) live in `.cursor/commands/` and are user-invocable via `/slash`.
18
+ - **Hooks** (session start, pre-tool-use on Task/Subagent, before-shell-execution, stop) are registered in `.cursor/hooks.json` and their handler scripts live in `.cursor/hooks/`.
19
+ - **Project rules** (always-applied policy) live in `.cursor/rules/*.mdc`.
59
20
 
60
21
  ## Decision Rules When Modifying Platform Files
61
22
 
62
- 1. User specified a platform: modify only that platform directory unless shared workflow/spec files must also change.
63
- 2. User says "all platforms should do this": synchronize equivalent entry points platform by platform; do not modify only one directory.
64
- 3. User only says "my AI": inspect the configuration directories that actually exist in the project and infer the current AI platform.
65
- 4. User wants project rules: prefer `.trellis/spec/` or a project-local skill.
66
- 5. User wants Trellis behavior: edit `.trellis/workflow.md` plus platform hooks/agents/skills/commands.
23
+ 1. User specified a platform other than Cursor: treat as a legacy adapter inspection preserve existing files but do not extend new behavior there.
24
+ 2. User says "all platforms should do this": in Cursor-only world this is equivalent to "modify the Cursor path"; also mirror any dogfooded copy under `.cursor/` in `packages/cli/src/templates/cursor/` if applicable.
25
+ 3. User only says "my AI": inspect which directories actually exist in the project; on a fresh `trellis init` only `.cursor/` and `.trellis/` are created.
26
+ 4. User wants project rules: prefer `.trellis/spec/` or a project-local skill under `.cursor/skills/`.
27
+ 5. User wants Trellis behavior: edit `.trellis/workflow.md` plus `.cursor/hooks.json` / `.cursor/agents/` / `.cursor/skills/` / `.cursor/commands/`.
67
28
 
68
29
  ## When Paths Differ
69
30
 
70
- Platform ecosystems change, and user projects may already be customized. If this table disagrees with local files, use the actual settings/config in the user project as authoritative:
31
+ Cursor's layout can change between versions, and user projects may already be customized. If this table disagrees with local files, use the actual settings/config in the user project as authoritative:
71
32
 
72
- - Check the hook that settings registers.
73
- - Check the script that a command/prompt/workflow points to.
33
+ - Check the hook that `.cursor/hooks.json` registers.
34
+ - Check the script that a command/agent points to.
74
35
  - Judge behavior by the read rules currently written in the agent file.
75
36
 
76
37
  Do not delete a custom file just because it is not listed in this path table.
38
+
39
+ ## Legacy Adapter Handling
40
+
41
+ If a user project still contains legacy platform directories (e.g. `.claude/`, `.codex/`, `.opencode/`):
42
+
43
+ - `trellis update` preserves them; do not delete on sight.
44
+ - If the user asks to clean them up, suggest removing the unused platform directories after confirming they are not shared with another tool.
45
+ - Do not register new hooks/agents/skills/commands under legacy platform directories. New Trellis features ship to `.cursor/` only.
@@ -1,6 +1,6 @@
1
1
  # Skills, Commands, Prompts, And Workflows
2
2
 
3
- Skills and commands are textual entry points for user interaction with Trellis. Different platforms use different names, but their core purpose is the same: tell the AI how to enter the Trellis flow when the user expresses a certain intent.
3
+ Skills and commands are textual entry points for user interaction with Trellis. They tell the AI how to enter the Trellis flow when the user expresses a certain intent.
4
4
 
5
5
  ## Conceptual Differences
6
6
 
@@ -11,6 +11,8 @@ Skills and commands are textual entry points for user interaction with Trellis.
11
11
  | prompt | Explicit user invocation or platform selection | Similar to command, but in a platform prompt format. |
12
12
  | workflow | Explicit user selection or platform auto-match | Guides the main session when no sub-agent/hook exists. |
13
13
 
14
+ > Trellis previously shipped per-platform skill/command directories for many AI tools. The project has converged on **Cursor-only**. New skills and commands ship into `.cursor/`; legacy adapter directories in upgraded projects are preserved but not extended.
15
+
14
16
  Trellis has two skill families:
15
17
 
16
18
  - Workflow skills: `brainstorm`, `before-dev`, `check`, `update-spec`, and `break-loop`.
@@ -22,36 +24,19 @@ Bundled skills are installed as directories and may include nested `agents/`, `e
22
24
 
23
25
  `trellis-spec-bootstrap` bootstraps project-specific `.trellis/spec/` guidance from the real repository.
24
26
 
25
- `trellis-skill-creator` is the authoring and review guide for Trellis-compatible skills. Use it when creating or improving project-local skills, shared `.agents/skills/`, platform-specific skill directories, or upstream bundled skills. Keep `trellis-meta` focused on architecture and routing.
27
+ `trellis-skill-creator` is the authoring and review guide for Trellis-compatible skills. Use it when creating or improving project-local skills under `.cursor/skills/`, the shared `.agents/skills/` directory (industry skill-sharing, kept but not extended by new Trellis behavior), or upstream bundled skills. Keep `trellis-meta` focused on architecture and routing.
26
28
 
27
29
  `trellis-micro-grill` is the Trellis clarification adapter. It asks one high-value question at a time and escalates to Lite, Full, or Parent/Child task modes only when durable artifacts or broader risk require it.
28
30
 
29
- `trellis-cursor2plus-setup` guides Cursor++ BYOK users through `trellis-task-models.json5` (primary/fallback per Task role), `patch_wpelc8.py`, and Reload Window. Use after `trellis init` with Cursor or when `providers.json` changes.
31
+ `trellis-cursor2plus-setup` guides Cursor++ BYOK users through `trellis-task-models.json5` (primary/fallback per Task role), `patch_wpelc8.py`, and Reload Window. Use after `trellis init --cursor` or when `providers.json` changes.
30
32
 
31
- ## Common Paths
33
+ ## Common Paths (Cursor)
32
34
 
33
35
  | Platform | Common entries |
34
36
  | --- | --- |
35
- | Claude Code | `.claude/skills/`, `.claude/commands/` |
36
37
  | Cursor | `.cursor/skills/` (preferred); `.cursor/commands/` is legacy compatibility-only |
37
- | OpenCode | `.opencode/skills/`, `.opencode/commands/` |
38
- | Codex | `.agents/skills/`, `.codex/skills/` |
39
- | Kilo | `.kilocode/skills/`, `.kilocode/workflows/` |
40
- | Kiro | `.kiro/skills/` |
41
- | Gemini CLI | `.agents/skills/`, `.gemini/commands/` |
42
- | Antigravity | `.agent/skills/`, `.agent/workflows/` |
43
- | Windsurf | `.windsurf/skills/`, `.windsurf/workflows/` |
44
- | Qoder | `.qoder/skills/`, `.qoder/commands/` |
45
- | CodeBuddy | `.codebuddy/skills/`, `.codebuddy/commands/` |
46
- | GitHub Copilot | `.github/skills/`, `.github/prompts/` |
47
- | Factory Droid | `.factory/skills/`, `.factory/commands/` |
48
- | Pi Agent | `.pi/skills/` |
49
-
50
- In a user project, use the files actually generated by init as authoritative.
51
- On current Cursor, Trellis prefers Agent Skills for manual entrypoints such as
52
- `trellis-continue` and `trellis-finish-work`; legacy `.cursor/commands` files
53
- may exist in older projects but should be treated as an explicit compatibility
54
- surface rather than the default current-platform command surface.
38
+
39
+ In a user project, use the files actually generated by init as authoritative. On current Cursor, Trellis prefers Agent Skills for manual entrypoints such as `trellis-continue` and `trellis-finish-work`; legacy `.cursor/commands/` files may exist in older projects but should be treated as an explicit compatibility surface rather than the default current-platform command surface.
55
40
 
56
41
  ## Skill Structure
57
42
 
@@ -114,15 +99,14 @@ Do not reintroduce `task.py start`, `task.py current`, or `task.py finish` into
114
99
  | --- | --- |
115
100
  | Change AI auto-trigger rules | The corresponding skill's frontmatter description. |
116
101
  | Change user command behavior | The corresponding command/prompt/workflow file. |
117
- | Add a project-local skill | Platform skill directory, or shared `.agents/skills/`. |
118
- | Let multiple platforms share one capability | Write equivalent skills in each platform skill directory, or use the `.agents/skills/` shared layer on platforms that support it. |
119
- | Change finish/continue entry points | Platform commands/prompts/workflows; on current Cursor, prefer `.cursor/skills/trellis-continue` and `.cursor/skills/trellis-finish-work` over legacy `.cursor/commands`. |
102
+ | Add a project-local skill | `.cursor/skills/` (or `.agents/skills/` only when explicitly sharing with another non-Trellis tool that reads that path). |
103
+ | Change finish/continue entry points | On current Cursor, prefer `.cursor/skills/trellis-continue` and `.cursor/skills/trellis-finish-work` over legacy `.cursor/commands/`. |
120
104
 
121
105
  ## Modification Principles
122
106
 
123
107
  1. **Keep entry files short; references carry long content**. This matters especially for multi-file skills like `trellis-meta` and `trellis-skill-creator`.
124
108
  2. **Make trigger descriptions specific**. A description that is too broad can mis-trigger; one that is too narrow may not trigger.
125
- 3. **Keep the same semantics consistent across platforms**. File formats can differ, but behavior descriptions should match.
109
+ 3. **Keep behavior descriptions consistent with the shared `.trellis/` runtime**. Format may differ per file type, but semantics should match the shared workflow.
126
110
  4. **Put project-specific capabilities in local skills**. Do not put team-private flows into public `trellis-meta`.
127
111
 
128
- If the user only wants local AI to know one more project rule, usually create a project-local skill or update `.trellis/spec/` instead of changing a Trellis built-in workflow skill.
112
+ If the user only wants local AI to know one more project rule, usually create a project-local skill under `.cursor/skills/` or update `.trellis/spec/` instead of changing a Trellis built-in workflow skill.
@@ -6,8 +6,8 @@ Choose the target directory before writing content. Local files are authoritativ
6
6
 
7
7
  | User goal | Default location | Notes |
8
8
  | --- | --- | --- |
9
- | Add a skill for one Trellis project across compatible tools | `.agents/skills/<skill-name>/` | Good default for Codex and tools that read the shared agentskills layer. |
10
- | Add a skill for one specific platform | Platform skill directory such as `.claude/skills/`, `.cursor/skills/`, `.qoder/skills/`, or `.pi/skills/` | Use when the platform has unique syntax, trigger behavior, or runtime expectations. |
9
+ | Add a skill for one Trellis project on Cursor | `.cursor/skills/<skill-name>/` | Default target Trellis is Cursor-only. |
10
+ | Add a skill shared across tools that read the agentskills.io convention | `.agents/skills/<skill-name>/` | Use only when explicitly sharing with a non-Trellis tool that reads the shared agentskills layer. New Trellis behavior stays in `.cursor/skills/`. |
11
11
  | Change an existing local Trellis skill | The existing skill directory in the user's project | Preserve local customizations and read the current `SKILL.md` first. |
12
12
  | Add a public Trellis bundled skill | `packages/cli/src/templates/common/bundled-skills/<skill-name>/` | Only when working in the Trellis source repository. Update tests that assert bundled skill installation and template tracking. |
13
13
  | Add a personal cross-project skill | User's configured global skills directory | Requires explicit user approval because it changes global behavior outside the project. |
@@ -14,6 +14,12 @@
14
14
  "timeout": 30
15
15
  }
16
16
  ],
17
+ "beforeSubmitPrompt": [
18
+ {
19
+ "command": "{{PYTHON_CMD}} .cursor/hooks/inject-retrieval-plan.py",
20
+ "timeout": 15
21
+ }
22
+ ],
17
23
  "beforeShellExecution": [
18
24
  {
19
25
  "command": "{{PYTHON_CMD}} .cursor/hooks/inject-shell-session-context.py",