@blxzer/cursor-trellis 0.2.8 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +89 -0
- package/README.md +37 -12
- package/README.zh-CN.md +41 -16
- package/bin/{trellis.js → cstl.js} +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +30 -4
- package/dist/cli/index.js.map +1 -1
- package/dist/commands/capability-smoke.d.ts +24 -0
- package/dist/commands/capability-smoke.d.ts.map +1 -0
- package/dist/commands/capability-smoke.js +83 -0
- package/dist/commands/capability-smoke.js.map +1 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +94 -34
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/uninstall.d.ts +1 -1
- package/dist/commands/uninstall.js +2 -2
- package/dist/commands/uninstall.js.map +1 -1
- package/dist/commands/update.d.ts +1 -1
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +79 -34
- package/dist/commands/update.js.map +1 -1
- package/dist/commands/upgrade.js +2 -2
- package/dist/commands/upgrade.js.map +1 -1
- package/dist/configurators/cursor.d.ts +2 -2
- package/dist/configurators/cursor.js +4 -4
- package/dist/configurators/cursor.js.map +1 -1
- package/dist/configurators/index.js +3 -3
- package/dist/configurators/index.js.map +1 -1
- package/dist/configurators/shared.d.ts +10 -10
- package/dist/configurators/shared.d.ts.map +1 -1
- package/dist/configurators/shared.js +26 -26
- package/dist/configurators/shared.js.map +1 -1
- package/dist/configurators/workflow.d.ts +2 -2
- package/dist/migrations/manifests/0.2.10.json +374 -0
- package/dist/migrations/manifests/0.2.9.json +9 -0
- package/dist/migrations/manifests/0.3.0.json +89 -0
- package/dist/templates/common/bundled-skills/{trellis-cursor2plus-setup → cstl-cursor2plus-setup}/SKILL.md +5 -4
- package/dist/templates/common/bundled-skills/{trellis-meta → cstl-meta}/SKILL.md +75 -75
- package/dist/templates/common/bundled-skills/{trellis-meta → cstl-meta}/references/customize-local/add-project-local-conventions.md +8 -8
- package/dist/templates/common/bundled-skills/{trellis-meta → cstl-meta}/references/customize-local/change-agents.md +6 -6
- package/dist/templates/common/bundled-skills/{trellis-meta → cstl-meta}/references/customize-local/change-context-loading.md +7 -7
- package/dist/templates/common/bundled-skills/{trellis-meta → cstl-meta}/references/customize-local/change-skills-or-commands.md +1 -1
- package/dist/templates/common/bundled-skills/{trellis-meta → cstl-meta}/references/customize-local/change-spec-structure.md +2 -2
- package/dist/templates/common/bundled-skills/{trellis-meta → cstl-meta}/references/customize-local/change-task-lifecycle.md +31 -31
- package/dist/templates/common/bundled-skills/{trellis-meta → cstl-meta}/references/customize-local/change-workflow.md +12 -12
- package/dist/templates/common/bundled-skills/{trellis-meta → cstl-meta}/references/customize-local/overview.md +55 -55
- package/dist/templates/common/bundled-skills/{trellis-meta → cstl-meta}/references/local-architecture/context-injection.md +13 -13
- package/dist/templates/common/bundled-skills/{trellis-meta → cstl-meta}/references/local-architecture/generated-files.md +83 -83
- package/dist/templates/common/bundled-skills/{trellis-meta → cstl-meta}/references/local-architecture/overview.md +2 -2
- package/dist/templates/common/bundled-skills/{trellis-meta → cstl-meta}/references/local-architecture/spec-system.md +1 -1
- package/dist/templates/common/bundled-skills/{trellis-meta → cstl-meta}/references/local-architecture/task-system.md +22 -22
- package/dist/templates/common/bundled-skills/{trellis-meta → cstl-meta}/references/local-architecture/workflow.md +5 -5
- package/dist/templates/common/bundled-skills/{trellis-meta → cstl-meta}/references/local-architecture/workspace-memory.md +3 -3
- package/dist/templates/common/bundled-skills/{trellis-meta → cstl-meta}/references/platform-files/agents.md +11 -11
- package/dist/templates/common/bundled-skills/{trellis-meta → cstl-meta}/references/platform-files/hooks-and-settings.md +1 -1
- package/dist/templates/common/bundled-skills/{trellis-meta → cstl-meta}/references/platform-files/overview.md +4 -4
- package/dist/templates/common/bundled-skills/{trellis-meta → cstl-meta}/references/platform-files/platform-map.md +5 -5
- package/dist/templates/common/bundled-skills/{trellis-meta → cstl-meta}/references/platform-files/skills-and-commands.md +15 -15
- package/dist/templates/common/bundled-skills/{trellis-micro-grill → cstl-micro-grill}/SKILL.md +62 -47
- package/dist/templates/common/bundled-skills/{trellis-skill-creator → cstl-skill-creator}/SKILL.md +44 -44
- package/dist/templates/common/bundled-skills/{trellis-skill-creator → cstl-skill-creator}/references/authoring-rules.md +97 -97
- package/dist/templates/common/bundled-skills/{trellis-skill-creator/references/trellis-skill-locations.md → cstl-skill-creator/references/cstl-skill-locations.md} +52 -52
- package/dist/templates/common/bundled-skills/{trellis-skill-creator → cstl-skill-creator}/references/review-checklist.md +47 -47
- package/dist/templates/common/bundled-skills/{trellis-spec-bootstrap → cstl-spec-bootstrap}/SKILL.md +1 -1
- package/dist/templates/common/bundled-skills/smart-search-cli/SKILL.md +7 -8
- package/dist/templates/common/bundled-skills/smart-search-cli/references/cli-contract.md +46 -46
- package/dist/templates/common/commands/continue.md +20 -20
- package/dist/templates/common/commands/start.md +11 -11
- package/dist/templates/common/index.d.ts +1 -1
- package/dist/templates/common/index.d.ts.map +1 -1
- package/dist/templates/common/skills/brainstorm.md +188 -164
- package/dist/templates/common/skills/check.md +1 -1
- package/dist/templates/cursor/agents/{trellis-check.md → cstl-check.md} +8 -8
- package/dist/templates/cursor/agents/{trellis-implement.md → cstl-implement.md} +8 -8
- package/dist/templates/cursor/agents/{trellis-research.md → cstl-research.md} +2 -2
- package/dist/templates/cursor/commands/cursor2plus-setup.md +5 -5
- package/dist/templates/cursor/fixtures/expected-rules.d.ts +1 -1
- package/dist/templates/cursor/fixtures/expected-rules.d.ts.map +1 -1
- package/dist/templates/cursor/fixtures/expected-rules.js +2 -2
- package/dist/templates/cursor/fixtures/expected-rules.js.map +1 -1
- package/dist/templates/cursor/rules/{trellis-subagent-dispatch.mdc → cstl-subagent-dispatch.mdc} +2 -2
- package/dist/templates/cursor/rules/{trellis-triage.mdc → cstl-triage.mdc} +1 -1
- package/dist/templates/markdown/agents.md +4 -4
- package/dist/templates/markdown/spec/guides/cross-platform-thinking-guide.md.txt +634 -634
- package/dist/templates/markdown/spec/guides/cursor-context-injection-guide.md.txt +4 -4
- package/dist/templates/markdown/spec/guides/cursor-semantic-compliance.md.txt +6 -0
- package/dist/templates/markdown/spec/guides/cursor-subagent-policy.md.txt +393 -391
- package/dist/templates/markdown/spec/guides/durable-learning-decision-guide.md.txt +6 -6
- package/dist/templates/markdown/spec/guides/execution-strategy.md.txt +2 -2
- package/dist/templates/markdown/spec/guides/index.md.txt +3 -2
- package/dist/templates/markdown/spec/guides/retrieval-daily-guide.md.txt +12 -0
- package/dist/templates/shared-hooks/index.d.ts +1 -1
- package/dist/templates/shared-hooks/index.js +1 -1
- package/dist/templates/shared-hooks/inject-subagent-context.py +3 -3
- package/dist/templates/shared-hooks/inject-workflow-state.py +27 -27
- package/dist/templates/shared-hooks/research-end-retrieval-pack.py +1 -1
- package/dist/templates/shared-hooks/session-start.py +3 -3
- package/dist/templates/trellis/config/execution-strategy-rules.json +1 -1
- package/dist/templates/trellis/config.yaml +4 -4
- package/dist/templates/trellis/local/README.md +12 -10
- package/dist/templates/trellis/local/patch_wpelc8.py +3 -3
- package/dist/templates/trellis/local/subagent-models.json.example +1 -1
- package/dist/templates/trellis/local/trellis-task-models.json.example +3 -3
- package/dist/templates/trellis/local/trellis-task-models.json5.example +5 -5
- package/dist/templates/trellis/local/trellis_task_models_config.py +6 -6
- package/dist/templates/trellis/scripts/common/cli_adapter.py +3 -3
- package/dist/templates/trellis/scripts/common/execution_strategy.py +1 -1
- package/dist/templates/trellis/scripts/common/parent_orchestration.py +702 -702
- package/dist/templates/trellis/scripts/common/session_context.py +1159 -1159
- package/dist/templates/trellis/scripts/common/smart_search_evidence.py +33 -1
- package/dist/templates/trellis/scripts/common/subagent_dispatch.py +5 -5
- package/dist/templates/trellis/scripts/common/task_gates.py +2056 -2034
- package/dist/templates/trellis/scripts/common/task_store.py +1594 -1594
- package/dist/templates/trellis/workflow.md +805 -805
- package/dist/types/ai-tools.d.ts +1 -1
- package/dist/types/ai-tools.d.ts.map +1 -1
- package/dist/types/ai-tools.js +1 -1
- package/dist/types/ai-tools.js.map +1 -1
- package/dist/utils/project-capabilities.d.ts +14 -3
- package/dist/utils/project-capabilities.d.ts.map +1 -1
- package/dist/utils/project-capabilities.js +122 -12
- package/dist/utils/project-capabilities.js.map +1 -1
- package/dist/utils/readiness.d.ts +10 -0
- package/dist/utils/readiness.d.ts.map +1 -1
- package/dist/utils/readiness.js +6 -3
- package/dist/utils/readiness.js.map +1 -1
- package/package.json +4 -5
- /package/dist/templates/common/bundled-skills/{trellis-meta → cstl-meta}/references/customize-local/change-hooks.md +0 -0
- /package/dist/templates/common/bundled-skills/{trellis-spec-bootstrap → cstl-spec-bootstrap}/references/mcp-setup.md +0 -0
- /package/dist/templates/common/bundled-skills/{trellis-spec-bootstrap → cstl-spec-bootstrap}/references/repository-analysis.md +0 -0
- /package/dist/templates/common/bundled-skills/{trellis-spec-bootstrap → cstl-spec-bootstrap}/references/spec-task-planning.md +0 -0
- /package/dist/templates/common/bundled-skills/{trellis-spec-bootstrap → cstl-spec-bootstrap}/references/spec-writing.md +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Durable Learning Decision Guide
|
|
1
|
+
# Durable Learning Decision Guide
|
|
2
2
|
|
|
3
3
|
> **Purpose**: Decide whether a completed task should update `.trellis/spec/` or can archive with an explicit **no durable learning** line.
|
|
4
4
|
|
|
@@ -17,7 +17,7 @@ Pick **one** grep-friendly line before `archive --check`:
|
|
|
17
17
|
| Insight already documented | `Learning artifact: .trellis/tasks/<task>/handoff.md` |
|
|
18
18
|
| Retrospective captured | `Learning artifact: .trellis/workspace/...` or `retrospective.md: <path>` |
|
|
19
19
|
|
|
20
|
-
Optional planning note (not sufficient alone): `Spec update needed: <reason>` — still record **spec update evidence** after `/
|
|
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 `/
|
|
36
|
+
- Workflow bug that should not recur (after `/cstl:break-loop` analysis)
|
|
37
37
|
- Cross-layer contract clarification
|
|
38
38
|
|
|
39
39
|
### Learning artifact
|
|
@@ -60,9 +60,9 @@ python ./.trellis/scripts/task.py review-child <parent> <child> --check
|
|
|
60
60
|
|
|
61
61
|
## Skills
|
|
62
62
|
|
|
63
|
-
- **`/
|
|
64
|
-
- **`/
|
|
65
|
-
- **`/
|
|
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`
|
|
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.
|
|
@@ -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 `
|
|
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 `/
|
|
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 |
|
|
@@ -78,6 +78,18 @@ When `smart-search doctor` is not ok or `run_smart_search.py` status is `not_con
|
|
|
78
78
|
|
|
79
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`.
|
|
80
80
|
|
|
81
|
+
**Research flags (smart-search ≥ 0.1.15):** pass through `run_smart_search.py` for `--intent deep-research`:
|
|
82
|
+
|
|
83
|
+
| Flag | Values | Use |
|
|
84
|
+
| --- | --- | --- |
|
|
85
|
+
| `--locale-scope` | `cn`, `en`, `both` (CLI default) | Skip bilingual discovery when cost matters |
|
|
86
|
+
| `--dry-run` | flag | Plan + routing preview only; no live providers |
|
|
87
|
+
| `--progress` | flag | `[research]` stage logs to stderr |
|
|
88
|
+
|
|
89
|
+
Research JSON may include `output_schema_version: 1` and structured `citations` (`id`, `source_type`, `verified`, `content_len`). Trellis manifests preserve those fields when present.
|
|
90
|
+
|
|
91
|
+
**Cursor skill surface:** `smart-search-cli` is an internal workflow name — it is **not** installed under `.cursor/skills/` (commands-only policy). On Cursor, follow this guide + `run_smart_search.py`; bundled skill assets ship for Codex/Gemini via `.agents/skills/` only.
|
|
92
|
+
|
|
81
93
|
## Router vs execution
|
|
82
94
|
|
|
83
95
|
`route_codebase_retrieval.py` returns **intent + route suggestions** and **`agentInstructions`** (numbered steps with Cursor-native tool names). **codebase-evidence** is **candidate** until confirmed by Read/Git/tests.
|
|
@@ -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` (`
|
|
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
|
|
@@ -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` (`
|
|
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
|
|
@@ -28,9 +28,9 @@ if sys.platform.startswith("win"):
|
|
|
28
28
|
|
|
29
29
|
DIR_WORKFLOW = ".trellis"
|
|
30
30
|
|
|
31
|
-
AGENT_IMPLEMENT = "
|
|
32
|
-
AGENT_CHECK = "
|
|
33
|
-
AGENT_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 /
|
|
@@ -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 `
|
|
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
|
|
|
@@ -85,7 +85,7 @@ def find_trellis_root(start: Path) -> Optional[Path]:
|
|
|
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 / ".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)
|
|
139
139
|
if not active.task_path:
|
|
140
140
|
return None
|
|
141
141
|
|
|
@@ -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(
|
|
@@ -33,7 +33,7 @@ if sys.platform.startswith("win"):
|
|
|
33
33
|
|
|
34
34
|
DIR_WORKFLOW = ".trellis"
|
|
35
35
|
OUTPUT_BASENAME = "retrieval-pack-latest.json"
|
|
36
|
-
MARKER = "<!--
|
|
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
|
|
@@ -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 `/
|
|
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 `
|
|
385
|
+
"Next-Action: Load `cstl-brainstorm` and write `prd.md`. Stay in planning."
|
|
386
386
|
)
|
|
387
387
|
|
|
388
388
|
if task_status == "planning":
|
|
@@ -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
|
|
23
|
+
"message": "worker usually runs in main-worktree; git-worktree is rare for cstl-implement"
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
26
|
"execution_mode": "inline",
|
|
@@ -55,7 +55,7 @@ max_journal_lines: 2000
|
|
|
55
55
|
#-------------------------------------------------------------------------------
|
|
56
56
|
|
|
57
57
|
# Declare packages for monorepo projects.
|
|
58
|
-
# Trellis auto-detects workspaces during `
|
|
58
|
+
# Trellis auto-detects workspaces during `cstl init`, but you can also
|
|
59
59
|
# configure them manually here.
|
|
60
60
|
#
|
|
61
61
|
# packages:
|
|
@@ -101,7 +101,7 @@ max_journal_lines: 2000
|
|
|
101
101
|
#-------------------------------------------------------------------------------
|
|
102
102
|
# Channel worker OOM guard
|
|
103
103
|
#-------------------------------------------------------------------------------
|
|
104
|
-
# Default safeguards for `
|
|
104
|
+
# Default safeguards for `cstl channel spawn` workers. The guard runs
|
|
105
105
|
# at spawn time (cleans expired idle workers, then enforces the live-worker
|
|
106
106
|
# budget) and inside each supervisor (self-terminates a worker that stays
|
|
107
107
|
# continuously idle past `idle_timeout`).
|
|
@@ -125,8 +125,8 @@ channel:
|
|
|
125
125
|
# main Codex agent edit code directly because Codex sub-agents run with
|
|
126
126
|
# `fork_turns="none"` isolation and can't inherit the parent session's
|
|
127
127
|
# task context. Set to "sub-agent" to opt into the legacy dispatch model
|
|
128
|
-
# (main agent spawns
|
|
128
|
+
# (main agent spawns cstl-implement / cstl-check / cstl-research
|
|
129
129
|
# sub-agents).
|
|
130
130
|
#
|
|
131
131
|
# codex:
|
|
132
|
-
# dispatch_mode: inline # or "sub-agent" to dispatch
|
|
132
|
+
# dispatch_mode: inline # or "sub-agent" to dispatch cstl-* sub-agents
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
# Cursor++ Local Bundle
|
|
2
2
|
|
|
3
|
-
> **Native Cursor users:** safe to ignore or delete this directory unless using **Cursor++ BYOK**.
|
|
3
|
+
> **Native Cursor users:** safe to ignore or delete this directory unless using **Cursor++ BYOK** on **this repo**.
|
|
4
4
|
|
|
5
|
-
**
|
|
5
|
+
**Coexistence:** Native and BYOK can run on the same machine across different projects. This bundle is **per-repo** (`cstl init --cursor --cursor2plus`); sibling repos may use `cstl init --cursor` only. Full guide: cursor-trellis `docs/cursor.md` — section *Native and BYOK coexistence (not either/or)*.
|
|
6
|
+
|
|
7
|
+
**Who needs this:** Cursor IDE with [Cursor++](https://ccursor.cometix.dev) (BYOK proxy). Method 2.5 patches the Cursor++ task model resolver (historically located via `WPeLc8` in verified builds) so Trellis Task subagents get per-role BYOK slugs instead of inheriting the parent model. **After any Cursor or Cursor++ upgrade**, run `python patch_wpelc8.py --check-compat` before re-applying.
|
|
6
8
|
|
|
7
9
|
## Bundle files
|
|
8
10
|
|
|
@@ -28,10 +30,10 @@ User-wide model doc: `~/.ccursor/trellis-task-models.json5` (see `../trellis-tas
|
|
|
28
30
|
2. **Operator approval** — review map and compat output; decide to proceed
|
|
29
31
|
3. **Apply** — `python patch_wpelc8.py --apply --approve` (writes `extension.js`)
|
|
30
32
|
4. **Reload Cursor** — Developer: Reload Window (once per apply/revert)
|
|
31
|
-
5. **A ≠ B probe** — parent chat model must differ from a patched subagent map target; dispatch a `
|
|
33
|
+
5. **A ≠ B probe** — parent chat model must differ from a patched subagent map target; dispatch a `cstl-*` Task and confirm the subagent self-reports the **map target** slug/model, not the parent
|
|
32
34
|
6. **Revert if needed** — `python patch_wpelc8.py --revert` then Reload Window
|
|
33
35
|
|
|
34
|
-
Agent-led setup: run skill **`
|
|
36
|
+
Agent-led setup: run skill **`cstl-cursor2plus-setup`** in Cursor Agent (lists models, writes JSON5, runs patch steps).
|
|
35
37
|
|
|
36
38
|
## Revert recipe
|
|
37
39
|
|
|
@@ -47,10 +49,10 @@ Then **Developer: Reload Window**. Subagents return to **inherit parent** BYOK m
|
|
|
47
49
|
Goal: prove the patch routes **subagent** model independently of the **parent** session model.
|
|
48
50
|
|
|
49
51
|
1. Set parent chat to model **A** (any BYOK model in Cursor++).
|
|
50
|
-
2. Ensure `trellis-task-models.json5` maps e.g. `
|
|
51
|
-
3. `python patch_wpelc8.py --print-map` — note the slug for `
|
|
52
|
+
2. Ensure `trellis-task-models.json5` maps e.g. `cstl-implement` to model **B** (`primary`/`fallback` resolving to a different slug than A).
|
|
53
|
+
3. `python patch_wpelc8.py --print-map` — note the slug for `cstl-implement` (= map target **B**).
|
|
52
54
|
4. `python patch_wpelc8.py --apply --approve` → Reload Window.
|
|
53
|
-
5. Dispatch a `
|
|
55
|
+
5. Dispatch a `cstl-implement` Task from a parent on model **A**.
|
|
54
56
|
6. **Pass:** subagent self-report / trace shows **B** (map target), not **A**.
|
|
55
57
|
7. **Fail:** subagent shows **A** → patch stale or not applied; run `--check-compat`, re-patch, or `--revert`.
|
|
56
58
|
|
|
@@ -73,9 +75,9 @@ python smoke.py # env + patch_status smoke
|
|
|
73
75
|
|
|
74
76
|
| JSON key (under `models`) | Meaning |
|
|
75
77
|
|---------------------------|---------|
|
|
76
|
-
| `
|
|
77
|
-
| `
|
|
78
|
-
| `
|
|
78
|
+
| `cstl-research` | Trellis research Task subagent |
|
|
79
|
+
| `cstl-implement` | Trellis implement (+ Parent/Child default Task) |
|
|
80
|
+
| `cstl-check` | Trellis check Task subagent |
|
|
79
81
|
| `generalPurpose` / `shell` / `best-of-n-runner` | Cursor built-in Task types |
|
|
80
82
|
|
|
81
83
|
Each role: `{ "primary": "<name>", "fallback": "<name>" }`. Names: **apiModel** or **displayName** from Cursor++ (`--list-models`). **Explore** is not in this file — use the Cursor++ panel.
|
|
@@ -166,7 +166,7 @@ def try_resolve_extension_js(bundle_dir: Path, config: dict) -> Path | None:
|
|
|
166
166
|
def build_inject_block(model_map: dict[str, str]) -> str:
|
|
167
167
|
if not model_map:
|
|
168
168
|
raise SystemExit(
|
|
169
|
-
"model map empty — use skill
|
|
169
|
+
"model map empty — use skill cstl-cursor2plus-setup or write "
|
|
170
170
|
"~/.ccursor/trellis-task-models.json5 (see .trellis/local/trellis-task-models.json5.example)"
|
|
171
171
|
)
|
|
172
172
|
pairs = ",".join(f'"{k}":"{v}"' for k, v in sorted(model_map.items()))
|
|
@@ -240,7 +240,7 @@ def cmd_explain() -> None:
|
|
|
240
240
|
print(f" {key}")
|
|
241
241
|
print(f" → {SUBAGENT_TYPE_HELP.get(key, '')}")
|
|
242
242
|
print()
|
|
243
|
-
print("Skill:
|
|
243
|
+
print("Skill: cstl-cursor2plus-setup (init 后与大模型交互完成配置)")
|
|
244
244
|
|
|
245
245
|
|
|
246
246
|
def cmd_list_models(providers_path: Path) -> None:
|
|
@@ -272,7 +272,7 @@ def cmd_bootstrap(bundle_dir: Path) -> None:
|
|
|
272
272
|
config["extensionJs"] = path
|
|
273
273
|
cfg_out.write_text(json.dumps(config, indent=2) + "\n", encoding="utf-8")
|
|
274
274
|
print("wrote", cfg_out)
|
|
275
|
-
print("Next: in Cursor Agent, run skill
|
|
275
|
+
print("Next: in Cursor Agent, run skill cstl-cursor2plus-setup", file=sys.stderr)
|
|
276
276
|
|
|
277
277
|
|
|
278
278
|
def cmd_check_compat(bundle_dir: Path, config: dict) -> int:
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_comment": "Copy to ~/.ccursor/trellis-task-models.json (Windows: %USERPROFILE%\\.ccursor\\). Values: use apiModel or displayName from Cursor++ — patch_wpelc8.py resolves to slug at patch time. Optional keys: omit types you do not use.",
|
|
3
3
|
"_when_providers_change": "Run: python patch_wpelc8.py --list-models then fix this file and patch again.",
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
4
|
+
"cstl-research": "glm-5.1",
|
|
5
|
+
"cstl-implement": "qwen3.6-plus",
|
|
6
|
+
"cstl-check": "qwen3.7-max",
|
|
7
7
|
"generalPurpose": "gpt-5.5",
|
|
8
8
|
"shell": "grok-composer-2.5-fast",
|
|
9
9
|
"best-of-n-runner": "kimi-k2.7-code"
|
|
@@ -10,20 +10,20 @@
|
|
|
10
10
|
|
|
11
11
|
{
|
|
12
12
|
"models": {
|
|
13
|
-
// Trellis 调研(Task
|
|
14
|
-
"
|
|
13
|
+
// Trellis 调研(Task cstl-research)
|
|
14
|
+
"cstl-research": {
|
|
15
15
|
"primary": "glm-5.1",
|
|
16
16
|
"fallback": "qwen3.7-max"
|
|
17
17
|
},
|
|
18
18
|
|
|
19
19
|
// Trellis 实现;Parent generate-child-prompt --mode subagent 默认派发此类型
|
|
20
|
-
"
|
|
20
|
+
"cstl-implement": {
|
|
21
21
|
"primary": "qwen3.6-plus",
|
|
22
22
|
"fallback": "kimi-k2.7-code"
|
|
23
23
|
},
|
|
24
24
|
|
|
25
|
-
// Trellis 验收(Task
|
|
26
|
-
"
|
|
25
|
+
// Trellis 验收(Task cstl-check)
|
|
26
|
+
"cstl-check": {
|
|
27
27
|
"primary": "qwen3.7-max",
|
|
28
28
|
"fallback": "glm-5.1"
|
|
29
29
|
},
|
|
@@ -6,18 +6,18 @@ from pathlib import Path
|
|
|
6
6
|
from typing import Any
|
|
7
7
|
|
|
8
8
|
KNOWN_SUBAGENT_TYPES = (
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
9
|
+
"cstl-research",
|
|
10
|
+
"cstl-implement",
|
|
11
|
+
"cstl-check",
|
|
12
12
|
"generalPurpose",
|
|
13
13
|
"shell",
|
|
14
14
|
"best-of-n-runner",
|
|
15
15
|
)
|
|
16
16
|
|
|
17
17
|
SUBAGENT_TYPE_HELP: dict[str, str] = {
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
18
|
+
"cstl-research": "Trellis 调研 Task(cstl-research)",
|
|
19
|
+
"cstl-implement": "Trellis 实现 Task;Parent/Child 默认派发类型",
|
|
20
|
+
"cstl-check": "Trellis 验收 Task(cstl-check)",
|
|
21
21
|
"generalPurpose": "Cursor 内置 Task:generalPurpose",
|
|
22
22
|
"shell": "Cursor 内置 Task:shell",
|
|
23
23
|
"best-of-n-runner": "Cursor 内置 Task:best-of-n-runner",
|
|
@@ -46,15 +46,15 @@ class CLIAdapter:
|
|
|
46
46
|
def get_commands_path(self, project_root: Path, *parts: str) -> Path:
|
|
47
47
|
if not parts:
|
|
48
48
|
return self.get_config_dir(project_root) / "commands"
|
|
49
|
-
if len(parts) >= 2 and parts[0] == "
|
|
49
|
+
if len(parts) >= 2 and parts[0] == "cstl":
|
|
50
50
|
filename = parts[-1]
|
|
51
51
|
return (
|
|
52
|
-
self.get_config_dir(project_root) / "commands" / f"
|
|
52
|
+
self.get_config_dir(project_root) / "commands" / f"cstl-{filename}"
|
|
53
53
|
)
|
|
54
54
|
return self.get_config_dir(project_root) / "commands" / Path(*parts)
|
|
55
55
|
|
|
56
56
|
def get_trellis_command_path(self, name: str) -> str:
|
|
57
|
-
return f".cursor/commands/
|
|
57
|
+
return f".cursor/commands/cstl-{name}.md"
|
|
58
58
|
|
|
59
59
|
def get_non_interactive_env(self) -> dict[str, str]:
|
|
60
60
|
return {}
|
|
@@ -195,7 +195,7 @@ def suggest_execution_strategy(
|
|
|
195
195
|
elif profile == "full":
|
|
196
196
|
mode = "worker"
|
|
197
197
|
iso = "main-worktree"
|
|
198
|
-
reasons.append("Full task touching code → worker (
|
|
198
|
+
reasons.append("Full task touching code → worker (cstl-implement / check sub-agents)")
|
|
199
199
|
else:
|
|
200
200
|
mode = "inline"
|
|
201
201
|
iso = "main-worktree"
|