@blxzer/cursor-trellis 0.2.9 → 0.3.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 (234) hide show
  1. package/CHANGELOG.md +94 -0
  2. package/README.md +85 -19
  3. package/README.zh-CN.md +60 -21
  4. package/bin/smart-search.js +1 -1
  5. package/dist/cli/index.d.ts.map +1 -1
  6. package/dist/cli/index.js +46 -18
  7. package/dist/cli/index.js.map +1 -1
  8. package/dist/commands/capability-smoke.d.ts +24 -0
  9. package/dist/commands/capability-smoke.d.ts.map +1 -0
  10. package/dist/commands/capability-smoke.js +83 -0
  11. package/dist/commands/capability-smoke.js.map +1 -0
  12. package/dist/commands/channel/agent-loader.d.ts +1 -1
  13. package/dist/commands/channel/agent-loader.js +4 -4
  14. package/dist/commands/channel/agent-loader.js.map +1 -1
  15. package/dist/commands/channel/guard.d.ts +2 -2
  16. package/dist/commands/channel/guard.js +3 -3
  17. package/dist/commands/channel/guard.js.map +1 -1
  18. package/dist/commands/channel/index.js +3 -3
  19. package/dist/commands/channel/index.js.map +1 -1
  20. package/dist/commands/channel/list.d.ts +1 -1
  21. package/dist/commands/channel/list.js +1 -1
  22. package/dist/commands/channel/rm.d.ts +1 -1
  23. package/dist/commands/channel/rm.js +1 -1
  24. package/dist/commands/channel/store/lock.d.ts +1 -1
  25. package/dist/commands/channel/store/lock.js +1 -1
  26. package/dist/commands/channel/store/paths.js +1 -1
  27. package/dist/commands/channel/store/paths.js.map +1 -1
  28. package/dist/commands/init.d.ts.map +1 -1
  29. package/dist/commands/init.js +197 -91
  30. package/dist/commands/init.js.map +1 -1
  31. package/dist/commands/uninstall.d.ts +4 -4
  32. package/dist/commands/uninstall.js +12 -12
  33. package/dist/commands/uninstall.js.map +1 -1
  34. package/dist/commands/update.d.ts +7 -2
  35. package/dist/commands/update.d.ts.map +1 -1
  36. package/dist/commands/update.js +161 -61
  37. package/dist/commands/update.js.map +1 -1
  38. package/dist/commands/upgrade.js +2 -2
  39. package/dist/commands/upgrade.js.map +1 -1
  40. package/dist/commands/workflow.d.ts +4 -4
  41. package/dist/commands/workflow.d.ts.map +1 -1
  42. package/dist/commands/workflow.js +10 -9
  43. package/dist/commands/workflow.js.map +1 -1
  44. package/dist/configurators/cursor.d.ts +2 -2
  45. package/dist/configurators/cursor.js +4 -4
  46. package/dist/configurators/cursor.js.map +1 -1
  47. package/dist/configurators/index.d.ts.map +1 -1
  48. package/dist/configurators/index.js +4 -4
  49. package/dist/configurators/index.js.map +1 -1
  50. package/dist/configurators/shared.d.ts +10 -10
  51. package/dist/configurators/shared.d.ts.map +1 -1
  52. package/dist/configurators/shared.js +32 -32
  53. package/dist/configurators/shared.js.map +1 -1
  54. package/dist/configurators/workflow.d.ts +6 -6
  55. package/dist/configurators/workflow.js +1 -1
  56. package/dist/constants/paths.d.ts +24 -24
  57. package/dist/constants/paths.d.ts.map +1 -1
  58. package/dist/constants/paths.js +16 -16
  59. package/dist/constants/paths.js.map +1 -1
  60. package/dist/migrations/manifests/0.2.10.json +374 -0
  61. package/dist/migrations/manifests/0.3.0.json +89 -0
  62. package/dist/migrations/manifests/0.3.1.json +32 -0
  63. package/dist/templates/common/bundled-skills/{trellis-cursor2plus-setup → cstl-cursor2plus-setup}/SKILL.md +15 -14
  64. package/dist/templates/common/bundled-skills/{trellis-meta → cstl-meta}/SKILL.md +75 -75
  65. package/dist/templates/common/bundled-skills/{trellis-meta → cstl-meta}/references/customize-local/add-project-local-conventions.md +19 -19
  66. package/dist/templates/common/bundled-skills/{trellis-meta → cstl-meta}/references/customize-local/change-agents.md +8 -8
  67. package/dist/templates/common/bundled-skills/{trellis-meta → cstl-meta}/references/customize-local/change-context-loading.md +26 -26
  68. package/dist/templates/common/bundled-skills/{trellis-meta → cstl-meta}/references/customize-local/change-hooks.md +9 -9
  69. package/dist/templates/common/bundled-skills/{trellis-meta → cstl-meta}/references/customize-local/change-skills-or-commands.md +8 -8
  70. package/dist/templates/common/bundled-skills/{trellis-meta → cstl-meta}/references/customize-local/change-spec-structure.md +17 -17
  71. package/dist/templates/common/bundled-skills/{trellis-meta → cstl-meta}/references/customize-local/change-task-lifecycle.md +46 -46
  72. package/dist/templates/common/bundled-skills/{trellis-meta → cstl-meta}/references/customize-local/change-workflow.md +18 -18
  73. package/dist/templates/common/bundled-skills/{trellis-meta → cstl-meta}/references/customize-local/overview.md +55 -55
  74. package/dist/templates/common/bundled-skills/{trellis-meta → cstl-meta}/references/local-architecture/context-injection.md +20 -20
  75. package/dist/templates/common/bundled-skills/cstl-meta/references/local-architecture/generated-files.md +83 -0
  76. package/dist/templates/common/bundled-skills/{trellis-meta → cstl-meta}/references/local-architecture/overview.md +15 -15
  77. package/dist/templates/common/bundled-skills/{trellis-meta → cstl-meta}/references/local-architecture/spec-system.md +12 -12
  78. package/dist/templates/common/bundled-skills/{trellis-meta → cstl-meta}/references/local-architecture/task-system.md +34 -34
  79. package/dist/templates/common/bundled-skills/{trellis-meta → cstl-meta}/references/local-architecture/workflow.md +8 -8
  80. package/dist/templates/common/bundled-skills/{trellis-meta → cstl-meta}/references/local-architecture/workspace-memory.md +19 -19
  81. package/dist/templates/common/bundled-skills/{trellis-meta → cstl-meta}/references/platform-files/agents.md +12 -12
  82. package/dist/templates/common/bundled-skills/{trellis-meta → cstl-meta}/references/platform-files/hooks-and-settings.md +7 -7
  83. package/dist/templates/common/bundled-skills/{trellis-meta → cstl-meta}/references/platform-files/overview.md +9 -9
  84. package/dist/templates/common/bundled-skills/{trellis-meta → cstl-meta}/references/platform-files/platform-map.md +7 -7
  85. package/dist/templates/common/bundled-skills/{trellis-meta → cstl-meta}/references/platform-files/skills-and-commands.md +19 -19
  86. package/dist/templates/common/bundled-skills/{trellis-micro-grill → cstl-micro-grill}/SKILL.md +62 -47
  87. package/dist/templates/common/bundled-skills/{trellis-skill-creator → cstl-skill-creator}/SKILL.md +44 -44
  88. package/dist/templates/common/bundled-skills/{trellis-skill-creator → cstl-skill-creator}/references/authoring-rules.md +97 -97
  89. package/dist/templates/common/bundled-skills/{trellis-skill-creator/references/trellis-skill-locations.md → cstl-skill-creator/references/cstl-skill-locations.md} +52 -52
  90. package/dist/templates/common/bundled-skills/{trellis-skill-creator → cstl-skill-creator}/references/review-checklist.md +47 -47
  91. package/dist/templates/common/bundled-skills/{trellis-spec-bootstrap → cstl-spec-bootstrap}/SKILL.md +6 -6
  92. package/dist/templates/common/bundled-skills/{trellis-spec-bootstrap → cstl-spec-bootstrap}/references/repository-analysis.md +1 -1
  93. package/dist/templates/common/bundled-skills/{trellis-spec-bootstrap → cstl-spec-bootstrap}/references/spec-task-planning.md +3 -3
  94. package/dist/templates/common/bundled-skills/{trellis-spec-bootstrap → cstl-spec-bootstrap}/references/spec-writing.md +1 -1
  95. package/dist/templates/common/commands/continue.md +24 -24
  96. package/dist/templates/common/commands/finish-work.md +5 -5
  97. package/dist/templates/common/commands/start.md +20 -20
  98. package/dist/templates/common/index.d.ts +1 -1
  99. package/dist/templates/common/index.d.ts.map +1 -1
  100. package/dist/templates/common/skills/before-dev.md +4 -4
  101. package/dist/templates/common/skills/brainstorm.md +188 -164
  102. package/dist/templates/common/skills/break-loop.md +3 -3
  103. package/dist/templates/common/skills/check.md +5 -5
  104. package/dist/templates/common/skills/update-spec.md +4 -4
  105. package/dist/templates/cursor/agents/{trellis-check.md → cstl-check.md} +14 -14
  106. package/dist/templates/cursor/agents/{trellis-implement.md → cstl-implement.md} +14 -14
  107. package/dist/templates/cursor/agents/{trellis-research.md → cstl-research.md} +11 -11
  108. package/dist/templates/cursor/commands/cursor2plus-setup.md +15 -15
  109. package/dist/templates/cursor/fixtures/expected-rules.d.ts +1 -1
  110. package/dist/templates/cursor/fixtures/expected-rules.d.ts.map +1 -1
  111. package/dist/templates/cursor/fixtures/expected-rules.js +2 -2
  112. package/dist/templates/cursor/fixtures/expected-rules.js.map +1 -1
  113. package/dist/templates/cursor/rules/{trellis-subagent-dispatch.mdc → cstl-subagent-dispatch.mdc} +4 -4
  114. package/dist/templates/cursor/rules/{trellis-triage.mdc → cstl-triage.mdc} +3 -3
  115. package/dist/templates/cursor/rules/retrieval-routing.mdc +4 -4
  116. package/dist/templates/extract.d.ts +1 -1
  117. package/dist/templates/extract.js +1 -1
  118. package/dist/templates/markdown/agents.md +13 -13
  119. package/dist/templates/markdown/prompts/run-semantic-slice-12.md.txt +1 -1
  120. package/dist/templates/markdown/spec/guides/cross-platform-thinking-guide.md.txt +634 -634
  121. package/dist/templates/markdown/spec/guides/cursor-context-injection-guide.md.txt +5 -5
  122. package/dist/templates/markdown/spec/guides/cursor-semantic-compliance.md.txt +7 -1
  123. package/dist/templates/markdown/spec/guides/cursor-subagent-policy.md.txt +393 -391
  124. package/dist/templates/markdown/spec/guides/durable-learning-decision-guide.md.txt +14 -14
  125. package/dist/templates/markdown/spec/guides/execution-strategy.md.txt +5 -5
  126. package/dist/templates/markdown/spec/guides/index.md.txt +3 -2
  127. package/dist/templates/markdown/spec/guides/retrieval-daily-guide.md.txt +10 -10
  128. package/dist/templates/markdown/workspace-index.md +3 -3
  129. package/dist/templates/markdown/worktree.yaml.txt +1 -1
  130. package/dist/templates/shared-hooks/index.d.ts +2 -2
  131. package/dist/templates/shared-hooks/index.js +2 -2
  132. package/dist/templates/shared-hooks/inject-retrieval-plan.py +3 -3
  133. package/dist/templates/shared-hooks/inject-shell-session-context.py +7 -7
  134. package/dist/templates/shared-hooks/inject-subagent-context.py +4 -4
  135. package/dist/templates/shared-hooks/inject-workflow-state.py +37 -37
  136. package/dist/templates/shared-hooks/research-end-retrieval-pack.py +2 -2
  137. package/dist/templates/shared-hooks/session-start.py +16 -16
  138. package/dist/templates/trellis/config/execution-strategy-rules.json +1 -1
  139. package/dist/templates/trellis/config.yaml +5 -25
  140. package/dist/templates/trellis/index.d.ts +2 -2
  141. package/dist/templates/trellis/index.js +2 -2
  142. package/dist/templates/trellis/local/README.md +15 -13
  143. package/dist/templates/trellis/local/patch_wpelc8.py +7 -7
  144. package/dist/templates/trellis/local/subagent-models.json.example +1 -1
  145. package/dist/templates/trellis/local/trellis-task-models.json.example +3 -3
  146. package/dist/templates/trellis/local/trellis-task-models.json5.example +5 -5
  147. package/dist/templates/trellis/local/trellis_task_models_config.py +6 -6
  148. package/dist/templates/trellis/scripts/add_session.py +20 -20
  149. package/dist/templates/trellis/scripts/common/active_task.py +2 -2
  150. package/dist/templates/trellis/scripts/common/artifact_search.py +587 -587
  151. package/dist/templates/trellis/scripts/common/cli_adapter.py +3 -3
  152. package/dist/templates/trellis/scripts/common/codebase_retrieval_router.py +6 -6
  153. package/dist/templates/trellis/scripts/common/config.py +3 -3
  154. package/dist/templates/trellis/scripts/common/developer.py +2 -2
  155. package/dist/templates/trellis/scripts/common/execution_strategy.py +1 -1
  156. package/dist/templates/trellis/scripts/common/packages_context.py +23 -23
  157. package/dist/templates/trellis/scripts/common/parent_orchestration.py +702 -702
  158. package/dist/templates/trellis/scripts/common/paths.py +107 -107
  159. package/dist/templates/trellis/scripts/common/project_file_stats.py +1 -1
  160. package/dist/templates/trellis/scripts/common/retrieval_agent_instructions.py +1 -1
  161. package/dist/templates/trellis/scripts/common/safe_commit.py +31 -31
  162. package/dist/templates/trellis/scripts/common/session_context.py +1159 -1159
  163. package/dist/templates/trellis/scripts/common/session_memory.py +360 -360
  164. package/dist/templates/trellis/scripts/common/smart_search_evidence.py +514 -514
  165. package/dist/templates/trellis/scripts/common/smart_search_resolve.py +1 -1
  166. package/dist/templates/trellis/scripts/common/subagent_dispatch.py +7 -7
  167. package/dist/templates/trellis/scripts/common/task_context.py +1 -1
  168. package/dist/templates/trellis/scripts/common/task_dashboard.py +140 -140
  169. package/dist/templates/trellis/scripts/common/task_gates.py +2056 -2034
  170. package/dist/templates/trellis/scripts/common/task_store.py +1594 -1594
  171. package/dist/templates/trellis/scripts/common/task_utils.py +3 -3
  172. package/dist/templates/trellis/scripts/common/tasks.py +1 -1
  173. package/dist/templates/trellis/scripts/common/trellis_config.py +3 -3
  174. package/dist/templates/trellis/scripts/common/workflow_phase.py +1 -1
  175. package/dist/templates/trellis/scripts/cursor_retrieval_probe.py +3 -3
  176. package/dist/templates/trellis/scripts/cursor_retrieval_probe_prompt.md +11 -11
  177. package/dist/templates/trellis/scripts/hooks/linear_sync.py +8 -8
  178. package/dist/templates/trellis/scripts/init_developer.py +2 -2
  179. package/dist/templates/trellis/scripts/retrieval_probe_matrix_template.json +4 -4
  180. package/dist/templates/trellis/scripts/route_codebase_retrieval.py +1 -1
  181. package/dist/templates/trellis/scripts/task.py +918 -918
  182. package/dist/templates/trellis/tasks/templates/release-readiness/implement.md +2 -2
  183. package/dist/templates/trellis/workflow.md +805 -805
  184. package/dist/types/ai-tools.d.ts +1 -1
  185. package/dist/types/ai-tools.d.ts.map +1 -1
  186. package/dist/types/ai-tools.js +1 -1
  187. package/dist/types/ai-tools.js.map +1 -1
  188. package/dist/types/migration.d.ts +1 -1
  189. package/dist/types/migration.d.ts.map +1 -1
  190. package/dist/utils/agents-md.d.ts +37 -0
  191. package/dist/utils/agents-md.d.ts.map +1 -0
  192. package/dist/utils/agents-md.js +82 -0
  193. package/dist/utils/agents-md.js.map +1 -0
  194. package/dist/utils/codebase-retrieval-router.js +5 -5
  195. package/dist/utils/codebase-retrieval-router.js.map +1 -1
  196. package/dist/utils/manifest-prune.d.ts +2 -2
  197. package/dist/utils/manifest-prune.js +4 -4
  198. package/dist/utils/manifest-prune.js.map +1 -1
  199. package/dist/utils/mirror-check.d.ts +3 -1
  200. package/dist/utils/mirror-check.d.ts.map +1 -1
  201. package/dist/utils/mirror-check.js +22 -11
  202. package/dist/utils/mirror-check.js.map +1 -1
  203. package/dist/utils/project-capabilities.d.ts +14 -3
  204. package/dist/utils/project-capabilities.d.ts.map +1 -1
  205. package/dist/utils/project-capabilities.js +127 -17
  206. package/dist/utils/project-capabilities.js.map +1 -1
  207. package/dist/utils/readiness.d.ts +10 -0
  208. package/dist/utils/readiness.d.ts.map +1 -1
  209. package/dist/utils/readiness.js +6 -3
  210. package/dist/utils/readiness.js.map +1 -1
  211. package/dist/utils/retrieval-agent-instructions.js +1 -1
  212. package/dist/utils/retrieval-agent-instructions.js.map +1 -1
  213. package/dist/utils/retrieval-execution-telemetry.js +1 -1
  214. package/dist/utils/retrieval-execution-telemetry.js.map +1 -1
  215. package/dist/utils/template-fetcher.js +1 -1
  216. package/dist/utils/template-fetcher.js.map +1 -1
  217. package/dist/utils/template-hash.d.ts +2 -2
  218. package/dist/utils/template-hash.d.ts.map +1 -1
  219. package/dist/utils/template-hash.js +12 -10
  220. package/dist/utils/template-hash.js.map +1 -1
  221. package/dist/utils/workflow-dir.d.ts +13 -0
  222. package/dist/utils/workflow-dir.d.ts.map +1 -0
  223. package/dist/utils/workflow-dir.js +35 -0
  224. package/dist/utils/workflow-dir.js.map +1 -0
  225. package/dist/utils/workflow-ownership.d.ts +36 -0
  226. package/dist/utils/workflow-ownership.d.ts.map +1 -0
  227. package/dist/utils/workflow-ownership.js +137 -0
  228. package/dist/utils/workflow-ownership.js.map +1 -0
  229. package/dist/utils/workflow-resolver.d.ts +1 -1
  230. package/dist/utils/workflow-resolver.js +1 -1
  231. package/package.json +3 -4
  232. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/generated-files.md +0 -83
  233. /package/bin/{trellis.js → cstl.js} +0 -0
  234. /package/dist/templates/common/bundled-skills/{trellis-spec-bootstrap → cstl-spec-bootstrap}/references/mcp-setup.md +0 -0
@@ -1,8 +1,8 @@
1
- # Durable Learning Decision Guide
1
+ # Durable Learning Decision Guide
2
2
 
3
- > **Purpose**: Decide whether a completed task should update `.trellis/spec/` or can archive with an explicit **no durable learning** line.
3
+ > **Purpose**: Decide whether a completed task should update `.cstl/spec/` or can archive with an explicit **no durable learning** line.
4
4
 
5
- This guide is a **thinking checklist**. It does not replace code-spec files under `.trellis/spec/<layer>/`.
5
+ This guide is a **thinking checklist**. It does not replace code-spec files under `.cstl/spec/<layer>/`.
6
6
 
7
7
  ---
8
8
 
@@ -13,11 +13,11 @@ Pick **one** grep-friendly line before `archive --check`:
13
13
  | Outcome | Example line in `verify.md` |
14
14
  | --- | --- |
15
15
  | No reusable insight | `Durable learning decision: no durable learning` (or any line containing `no durable learning`) |
16
- | Spec was updated | `Spec update evidence: .trellis/spec/Trellis/framework/index.md` |
17
- | Insight already documented | `Learning artifact: .trellis/tasks/<task>/handoff.md` |
18
- | Retrospective captured | `Learning artifact: .trellis/workspace/...` or `retrospective.md: <path>` |
16
+ | Spec was updated | `Spec update evidence: .cstl/spec/Trellis/framework/index.md` |
17
+ | Insight already documented | `Learning artifact: .cstl/tasks/<task>/handoff.md` |
18
+ | Retrospective captured | `Learning artifact: .cstl/workspace/...` or `retrospective.md: <path>` |
19
19
 
20
- Optional planning note (not sufficient alone): `Spec update needed: <reason>` — still record **spec update evidence** after `/trellis:update-spec`.
20
+ Optional planning note (not sufficient alone): `Spec update needed: <reason>` — still record **spec update evidence** after `/cstl:update-spec`.
21
21
 
22
22
  ---
23
23
 
@@ -33,7 +33,7 @@ Optional planning note (not sufficient alone): `Spec update needed: <reason>`
33
33
 
34
34
  - New or changed CLI/API signature or gate behavior
35
35
  - Repeated parent review **changes** on the same class of mistake
36
- - Workflow bug that should not recur (after `/trellis:break-loop` analysis)
36
+ - Workflow bug that should not recur (after `/cstl:break-loop` analysis)
37
37
  - Cross-layer contract clarification
38
38
 
39
39
  ### Learning artifact
@@ -47,22 +47,22 @@ Optional planning note (not sufficient alone): `Spec update needed: <reason>`
47
47
 
48
48
  ```bash
49
49
  # Draft missing archive sections (append-only)
50
- python ./.trellis/scripts/task.py prepare-archive-evidence .trellis/tasks/<task>
50
+ python ./.cstl/scripts/task.py prepare-archive-evidence .cstl/tasks/<task>
51
51
 
52
52
  # Print spec-capture checklist (stdout only; does not edit specs)
53
- python ./.trellis/scripts/task.py prepare-learning-scaffold .trellis/tasks/<task> --trigger "parent review changes"
53
+ python ./.cstl/scripts/task.py prepare-learning-scaffold .cstl/tasks/<task> --trigger "parent review changes"
54
54
 
55
55
  # Parent review surfaces missing child learning lines
56
- python ./.trellis/scripts/task.py review-child <parent> <child> --check
56
+ python ./.cstl/scripts/task.py review-child <parent> <child> --check
57
57
  ```
58
58
 
59
59
  ---
60
60
 
61
61
  ## Skills
62
62
 
63
- - **`/trellis:update-spec`** — edit code-spec after reviewer confirmation
64
- - **`/trellis:break-loop`** — deep bug analysis; often leads to spec updates
65
- - **`/trellis:finish-work`** — archive after learning line is present in `verify.md`
63
+ - **`/cstl:update-spec`** — edit code-spec after reviewer confirmation
64
+ - **`/cstl:break-loop`** — deep bug analysis; often leads to spec updates
65
+ - **`/cstl:finish-work`** — archive after learning line is present in `verify.md`
66
66
 
67
67
  ---
68
68
 
@@ -8,7 +8,7 @@
8
8
 
9
9
  | Field | Question |
10
10
  | --- | --- |
11
- | `execution_mode` | **Who** implements and checks? (`inline` main session, `worker` trellis-implement/check agents, `child-task` Child worker) |
11
+ | `execution_mode` | **Who** implements and checks? (`inline` main session, `worker` cstl-implement/check agents, `child-task` Child worker) |
12
12
  | `isolation` | **Where** are files edited? (`main-worktree` vs `git-worktree` for Child) |
13
13
 
14
14
  Non-git repo roots do **not** force `inline` for code Full tasks; they only affect whether `git-worktree` / `prepare-child-worktree` is recommended.
@@ -16,8 +16,8 @@ Non-git repo roots do **not** force `inline` for code Full tasks; they only affe
16
16
  ## Suggest (planning)
17
17
 
18
18
  ```bash
19
- python3 ./.trellis/scripts/task.py suggest-execution-strategy <task-dir>
20
- python3 ./.trellis/scripts/task.py suggest-execution-strategy <task-dir> --json
19
+ python3 ./.cstl/scripts/task.py suggest-execution-strategy <task-dir>
20
+ python3 ./.cstl/scripts/task.py suggest-execution-strategy <task-dir> --json
21
21
  ```
22
22
 
23
23
  Run during brainstorm / before finalizing the YAML block in `implement.md`. Reconcile suggestion with product intent; the contract in `implement.md` is authoritative after approval.
@@ -32,7 +32,7 @@ Run during brainstorm / before finalizing the YAML block in `implement.md`. Reco
32
32
  | Parent / has children | `inline` | `main-worktree` |
33
33
  | Child (`task.json` parent set) | `child-task` | `git-worktree` when git package root resolves; else `main-worktree` + WARN |
34
34
 
35
- `touches_code` is deterministic: code `optional_capabilities`, `package`/`scope` path segments (`src`, `packages`, `scripts`, …), or Full with `design.md` and non-doc-only capabilities. Rules live in `.trellis/config/execution-strategy-rules.json`.
35
+ `touches_code` is deterministic: code `optional_capabilities`, `package`/`scope` path segments (`src`, `packages`, `scripts`, …), or Full with `design.md` and non-doc-only capabilities. Rules live in `.cstl/config/execution-strategy-rules.json`.
36
36
 
37
37
  ## Drift warning (preflight)
38
38
 
@@ -40,4 +40,4 @@ Run during brainstorm / before finalizing the YAML block in `implement.md`. Reco
40
40
 
41
41
  ## Phase 2 alignment
42
42
 
43
- See `workflow.md` Phase 2.1 / 2.2 tables: spawn `trellis-implement` / `trellis-check` only when `execution_mode: worker`.
43
+ See `workflow.md` Phase 2.1 / 2.2 tables: spawn `cstl-implement` / `cstl-check` only when `execution_mode: worker`.
@@ -1,4 +1,4 @@
1
- # Thinking Guides
1
+ # Thinking Guides
2
2
 
3
3
  > **Purpose**: Expand your thinking to catch things you might not have considered.
4
4
 
@@ -21,10 +21,11 @@ These guides help you **ask the right questions before coding**.
21
21
 
22
22
  | Guide | Purpose | When to Use |
23
23
  |-------|---------|-------------|
24
- | [Durable Learning Decision Guide](./durable-learning-decision-guide.md) | Choose no-learning vs spec update vs learning artifact before archive | Finishing a task, parent review, or after `/trellis:break-loop` |
24
+ | [Durable Learning Decision Guide](./durable-learning-decision-guide.md) | Choose no-learning vs spec update vs learning artifact before archive | Finishing a task, parent review, or after `/cstl:break-loop` |
25
25
  | [Code Reuse Thinking Guide](./code-reuse-thinking-guide.md) | Identify patterns and reduce duplication | When you notice repeated patterns |
26
26
  | [Cross-Layer Thinking Guide](./cross-layer-thinking-guide.md) | Think through data flow across layers | Features spanning multiple layers |
27
27
  | [Retrieval daily guide](./retrieval-daily-guide.md) | rg / codegraph / fast-context / smart-search / pack / router | Planning, research, finish verification |
28
+ | [Cursor semantic compliance](./cursor-semantic-compliance.md) | Native planned vs executed semantic (`SemanticSearch`, classify_tool_calls) | Retrieval eval, OC-15 compliance runs, telemetry interpretation |
28
29
  | [Cursor subagent policy](./cursor-subagent-policy.md) | Task tool scenes, Agent mode, `model_policy: cursor-configured`, Cursor++ | Parent/Child dispatch, research/implement/check, parallel execution |
29
30
  | [Execution strategy](./execution-strategy.md) | `suggest-execution-strategy`, rules JSON, inline vs worker vs child-task | Writing `implement.md` contract, Phase 2 dispatch |
30
31
  | [Cursor context injection guide](./cursor-context-injection-guide.md) | Which Cursor channels reach the model (sessionStart bug, .cursor/rules, AGENTS.md) | "Agent ignored instructions" on Cursor, adding always-visible rules |
@@ -46,13 +46,13 @@ When `projectFileCount > 2000`, the router promotes structural (codegraph) route
46
46
  ## Commands
47
47
 
48
48
  ```powershell
49
- python ./.trellis/scripts/search_artifacts.py --query "<topic>" --json
50
- python ./.trellis/scripts/search_memory.py --query "<topic>" --json
51
- python ./.trellis/scripts/run_smart_search.py "<question>" --intent deep-research --json
52
- python ./.trellis/scripts/route_codebase_retrieval.py "<question>" --json
53
- python ./.trellis/scripts/route_codebase_retrieval.py "<question>" --instructions
54
- python ./.trellis/scripts/get_context.py --mode retrieval-pack --json --input evidence.json
55
- python ./.trellis/scripts/codegraph_session_smoke.py --json
49
+ python ./.cstl/scripts/search_artifacts.py --query "<topic>" --json
50
+ python ./.cstl/scripts/search_memory.py --query "<topic>" --json
51
+ python ./.cstl/scripts/run_smart_search.py "<question>" --intent deep-research --json
52
+ python ./.cstl/scripts/route_codebase_retrieval.py "<question>" --json
53
+ python ./.cstl/scripts/route_codebase_retrieval.py "<question>" --instructions
54
+ python ./.cstl/scripts/get_context.py --mode retrieval-pack --json --input evidence.json
55
+ python ./.cstl/scripts/codegraph_session_smoke.py --json
56
56
  ```
57
57
 
58
58
  ## Codegraph session readiness (eval / dogfood)
@@ -60,7 +60,7 @@ python ./.trellis/scripts/codegraph_session_smoke.py --json
60
60
  Before a **cold benchmark** or structural-heavy run:
61
61
 
62
62
  1. **MCP**: In Cursor project MCP settings, enable the **codegraph** server for the workspace (or eval checkout).
63
- 2. **Index on disk**: Run `python ./.trellis/scripts/codegraph_session_smoke.py` (exit 0 = at least one `.codegraph/` under workspace root or a top-level subproject). Use `--root <eval-checkout>` when the agent root is not the harness.
63
+ 2. **Index on disk**: Run `python ./.cstl/scripts/codegraph_session_smoke.py` (exit 0 = at least one `.codegraph/` under workspace root or a top-level subproject). Use `--root <eval-checkout>` when the agent root is not the harness.
64
64
  3. **Live MCP smoke** (manual): one `codegraph_search` with a known symbol in that repo; stale-index banner → re-read affected files.
65
65
 
66
66
  Paste into the **run report header** (markdown):
@@ -76,7 +76,7 @@ Paste into the **run report header** (markdown):
76
76
 
77
77
  When `smart-search doctor` is not ok or `run_smart_search.py` status is `not_configured` / `failed` (including **search timeout**), use **Cursor WebSearch/WebFetch**, then persist to `{TASK}/research/` with `source: cursor-web-fallback` in frontmatter. See `smart-search-cli` skill §4b.
78
78
 
79
- **CLI discovery (Cursor):** `TRELLIS_SMART_SEARCH_COMMAND` / `smart_search.command` → PATH `smart-search` → project `node_modules/.bin/smart-search` (when installed as a dependency). Agent entrypoint is always `./.trellis/scripts/run_smart_search.py`.
79
+ **CLI discovery (Cursor):** `TRELLIS_SMART_SEARCH_COMMAND` / `smart_search.command` → PATH `smart-search` → project `node_modules/.bin/smart-search` (when installed as a dependency). Agent entrypoint is always `./.cstl/scripts/run_smart_search.py`.
80
80
 
81
81
  **Research flags (smart-search ≥ 0.1.15):** pass through `run_smart_search.py` for `--intent deep-research`:
82
82
 
@@ -107,7 +107,7 @@ After Grep/codegraph/semantic produce **path candidates**, reorder before choosi
107
107
  | `env-config-literal` | Prefer `scripts/`, `e2e/`, `bench/`, `test/` over generic `src/auth` / `src/paths`. |
108
108
 
109
109
  - **Agent plans**: `render_agent_instructions` / `inject-retrieval-plan.py` append a **结果层排序** block when these intents appear.
110
- - **Offline reorder**: `python ./.trellis/scripts/rank_retrieval_candidates.py --candidates fixtures.json --intents caller-chain --top-k 5 --pretty`
110
+ - **Offline reorder**: `python ./.cstl/scripts/rank_retrieval_candidates.py --candidates fixtures.json --intents caller-chain --top-k 5 --pretty`
111
111
  - **Library**: `common/retrieval_result_ranking.py` (Python mirror used by router and rank script).
112
112
 
113
113
  Do **not** claim aggregate openclaw score gains from ranking alone without fresh telemetry (`candidate_pool_recall` vs final Top-K).
@@ -38,7 +38,7 @@ workspace/
38
38
  Run the initialization script:
39
39
 
40
40
  ```bash
41
- python3 ./.trellis/scripts/init_developer.py <your-name>
41
+ python3 ./.cstl/scripts/init_developer.py <your-name>
42
42
  ```
43
43
 
44
44
  This will:
@@ -51,12 +51,12 @@ This will:
51
51
 
52
52
  1. Get your developer name:
53
53
  ```bash
54
- python3 ./.trellis/scripts/get_developer.py
54
+ python3 ./.cstl/scripts/get_developer.py
55
55
  ```
56
56
 
57
57
  2. Read your personal index:
58
58
  ```bash
59
- cat .trellis/workspace/$(python3 ./.trellis/scripts/get_developer.py)/index.md
59
+ cat .cstl/workspace/$(python3 ./.cstl/scripts/get_developer.py)/index.md
60
60
  ```
61
61
 
62
62
  ---
@@ -22,7 +22,7 @@ copy:
22
22
  # - .env
23
23
  # - .env.local
24
24
  # Workflow config
25
- - .trellis/.developer
25
+ - .cstl/.developer
26
26
 
27
27
  #-------------------------------------------------------------------------------
28
28
  # Post-Create Hooks
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Shared hook templates — platform-independent Python hook scripts.
3
3
  *
4
- * These scripts read only from .trellis/ paths (JSONL, prd.md, spec/) and
4
+ * These scripts read only from .cstl/ paths (JSONL, prd.md, spec/) and
5
5
  * have no platform-specific placeholders. They can be written as-is to any
6
6
  * platform's hooks directory.
7
7
  */
@@ -16,7 +16,7 @@ export type SharedHookPlatform = "claude" | "cursor" | "codex" | "gemini" | "qod
16
16
  /**
17
17
  * Which shared hooks each platform actually invokes. Single source of truth
18
18
  * for shared-hook distribution — both `writeSharedHooks` (runtime install)
19
- * and `collectSharedHooks` (`trellis update` diff) read from this table.
19
+ * and `collectSharedHooks` (`cstl update` diff) read from this table.
20
20
  *
21
21
  * Routing rules encoded here:
22
22
  * - `session-start.py` — shipped by every platform with a SessionStart
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Shared hook templates — platform-independent Python hook scripts.
3
3
  *
4
- * These scripts read only from .trellis/ paths (JSONL, prd.md, spec/) and
4
+ * These scripts read only from .cstl/ paths (JSONL, prd.md, spec/) and
5
5
  * have no platform-specific placeholders. They can be written as-is to any
6
6
  * platform's hooks directory.
7
7
  */
@@ -16,7 +16,7 @@ function readTemplate(relativePath) {
16
16
  /**
17
17
  * Which shared hooks each platform actually invokes. Single source of truth
18
18
  * for shared-hook distribution — both `writeSharedHooks` (runtime install)
19
- * and `collectSharedHooks` (`trellis update` diff) read from this table.
19
+ * and `collectSharedHooks` (`cstl update` diff) read from this table.
20
20
  *
21
21
  * Routing rules encoded here:
22
22
  * - `session-start.py` — shipped by every platform with a SessionStart
@@ -4,10 +4,10 @@
4
4
  DEGRADED MODE (2026-06-24): beforeSubmitPrompt hook's additional_context does
5
5
  not reach the model in current Cursor versions (L1: event often not fired;
6
6
  L2: additional_context not delivered). This hook now runs in telemetry-only
7
- mode: logs routing decisions to .trellis/.runtime/retrieval-plan-events.log
7
+ mode: logs routing decisions to .cstl/.runtime/retrieval-plan-events.log
8
8
  for post-session analysis but does NOT inject plan blocks.
9
9
 
10
- See .trellis/tasks/06-24-handle-beforesubmitprompt-unreliability/prd.md for
10
+ See .cstl/tasks/06-24-handle-beforesubmitprompt-unreliability/prd.md for
11
11
  probe results and mitigation strategy.
12
12
 
13
13
  Silent exit 0 (no stdout) when:
@@ -48,7 +48,7 @@ if sys.platform.startswith("win"):
48
48
  except Exception:
49
49
  pass
50
50
 
51
- DIR_WORKFLOW = ".trellis"
51
+ DIR_WORKFLOW = ".cstl"
52
52
  PLAN_MARKER_ZH = "## 代码库检索计划"
53
53
  PLAN_MARKER_EN = "## Codebase retrieval plan"
54
54
  TELEMETRY_LOG = ".runtime/retrieval-plan-events.log"
@@ -2,9 +2,9 @@
2
2
  """Cursor beforeShellExecution hook: bridge conversation identity to task.py.
3
3
 
4
4
  Cursor's shell command environment does not inherit SessionStart data. This
5
- hook writes a short-lived runtime ticket before Cursor runs a shell command
6
- that calls `task.py select/selected/exit`. The task script then consumes the
7
- ticket only when it has no native session environment.
5
+ hook writes a short-lived runtime ticket before Cursor runs a shell command
6
+ that calls `task.py select/selected/exit`. The task script then consumes the
7
+ ticket only when it has no native session environment.
8
8
  """
9
9
  from __future__ import annotations
10
10
 
@@ -18,10 +18,10 @@ from pathlib import Path
18
18
  from typing import Any
19
19
 
20
20
 
21
- DIR_WORKFLOW = ".trellis"
21
+ DIR_WORKFLOW = ".cstl"
22
22
  DIR_RUNTIME = ".runtime"
23
23
  DIR_CURSOR_SHELL = "cursor-shell"
24
- SESSION_SUBCOMMANDS = {"select", "selected", "exit"}
24
+ SESSION_SUBCOMMANDS = {"select", "selected", "exit"}
25
25
  TICKET_TTL_SECONDS = 30
26
26
  CONTEXT_IDENTITY_KEYS = (
27
27
  "session_id",
@@ -80,8 +80,8 @@ def _extract_task_subcommands(command: str) -> list[dict[str, str]]:
80
80
  if name not in SESSION_SUBCOMMANDS:
81
81
  continue
82
82
  item = {"name": name}
83
- if name == "select" and index + 2 < len(tokens):
84
- item["task_ref"] = tokens[index + 2]
83
+ if name == "select" and index + 2 < len(tokens):
84
+ item["task_ref"] = tokens[index + 2]
85
85
  subcommands.append(item)
86
86
  return subcommands
87
87
 
@@ -26,11 +26,11 @@ if sys.platform.startswith("win"):
26
26
  elif hasattr(sys.stdout, "detach"):
27
27
  sys.stdout = _io.TextIOWrapper(sys.stdout.detach(), encoding="utf-8", errors="replace") # type: ignore[union-attr]
28
28
 
29
- DIR_WORKFLOW = ".trellis"
29
+ DIR_WORKFLOW = ".cstl"
30
30
 
31
- AGENT_IMPLEMENT = "trellis-implement"
32
- AGENT_CHECK = "trellis-check"
33
- AGENT_RESEARCH = "trellis-research"
31
+ AGENT_IMPLEMENT = "cstl-implement"
32
+ AGENT_CHECK = "cstl-check"
33
+ AGENT_RESEARCH = "cstl-research"
34
34
  AGENTS_ALL = (AGENT_IMPLEMENT, AGENT_CHECK, AGENT_RESEARCH)
35
35
  AGENTS_REQUIRE_TASK = (AGENT_IMPLEMENT, AGENT_CHECK)
36
36
 
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env python3
2
2
  """Trellis per-turn breadcrumb hook (UserPromptSubmit / BeforeAgent equivalent).
3
3
 
4
- Runs on every user prompt. Resolves the selected task through Trellis'
5
- session-aware selected task resolver and emits a short <workflow-state>
6
- block reminding the main AI what task is selected and its expected flow.
4
+ Runs on every user prompt. Resolves the selected task through Trellis'
5
+ session-aware selected task resolver and emits a short <workflow-state>
6
+ block reminding the main AI what task is selected and its expected flow.
7
7
 
8
8
  The emitted ``hookEventName`` field is platform-aware: most hosts expect
9
9
  ``UserPromptSubmit`` (Claude Code naming, also accepted by Cursor / Qoder /
@@ -23,7 +23,7 @@ hook entry point). Written to each platform's hooks directory via
23
23
  writeSharedHooks() at init time.
24
24
 
25
25
  Silent exit 0 cases (no output):
26
- - No .trellis/ directory found (not a Trellis project)
26
+ - No .cstl/ directory found (not a Trellis project)
27
27
  - task.json malformed or missing status
28
28
  """
29
29
  from __future__ import annotations
@@ -58,11 +58,11 @@ if sys.platform.startswith("win"):
58
58
  from typing import Optional
59
59
 
60
60
 
61
- # Bootstrap notice for Codex while the session has no selected task. Codex does not
61
+ # Bootstrap notice for Codex while the session has no selected task. Codex does not
62
62
  # get the full SessionStart overview; this short reminder points the main session
63
63
  # at the start skill once and leaves the per-turn state block compact.
64
64
  CODEX_NO_TASK_BOOTSTRAP_NOTICE = """<trellis-bootstrap>
65
- If you have not already loaded Trellis context this session, read the `trellis-start` skill once.
65
+ If you have not already loaded Trellis context this session, read the `cstl-start` skill once.
66
66
  </trellis-bootstrap>"""
67
67
 
68
68
 
@@ -71,21 +71,21 @@ If you have not already loaded Trellis context this session, read the `trellis-s
71
71
  # ---------------------------------------------------------------------------
72
72
 
73
73
  def find_trellis_root(start: Path) -> Optional[Path]:
74
- """Walk up from start to find directory containing .trellis/.
74
+ """Walk up from start to find directory containing .cstl/.
75
75
 
76
76
  Handles CWD drift: subdirectory launches, monorepo packages, etc.
77
- Returns None if no .trellis/ found (silent no-op).
77
+ Returns None if no .cstl/ found (silent no-op).
78
78
  """
79
79
  cur = start.resolve()
80
80
  while cur != cur.parent:
81
- if (cur / ".trellis").is_dir():
81
+ if (cur / ".cstl").is_dir():
82
82
  return cur
83
83
  cur = cur.parent
84
84
  return None
85
85
 
86
86
 
87
87
  # ---------------------------------------------------------------------------
88
- # Selected task discovery
88
+ # Selected task discovery
89
89
  # ---------------------------------------------------------------------------
90
90
 
91
91
  def _detect_platform(input_data: dict) -> str | None:
@@ -124,18 +124,18 @@ def _detect_platform(input_data: dict) -> str | None:
124
124
  return None
125
125
 
126
126
 
127
- def _resolve_selected_task(root: Path, input_data: dict):
128
- scripts_dir = root / ".trellis" / "scripts"
129
- if str(scripts_dir) not in sys.path:
130
- sys.path.insert(0, str(scripts_dir))
131
- from common.active_task import resolve_selected_task # type: ignore[import-not-found]
132
-
133
- return resolve_selected_task(root, input_data, platform=_detect_platform(input_data))
134
-
135
-
136
- def get_selected_task(root: Path, input_data: dict) -> Optional[tuple[str, str, str]]:
137
- """Return (task_id, status, source) from the selected task."""
138
- active = _resolve_selected_task(root, input_data)
127
+ def _resolve_selected_task(root: Path, input_data: dict):
128
+ scripts_dir = root / ".cstl" / "scripts"
129
+ if str(scripts_dir) not in sys.path:
130
+ sys.path.insert(0, str(scripts_dir))
131
+ from common.active_task import resolve_selected_task # type: ignore[import-not-found]
132
+
133
+ return resolve_selected_task(root, input_data, platform=_detect_platform(input_data))
134
+
135
+
136
+ def get_selected_task(root: Path, input_data: dict) -> Optional[tuple[str, str, str]]:
137
+ """Return (task_id, status, source) from the selected task."""
138
+ active = _resolve_selected_task(root, input_data)
139
139
  if not active.task_path:
140
140
  return None
141
141
 
@@ -180,7 +180,7 @@ def load_breadcrumbs(root: Path) -> dict[str, str]:
180
180
  in build_breadcrumb so users see the broken state and fix
181
181
  workflow.md, rather than the hook silently masking the issue.
182
182
  """
183
- workflow = root / ".trellis" / "workflow.md"
183
+ workflow = root / ".cstl" / "workflow.md"
184
184
  if not workflow.is_file():
185
185
  return {}
186
186
  try:
@@ -198,12 +198,12 @@ def load_breadcrumbs(root: Path) -> dict[str, str]:
198
198
 
199
199
 
200
200
  def _read_trellis_config(root: Path) -> dict:
201
- """Load .trellis/config.yaml via the bundled trellis_config helper.
201
+ """Load .cstl/config.yaml via the bundled trellis_config helper.
202
202
 
203
- The helper lives in .trellis/scripts/common; the hook lives outside the
203
+ The helper lives in .cstl/scripts/common; the hook lives outside the
204
204
  scripts tree, so we extend sys.path before importing.
205
205
  """
206
- scripts_dir = root / ".trellis" / "scripts"
206
+ scripts_dir = root / ".cstl" / "scripts"
207
207
  if str(scripts_dir) not in sys.path:
208
208
  sys.path.insert(0, str(scripts_dir))
209
209
  try:
@@ -219,7 +219,7 @@ def _read_trellis_config(root: Path) -> dict:
219
219
  def _codex_mode_banner(config: dict) -> str:
220
220
  """Emit a `<codex-mode>` banner for the additionalContext payload.
221
221
 
222
- Reads `codex.dispatch_mode` from .trellis/config.yaml; defaults to
222
+ Reads `codex.dispatch_mode` from .cstl/config.yaml; defaults to
223
223
  `inline` when missing or invalid because Codex sub-agents run with
224
224
  `fork_turns="none"` isolation and can't inherit the parent session's
225
225
  task context. The banner makes the active mode explicit to Codex AI
@@ -254,7 +254,7 @@ def resolve_breadcrumb_key(
254
254
 
255
255
  Codex defaults to ``inline`` because sub-agents run with ``fork_turns="none"``
256
256
  isolation and can't inherit the parent session's task context. Users can
257
- opt into ``codex.dispatch_mode: sub-agent`` in ``.trellis/config.yaml``
257
+ opt into ``codex.dispatch_mode: sub-agent`` in ``.cstl/config.yaml``
258
258
  to use the parallel ``<status>-inline`` tag → ``<status>`` flip. Invalid
259
259
  or missing values fall back to inline.
260
260
 
@@ -292,11 +292,11 @@ def build_breadcrumb(
292
292
  body = templates.get(status)
293
293
  if body is None:
294
294
  body = "Refer to workflow.md for current step."
295
- header = (
296
- f"Selected task: none\nStatus: {status}"
297
- if task_id is None
298
- else f"Selected task: {task_id} ({status})"
299
- )
295
+ header = (
296
+ f"Selected task: none\nStatus: {status}"
297
+ if task_id is None
298
+ else f"Selected task: {task_id} ({status})"
299
+ )
300
300
  return f"<workflow-state>\n{header}\n{body}\n</workflow-state>"
301
301
 
302
302
 
@@ -323,15 +323,15 @@ def main() -> int:
323
323
  templates = load_breadcrumbs(root)
324
324
  platform = _detect_platform(data)
325
325
  config = _read_trellis_config(root)
326
- task = get_selected_task(root, data)
326
+ task = get_selected_task(root, data)
327
327
  if task is None:
328
- # No selected task — still emit the framework-entry breadcrumb.
329
- no_task_key = resolve_breadcrumb_key("no_task", platform, config)
328
+ # No selected task — still emit the framework-entry breadcrumb.
329
+ no_task_key = resolve_breadcrumb_key("no_task", platform, config)
330
330
  breadcrumb = build_breadcrumb(
331
331
  None, "no_task", templates, breadcrumb_key=no_task_key
332
332
  )
333
333
  else:
334
- task_id, status, source = task
334
+ task_id, status, source = task
335
335
  status_key = resolve_breadcrumb_key(status, platform, config)
336
336
  source_for_breadcrumb = None if platform == "codex" else source
337
337
  breadcrumb = build_breadcrumb(
@@ -31,9 +31,9 @@ if sys.platform.startswith("win"):
31
31
  sys.stdout.detach(), encoding="utf-8", errors="replace"
32
32
  )
33
33
 
34
- DIR_WORKFLOW = ".trellis"
34
+ DIR_WORKFLOW = ".cstl"
35
35
  OUTPUT_BASENAME = "retrieval-pack-latest.json"
36
- MARKER = "<!-- trellis-research-end-pack -->"
36
+ MARKER = "<!-- cstl-research-end-pack -->"
37
37
 
38
38
 
39
39
  def _repo_root(cwd: str) -> Path | None:
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env python3
1
+ #!/usr/bin/env python3
2
2
  # -*- coding: utf-8 -*-
3
3
  """
4
4
  Session Start Hook - Inject structured context
@@ -308,7 +308,7 @@ def _normalize_task_ref(task_ref: str) -> str:
308
308
  normalized = normalized[2:]
309
309
 
310
310
  if normalized.startswith("tasks/"):
311
- return f".trellis/{normalized}"
311
+ return f".cstl/{normalized}"
312
312
 
313
313
  return normalized
314
314
 
@@ -318,7 +318,7 @@ def _resolve_task_dir(trellis_dir: Path, task_ref: str) -> Path:
318
318
  path_obj = Path(normalized)
319
319
  if path_obj.is_absolute():
320
320
  return path_obj
321
- if normalized.startswith(".trellis/"):
321
+ if normalized.startswith(".cstl/"):
322
322
  return trellis_dir.parent / path_obj
323
323
  return trellis_dir / "tasks" / path_obj
324
324
 
@@ -341,7 +341,7 @@ def _get_task_status(trellis_dir: Path, input_data: dict) -> str:
341
341
  return (
342
342
  f"Trellis framework: active\nSelected task: {task_ref}\n"
343
343
  "Status: STALE SELECTION\n"
344
- f"Next-Action: Run `{_PYTHON_CMD} ./.trellis/scripts/task.py exit` to clear the stale selection, "
344
+ f"Next-Action: Run `{_PYTHON_CMD} ./.cstl/scripts/task.py exit` to clear the stale selection, "
345
345
  "then ask the user what to work on next."
346
346
  )
347
347
 
@@ -365,7 +365,7 @@ def _get_task_status(trellis_dir: Path, input_data: dict) -> str:
365
365
  return (
366
366
  f"Status: COMPLETED\nTask: {task_title}\n"
367
367
  f"Present: {present_line}\n"
368
- "Next-Action: Run `/trellis:finish-work`. If the working tree is dirty, return to Phase 3.4 first."
368
+ "Next-Action: Run `/cstl:finish-work`. If the working tree is dirty, return to Phase 3.4 first."
369
369
  )
370
370
 
371
371
  has_prd = (task_dir / "prd.md").is_file()
@@ -382,7 +382,7 @@ def _get_task_status(trellis_dir: Path, input_data: dict) -> str:
382
382
  return (
383
383
  f"Status: PLANNING\nTask: {task_title}\n"
384
384
  f"Present: {present_line}\n"
385
- "Next-Action: Load `trellis-brainstorm` and write `prd.md`. Stay in planning."
385
+ "Next-Action: Load `cstl-brainstorm` and write `prd.md`. Stay in planning."
386
386
  )
387
387
 
388
388
  if task_status == "planning":
@@ -570,7 +570,7 @@ def _collect_spec_index_paths(trellis_dir: Path, allowed_pkgs: set | None) -> li
570
570
  paths: list[str] = []
571
571
  guides_index = trellis_dir / "spec" / "guides" / "index.md"
572
572
  if guides_index.is_file():
573
- paths.append(".trellis/spec/guides/index.md")
573
+ paths.append(".cstl/spec/guides/index.md")
574
574
 
575
575
  spec_dir = trellis_dir / "spec"
576
576
  if not spec_dir.is_dir():
@@ -582,7 +582,7 @@ def _collect_spec_index_paths(trellis_dir: Path, allowed_pkgs: set | None) -> li
582
582
 
583
583
  index_file = sub / "index.md"
584
584
  if index_file.is_file():
585
- paths.append(f".trellis/spec/{sub.name}/index.md")
585
+ paths.append(f".cstl/spec/{sub.name}/index.md")
586
586
  continue
587
587
 
588
588
  if allowed_pkgs is not None and sub.name not in allowed_pkgs:
@@ -592,7 +592,7 @@ def _collect_spec_index_paths(trellis_dir: Path, allowed_pkgs: set | None) -> li
592
592
  continue
593
593
  nested_index = nested / "index.md"
594
594
  if nested_index.is_file():
595
- paths.append(f".trellis/spec/{sub.name}/{nested.name}/index.md")
595
+ paths.append(f".cstl/spec/{sub.name}/{nested.name}/index.md")
596
596
 
597
597
  return paths
598
598
 
@@ -641,7 +641,7 @@ def _build_compact_current_state(
641
641
  try:
642
642
  task_count = sum(1 for _ in iter_active_tasks(get_tasks_dir(repo_root)))
643
643
  lines.append(
644
- f"Active tasks: {task_count} total. Use the Task Dashboard for routing; use `{_PYTHON_CMD} ./.trellis/scripts/task.py list --mine` only for raw inspection."
644
+ f"Active tasks: {task_count} total. Use the Task Dashboard for routing; use `{_PYTHON_CMD} ./.cstl/scripts/task.py list --mine` only for raw inspection."
645
645
  )
646
646
  except Exception:
647
647
  pass
@@ -672,7 +672,7 @@ def _build_task_dashboard(trellis_dir: Path, input_data: dict) -> str:
672
672
  _detect_platform(input_data),
673
673
  )
674
674
  except Exception:
675
- return f"Task Dashboard unavailable. Run: {_PYTHON_CMD} ./.trellis/scripts/task.py dashboard"
675
+ return f"Task Dashboard unavailable. Run: {_PYTHON_CMD} ./.cstl/scripts/task.py dashboard"
676
676
 
677
677
 
678
678
  def _extract_range(content: str, start_header: str, end_header: str) -> str:
@@ -739,7 +739,7 @@ def _build_workflow_overview(workflow_path: Path) -> str:
739
739
 
740
740
  out_lines = [
741
741
  "# Development Workflow - Session Summary",
742
- f"Full guide: .trellis/workflow.md. Step detail: `{_PYTHON_CMD} ./.trellis/scripts/get_context.py --mode phase --step <X.Y>`.",
742
+ f"Full guide: .cstl/workflow.md. Step detail: `{_PYTHON_CMD} ./.cstl/scripts/get_context.py --mode phase --step <X.Y>`.",
743
743
  "",
744
744
  ]
745
745
 
@@ -781,7 +781,7 @@ def main():
781
781
  if project_dir is None:
782
782
  project_dir = Path(_normalize_windows_shell_path(hook_input.get("cwd", "."))).resolve()
783
783
 
784
- trellis_dir = project_dir / ".trellis"
784
+ trellis_dir = project_dir / ".cstl"
785
785
  context_key = _resolve_context_key(trellis_dir, hook_input)
786
786
  _persist_context_key_for_bash(context_key)
787
787
 
@@ -836,17 +836,17 @@ Trellis compact SessionStart context. Use it to orient the session; load details
836
836
 
837
837
  output.write(
838
838
  "Discover more via: "
839
- f"`{_PYTHON_CMD} ./.trellis/scripts/get_context.py --mode packages`\n"
839
+ f"`{_PYTHON_CMD} ./.cstl/scripts/get_context.py --mode packages`\n"
840
840
  )
841
841
  if _detect_platform(hook_input) == "cursor":
842
842
  output.write(
843
843
  "\n**External web research (Cursor):** run "
844
- f"`{_PYTHON_CMD} ./.trellis/scripts/run_smart_search.py \"<question>\" "
844
+ f"`{_PYTHON_CMD} ./.cstl/scripts/run_smart_search.py \"<question>\" "
845
845
  "--intent deep-research --json` first (Trellis evidence wrapper → "
846
846
  "`smart-search` CLI). CLI discovery: `TRELLIS_SMART_SEARCH_COMMAND` / "
847
847
  "`smart_search.command`, then PATH `smart-search`, then project "
848
848
  "`node_modules/.bin/smart-search`, then optional repo-local layouts "
849
- "(see `.trellis/spec/guides/retrieval-daily-guide.md`). "
849
+ "(see `.cstl/spec/guides/retrieval-daily-guide.md`). "
850
850
  "`smart-search-cli` is an internal workflow skill name — not a file under `.cursor/skills/` on Cursor. "
851
851
  "If `run_smart_search.py` status is `not_configured` or `failed` (incl. timeout), "
852
852
  "use **WebSearch/WebFetch**, persist `{TASK}/research/*.md` with "
@@ -20,7 +20,7 @@
20
20
  {
21
21
  "execution_mode": "worker",
22
22
  "isolation": "git-worktree",
23
- "message": "worker usually runs in main-worktree; git-worktree is rare for trellis-implement"
23
+ "message": "worker usually runs in main-worktree; git-worktree is rare for cstl-implement"
24
24
  },
25
25
  {
26
26
  "execution_mode": "inline",