@blxzer/cursor-trellis 0.3.0 → 0.3.3

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 (196) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/README.md +51 -10
  3. package/README.zh-CN.md +21 -7
  4. package/bin/cstl.js +1 -1
  5. package/bin/smart-search.js +1 -1
  6. package/dist/cli/index.d.ts.map +1 -1
  7. package/dist/cli/index.js +17 -15
  8. package/dist/cli/index.js.map +1 -1
  9. package/dist/commands/capability-smoke.js +2 -2
  10. package/dist/commands/capability-smoke.js.map +1 -1
  11. package/dist/commands/channel/agent-loader.d.ts +1 -1
  12. package/dist/commands/channel/agent-loader.js +4 -4
  13. package/dist/commands/channel/agent-loader.js.map +1 -1
  14. package/dist/commands/channel/guard.d.ts +2 -2
  15. package/dist/commands/channel/guard.js +3 -3
  16. package/dist/commands/channel/guard.js.map +1 -1
  17. package/dist/commands/channel/index.js +3 -3
  18. package/dist/commands/channel/index.js.map +1 -1
  19. package/dist/commands/channel/list.d.ts +1 -1
  20. package/dist/commands/channel/list.js +1 -1
  21. package/dist/commands/channel/rm.d.ts +1 -1
  22. package/dist/commands/channel/rm.js +1 -1
  23. package/dist/commands/channel/store/lock.d.ts +1 -1
  24. package/dist/commands/channel/store/lock.js +1 -1
  25. package/dist/commands/channel/store/paths.js +1 -1
  26. package/dist/commands/channel/store/paths.js.map +1 -1
  27. package/dist/commands/init.d.ts.map +1 -1
  28. package/dist/commands/init.js +105 -59
  29. package/dist/commands/init.js.map +1 -1
  30. package/dist/commands/uninstall.d.ts +3 -3
  31. package/dist/commands/uninstall.d.ts.map +1 -1
  32. package/dist/commands/uninstall.js +69 -15
  33. package/dist/commands/uninstall.js.map +1 -1
  34. package/dist/commands/update.d.ts +6 -1
  35. package/dist/commands/update.d.ts.map +1 -1
  36. package/dist/commands/update.js +83 -28
  37. package/dist/commands/update.js.map +1 -1
  38. package/dist/commands/workflow.d.ts +4 -4
  39. package/dist/commands/workflow.d.ts.map +1 -1
  40. package/dist/commands/workflow.js +10 -9
  41. package/dist/commands/workflow.js.map +1 -1
  42. package/dist/configurators/index.d.ts.map +1 -1
  43. package/dist/configurators/index.js +1 -1
  44. package/dist/configurators/index.js.map +1 -1
  45. package/dist/configurators/shared.js +6 -6
  46. package/dist/configurators/shared.js.map +1 -1
  47. package/dist/configurators/workflow.d.ts +4 -4
  48. package/dist/configurators/workflow.js +1 -1
  49. package/dist/constants/paths.d.ts +24 -24
  50. package/dist/constants/paths.d.ts.map +1 -1
  51. package/dist/constants/paths.js +16 -16
  52. package/dist/constants/paths.js.map +1 -1
  53. package/dist/migrations/manifests/0.3.1.json +32 -0
  54. package/dist/templates/common/bundled-skills/cstl-cursor2plus-setup/SKILL.md +11 -11
  55. package/dist/templates/common/bundled-skills/cstl-meta/SKILL.md +15 -15
  56. package/dist/templates/common/bundled-skills/cstl-meta/references/customize-local/add-project-local-conventions.md +12 -12
  57. package/dist/templates/common/bundled-skills/cstl-meta/references/customize-local/change-agents.md +2 -2
  58. package/dist/templates/common/bundled-skills/cstl-meta/references/customize-local/change-context-loading.md +21 -21
  59. package/dist/templates/common/bundled-skills/cstl-meta/references/customize-local/change-hooks.md +9 -9
  60. package/dist/templates/common/bundled-skills/cstl-meta/references/customize-local/change-skills-or-commands.md +7 -7
  61. package/dist/templates/common/bundled-skills/cstl-meta/references/customize-local/change-spec-structure.md +15 -15
  62. package/dist/templates/common/bundled-skills/cstl-meta/references/customize-local/change-task-lifecycle.md +27 -27
  63. package/dist/templates/common/bundled-skills/cstl-meta/references/customize-local/change-workflow.md +7 -7
  64. package/dist/templates/common/bundled-skills/cstl-meta/references/customize-local/overview.md +11 -11
  65. package/dist/templates/common/bundled-skills/cstl-meta/references/local-architecture/context-injection.md +12 -12
  66. package/dist/templates/common/bundled-skills/cstl-meta/references/local-architecture/generated-files.md +21 -21
  67. package/dist/templates/common/bundled-skills/cstl-meta/references/local-architecture/overview.md +14 -14
  68. package/dist/templates/common/bundled-skills/cstl-meta/references/local-architecture/spec-system.md +12 -12
  69. package/dist/templates/common/bundled-skills/cstl-meta/references/local-architecture/task-system.md +23 -23
  70. package/dist/templates/common/bundled-skills/cstl-meta/references/local-architecture/workflow.md +3 -3
  71. package/dist/templates/common/bundled-skills/cstl-meta/references/local-architecture/workspace-memory.md +16 -16
  72. package/dist/templates/common/bundled-skills/cstl-meta/references/platform-files/agents.md +2 -2
  73. package/dist/templates/common/bundled-skills/cstl-meta/references/platform-files/hooks-and-settings.md +6 -6
  74. package/dist/templates/common/bundled-skills/cstl-meta/references/platform-files/overview.md +5 -5
  75. package/dist/templates/common/bundled-skills/cstl-meta/references/platform-files/platform-map.md +3 -3
  76. package/dist/templates/common/bundled-skills/cstl-meta/references/platform-files/skills-and-commands.md +5 -5
  77. package/dist/templates/common/bundled-skills/cstl-skill-creator/SKILL.md +2 -2
  78. package/dist/templates/common/bundled-skills/cstl-skill-creator/references/review-checklist.md +1 -1
  79. package/dist/templates/common/bundled-skills/cstl-spec-bootstrap/SKILL.md +5 -5
  80. package/dist/templates/common/bundled-skills/cstl-spec-bootstrap/references/repository-analysis.md +1 -1
  81. package/dist/templates/common/bundled-skills/cstl-spec-bootstrap/references/spec-task-planning.md +3 -3
  82. package/dist/templates/common/bundled-skills/cstl-spec-bootstrap/references/spec-writing.md +1 -1
  83. package/dist/templates/common/commands/continue.md +6 -6
  84. package/dist/templates/common/commands/finish-work.md +5 -5
  85. package/dist/templates/common/commands/start.md +8 -8
  86. package/dist/templates/common/skills/before-dev.md +4 -4
  87. package/dist/templates/common/skills/brainstorm.md +5 -5
  88. package/dist/templates/common/skills/break-loop.md +3 -3
  89. package/dist/templates/common/skills/check.md +5 -5
  90. package/dist/templates/common/skills/update-spec.md +4 -4
  91. package/dist/templates/cursor/agents/cstl-check.md +6 -6
  92. package/dist/templates/cursor/agents/cstl-implement.md +7 -7
  93. package/dist/templates/cursor/agents/cstl-research.md +9 -9
  94. package/dist/templates/cursor/commands/cursor2plus-setup.md +10 -10
  95. package/dist/templates/cursor/rules/cstl-subagent-dispatch.mdc +2 -2
  96. package/dist/templates/cursor/rules/cstl-triage.mdc +2 -2
  97. package/dist/templates/cursor/rules/retrieval-routing.mdc +4 -4
  98. package/dist/templates/extract.d.ts +1 -1
  99. package/dist/templates/extract.js +1 -1
  100. package/dist/templates/markdown/agents.md +11 -11
  101. package/dist/templates/markdown/prompts/run-semantic-slice-12.md.txt +1 -1
  102. package/dist/templates/markdown/spec/guides/cross-platform-thinking-guide.md.txt +5 -5
  103. package/dist/templates/markdown/spec/guides/cursor-context-injection-guide.md.txt +3 -3
  104. package/dist/templates/markdown/spec/guides/cursor-semantic-compliance.md.txt +1 -1
  105. package/dist/templates/markdown/spec/guides/cursor-subagent-policy.md.txt +11 -11
  106. package/dist/templates/markdown/spec/guides/cursor-trellis-release-coexistence-guide.md.txt +166 -0
  107. package/dist/templates/markdown/spec/guides/durable-learning-decision-guide.md.txt +8 -8
  108. package/dist/templates/markdown/spec/guides/execution-strategy.md.txt +3 -3
  109. package/dist/templates/markdown/spec/guides/index.md.txt +1 -0
  110. package/dist/templates/markdown/spec/guides/retrieval-daily-guide.md.txt +10 -10
  111. package/dist/templates/markdown/workspace-index.md +3 -3
  112. package/dist/templates/markdown/worktree.yaml.txt +1 -1
  113. package/dist/templates/shared-hooks/index.d.ts +1 -1
  114. package/dist/templates/shared-hooks/index.js +1 -1
  115. package/dist/templates/shared-hooks/inject-retrieval-plan.py +3 -3
  116. package/dist/templates/shared-hooks/inject-shell-session-context.py +7 -7
  117. package/dist/templates/shared-hooks/inject-subagent-context.py +1 -1
  118. package/dist/templates/shared-hooks/inject-workflow-state.py +11 -11
  119. package/dist/templates/shared-hooks/research-end-retrieval-pack.py +1 -1
  120. package/dist/templates/shared-hooks/session-start.py +13 -13
  121. package/dist/templates/trellis/config.yaml +2 -22
  122. package/dist/templates/trellis/index.d.ts +2 -2
  123. package/dist/templates/trellis/index.js +2 -2
  124. package/dist/templates/trellis/local/README.md +3 -3
  125. package/dist/templates/trellis/local/patch_wpelc8.py +4 -4
  126. package/dist/templates/trellis/scripts/add_session.py +20 -20
  127. package/dist/templates/trellis/scripts/common/active_task.py +2 -2
  128. package/dist/templates/trellis/scripts/common/artifact_search.py +587 -587
  129. package/dist/templates/trellis/scripts/common/codebase_retrieval_router.py +6 -6
  130. package/dist/templates/trellis/scripts/common/config.py +3 -3
  131. package/dist/templates/trellis/scripts/common/developer.py +2 -2
  132. package/dist/templates/trellis/scripts/common/packages_context.py +23 -23
  133. package/dist/templates/trellis/scripts/common/parent_orchestration.py +16 -16
  134. package/dist/templates/trellis/scripts/common/paths.py +107 -107
  135. package/dist/templates/trellis/scripts/common/project_file_stats.py +1 -1
  136. package/dist/templates/trellis/scripts/common/retrieval_agent_instructions.py +1 -1
  137. package/dist/templates/trellis/scripts/common/safe_commit.py +31 -31
  138. package/dist/templates/trellis/scripts/common/session_memory.py +360 -360
  139. package/dist/templates/trellis/scripts/common/smart_search_evidence.py +514 -514
  140. package/dist/templates/trellis/scripts/common/smart_search_resolve.py +1 -1
  141. package/dist/templates/trellis/scripts/common/subagent_dispatch.py +2 -2
  142. package/dist/templates/trellis/scripts/common/task_context.py +1 -1
  143. package/dist/templates/trellis/scripts/common/task_dashboard.py +140 -140
  144. package/dist/templates/trellis/scripts/common/task_gates.py +23 -23
  145. package/dist/templates/trellis/scripts/common/task_store.py +5 -5
  146. package/dist/templates/trellis/scripts/common/task_utils.py +3 -3
  147. package/dist/templates/trellis/scripts/common/tasks.py +1 -1
  148. package/dist/templates/trellis/scripts/common/trellis_config.py +3 -3
  149. package/dist/templates/trellis/scripts/common/workflow_phase.py +1 -1
  150. package/dist/templates/trellis/scripts/cursor_retrieval_probe.py +3 -3
  151. package/dist/templates/trellis/scripts/cursor_retrieval_probe_prompt.md +11 -11
  152. package/dist/templates/trellis/scripts/hooks/linear_sync.py +8 -8
  153. package/dist/templates/trellis/scripts/init_developer.py +2 -2
  154. package/dist/templates/trellis/scripts/retrieval_probe_matrix_template.json +4 -4
  155. package/dist/templates/trellis/scripts/route_codebase_retrieval.py +1 -1
  156. package/dist/templates/trellis/scripts/task.py +918 -918
  157. package/dist/templates/trellis/tasks/templates/release-readiness/implement.md +2 -2
  158. package/dist/templates/trellis/workflow.md +64 -64
  159. package/dist/types/migration.d.ts +1 -1
  160. package/dist/types/migration.d.ts.map +1 -1
  161. package/dist/utils/agents-md.d.ts +47 -0
  162. package/dist/utils/agents-md.d.ts.map +1 -0
  163. package/dist/utils/agents-md.js +107 -0
  164. package/dist/utils/agents-md.js.map +1 -0
  165. package/dist/utils/codebase-retrieval-router.js +5 -5
  166. package/dist/utils/codebase-retrieval-router.js.map +1 -1
  167. package/dist/utils/manifest-prune.d.ts +2 -2
  168. package/dist/utils/manifest-prune.js +4 -4
  169. package/dist/utils/manifest-prune.js.map +1 -1
  170. package/dist/utils/mirror-check.d.ts +3 -1
  171. package/dist/utils/mirror-check.d.ts.map +1 -1
  172. package/dist/utils/mirror-check.js +22 -11
  173. package/dist/utils/mirror-check.js.map +1 -1
  174. package/dist/utils/project-capabilities.js +5 -5
  175. package/dist/utils/project-capabilities.js.map +1 -1
  176. package/dist/utils/retrieval-agent-instructions.js +1 -1
  177. package/dist/utils/retrieval-agent-instructions.js.map +1 -1
  178. package/dist/utils/retrieval-execution-telemetry.js +1 -1
  179. package/dist/utils/retrieval-execution-telemetry.js.map +1 -1
  180. package/dist/utils/template-fetcher.js +1 -1
  181. package/dist/utils/template-fetcher.js.map +1 -1
  182. package/dist/utils/template-hash.d.ts +2 -2
  183. package/dist/utils/template-hash.d.ts.map +1 -1
  184. package/dist/utils/template-hash.js +51 -18
  185. package/dist/utils/template-hash.js.map +1 -1
  186. package/dist/utils/workflow-dir.d.ts +13 -0
  187. package/dist/utils/workflow-dir.d.ts.map +1 -0
  188. package/dist/utils/workflow-dir.js +35 -0
  189. package/dist/utils/workflow-dir.js.map +1 -0
  190. package/dist/utils/workflow-ownership.d.ts +36 -0
  191. package/dist/utils/workflow-ownership.d.ts.map +1 -0
  192. package/dist/utils/workflow-ownership.js +137 -0
  193. package/dist/utils/workflow-ownership.js.map +1 -0
  194. package/dist/utils/workflow-resolver.d.ts +1 -1
  195. package/dist/utils/workflow-resolver.js +1 -1
  196. package/package.json +2 -2
@@ -16,7 +16,7 @@ Use the same patterns as telemetry:
16
16
  python -c "from common.retrieval_tool_classification import classify_tool_calls; print(classify_tool_calls(['Grep','codebase_search'], platform='cursor'))"
17
17
  ```
18
18
 
19
- (Run from `.trellis/scripts` with `PYTHONPATH` set to that directory.)
19
+ (Run from `.cstl/scripts` with `PYTHONPATH` set to that directory.)
20
20
 
21
21
  On **cursor**, `semantic_executed` = `platform_semantic_executed`. Track `fast_context_count` and `cursor_fast_context_misuse` separately.
22
22
 
@@ -98,14 +98,14 @@ When research is purely **codebase exploration** (no external web search, no fil
98
98
 
99
99
  **What it is:** A reversible patch to Cursor++ `extension.js` resolver `WPeLc8` that maps `subagentType` → BYOK catalog **slug** (`model-xxxxx`), evaluated **before** the inherit-parent branch. Verified 2026-06-18 (Cursor++ v0.0.11).
100
100
 
101
- **Trellis ships (every `cstl init` / `cstl update`, strategy C):** `.trellis/local/cursor2plus/` — `patch_wpelc8.py`, `README.md`, `config.local.json.example`. Native Cursor API users can ignore this directory.
101
+ **Trellis ships (every `cstl init` / `cstl update`, strategy C):** `.cstl/local/cursor2plus/` — `patch_wpelc8.py`, `README.md`, `config.local.json.example`. Native Cursor API users can ignore this directory.
102
102
 
103
103
  **Operator workflow (Cursor++ BYOK only):**
104
104
 
105
105
  1. Fill **`~/.ccursor/trellis-task-models.json`** (user-wide) with `subagent_type` → slug from **`~/.ccursor/providers.json`** `id` fields.
106
- 2. Optionally override per repo: **`.trellis/local/subagent-models.json`** (project wins on same key).
106
+ 2. Optionally override per repo: **`.cstl/local/subagent-models.json`** (project wins on same key).
107
107
  3. If paths are not auto-detected: copy `config.local.json.example` → `config.local.json`, or run `python patch_wpelc8.py --bootstrap`, or set `TRELLIS_CCURSOR_HOME` / `TRELLIS_CURSOR2PLUS_EXTENSION`.
108
- 4. From `.trellis/local/cursor2plus/`: `python patch_wpelc8.py --print-map` → `python patch_wpelc8.py` → **Developer: Reload Window**.
108
+ 4. From `.cstl/local/cursor2plus/`: `python patch_wpelc8.py --print-map` → `python patch_wpelc8.py` → **Developer: Reload Window**.
109
109
  5. **Verify:** `taskToolCall dispatching` → `resolvedModelId` matches slug.
110
110
 
111
111
  **Revert:** `python patch_wpelc8.py --revert`; Reload Window. Re-run patch after Cursor / Cursor++ upgrades.
@@ -117,7 +117,7 @@ When research is purely **codebase exploration** (no external web search, no fil
117
117
  For rare per-dispatch models on the Task channel without changing global slots:
118
118
 
119
119
  1. Add `.cursor/agents/cstl-worker-<id>.md` (role prompt only; no committed `model:`).
120
- 2. Add `"cstl-worker-<id>": "model-xxxxx"` to **project** `.trellis/local/subagent-models.json`.
120
+ 2. Add `"cstl-worker-<id>": "model-xxxxx"` to **project** `.cstl/local/subagent-models.json`.
121
121
  3. Re-run `patch_wpelc8.py`; dispatch `Task(subagent_type=cstl-worker-<id>)`.
122
122
  4. Remove agent file and JSON key when done.
123
123
 
@@ -128,7 +128,7 @@ Parent/Child **default** does not use 2.6 — it uses `cstl-implement` from the
128
128
  When a custom Task subagent (`cstl-research`, `cstl-implement`, `cstl-check`) needs a **different model** than the parent under BYOK **and Method 2.5 is not available**:
129
129
 
130
130
  1. **Main session prepares the dispatch prompt** — full text with:
131
- - First line: Selected task: <path> (e.g. .trellis/tasks/06-17-my-task)
131
+ - First line: Selected task: <path> (e.g. .cstl/tasks/06-17-my-task)
132
132
  - Task context from inject-subagent-context.py content (PRD, design, implement docs)
133
133
  - Agent role instructions (from the corresponding .cursor/agents/cstl-<role>.md)
134
134
  - Specific work assignment
@@ -217,14 +217,14 @@ Operational contract between the Trellis task ladder and Cursor++ BYOK.
217
217
  | Layer | Picks model for… | Mechanism |
218
218
  | ----- | ---------------- | --------- |
219
219
  | **You (operator)** | Main orchestration chat | Cursor model picker (parent BYOK route) |
220
- | **You (operator)** | `cstl-research` / `cstl-implement` / `cstl-check` (+ optional built-in Task types) | **Method 2.5 / 2.6** JSON maps + `.trellis/local/cursor2plus/patch_wpelc8.py` — **not** repo agent files |
220
+ | **You (operator)** | `cstl-research` / `cstl-implement` / `cstl-check` (+ optional built-in Task types) | **Method 2.5 / 2.6** JSON maps + `.cstl/local/cursor2plus/patch_wpelc8.py` — **not** repo agent files |
221
221
  | **You (operator)** | `explore` | Cursor++ panel |
222
222
  | **Main Agent session** | When to spawn which agent | `workflow.md`, skills, scene matrix |
223
223
  | **Hooks** | Never | `inject-subagent-context.py` — task context only |
224
224
 
225
225
  ### Normal Full / Lite task flow
226
226
 
227
- 1. **Select task** — `task.py select`; dispatch prompts include `Selected task: .trellis/tasks/<id>` when hooks need it.
227
+ 1. **Select task** — `task.py select`; dispatch prompts include `Selected task: .cstl/tasks/<id>` when hooks need it.
228
228
  2. **Main session model** — your choice for planning and orchestration.
229
229
  3. **Research** — Task `subagent_type=cstl-research` → mapped research slug (Method 2.5).
230
230
  4. **Implement** — after `start-execution --approved`, Task `cstl-implement` → mapped implement slug.
@@ -252,7 +252,7 @@ No model field in dispatch prompt under Method 2.5. Task `model: fast` does **no
252
252
 
253
253
  1. Resolve slugs in `~/.ccursor/providers.json` (or path in `config.local.json`).
254
254
  2. Edit user and/or project JSON maps; include `generalPurpose`, `shell`, `best-of-n-runner` if you use those Task types.
255
- 3. Run `patch_wpelc8.py` from `.trellis/local/cursor2plus/` → Reload Window.
255
+ 3. Run `patch_wpelc8.py` from `.cstl/local/cursor2plus/` → Reload Window.
256
256
  4. Re-apply after Cursor / Cursor++ upgrades.
257
257
 
258
258
  ### What stays in the Trellis repo
@@ -317,7 +317,7 @@ trellis_task_subagents:
317
317
  If a dispatched subagent cannot answer from `prd.md` / jsonl (empty or generic replies):
318
318
 
319
319
  1. Confirm the main session used **CLI Layer 2** before `Task(...)` (workflow Phase 2.1 / 2.2).
320
- 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=...)`.
320
+ 2. **Manual fallback (Method 3):** run `python ./.cstl/scripts/task.py generate-dispatch-prompt <task-dir> <role> [--scope "..."]`, paste stdout into `Task(subagent_type=..., prompt=...)`.
321
321
  3. Hook-only injection is best-effort on Cursor; do not treat `preToolUse` as the sole source.
322
322
 
323
323
  This command is **Agent-facing** — not listed in user README or slash command surface.
@@ -385,9 +385,9 @@ For multi-package workspaces, list all install commands needed after a fresh che
385
385
  ## References
386
386
 
387
387
  - `.cursor/agents/cstl-research.md`, `cstl-implement.md`, `cstl-check.md`
388
- - `.cursor/agents/.trellis-model-overlay.local.md` — optional overlay audit stub (native API)
388
+ - `.cursor/agents/.cstl-model-overlay.local.md` — optional overlay audit stub (native API)
389
389
  - Reference `patch_wpelc8.py` in task `06-18-byok-manual-dispatch-automation/research/` — copy locally; not a runtime git dependency
390
- - `.trellis/workflow.md` — Task Ladder + Parent orchestration
390
+ - `.cstl/workflow.md` — Task Ladder + Parent orchestration
391
391
  - [Cursor Subagents](https://cursor.com/docs/subagents) — `model: inherit | <id>`
392
392
  - [Cursor Multitask changelog](https://cursor.com/changelog/04-24-26) — `/multitask`, Worktrees, Multi-root Workspaces
393
393
  - `.cursor/worktrees.json` — Cursor native worktree setup configuration
@@ -0,0 +1,166 @@
1
+ # cursor-trellis Release & Coexistence Guide
2
+
3
+ > **Audience**: Maintainers and agents working on `@blxzer/cursor-trellis` in `D:\MyHarness\cursor-trellis`.
4
+ > **Scope**: npm publish runbook, git tag naming (`cstl-v*`), and upstream Trellis coexistence semantics (0.3.2+).
5
+
6
+ ---
7
+
8
+ ## 1. npm publish runbook (mandatory)
9
+
10
+ cursor-trellis ships **two** npm packages at the **same version**:
11
+
12
+ | Package | Role |
13
+ | --- | --- |
14
+ | `@blxzer/cursor-trellis-core` | SDK (must publish **first**) |
15
+ | `@blxzer/cursor-trellis` | CLI (depends on core) |
16
+
17
+ ### Do
18
+
19
+ ```bash
20
+ cd D:\MyHarness\cursor-trellis\packages\cli
21
+
22
+ # 1. Version parity (cli + core package.json must match)
23
+ cd ../.. && pnpm release:check
24
+
25
+ # 2. Optional: dry-run pack shape (rewrites workspace:* in tarball)
26
+ node packages/cli/scripts/publish-packages.js --dry-run
27
+
28
+ # 3. Publish both packages in dependency order
29
+ node packages/cli/scripts/publish-packages.js
30
+
31
+ # 4. Verify registry visibility
32
+ node packages/cli/scripts/release-preflight.js verify-npm --package all
33
+ ```
34
+
35
+ `publish-packages.js` uses **`pnpm publish`** (not bare `npm publish`). pnpm rewrites `workspace:*` dependencies to the resolved semver (e.g. `"@blxzer/cursor-trellis-core": "0.3.3"`). Bare `npm publish` leaves `workspace:*` in the tarball → **`EUNSUPPORTEDPROTOCOL`** on install.
36
+
37
+ ### Do not
38
+
39
+ - **`npm publish`** from `packages/cli` alone (0.3.1 incident: cli tarball had `workspace:*`, core was missing).
40
+ - Publish cli before core (cli install fails with ETARGET until core exists).
41
+ - Skip `prepublishOnly` (runs test + build + copy-release-assets on cli).
42
+
43
+ ### Preflight commands
44
+
45
+ | Command | Purpose |
46
+ | --- | --- |
47
+ | `release-preflight.js check-versions` | cli/core version match |
48
+ | `release-preflight.js verify-packed-cli` | Packed cli resolves core to exact semver (not `workspace:*`) |
49
+ | `release-preflight.js verify-npm` | Post-publish registry check |
50
+ | `release-preflight.js publish-plan` | Idempotent CI plan (skip already-published versions) |
51
+
52
+ ### Withdrawn / deprecated versions
53
+
54
+ - **0.3.1 cli**: withdrawn (unpublish); use **0.3.2+**.
55
+ - **0.3.1 core**: cannot unpublish (npm policy); **`npm deprecate`** applied — use `@latest`.
56
+
57
+ ---
58
+
59
+ ## 2. Git tags (`cstl-v*` prefix)
60
+
61
+ This repo shares git history with legacy `@blxzer/trellis` (1.x). Old tags `v0.3.x`–`v0.6.x` point at **trellis** commits, not cursor-trellis releases.
62
+
63
+ | Tag pattern | Product | Example |
64
+ | --- | --- | --- |
65
+ | `v*` (legacy) | `@blxzer/trellis` | `v0.3.2` @ 2026-03 trellis commit |
66
+ | **`cstl-v*`** | `@blxzer/cursor-trellis` | `cstl-v0.3.2` @ cursor-trellis release commit |
67
+
68
+ `packages/cli/scripts/release.js` tags releases as **`cstl-v${version}`** (since 0.3.2 tag-hygiene commit).
69
+
70
+ `release-preflight tagVersionFromEnv` extracts semver from tag suffix (`cstl-v0.3.2` → `0.3.2`).
71
+
72
+ **CI publish workflow** (`.github/workflows/publish.yml`): triggers on `push.tags: cstl-v*`. Requires repo secret `NPM_TOKEN`.
73
+
74
+ Do **not** delete legacy `v*` tags — they are historical trellis releases.
75
+
76
+ ---
77
+
78
+ ## 3. Coexistence with upstream mindfold-ai/Trellis
79
+
80
+ **Product decision**: Both are workflow frameworks. **Cursor configuration belongs to cursor-trellis**. Upstream Trellis keeps `.trellis/` and non-Cursor platform dirs; cursor-trellis uses `.cstl/` + `.cursor/cstl-*`.
81
+
82
+ ### Scenario matrix
83
+
84
+ | Scenario | User state | Action |
85
+ | --- | --- | --- |
86
+ | 1 Pure cstl | Only cursor-trellis (legacy `.trellis/` runtime) | `cstl update --migrate` → rename `.trellis/` → `.cstl/` |
87
+ | 2 Coexistence | Upstream `.trellis/` + wants Cursor cstl | `cstl init --cursor` → creates `.cstl/`, **takes over `.cursor/`**, AGENTS dual-block |
88
+ | 3 Fresh | Never used either | `cstl init --cursor` → `.cstl/` only |
89
+
90
+ ### `cstl init` coexistence mode
91
+
92
+ When `.trellis/` exists and `.cstl/` does not:
93
+
94
+ 1. Creates `.cstl/` (does not touch `.trellis/`).
95
+ 2. **Force-writes** `.cursor/` (hooks, rules, commands) even under `-y`.
96
+ 3. **AGENTS.md dual-block**: preserves `<!-- TRELLIS:START -->`, adds/refreshes `<!-- CSTL:START -->` (`insertCstlManagedBlock`).
97
+ 4. Prints banner: do **not** run `cstl update --migrate` (would rename upstream `.trellis/`).
98
+
99
+ ### Migrate gate (`assessCstlDirectoryMigrate`)
100
+
101
+ Conservative by default for `.trellis/` → `.cstl/` rename:
102
+
103
+ | Signal | Meaning |
104
+ | --- | --- |
105
+ | F1 | `.cursor/commands/cstl-*.md` |
106
+ | F2 | `.cursor/rules/cstl-triage.mdc` |
107
+ | F3 | `.trellis/scripts/common/cli_adapter.py` contains `cstl` |
108
+ | U1 | `.claude/agents/trellis-implement.md` |
109
+ | U2 | Non-Cursor platform `trellis-*` agents/skills |
110
+ | U4 | `.cursor/commands/trellis-*.md` without cstl fingerprint |
111
+
112
+ - No F fingerprint → **abort** (protect scenario 2).
113
+ - F + U mixed → **abort** (manual split).
114
+ - Escape: `cstl update --force-cstl-migrate`.
115
+
116
+ ### AGENTS.md hash tracking (block-level)
117
+
118
+ `.template-hashes.json` stores **CSTL block hash only** for `AGENTS.md`, not the whole file. Upstream edits to TRELLIS block or user content outside CSTL block do **not** trigger "modified" on `cstl update`.
119
+
120
+ Implementation: `template-hash.ts` → `hashContentForPath` + `extractBlock(CSTL:START/END)`.
121
+
122
+ ### `cstl uninstall` in coexistence repos
123
+
124
+ - Strips **CSTL block only** (`removeCstlManagedBlock`); keeps TRELLIS block + user content.
125
+ - If file was only the CSTL block → deletes `AGENTS.md`.
126
+ - Does **not** restore upstream `.cursor/` files overwritten during init (by design: cstl owned Cursor).
127
+
128
+ ---
129
+
130
+ ## 4. Post-release dogfood checklist
131
+
132
+ ```bash
133
+ npm install -g @blxzer/cursor-trellis@latest
134
+ cstl --version
135
+
136
+ # Each dogfood project (no --migrate unless upgrading from pre-0.3.1):
137
+ cd <project>
138
+ cstl update --skip-readiness --skip-all
139
+ # Confirm .cstl/.version matches npm latest
140
+ ```
141
+
142
+ Sandbox smoke (from empty dir):
143
+
144
+ ```bash
145
+ npm init -y && npm install @blxzer/cursor-trellis@latest
146
+ npx cstl init --yes --skip-readiness --cursor
147
+ ```
148
+
149
+ ---
150
+
151
+ ## 5. Related files (source of truth)
152
+
153
+ | Topic | Path |
154
+ | --- | --- |
155
+ | Publish orchestration | `cursor-trellis/packages/cli/scripts/publish-packages.js` |
156
+ | Release preflight | `cursor-trellis/packages/cli/scripts/release-preflight.js` |
157
+ | Tag prefix | `cursor-trellis/packages/cli/scripts/release.js` |
158
+ | Coexistence init | `packages/cli/src/commands/init.ts` |
159
+ | Migrate gate | `packages/cli/src/utils/workflow-ownership.ts` |
160
+ | AGENTS helpers | `packages/cli/src/utils/agents-md.ts` |
161
+ | Block-level hash | `packages/cli/src/utils/template-hash.ts` |
162
+ | Uninstall strip | `packages/cli/src/commands/uninstall.ts` |
163
+
164
+ ---
165
+
166
+ **Last updated**: 2026-07-04 (0.3.3 follow-up: uninstall CSTL strip + block hash + this guide).
@@ -1,8 +1,8 @@
1
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,9 +13,9 @@ 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
20
  Optional planning note (not sufficient alone): `Spec update needed: <reason>` — still record **spec update evidence** after `/cstl:update-spec`.
21
21
 
@@ -47,13 +47,13 @@ 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
  ---
@@ -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
 
@@ -29,6 +29,7 @@ These guides help you **ask the right questions before coding**.
29
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 |
30
30
  | [Execution strategy](./execution-strategy.md) | `suggest-execution-strategy`, rules JSON, inline vs worker vs child-task | Writing `implement.md` contract, Phase 2 dispatch |
31
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 |
32
+ | [cursor-trellis release & coexistence](./cursor-trellis-release-coexistence-guide.md) | npm publish runbook, `cstl-v*` tags, upstream Trellis coexistence | Releasing cstl, scenario 2 init, migrate gate, uninstall AGENTS strip |
32
33
 
33
34
  ---
34
35
 
@@ -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
  */
@@ -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
  */
@@ -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,7 +26,7 @@ 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
31
  AGENT_IMPLEMENT = "cstl-implement"
32
32
  AGENT_CHECK = "cstl-check"
@@ -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
@@ -71,14 +71,14 @@ If you have not already loaded Trellis context this session, read the `cstl-star
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
@@ -125,7 +125,7 @@ def _detect_platform(input_data: dict) -> str | None:
125
125
 
126
126
 
127
127
  def _resolve_selected_task(root: Path, input_data: dict):
128
- scripts_dir = root / ".trellis" / "scripts"
128
+ scripts_dir = root / ".cstl" / "scripts"
129
129
  if str(scripts_dir) not in sys.path:
130
130
  sys.path.insert(0, str(scripts_dir))
131
131
  from common.active_task import resolve_selected_task # type: ignore[import-not-found]
@@ -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
 
@@ -31,7 +31,7 @@ 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
36
  MARKER = "<!-- cstl-research-end-pack -->"
37
37