@blxzer/cursor-trellis 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (285) 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/migrations/manifests/0.1.1.json +9 -0
  24. package/dist/migrations/manifests/0.1.2.json +9 -0
  25. package/dist/templates/common/bundled-skills/smart-search-cli/SKILL.md +3 -3
  26. package/dist/templates/common/bundled-skills/trellis-meta/SKILL.md +4 -2
  27. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-agents.md +8 -15
  28. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-hooks.md +7 -7
  29. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-skills-or-commands.md +18 -21
  30. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/overview.md +2 -2
  31. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/generated-files.md +10 -7
  32. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/overview.md +4 -4
  33. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/agents.md +20 -31
  34. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/hooks-and-settings.md +20 -31
  35. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/overview.md +24 -40
  36. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/platform-map.md +28 -59
  37. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/skills-and-commands.md +12 -28
  38. package/dist/templates/common/bundled-skills/trellis-skill-creator/references/trellis-skill-locations.md +2 -2
  39. package/dist/templates/cursor/hooks.json +6 -0
  40. package/dist/templates/cursor/rules/retrieval-routing.mdc +57 -0
  41. package/dist/templates/extract.d.ts +0 -14
  42. package/dist/templates/extract.d.ts.map +1 -1
  43. package/dist/templates/extract.js +0 -34
  44. package/dist/templates/extract.js.map +1 -1
  45. package/dist/templates/markdown/agents.md +2 -6
  46. package/dist/templates/markdown/index.d.ts +1 -0
  47. package/dist/templates/markdown/index.d.ts.map +1 -1
  48. package/dist/templates/markdown/index.js +1 -0
  49. package/dist/templates/markdown/index.js.map +1 -1
  50. package/dist/templates/markdown/prompts/run-semantic-slice-12.md.txt +41 -0
  51. package/dist/templates/markdown/spec/guides/code-reuse-thinking-guide.md.txt +14 -14
  52. package/dist/templates/markdown/spec/guides/cross-layer-thinking-guide.md.txt +8 -20
  53. package/dist/templates/markdown/spec/guides/cross-platform-thinking-guide.md.txt +15 -14
  54. package/dist/templates/markdown/spec/guides/cursor-context-injection-guide.md.txt +4 -2
  55. package/dist/templates/markdown/spec/guides/cursor-semantic-compliance.md.txt +49 -0
  56. package/dist/templates/markdown/spec/guides/cursor-subagent-policy.md.txt +18 -5
  57. package/dist/templates/markdown/spec/guides/retrieval-daily-guide.md.txt +68 -20
  58. package/dist/templates/shared-hooks/index.d.ts +1 -1
  59. package/dist/templates/shared-hooks/index.d.ts.map +1 -1
  60. package/dist/templates/shared-hooks/index.js +1 -0
  61. package/dist/templates/shared-hooks/index.js.map +1 -1
  62. package/dist/templates/shared-hooks/inject-retrieval-plan.py +163 -0
  63. package/dist/templates/shared-hooks/inject-subagent-context.py +31 -567
  64. package/dist/templates/shared-hooks/research-end-retrieval-pack.py +2 -11
  65. package/dist/templates/trellis/index.d.ts +12 -0
  66. package/dist/templates/trellis/index.d.ts.map +1 -1
  67. package/dist/templates/trellis/index.js +24 -0
  68. package/dist/templates/trellis/index.js.map +1 -1
  69. package/dist/templates/trellis/scripts/aggregate_retrieval_telemetry.py +342 -0
  70. package/dist/templates/trellis/scripts/batch_plan_envelope.py +105 -0
  71. package/dist/templates/trellis/scripts/codegraph_session_smoke.py +76 -0
  72. package/dist/templates/trellis/scripts/common/active_task.py +116 -147
  73. package/dist/templates/trellis/scripts/common/cli_adapter.py +34 -710
  74. package/dist/templates/trellis/scripts/common/codebase_retrieval_router.py +49 -106
  75. package/dist/templates/trellis/scripts/common/git_context.py +17 -2
  76. package/dist/templates/trellis/scripts/common/project_file_stats.py +91 -0
  77. package/dist/templates/trellis/scripts/common/retrieval_adapter_metadata.py +9 -11
  78. package/dist/templates/trellis/scripts/common/retrieval_agent_instructions.py +313 -0
  79. package/dist/templates/trellis/scripts/common/retrieval_pack.py +0 -6
  80. package/dist/templates/trellis/scripts/common/retrieval_pack_context.py +0 -4
  81. package/dist/templates/trellis/scripts/common/retrieval_plan_gate.py +76 -0
  82. package/dist/templates/trellis/scripts/common/retrieval_result_ranking.py +253 -0
  83. package/dist/templates/trellis/scripts/common/retrieval_tool_classification.py +157 -0
  84. package/dist/templates/trellis/scripts/common/semantic_plan_gate.py +52 -0
  85. package/dist/templates/trellis/scripts/common/subagent_dispatch.py +527 -0
  86. package/dist/templates/trellis/scripts/common/task_store.py +32 -0
  87. package/dist/templates/trellis/scripts/common/workflow_phase.py +3 -24
  88. package/dist/templates/trellis/scripts/rank_retrieval_candidates.py +80 -0
  89. package/dist/templates/trellis/scripts/route_codebase_retrieval.py +38 -11
  90. package/dist/templates/trellis/scripts/score_evidence.py +112 -0
  91. package/dist/templates/trellis/scripts/task.py +26 -0
  92. package/dist/templates/trellis/workflow.md +844 -960
  93. package/dist/types/ai-tools.d.ts +13 -16
  94. package/dist/types/ai-tools.d.ts.map +1 -1
  95. package/dist/types/ai-tools.js +5 -238
  96. package/dist/types/ai-tools.js.map +1 -1
  97. package/dist/utils/codebase-retrieval-router.d.ts +1 -8
  98. package/dist/utils/codebase-retrieval-router.d.ts.map +1 -1
  99. package/dist/utils/codebase-retrieval-router.js +39 -180
  100. package/dist/utils/codebase-retrieval-router.js.map +1 -1
  101. package/dist/utils/project-capabilities.d.ts.map +1 -1
  102. package/dist/utils/project-capabilities.js +10 -24
  103. package/dist/utils/project-capabilities.js.map +1 -1
  104. package/dist/utils/retrieval-agent-instructions.d.ts +14 -0
  105. package/dist/utils/retrieval-agent-instructions.d.ts.map +1 -0
  106. package/dist/utils/retrieval-agent-instructions.js +221 -0
  107. package/dist/utils/retrieval-agent-instructions.js.map +1 -0
  108. package/dist/utils/retrieval-execution-telemetry.d.ts +43 -85
  109. package/dist/utils/retrieval-execution-telemetry.d.ts.map +1 -1
  110. package/dist/utils/retrieval-execution-telemetry.js +289 -22
  111. package/dist/utils/retrieval-execution-telemetry.js.map +1 -1
  112. package/dist/utils/retrieval-result-ranking.js +1 -1
  113. package/dist/utils/retrieval-result-ranking.js.map +1 -1
  114. package/dist/utils/retrieval-tool-classification.d.ts +32 -0
  115. package/dist/utils/retrieval-tool-classification.d.ts.map +1 -0
  116. package/dist/utils/retrieval-tool-classification.js +113 -0
  117. package/dist/utils/retrieval-tool-classification.js.map +1 -0
  118. package/dist/utils/uninstall-scrubbers.d.ts +0 -36
  119. package/dist/utils/uninstall-scrubbers.d.ts.map +1 -1
  120. package/dist/utils/uninstall-scrubbers.js +0 -184
  121. package/dist/utils/uninstall-scrubbers.js.map +1 -1
  122. package/package.json +4 -2
  123. package/dist/commands/mem.d.ts +0 -30
  124. package/dist/commands/mem.d.ts.map +0 -1
  125. package/dist/commands/mem.js +0 -424
  126. package/dist/commands/mem.js.map +0 -1
  127. package/dist/configurators/antigravity.d.ts +0 -7
  128. package/dist/configurators/antigravity.d.ts.map +0 -1
  129. package/dist/configurators/antigravity.js +0 -19
  130. package/dist/configurators/antigravity.js.map +0 -1
  131. package/dist/configurators/claude.d.ts +0 -9
  132. package/dist/configurators/claude.d.ts.map +0 -1
  133. package/dist/configurators/claude.js +0 -72
  134. package/dist/configurators/claude.js.map +0 -1
  135. package/dist/configurators/codebuddy.d.ts +0 -10
  136. package/dist/configurators/codebuddy.d.ts.map +0 -1
  137. package/dist/configurators/codebuddy.js +0 -30
  138. package/dist/configurators/codebuddy.js.map +0 -1
  139. package/dist/configurators/codex.d.ts +0 -8
  140. package/dist/configurators/codex.d.ts.map +0 -1
  141. package/dist/configurators/codex.js +0 -87
  142. package/dist/configurators/codex.js.map +0 -1
  143. package/dist/configurators/copilot.d.ts +0 -10
  144. package/dist/configurators/copilot.d.ts.map +0 -1
  145. package/dist/configurators/copilot.js +0 -51
  146. package/dist/configurators/copilot.js.map +0 -1
  147. package/dist/configurators/droid.d.ts +0 -10
  148. package/dist/configurators/droid.d.ts.map +0 -1
  149. package/dist/configurators/droid.js +0 -30
  150. package/dist/configurators/droid.js.map +0 -1
  151. package/dist/configurators/gemini.d.ts +0 -16
  152. package/dist/configurators/gemini.d.ts.map +0 -1
  153. package/dist/configurators/gemini.js +0 -38
  154. package/dist/configurators/gemini.js.map +0 -1
  155. package/dist/configurators/kilo.d.ts +0 -7
  156. package/dist/configurators/kilo.d.ts.map +0 -1
  157. package/dist/configurators/kilo.js +0 -19
  158. package/dist/configurators/kilo.js.map +0 -1
  159. package/dist/configurators/kiro.d.ts +0 -8
  160. package/dist/configurators/kiro.d.ts.map +0 -1
  161. package/dist/configurators/kiro.js +0 -24
  162. package/dist/configurators/kiro.js.map +0 -1
  163. package/dist/configurators/opencode.d.ts +0 -14
  164. package/dist/configurators/opencode.d.ts.map +0 -1
  165. package/dist/configurators/opencode.js +0 -96
  166. package/dist/configurators/opencode.js.map +0 -1
  167. package/dist/configurators/pi.d.ts +0 -3
  168. package/dist/configurators/pi.d.ts.map +0 -1
  169. package/dist/configurators/pi.js +0 -45
  170. package/dist/configurators/pi.js.map +0 -1
  171. package/dist/configurators/qoder.d.ts +0 -11
  172. package/dist/configurators/qoder.d.ts.map +0 -1
  173. package/dist/configurators/qoder.js +0 -31
  174. package/dist/configurators/qoder.js.map +0 -1
  175. package/dist/configurators/windsurf.d.ts +0 -7
  176. package/dist/configurators/windsurf.d.ts.map +0 -1
  177. package/dist/configurators/windsurf.js +0 -19
  178. package/dist/configurators/windsurf.js.map +0 -1
  179. package/dist/templates/claude/agents/trellis-check.md +0 -124
  180. package/dist/templates/claude/agents/trellis-implement.md +0 -110
  181. package/dist/templates/claude/agents/trellis-research.md +0 -137
  182. package/dist/templates/claude/index.d.ts +0 -22
  183. package/dist/templates/claude/index.d.ts.map +0 -1
  184. package/dist/templates/claude/index.js +0 -46
  185. package/dist/templates/claude/index.js.map +0 -1
  186. package/dist/templates/claude/settings.json +0 -84
  187. package/dist/templates/codebuddy/agents/trellis-check.md +0 -115
  188. package/dist/templates/codebuddy/agents/trellis-implement.md +0 -110
  189. package/dist/templates/codebuddy/agents/trellis-research.md +0 -137
  190. package/dist/templates/codebuddy/index.d.ts +0 -15
  191. package/dist/templates/codebuddy/index.d.ts.map +0 -1
  192. package/dist/templates/codebuddy/index.js +0 -15
  193. package/dist/templates/codebuddy/index.js.map +0 -1
  194. package/dist/templates/codebuddy/settings.json +0 -70
  195. package/dist/templates/codex/agents/trellis-check.toml +0 -67
  196. package/dist/templates/codex/agents/trellis-implement.toml +0 -40
  197. package/dist/templates/codex/agents/trellis-research.toml +0 -73
  198. package/dist/templates/codex/config.toml +0 -28
  199. package/dist/templates/codex/hooks/session-start.py +0 -575
  200. package/dist/templates/codex/hooks.json +0 -15
  201. package/dist/templates/codex/index.d.ts +0 -39
  202. package/dist/templates/codex/index.d.ts.map +0 -1
  203. package/dist/templates/codex/index.js +0 -85
  204. package/dist/templates/codex/index.js.map +0 -1
  205. package/dist/templates/codex/skills/before-dev/SKILL.md +0 -40
  206. package/dist/templates/codex/skills/brainstorm/SKILL.md +0 -112
  207. package/dist/templates/codex/skills/break-loop/SKILL.md +0 -130
  208. package/dist/templates/codex/skills/check/SKILL.md +0 -98
  209. package/dist/templates/codex/skills/check-cross-layer/SKILL.md +0 -158
  210. package/dist/templates/codex/skills/create-command/SKILL.md +0 -101
  211. package/dist/templates/codex/skills/finish-work/SKILL.md +0 -90
  212. package/dist/templates/codex/skills/improve-ut/SKILL.md +0 -69
  213. package/dist/templates/codex/skills/integrate-skill/SKILL.md +0 -221
  214. package/dist/templates/codex/skills/onboard/SKILL.md +0 -363
  215. package/dist/templates/codex/skills/record-session/SKILL.md +0 -67
  216. package/dist/templates/codex/skills/start/SKILL.md +0 -66
  217. package/dist/templates/codex/skills/update-spec/SKILL.md +0 -335
  218. package/dist/templates/copilot/hooks/session-start.py +0 -557
  219. package/dist/templates/copilot/hooks.json +0 -19
  220. package/dist/templates/copilot/index.d.ts +0 -23
  221. package/dist/templates/copilot/index.d.ts.map +0 -1
  222. package/dist/templates/copilot/index.js +0 -54
  223. package/dist/templates/copilot/index.js.map +0 -1
  224. package/dist/templates/copilot/prompts/before-dev.prompt.md +0 -39
  225. package/dist/templates/copilot/prompts/brainstorm.prompt.md +0 -111
  226. package/dist/templates/copilot/prompts/break-loop.prompt.md +0 -129
  227. package/dist/templates/copilot/prompts/check-cross-layer.prompt.md +0 -157
  228. package/dist/templates/copilot/prompts/check.prompt.md +0 -97
  229. package/dist/templates/copilot/prompts/create-command.prompt.md +0 -116
  230. package/dist/templates/copilot/prompts/finish-work.prompt.md +0 -99
  231. package/dist/templates/copilot/prompts/integrate-skill.prompt.md +0 -223
  232. package/dist/templates/copilot/prompts/onboard.prompt.md +0 -362
  233. package/dist/templates/copilot/prompts/parallel.prompt.md +0 -204
  234. package/dist/templates/copilot/prompts/record-session.prompt.md +0 -66
  235. package/dist/templates/copilot/prompts/start.prompt.md +0 -63
  236. package/dist/templates/copilot/prompts/update-spec.prompt.md +0 -358
  237. package/dist/templates/droid/droids/trellis-check.md +0 -107
  238. package/dist/templates/droid/droids/trellis-implement.md +0 -102
  239. package/dist/templates/droid/droids/trellis-research.md +0 -137
  240. package/dist/templates/droid/index.d.ts +0 -15
  241. package/dist/templates/droid/index.d.ts.map +0 -1
  242. package/dist/templates/droid/index.js +0 -15
  243. package/dist/templates/droid/index.js.map +0 -1
  244. package/dist/templates/droid/settings.json +0 -70
  245. package/dist/templates/gemini/agents/trellis-check.md +0 -107
  246. package/dist/templates/gemini/agents/trellis-implement.md +0 -102
  247. package/dist/templates/gemini/agents/trellis-research.md +0 -136
  248. package/dist/templates/gemini/index.d.ts +0 -13
  249. package/dist/templates/gemini/index.d.ts.map +0 -1
  250. package/dist/templates/gemini/index.js +0 -13
  251. package/dist/templates/gemini/index.js.map +0 -1
  252. package/dist/templates/gemini/settings.json +0 -28
  253. package/dist/templates/kiro/agents/trellis-check.json +0 -26
  254. package/dist/templates/kiro/agents/trellis-implement.json +0 -26
  255. package/dist/templates/kiro/agents/trellis-research.json +0 -30
  256. package/dist/templates/kiro/index.d.ts +0 -18
  257. package/dist/templates/kiro/index.d.ts.map +0 -1
  258. package/dist/templates/kiro/index.js +0 -18
  259. package/dist/templates/kiro/index.js.map +0 -1
  260. package/dist/templates/opencode/agents/trellis-check.md +0 -122
  261. package/dist/templates/opencode/agents/trellis-implement.md +0 -118
  262. package/dist/templates/opencode/agents/trellis-research.md +0 -145
  263. package/dist/templates/opencode/lib/session-utils.js +0 -667
  264. package/dist/templates/opencode/lib/trellis-context.js +0 -336
  265. package/dist/templates/opencode/package.json +0 -5
  266. package/dist/templates/opencode/plugins/inject-subagent-context.js +0 -495
  267. package/dist/templates/opencode/plugins/inject-workflow-state.js +0 -159
  268. package/dist/templates/opencode/plugins/session-start.js +0 -101
  269. package/dist/templates/pi/agents/trellis-check.md +0 -37
  270. package/dist/templates/pi/agents/trellis-implement.md +0 -42
  271. package/dist/templates/pi/agents/trellis-research.md +0 -25
  272. package/dist/templates/pi/extensions/trellis/index.ts.txt +0 -1600
  273. package/dist/templates/pi/index.d.ts +0 -5
  274. package/dist/templates/pi/index.d.ts.map +0 -1
  275. package/dist/templates/pi/index.js +0 -12
  276. package/dist/templates/pi/index.js.map +0 -1
  277. package/dist/templates/pi/settings.json +0 -12
  278. package/dist/templates/qoder/agents/trellis-check.md +0 -108
  279. package/dist/templates/qoder/agents/trellis-implement.md +0 -103
  280. package/dist/templates/qoder/agents/trellis-research.md +0 -137
  281. package/dist/templates/qoder/index.d.ts +0 -15
  282. package/dist/templates/qoder/index.d.ts.map +0 -1
  283. package/dist/templates/qoder/index.js +0 -15
  284. package/dist/templates/qoder/index.js.map +0 -1
  285. package/dist/templates/qoder/settings.json +0 -47
@@ -0,0 +1,57 @@
1
+ ---
2
+ description: "Trellis codebase retrieval on Cursor — follow router-derived plans; Rules are the primary injection channel (not sessionStart hooks)"
3
+ alwaysApply: true
4
+ ---
5
+
6
+ # Codebase retrieval routing (Cursor)
7
+
8
+ Before answering **code-location / architecture / caller-chain / config-schema** questions in this repo, use the retrieval layer deliberately. On Cursor, **`.cursor/rules` is the reliable policy channel**; **per-query `## 代码库检索计划` blocks** are injected by the **`beforeSubmitPrompt`** hook (`.cursor/hooks/inject-retrieval-plan.py`) when the user message looks like a codebase question. Do **not** depend on `sessionStart` hook `additional_context` (#158452) or end-of-turn retrieval-pack hooks for plans.
9
+
10
+ ## When a retrieval plan block is present
11
+
12
+ If the user message or Trellis context contains a block starting with `## 代码库检索计划` or `## Codebase retrieval plan`:
13
+
14
+ 1. Execute steps **in order** before stating file paths or behavior claims.
15
+ 2. Treat each step as mandatory tooling (not suggestions).
16
+ 3. Finish with **Read** (or GO_TO_DEFINITION) verification on cited sources.
17
+
18
+ Generate a fresh plan when needed:
19
+
20
+ ```powershell
21
+ python ./.trellis/scripts/route_codebase_retrieval.py "<question>" --instructions
22
+ ```
23
+
24
+ JSON (includes `agentInstructions`):
25
+
26
+ ```powershell
27
+ python ./.trellis/scripts/route_codebase_retrieval.py "<question>" --json
28
+ ```
29
+
30
+ ## Default tool order (no plan block)
31
+
32
+ | Need | Tool (Cursor) |
33
+ | --- | --- |
34
+ | Exact string / path | **Grep** (Instant Grep) |
35
+ | Who calls / blast radius | **codegraph_callers** → Grep for imports/callbacks |
36
+ | Same name across packages (trap) | **codegraph_search** / **codegraph_explore** → Grep |
37
+ | Extension symbols | **codegraph_search** under `extensions/` |
38
+ | Conceptual / how does X work | Cursor **built-in codebase semantic search** (@codebase-class; **not** fast-context MCP) |
39
+ | Policy / architecture / boundaries / storage rules | **Grep** on `AGENTS.md`, `**/AGENTS.md`, `.trellis/spec/**`, `README.md` (router `policy-docs-rg`) before implementation modules |
40
+ | Definition jump | **GO_TO_DEFINITION** / find references **when the host exposes them**; otherwise **Read** + **Grep** on known candidates (LSP is optional, not a guaranteed Agent default) |
41
+ | Wide cross-cutting explore | **DEEP_SEARCH** or Explore subagent, then verify with Grep/codegraph |
42
+
43
+ ## Semantic on Cursor
44
+
45
+ Router id: `platform-semantic` (`platformNative: true`). Use Cursor **built-in semantic / codebase search**. Do **not** call `fast_context_search` on Cursor.
46
+
47
+ ## Result-layer ranking (B / E / D)
48
+
49
+ When the plan block includes **结果层排序**, apply it **after** collecting path candidates and **before** stating Top-1 / Top-5: caller concrete sites over assembly files; trap demotion; env scripts/e2e/bench over generic `src/auth`/`paths`. Offline reorder: `rank_retrieval_candidates.py`.
50
+
51
+ ## codegraph-only value
52
+
53
+ Use codegraph for **call chains**, **cross-package trap disambiguation**, **extension symbol resolution**, and **impact** — not for pure literal search (Grep) or single-hop definition (LSP).
54
+
55
+ ## External facts
56
+
57
+ Web/current events: **smart-search** first per `.trellis/spec/guides/retrieval-daily-guide.md`.
@@ -5,20 +5,6 @@ type TemplateCategory = "scripts" | "markdown" | "commands";
5
5
  export declare function getTrellisTemplatePath(): string;
6
6
  /** @deprecated Use getTrellisTemplatePath() instead. */
7
7
  export declare function getTrellisSourcePath(): string;
8
- /**
9
- * Get the path to the claude templates directory (hooks, agents, settings).
10
- */
11
- export declare function getClaudeTemplatePath(): string;
12
- /**
13
- * Get the path to the opencode templates directory (agents, plugins, lib).
14
- */
15
- export declare function getOpenCodeTemplatePath(): string;
16
- /**
17
- * Get the path to the Pi Agent templates directory (agents, extension, settings).
18
- */
19
- export declare function getPiTemplatePath(): string;
20
- /** @deprecated Use getPiTemplatePath() instead. */
21
- export declare function getPiSourcePath(): string;
22
8
  /**
23
9
  * Read a file from the trellis template directory.
24
10
  */
@@ -1 +1 @@
1
- {"version":3,"file":"extract.d.ts","sourceRoot":"","sources":["../../src/templates/extract.ts"],"names":[],"mappings":"AASA,KAAK,gBAAgB,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;AAE5D;;GAEG;AACH,wBAAgB,sBAAsB,IAAI,MAAM,CAQ/C;AAED,wDAAwD;AACxD,wBAAgB,oBAAoB,IAAI,MAAM,CAE7C;AAED;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,CAQ9C;AAED;;GAEG;AACH,wBAAgB,uBAAuB,IAAI,MAAM,CAQhD;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAQ1C;AAED,mDAAmD;AACnD,wBAAgB,eAAe,IAAI,MAAM,CAExC;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAI5D;AAED;;GAEG;AACH,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,gBAAgB,EAC1B,QAAQ,EAAE,MAAM,GACf,MAAM,CAGR;AAED,wBAAgB,UAAU,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED,wBAAgB,YAAY,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED;;GAEG;AACH,wBAAsB,cAAc,CAClC,eAAe,EAAE,MAAM,EACvB,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE;IAAE,UAAU,CAAC,EAAE,OAAO,CAAA;CAAE,GACjC,OAAO,CAAC,IAAI,CAAC,CAIf"}
1
+ {"version":3,"file":"extract.d.ts","sourceRoot":"","sources":["../../src/templates/extract.ts"],"names":[],"mappings":"AASA,KAAK,gBAAgB,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;AAE5D;;GAEG;AACH,wBAAgB,sBAAsB,IAAI,MAAM,CAQ/C;AAED,wDAAwD;AACxD,wBAAgB,oBAAoB,IAAI,MAAM,CAE7C;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAI5D;AAED;;GAEG;AACH,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,gBAAgB,EAC1B,QAAQ,EAAE,MAAM,GACf,MAAM,CAGR;AAED,wBAAgB,UAAU,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED,wBAAgB,YAAY,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED;;GAEG;AACH,wBAAsB,cAAc,CAClC,eAAe,EAAE,MAAM,EACvB,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE;IAAE,UAAU,CAAC,EAAE,OAAO,CAAA;CAAE,GACjC,OAAO,CAAC,IAAI,CAAC,CAIf"}
@@ -19,40 +19,6 @@ export function getTrellisTemplatePath() {
19
19
  export function getTrellisSourcePath() {
20
20
  return getTrellisTemplatePath();
21
21
  }
22
- /**
23
- * Get the path to the claude templates directory (hooks, agents, settings).
24
- */
25
- export function getClaudeTemplatePath() {
26
- const templatePath = path.join(__dirname, "claude");
27
- if (fs.existsSync(templatePath)) {
28
- return templatePath;
29
- }
30
- throw new Error("Could not find claude templates directory. Expected at templates/claude/");
31
- }
32
- /**
33
- * Get the path to the opencode templates directory (agents, plugins, lib).
34
- */
35
- export function getOpenCodeTemplatePath() {
36
- const templatePath = path.join(__dirname, "opencode");
37
- if (fs.existsSync(templatePath)) {
38
- return templatePath;
39
- }
40
- throw new Error("Could not find opencode templates directory. Expected at templates/opencode/");
41
- }
42
- /**
43
- * Get the path to the Pi Agent templates directory (agents, extension, settings).
44
- */
45
- export function getPiTemplatePath() {
46
- const templatePath = path.join(__dirname, "pi");
47
- if (fs.existsSync(templatePath)) {
48
- return templatePath;
49
- }
50
- throw new Error("Could not find pi templates directory. Expected at templates/pi/");
51
- }
52
- /** @deprecated Use getPiTemplatePath() instead. */
53
- export function getPiSourcePath() {
54
- return getPiTemplatePath();
55
- }
56
22
  /**
57
23
  * Read a file from the trellis template directory.
58
24
  */
@@ -1 +1 @@
1
- {"version":3,"file":"extract.js","sourceRoot":"","sources":["../../src/templates/extract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,4BAA4B,EAAE,MAAM,4BAA4B,CAAC;AAE1E,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;AAI3C;;GAEG;AACH,MAAM,UAAU,sBAAsB;IACpC,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IACrD,IAAI,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;QAChC,OAAO,YAAY,CAAC;IACtB,CAAC;IACD,MAAM,IAAI,KAA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;AACrD,CAAC;AAED,KAAK,UAAU,gBAAgB,CAC7B,GAAW,EACX,IAAY,EACZ,OAAkC;IAElC,SAAS,CAAC,IAAI,CAAC,CAAC;IAEhB,KAAK,MAAM,KAAK,IAAI,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,CAAC;QACxC,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACtC,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QACxC,MAAM,IAAI,GAAG,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAElC,IAAI,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;YACvB,MAAM,gBAAgB,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;QACrD,CAAC;aAAM,CAAC;YACN,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YAClD,MAAM,YAAY,GAChB,OAAO,EAAE,UAAU,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;YAC1E,MAAM,SAAS,CAAC,QAAQ,EAAE,4BAA4B,CAAC,OAAO,CAAC,EAAE;gBAC/D,UAAU,EAAE,YAAY;aACzB,CAAC,CAAC;QACL,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -10,23 +10,19 @@ This project is managed by Trellis. The working knowledge you need lives under `
10
10
  - `.trellis/workspace/` — per-developer journals and session traces
11
11
  - `.trellis/tasks/` — active and archived tasks (PRDs, research, jsonl context)
12
12
 
13
- If a Trellis command is available on your platform (e.g. `/trellis:finish-work`, `/trellis:continue`), prefer it over manual steps. Not every platform exposes every command.
13
+ If a Trellis command is available on Cursor (e.g. `/trellis:finish-work`, `/trellis:continue`), prefer it over manual steps.
14
14
 
15
15
  ## Command surface (what is user-invocable vs internal)
16
16
 
17
17
  Only a handful of Trellis entry points are meant for **manual `/` invocation**. Everything else is an **internal auto-triggered skill** — the agent loads it via the skill matcher or workflow routing, not by being called directly. Do **not** manually invoke internal skills through the slash palette.
18
18
 
19
- - **User-invocable (manual)**: `/trellis-continue`, `/trellis-finish-work` (and `/trellis-start` on agent-less platforms).
19
+ - **User-invocable (manual)**: `/trellis-continue`, `/trellis-finish-work` (and `/trellis-start` when needed).
20
20
  - **Internal auto-triggered (do NOT call manually)**: `trellis-brainstorm`, `trellis-before-dev`, `trellis-check`, `trellis-break-loop`, `trellis-update-spec`, `trellis-micro-grill`, `trellis-meta`, `trellis-spec-bootstrap`, `trellis-skill-creator`, `smart-search-cli`. These activate on their own when the workflow/skill matcher decides they fit.
21
21
 
22
22
  ## Web research routing (smart-search first)
23
23
 
24
24
  For **any external / current / web fact**, use **smart-search** (`run_smart_search.py`) **first**. Platform built-in web tools (Cursor `WebSearch` / `WebFetch`, or native web tools elsewhere) are **downgrade-only fallbacks**, used solely when smart-search is unavailable (`doctor` not ok, status `not_configured` / `failed`, or search timeout). Do not reach for built-in web search while smart-search is healthy. See `.trellis/spec/guides/retrieval-daily-guide.md` and the `smart-search-cli` skill.
25
25
 
26
- If you're using Codex or another agent-capable tool, additional project-scoped helpers may live in:
27
- - `.agents/skills/` — reusable Trellis skills
28
- - `.codex/agents/` — optional custom subagents
29
-
30
26
  Managed by Trellis. Edits outside this block are preserved; edits inside may be overwritten by a future `trellis update`.
31
27
 
32
28
  <!-- TRELLIS:END -->
@@ -26,5 +26,6 @@ export declare const guidesCrossLayerThinkingGuideContent: string;
26
26
  export declare const guidesCodeReuseThinkingGuideContent: string;
27
27
  export declare const guidesDurableLearningDecisionGuideContent: string;
28
28
  export declare const guidesRetrievalDailyGuideContent: string;
29
+ export declare const guidesCursorSemanticComplianceContent: string;
29
30
  export declare const guidesCursorSubagentPolicyContent: string;
30
31
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/markdown/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAqBH,eAAO,MAAM,eAAe,EAAE,MAAuC,CAAC;AAGtE,eAAO,MAAM,qBAAqB,EAAE,MACK,CAAC;AAG1C,eAAO,MAAM,yBAAyB,QAAwB,CAAC;AAG/D,eAAO,MAAM,wBAAwB,EAAE,MACH,CAAC;AAQrC,eAAO,MAAM,mBAAmB,EAAE,MAEjC,CAAC;AACF,eAAO,MAAM,gCAAgC,EAAE,MAE9C,CAAC;AACF,eAAO,MAAM,gCAAgC,EAAE,MAE9C,CAAC;AACF,eAAO,MAAM,+BAA+B,EAAE,MAE7C,CAAC;AACF,eAAO,MAAM,+BAA+B,EAAE,MAE7C,CAAC;AACF,eAAO,MAAM,2BAA2B,EAAE,MAEzC,CAAC;AAGF,eAAO,MAAM,oBAAoB,EAAE,MAElC,CAAC;AACF,eAAO,MAAM,iCAAiC,EAAE,MAE/C,CAAC;AACF,eAAO,MAAM,yBAAyB,EAAE,MAEvC,CAAC;AACF,eAAO,MAAM,6BAA6B,EAAE,MAE3C,CAAC;AACF,eAAO,MAAM,kCAAkC,EAAE,MAEhD,CAAC;AACF,eAAO,MAAM,gCAAgC,EAAE,MAE9C,CAAC;AACF,eAAO,MAAM,8BAA8B,EAAE,MAE5C,CAAC;AAGF,eAAO,MAAM,kBAAkB,EAAE,MAEhC,CAAC;AACF,eAAO,MAAM,oCAAoC,EAAE,MAElD,CAAC;AACF,eAAO,MAAM,mCAAmC,EAAE,MAEjD,CAAC;AACF,eAAO,MAAM,yCAAyC,EAAE,MACiB,CAAC;AAC1E,eAAO,MAAM,gCAAgC,EAAE,MAE9C,CAAC;AACF,eAAO,MAAM,iCAAiC,EAAE,MAE/C,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/markdown/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAqBH,eAAO,MAAM,eAAe,EAAE,MAAuC,CAAC;AAGtE,eAAO,MAAM,qBAAqB,EAAE,MACK,CAAC;AAG1C,eAAO,MAAM,yBAAyB,QAAwB,CAAC;AAG/D,eAAO,MAAM,wBAAwB,EAAE,MACH,CAAC;AAQrC,eAAO,MAAM,mBAAmB,EAAE,MAEjC,CAAC;AACF,eAAO,MAAM,gCAAgC,EAAE,MAE9C,CAAC;AACF,eAAO,MAAM,gCAAgC,EAAE,MAE9C,CAAC;AACF,eAAO,MAAM,+BAA+B,EAAE,MAE7C,CAAC;AACF,eAAO,MAAM,+BAA+B,EAAE,MAE7C,CAAC;AACF,eAAO,MAAM,2BAA2B,EAAE,MAEzC,CAAC;AAGF,eAAO,MAAM,oBAAoB,EAAE,MAElC,CAAC;AACF,eAAO,MAAM,iCAAiC,EAAE,MAE/C,CAAC;AACF,eAAO,MAAM,yBAAyB,EAAE,MAEvC,CAAC;AACF,eAAO,MAAM,6BAA6B,EAAE,MAE3C,CAAC;AACF,eAAO,MAAM,kCAAkC,EAAE,MAEhD,CAAC;AACF,eAAO,MAAM,gCAAgC,EAAE,MAE9C,CAAC;AACF,eAAO,MAAM,8BAA8B,EAAE,MAE5C,CAAC;AAGF,eAAO,MAAM,kBAAkB,EAAE,MAEhC,CAAC;AACF,eAAO,MAAM,oCAAoC,EAAE,MAElD,CAAC;AACF,eAAO,MAAM,mCAAmC,EAAE,MAEjD,CAAC;AACF,eAAO,MAAM,yCAAyC,EAAE,MACiB,CAAC;AAC1E,eAAO,MAAM,gCAAgC,EAAE,MAE9C,CAAC;AACF,eAAO,MAAM,qCAAqC,EAAE,MAEnD,CAAC;AACF,eAAO,MAAM,iCAAiC,EAAE,MAE/C,CAAC"}
@@ -51,5 +51,6 @@ export const guidesCrossLayerThinkingGuideContent = readLocalTemplate("spec/guid
51
51
  export const guidesCodeReuseThinkingGuideContent = readLocalTemplate("spec/guides/code-reuse-thinking-guide.md.txt");
52
52
  export const guidesDurableLearningDecisionGuideContent = readLocalTemplate("spec/guides/durable-learning-decision-guide.md.txt");
53
53
  export const guidesRetrievalDailyGuideContent = readLocalTemplate("spec/guides/retrieval-daily-guide.md.txt");
54
+ export const guidesCursorSemanticComplianceContent = readLocalTemplate("spec/guides/cursor-semantic-compliance.md.txt");
54
55
  export const guidesCursorSubagentPolicyContent = readLocalTemplate("spec/guides/cursor-subagent-policy.md.txt");
55
56
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/templates/markdown/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEtC;;GAEG;AACH,SAAS,iBAAiB,CAAC,QAAgB;IACzC,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IAC3C,OAAO,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AACzC,CAAC;AAED,gFAAgF;AAChF,8BAA8B;AAC9B,gFAAgF;AAEhF,MAAM,CAAC,MAAM,eAAe,GAAW,iBAAiB,CAAC,WAAW,CAAC,CAAC;AAEtE,oDAAoD;AACpD,MAAM,CAAC,MAAM,qBAAqB,GAChC,iBAAiB,CAAC,oBAAoB,CAAC,CAAC;AAE1C,gCAAgC;AAChC,MAAM,CAAC,MAAM,yBAAyB,GAAG,qBAAqB,CAAC;AAE/D,2DAA2D;AAC3D,MAAM,CAAC,MAAM,wBAAwB,GACnC,iBAAiB,CAAC,eAAe,CAAC,CAAC;AAErC,gFAAgF;AAChF,0DAA0D;AAC1D,wEAAw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,iBAAiB,CAAC,oDAAoD,CAAC,CAAC;AAC1E,MAAM,CAAC,MAAM,gCAAgC,GAAW,iBAAiB,CACvE,0CAA0C,CAC3C,CAAC;AACF,MAAM,CAAC,MAAM,qCAAqC,GAAW,iBAAiB,CAC5E,+CAA+C,CAChD,CAAC;AACF,MAAM,CAAC,MAAM,iCAAiC,GAAW,iBAAiB,CACxE,2CAA2C,CAC5C,CAAC"}
@@ -0,0 +1,41 @@
1
+ # REC-06 — 12 题 semantic 切片实验(Cursor)
2
+
3
+ > 复制 `---BEGIN---` … `---END---` 到 **openclaw-retrieval-eval** 工作区新会话。
4
+ > 数据:`queries-semantic-slice.jsonl`(S01–S12)。
5
+
6
+ ---BEGIN---
7
+
8
+ 在 **`D:\openclaw-retrieval-eval`** 对 **`queries-semantic-slice.jsonl`** 共 **12 条**做 codebase 检索实验(非全 50 条)。
9
+
10
+ ### 目的
11
+
12
+ 测量 **semantic plan → semantic exec** 裂隙:计划含 `platform-semantic` 时,Agent 是否至少调用 **1 次 Cursor 内置代码库语义搜索**(**不要** fast-context MCP)。
13
+
14
+ ### 约束
15
+
16
+ 1. 代码根:`openclaw/`(pin `092075534e545ab4e0fe7824a3abe7e9784b3df7`)。
17
+ 2. 每条只用 JSONL 里 **`query` 原文**;盲测阶段不看 `expected_files`。
18
+ 3. 自然遵循 Trellis Rules + hook 注入的检索计划;若计划含 **语义合规** / **platform-semantic** 步骤,**必须执行**一次内置语义再定 Top-1。
19
+ 4. 每条记录:**完整 `tools_called` 列表**(Cursor 显示的工具名原样)、是否看到 `## 代码库检索计划`、是否执行内置语义。
20
+
21
+ ### 跑前
22
+
23
+ ```powershell
24
+ python .trellis/scripts/batch_plan_envelope.py --queries queries-semantic-slice.jsonl --pretty
25
+ ```
26
+
27
+ ### 产出
28
+
29
+ 1. `runs/cursor-semantic-slice-<YYYYMMDD>.md`:12 条明细 + 工具表。
30
+ 2. `runs/cursor-semantic-slice-<YYYYMMDD>/telemetry.jsonl`:每行含 `query_id`、`platform":"cursor"`、`tools_called`、`plan_block_in_prompt`、`semantic_in_plan`(可先 `batch_plan_envelope` 填 plan 字段)。
31
+ 3. 汇总:
32
+
33
+ ```powershell
34
+ python .trellis/scripts/aggregate_retrieval_telemetry.py runs/cursor-semantic-slice-<YYYYMMDD>/telemetry.jsonl --markdown
35
+ ```
36
+
37
+ 报告须含:`semantic_plan_rate`、`semantic_exec_rate`、`platform_semantic_exec_rate`、`cursor_fast_context_misuse_rate`。
38
+
39
+ 从 **S01** 开始,逐条执行。
40
+
41
+ ---END---
@@ -146,29 +146,29 @@ of that replay model.
146
146
 
147
147
  ## Gotcha: Python if/elif/else Exhaustive Check
148
148
 
149
- **Problem**: Python's if/elif/else chains have no compile-time exhaustive check. When you add a new value to a `Literal` type (e.g., `Platform`), existing if/elif/else chains silently fall through to `else` with wrong defaults.
149
+ **Problem**: Python's if/elif/else chains have no compile-time exhaustive check. When you add a new value to a `Literal` type (e.g., a hook event name), existing if/elif/else chains silently fall through to `else` with wrong defaults.
150
150
 
151
- **Symptom**: New platform works partially — some methods return Claude defaults instead of platform-specific values. No error is raised.
151
+ **Symptom**: New value works partially — some methods return the default branch instead of the new value's specific behavior. No error is raised.
152
152
 
153
153
  **Example** (`cli_adapter.py`):
154
154
  ```python
155
- # BAD: "gemini" falls through to else, returns "claude"
155
+ # BAD: "on_session_end" falls through to else, returns session-start defaults
156
156
  @property
157
- def cli_name(self) -> str:
158
- if self.platform == "opencode":
159
- return "opencode"
157
+ def hook_kind(self) -> str:
158
+ if self.event == "on_session_start":
159
+ return "session-start"
160
160
  else:
161
- return "claude" # gemini silently gets "claude"!
161
+ return "session-start" # on_session_end silently gets "session-start"!
162
162
 
163
- # GOOD: explicit branch for every platform
163
+ # GOOD: explicit branch for every value
164
164
  @property
165
- def cli_name(self) -> str:
166
- if self.platform == "opencode":
167
- return "opencode"
168
- elif self.platform == "gemini":
169
- return "gemini"
165
+ def hook_kind(self) -> str:
166
+ if self.event == "on_session_start":
167
+ return "session-start"
168
+ elif self.event == "on_session_end":
169
+ return "session-end"
170
170
  else:
171
- return "claude"
171
+ return "session-start"
172
172
  ```
173
173
 
174
174
  **Prevention**: When adding a new value to a Python `Literal` type, search for ALL if/elif/else chains that switch on that type and add explicit branches. Don't rely on `else` being correct for new values.
@@ -123,18 +123,17 @@ After implementation:
123
123
 
124
124
  ---
125
125
 
126
- ## Cross-Platform Template Consistency
126
+ ## Cross-Package Template Consistency
127
127
 
128
- In Trellis, command templates (e.g., `record-session.md`) exist in **multiple platforms** with identical or near-identical content. This is a cross-layer boundary.
128
+ In Trellis, command templates (e.g., `record-session.md`) exist in **multiple locations** with identical or near-identical content — the published template (`packages/cli/src/templates/cursor/commands/...`) and the dogfooded copy (`.cursor/commands/...`). This is a cross-layer boundary.
129
129
 
130
130
  ### Checklist: After Modifying Any Command Template
131
131
 
132
- - [ ] Find all platforms with the same command: `find src/templates/*/commands/trellis/ -name "<command>.*"`
133
- - [ ] Update all platform copies (Markdown `.md` and TOML `.toml`)
134
- - [ ] For Gemini TOML: adapt line continuations (`\\` vs `\`) and triple-quoted strings
132
+ - [ ] Find every copy that owns the same command: `find packages/cli/src/templates -name "<command>.*"` plus the dogfood mirror under `.cursor/commands/`
133
+ - [ ] Update every copy (Markdown `.md` and any TOML sidecar)
135
134
  - [ ] Run `/trellis:check-cross-layer` to verify nothing was missed
136
135
 
137
- **Real-world example**: Updated `record-session.md` in Claude to use `--mode record`, but forgot iFlow, Kilo, OpenCode, and Gemini — caught by cross-layer check.
136
+ **Real-world example**: Updated `record-session.md` in the dogfooded `.cursor/commands/` to use `--mode record`, but forgot to mirror it under `packages/cli/src/templates/cursor/commands/` — caught by cross-layer check.
138
137
 
139
138
  ---
140
139
 
@@ -177,20 +176,9 @@ release line.
177
176
  - [ ] Treat beta content appearing under root release paths as a source-path bug,
178
177
  not a rendering bug
179
178
 
180
- **Real-world example**: A beta-only task workflow change documented
181
- `prd.md` + `design.md` + `implement.md`, task-creation consent, and Codex
182
- mode banners under root `start/` and `advanced/` paths. The docs site then
183
- served 0.6 beta behavior under the Release selector. The fix was to restore root
184
- release docs, move the 0.6 content to `beta/` and `zh/beta/`, and add a grep
185
- audit for beta markers against the root release tree.
186
-
187
- **Real-world example**: Codex inline mode changed workflow platform markers from
188
- `[Codex]` / `[Kilo, Antigravity, Windsurf]` to `[codex-sub-agent]` /
189
- `[codex-inline, Kilo, Antigravity, Windsurf]`. Fresh init was correct, but
190
- `trellis update` only merged `[workflow-state:*]` blocks and preserved stale
191
- markers outside those blocks. Result: upgraded projects got new hook scripts
192
- but old workflow routing, so `get_context.py --mode phase --platform codex`
193
- could return empty Phase 2.1 detail.
179
+ **Real-world example**: A beta-only task workflow change documented `prd.md` + `design.md` + `implement.md` and task-creation consent under root `start/` and `advanced/` paths. The docs site then served 0.6 beta behavior under the Release selector. The fix was to restore root release docs, move the 0.6 content to `beta/` and `zh/beta/`, and add a grep audit for beta markers against the root release tree.
180
+
181
+ **Real-world example**: A workflow-phase marker refactor rewrote `[workflow-state:*]` blocks in `.trellis/workflow.md`. Fresh `init` was correct, but `trellis update` only merged the tagged `[workflow-state:*]` blocks and preserved stale free-text routing between them. Result: upgraded projects got new hook scripts but old workflow routing, so `get_context.py --mode phase` could return empty Phase 2.1 detail. (Historical note: the affected markers used to be platform-tagged when Trellis supported multiple AI platforms; the platform tags were removed when Trellis converged on Cursor-only.)
194
182
 
195
183
  ---
196
184
 
@@ -1,6 +1,8 @@
1
- # Cross-Platform Thinking Guide
1
+ # Cross-Platform Thinking Guide (OS / path)
2
2
 
3
- > **Purpose**: Catch platform-specific assumptions before they become bugs.
3
+ > **Purpose**: Catch OS and path assumptions before they become bugs.
4
+ >
5
+ > **Note (cursor-only fork):** This guide covers **operating-system and filesystem** portability (Windows vs macOS/Linux). AI platform adapter sync is Cursor-only; see `cross-layer-thinking-guide.md` for template consistency.
4
6
 
5
7
  ---
6
8
 
@@ -45,7 +47,7 @@ print("Run: {{PYTHON_CMD}} ./.trellis/scripts/task.py <args>")
45
47
 
46
48
  ```typescript
47
49
  // In template file (settings.json):
48
- { "command": "{{PYTHON_CMD}} .claude/hooks/script.py" }
50
+ { "command": "{{PYTHON_CMD}} .cursor/hooks/script.py" }
49
51
 
50
52
  // In configurator:
51
53
  function getPythonCommand(): string {
@@ -85,7 +87,7 @@ function warnIfPythonTooOld(): void {
85
87
  }
86
88
  ```
87
89
 
88
- **Rule 5**: Don't assume the Python version the AI CLI uses matches your shell's `python3`. The user's terminal may resolve `python3` → homebrew 3.11, but AI CLI hosts (including enterprise-forked Claude Code / Cursor distributions) spawn hook subprocesses with a minimal PATH that resolves `python3` → `/usr/bin/python3` → macOS system 3.9. Distributed templates must either target the lowest plausible version or use `from __future__ import annotations` for PEP 604 syntax. See `cli/backend/script-conventions.md` → **CRITICAL: PEP 604 Annotations Require `from __future__ import annotations`** for the hard rule and audit check.
90
+ **Rule 5**: Don't assume the Python version the AI CLI uses matches your shell's `python3`. The user's terminal may resolve `python3` → homebrew 3.11, but Cursor spawns hook subprocesses with a minimal PATH that resolves `python3` → `/usr/bin/python3` → macOS system 3.9. Distributed templates must either target the lowest plausible version or use `from __future__ import annotations` for PEP 604 syntax. See `cli/backend/script-conventions.md` → **CRITICAL: PEP 604 Annotations Require `from __future__ import annotations`** for the hard rule and audit check.
89
91
 
90
92
  **Rule 6**: When calling Python from Python, use `sys.executable`:
91
93
 
@@ -137,7 +139,7 @@ A path string has two distinct roles. **Treat them differently.**
137
139
  function collectTemplates(): Map<string, string> {
138
140
  const files = new Map<string, string>();
139
141
  for (const entry of walk(dir)) {
140
- files.set(path.join(".opencode", entry), readFile(entry)); // \ on Windows
142
+ files.set(path.join(".cursor", entry), readFile(entry)); // \ on Windows
141
143
  }
142
144
  return files;
143
145
  }
@@ -148,7 +150,7 @@ import { toPosix } from "../utils/posix.js";
148
150
  function collectTemplates(): Map<string, string> {
149
151
  const files = new Map<string, string>();
150
152
  for (const entry of walk(dir)) {
151
- files.set(toPosix(path.join(".opencode", entry)), readFile(entry));
153
+ files.set(toPosix(path.join(".cursor", entry)), readFile(entry));
152
154
  }
153
155
  return files;
154
156
  }
@@ -340,10 +342,10 @@ result = subprocess.run(
340
342
  When making platform-related changes, check **all these locations**:
341
343
 
342
344
  ### Commands / Skills Sync
343
- - [ ] New command/skill added to ALL platforms (claude, cursor, iflow, codex, and any new platform)
344
- - [ ] Each platform's test file updated with new entry in `EXPECTED_COMMAND_NAMES` / `EXPECTED_SKILL_NAMES`
345
- - [ ] Platform-integration spec's required command table updated if adding a new required command
346
- - [ ] Command format matches platform convention (see `platform-integration.md` Command Format by Platform)
345
+ - [ ] New command/skill added to the Cursor templates (`src/templates/cursor/` and `src/templates/common/`)
346
+ - [ ] Cursor test file updated with new entry in `EXPECTED_COMMAND_NAMES` / `EXPECTED_SKILL_NAMES`
347
+ - [ ] Command format matches Cursor convention (see `platform-integration.md` Command Format)
348
+ - [ ] If the command exists in the dogfooded copy (`.cursor/`), sync it too
347
349
 
348
350
  ### Documentation & Help Text
349
351
  - [ ] Docstrings at top of Python files
@@ -388,7 +390,7 @@ Before committing cross-platform code:
388
390
 
389
391
  ### 7. External Tool API Contracts
390
392
 
391
- When integrating with external tools (Claude Code, Cursor, etc.), their API contracts are **implicit assumptions**.
393
+ When integrating with external tools (Cursor, etc.), their API contracts are **implicit assumptions**.
392
394
 
393
395
  **Rule**: Verify API formats from official documentation, don't guess.
394
396
 
@@ -624,9 +626,8 @@ printf '{"name":"trellis-smoke","version":"0.0.0"}\n' > "$tmpdir/package.json"
624
626
  git -C "$tmpdir" init -q
625
627
  (
626
628
  cd "$tmpdir"
627
- node /path/to/Trellis/packages/cli/bin/trellis.js init -u smoke --yes --claude --codex
628
- test -f .claude/skills/<skill>/SKILL.md
629
- test -f .agents/skills/<skill>/SKILL.md
629
+ node /path/to/Trellis/packages/cli/bin/trellis.js init -u smoke --yes --cursor
630
+ test -f .cursor/skills/<skill>/SKILL.md
630
631
  grep -q '<skill>' .trellis/.template-hashes.json
631
632
  node /path/to/Trellis/packages/cli/bin/trellis.js update --dry-run
632
633
  )
@@ -11,11 +11,13 @@ Cursor has **four** channels that can put text in front of the model. They are *
11
11
  | Channel | How it loads | Reliable on Cursor? | Trellis content here |
12
12
  |---|---|---|---|
13
13
  | `.cursor/rules/*.mdc` (`alwaysApply: true`) | Prepended before **every** prompt, independent path | ✅ **Yes** | `trellis-triage.mdc` (Request Triage hard gate) |
14
+ | `beforeSubmitPrompt` hook → `additional_context` | Per user message; router emits `## 代码库检索计划` | ⚠️ **Verify on your Cursor build** (docs list field; forum reports vary) | `inject-retrieval-plan.py` + `retrieval-routing.mdc` enforcement |
14
15
  | `AGENTS.md` (repo root + nested) | Read automatically, treated as an always-on rule | ✅ **Yes** | smart-search-first rule, command surface, remote policy (the `<!-- TRELLIS:START -->` block) |
15
16
  | `sessionStart` hook → `additional_context` | Hook fires, JSON parsed... **but content never reaches the model's system context** | ❌ **No (confirmed bug)** | workflow.md Phase Index + Task Dashboard + first-reply notice |
16
17
  | `.trellis/workflow.md` (read on demand) | Only if the agent explicitly runs `get_context.py` or reads the file | ⚠️ Depends on agent taking action | Full Request Triage section, Task Ladder, workflow-state breadcrumbs |
18
+ | **`task.py generate-dispatch-prompt` → Task `prompt`** (CLI Layer 2) | Main session runs Trellis script before `Task(...)` | ✅ **Yes (primary for subagent task context on Cursor)** | Full embed: marker, `Selected task:`, prd/jsonl/spec bodies |
17
19
 
18
- **Key takeaway**: anything that must reach the model **every turn without the agent choosing to load it** must live in `.cursor/rules` or `AGENTS.md`. Anything in `workflow.md` that depends on `sessionStart` injection is **invisible to Cursor agents** until the bug is fixed.
20
+ **Key takeaway**: anything that must reach the model **every turn without the agent choosing to load it** must live in `.cursor/rules` or `AGENTS.md`. Subagent task context on Cursor uses **CLI Layer 2** before Task dispatch; `preToolUse` hook injection is best-effort only (see forum reports + 2026-06-22 spike). Anything in `workflow.md` that depends on `sessionStart` injection is **invisible to Cursor agents** until the bug is fixed.
19
21
 
20
22
  ---
21
23
 
@@ -23,7 +25,7 @@ Cursor has **four** channels that can put text in front of the model. They are *
23
25
 
24
26
  - **Bug**: Cursor forum #158452 — `sessionStart` hook `additional_context` is executed and JSON-parsed correctly, but the value is **never added to the agent's initial system context**.
25
27
  - **Status**: Confirmed by Cursor team (deanrie), internal bug filed, **no ETA** as of 2026-06-19.
26
- - **Scope**: Affects `sessionStart` and `postToolUse` `additional_context` on Cursor IDE. The `env` field of the same hook **does** work (separate storage path). Claude Code / OpenCode `sessionStart.additionalContext` is unaffected.
28
+ - **Scope**: Affects `sessionStart` and `postToolUse` `additional_context` on Cursor IDE. The `env` field of the same hook **does** work (separate storage path).
27
29
  - **Symptom**: hook runs (verifiable via side-channel log), valid JSON emitted, but the agent has zero awareness of the injected text (e.g. won't say a first-reply notice phrase).
28
30
 
29
31
  ### How to diagnose "is sessionStart injection actually reaching the model?"
@@ -0,0 +1,49 @@
1
+ # Cursor semantic compliance (REC-06)
2
+
3
+ ## Plan vs exec
4
+
5
+ | Layer | What counts |
6
+ | --- | --- |
7
+ | **Plan** | Router route `platform-semantic` (`platformNative: true`) or injected plan step「内置代码库语义搜索」 |
8
+ | **Exec (Cursor)** | Tool log matches **platform semantic** patterns only — see `retrieval_tool_classification` |
9
+ | **Not semantic exec on Cursor** | `fast_context_search`, pure Grep/Read/codegraph |
10
+
11
+ ## Classifying tool names from session logs
12
+
13
+ Use the same patterns as telemetry:
14
+
15
+ ```powershell
16
+ python -c "from common.retrieval_tool_classification import classify_tool_calls; print(classify_tool_calls(['Grep','codebase_search'], platform='cursor'))"
17
+ ```
18
+
19
+ (Run from `.trellis/scripts` with `PYTHONPATH` set to that directory.)
20
+
21
+ On **cursor**, `semantic_executed` = `platform_semantic_executed`. Track `fast_context_count` and `cursor_fast_context_misuse` separately.
22
+
23
+ ## Plan-only metrics (eval)
24
+
25
+ ```powershell
26
+ python .trellis/scripts/batch_plan_envelope.py --queries queries-semantic-slice.jsonl --pretty
27
+ ```
28
+
29
+ Do **not** use legacy `scripts/batch-plan-envelope.py` (looks for `semantic-fast-context` on all platforms).
30
+
31
+ ## 12-query slice experiment
32
+
33
+ Prompt: `prompts/run-semantic-slice-12.md` in openclaw-retrieval-eval (or Trellis template copy).
34
+
35
+ Record per query:
36
+
37
+ - `plan_block_in_prompt` (visible `## 代码库检索计划` + 语义合规 block)
38
+ - `tools_called` verbatim from Cursor
39
+ - `platform_semantic_executed` / `fast_context_count` from classifier
40
+
41
+ Aggregate:
42
+
43
+ ```powershell
44
+ python .trellis/scripts/aggregate_retrieval_telemetry.py runs/<run>/telemetry.jsonl --markdown
45
+ ```
46
+
47
+ ## Agent instructions
48
+
49
+ When `platform-semantic` is in the route list, `render_agent_instructions` appends **语义合规(Cursor)** requiring one built-in semantic search before Top-1 and logging the host tool name.
@@ -19,7 +19,8 @@ How did I reach trellis-research / trellis-implement / trellis-check?
19
19
 
20
20
  ├─ Main session dispatched Task(subagent_type=trellis-*)
21
21
  │ → Task dispatch. ONLY path where BYOK json5 + Method 2.5 applies.
22
- Hook injects task context (<!-- trellis-hook-injected --> marker).
22
+ Context: CLI Layer 2 pre-embed (primary on Cursor); hook is best-effort
23
+ │ (<!-- trellis-hook-injected --> marker; skips if already present).
23
24
 
24
25
  └─ Used the trellis-check SKILL in main session (no subagent spawn)
25
26
  → Skill form. Main-session model. Only trellis-check has both
@@ -35,8 +36,8 @@ If unsure: Task dispatch is the path Trellis workflow routes through; Agent sess
35
36
  | Scene | Mechanism | Mode | Output / notes |
36
37
  | --------------------------------------------------- | -------------------------------------------------------------- | ----------------------------------- | -------------------------------------------------------------------------------------------- |
37
38
  | Code, history, or external research | `ttrellis-research` | Cursor **Agent** (writable) | `{TASK}/research/*.md`; smart-search-cli first, Cursor web fallback per skill |
38
- | Implementation (after `start-execution --approved`) | `ttrellis-implement` | Agent | Code edits; no `git commit` in subagent |
39
- | Post-implementation verification | `ttrellis-check` | Agent | Fixes + `verify.md` / gate hints; main session records gates when required |
39
+ | Implementation (after `start-execution --approved`) | `ttrellis-implement` | Agent | Code edits; no `git commit` in subagent; **CLI Layer 2** dispatch prompt on Cursor |
40
+ | Post-implementation verification | `ttrellis-check` | Agent | Fixes + `verify.md` / gate hints; **CLI Layer 2** on Cursor; main session records gates |
40
41
  | Parent/Child child worker | `generate-child-prompt --mode subagent` | **Parent Task** `trellis-implement` (default) | Child delivers `verify.md` + `handoff.md`; rare per-child model → **new writable Agent** session when user names that child |
41
42
  | Architecture / deep review | `ttrellis-check` or documented inline deep review | Agent or main session | Model via dispatch strategy (Methods 1–2.5, 3–4 below) |
42
43
  | PRD Grill (planning) | `trellis-micro-grill` contract **inside** `trellis-brainstorm` | **Not** a subagent | Single-question business follow-ups only |
@@ -288,13 +289,13 @@ trellis_task_subagents:
288
289
  | `beforeShellExecution` | Short-lived ticket for `task.py select` / `selected` / `exit` in shells |
289
290
  | `stop` | Optional `retrieval-pack-latest.json` when task has `research/` |
290
291
 
291
- **Per-turn workflow-state on Cursor:** deferred — use `sessionStart` + `/trellis-continue` / `get_context.py --mode phase` instead of Claude `UserPromptSubmit` injection.
292
+ **Per-turn workflow-state on Cursor:** deferred — use `sessionStart` + `/trellis-continue` / `get_context.py --mode phase` instead of a per-turn hook injection (the relevant Cursor channel has a confirmed `additional_context` bug, see `cursor-context-injection-guide.md`).
292
293
 
293
294
  ---
294
295
 
295
296
  ## Parent/Child alignment
296
297
 
297
- - `generate-child-prompt --mode subagent` → Parent **Task** `trellis-implement` by default; inline mode remains the portable default for non-Cursor platforms.
298
+ - `generate-child-prompt --mode subagent` → Parent **Task** `trellis-implement` by default; inline mode is the portable default when dispatching without spawning a subagent.
298
299
  - Child workers call `task.py set-child-state <parent> <child> <open|working|blocked|review> --evidence <ref>` — **no** session identity required for this command.
299
300
  - Integration states (`accepted`, `integrating`, `integrated`, …) are **Parent-only** via `integrate-child` / `review-child`.
300
301
 
@@ -309,6 +310,18 @@ trellis_task_subagents:
309
310
 
310
311
  ---
311
312
 
313
+ ## Maintainer: subagent missing task context (Cursor)
314
+
315
+ If a dispatched subagent cannot answer from `prd.md` / jsonl (empty or generic replies):
316
+
317
+ 1. Confirm the main session used **CLI Layer 2** before `Task(...)` (workflow Phase 2.1 / 2.2).
318
+ 2. **Manual fallback (Method 3):** run `python ./.trellis/scripts/task.py generate-dispatch-prompt <task-dir> <role> [--scope "..."]`, paste stdout into `Task(subagent_type=..., prompt=...)`.
319
+ 3. Hook-only injection is best-effort on Cursor; do not treat `preToolUse` as the sole source.
320
+
321
+ This command is **Agent-facing** — not listed in user README or slash command surface.
322
+
323
+ ---
324
+
312
325
  ## Hook fallback (no selected-task pointer)
313
326
 
314
327
  When `preToolUse` cannot resolve a selected task, the subagent should read **`Selected task:`** from the first line of its dispatch prompt, then load `implement.jsonl` / `check.jsonl`, `prd.md`, `design.md`, and `implement.md` manually. Trellis does **not** document or depend on Cursor `/multitask` for workflow orchestration.