@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.
- package/CHANGELOG.md +45 -0
- package/README.md +51 -10
- package/README.zh-CN.md +21 -7
- package/bin/cstl.js +1 -1
- package/bin/smart-search.js +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +17 -15
- package/dist/cli/index.js.map +1 -1
- package/dist/commands/capability-smoke.js +2 -2
- package/dist/commands/capability-smoke.js.map +1 -1
- package/dist/commands/channel/agent-loader.d.ts +1 -1
- package/dist/commands/channel/agent-loader.js +4 -4
- package/dist/commands/channel/agent-loader.js.map +1 -1
- package/dist/commands/channel/guard.d.ts +2 -2
- package/dist/commands/channel/guard.js +3 -3
- package/dist/commands/channel/guard.js.map +1 -1
- package/dist/commands/channel/index.js +3 -3
- package/dist/commands/channel/index.js.map +1 -1
- package/dist/commands/channel/list.d.ts +1 -1
- package/dist/commands/channel/list.js +1 -1
- package/dist/commands/channel/rm.d.ts +1 -1
- package/dist/commands/channel/rm.js +1 -1
- package/dist/commands/channel/store/lock.d.ts +1 -1
- package/dist/commands/channel/store/lock.js +1 -1
- package/dist/commands/channel/store/paths.js +1 -1
- package/dist/commands/channel/store/paths.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +105 -59
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/uninstall.d.ts +3 -3
- package/dist/commands/uninstall.d.ts.map +1 -1
- package/dist/commands/uninstall.js +69 -15
- package/dist/commands/uninstall.js.map +1 -1
- package/dist/commands/update.d.ts +6 -1
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +83 -28
- package/dist/commands/update.js.map +1 -1
- package/dist/commands/workflow.d.ts +4 -4
- package/dist/commands/workflow.d.ts.map +1 -1
- package/dist/commands/workflow.js +10 -9
- package/dist/commands/workflow.js.map +1 -1
- package/dist/configurators/index.d.ts.map +1 -1
- package/dist/configurators/index.js +1 -1
- package/dist/configurators/index.js.map +1 -1
- package/dist/configurators/shared.js +6 -6
- package/dist/configurators/shared.js.map +1 -1
- package/dist/configurators/workflow.d.ts +4 -4
- package/dist/configurators/workflow.js +1 -1
- package/dist/constants/paths.d.ts +24 -24
- package/dist/constants/paths.d.ts.map +1 -1
- package/dist/constants/paths.js +16 -16
- package/dist/constants/paths.js.map +1 -1
- package/dist/migrations/manifests/0.3.1.json +32 -0
- package/dist/templates/common/bundled-skills/cstl-cursor2plus-setup/SKILL.md +11 -11
- package/dist/templates/common/bundled-skills/cstl-meta/SKILL.md +15 -15
- package/dist/templates/common/bundled-skills/cstl-meta/references/customize-local/add-project-local-conventions.md +12 -12
- package/dist/templates/common/bundled-skills/cstl-meta/references/customize-local/change-agents.md +2 -2
- package/dist/templates/common/bundled-skills/cstl-meta/references/customize-local/change-context-loading.md +21 -21
- package/dist/templates/common/bundled-skills/cstl-meta/references/customize-local/change-hooks.md +9 -9
- package/dist/templates/common/bundled-skills/cstl-meta/references/customize-local/change-skills-or-commands.md +7 -7
- package/dist/templates/common/bundled-skills/cstl-meta/references/customize-local/change-spec-structure.md +15 -15
- package/dist/templates/common/bundled-skills/cstl-meta/references/customize-local/change-task-lifecycle.md +27 -27
- package/dist/templates/common/bundled-skills/cstl-meta/references/customize-local/change-workflow.md +7 -7
- package/dist/templates/common/bundled-skills/cstl-meta/references/customize-local/overview.md +11 -11
- package/dist/templates/common/bundled-skills/cstl-meta/references/local-architecture/context-injection.md +12 -12
- package/dist/templates/common/bundled-skills/cstl-meta/references/local-architecture/generated-files.md +21 -21
- package/dist/templates/common/bundled-skills/cstl-meta/references/local-architecture/overview.md +14 -14
- package/dist/templates/common/bundled-skills/cstl-meta/references/local-architecture/spec-system.md +12 -12
- package/dist/templates/common/bundled-skills/cstl-meta/references/local-architecture/task-system.md +23 -23
- package/dist/templates/common/bundled-skills/cstl-meta/references/local-architecture/workflow.md +3 -3
- package/dist/templates/common/bundled-skills/cstl-meta/references/local-architecture/workspace-memory.md +16 -16
- package/dist/templates/common/bundled-skills/cstl-meta/references/platform-files/agents.md +2 -2
- package/dist/templates/common/bundled-skills/cstl-meta/references/platform-files/hooks-and-settings.md +6 -6
- package/dist/templates/common/bundled-skills/cstl-meta/references/platform-files/overview.md +5 -5
- package/dist/templates/common/bundled-skills/cstl-meta/references/platform-files/platform-map.md +3 -3
- package/dist/templates/common/bundled-skills/cstl-meta/references/platform-files/skills-and-commands.md +5 -5
- package/dist/templates/common/bundled-skills/cstl-skill-creator/SKILL.md +2 -2
- package/dist/templates/common/bundled-skills/cstl-skill-creator/references/review-checklist.md +1 -1
- package/dist/templates/common/bundled-skills/cstl-spec-bootstrap/SKILL.md +5 -5
- package/dist/templates/common/bundled-skills/cstl-spec-bootstrap/references/repository-analysis.md +1 -1
- package/dist/templates/common/bundled-skills/cstl-spec-bootstrap/references/spec-task-planning.md +3 -3
- package/dist/templates/common/bundled-skills/cstl-spec-bootstrap/references/spec-writing.md +1 -1
- package/dist/templates/common/commands/continue.md +6 -6
- package/dist/templates/common/commands/finish-work.md +5 -5
- package/dist/templates/common/commands/start.md +8 -8
- package/dist/templates/common/skills/before-dev.md +4 -4
- package/dist/templates/common/skills/brainstorm.md +5 -5
- package/dist/templates/common/skills/break-loop.md +3 -3
- package/dist/templates/common/skills/check.md +5 -5
- package/dist/templates/common/skills/update-spec.md +4 -4
- package/dist/templates/cursor/agents/cstl-check.md +6 -6
- package/dist/templates/cursor/agents/cstl-implement.md +7 -7
- package/dist/templates/cursor/agents/cstl-research.md +9 -9
- package/dist/templates/cursor/commands/cursor2plus-setup.md +10 -10
- package/dist/templates/cursor/rules/cstl-subagent-dispatch.mdc +2 -2
- package/dist/templates/cursor/rules/cstl-triage.mdc +2 -2
- package/dist/templates/cursor/rules/retrieval-routing.mdc +4 -4
- package/dist/templates/extract.d.ts +1 -1
- package/dist/templates/extract.js +1 -1
- package/dist/templates/markdown/agents.md +11 -11
- package/dist/templates/markdown/prompts/run-semantic-slice-12.md.txt +1 -1
- package/dist/templates/markdown/spec/guides/cross-platform-thinking-guide.md.txt +5 -5
- package/dist/templates/markdown/spec/guides/cursor-context-injection-guide.md.txt +3 -3
- package/dist/templates/markdown/spec/guides/cursor-semantic-compliance.md.txt +1 -1
- package/dist/templates/markdown/spec/guides/cursor-subagent-policy.md.txt +11 -11
- package/dist/templates/markdown/spec/guides/cursor-trellis-release-coexistence-guide.md.txt +166 -0
- package/dist/templates/markdown/spec/guides/durable-learning-decision-guide.md.txt +8 -8
- package/dist/templates/markdown/spec/guides/execution-strategy.md.txt +3 -3
- package/dist/templates/markdown/spec/guides/index.md.txt +1 -0
- package/dist/templates/markdown/spec/guides/retrieval-daily-guide.md.txt +10 -10
- package/dist/templates/markdown/workspace-index.md +3 -3
- package/dist/templates/markdown/worktree.yaml.txt +1 -1
- 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-retrieval-plan.py +3 -3
- package/dist/templates/shared-hooks/inject-shell-session-context.py +7 -7
- package/dist/templates/shared-hooks/inject-subagent-context.py +1 -1
- package/dist/templates/shared-hooks/inject-workflow-state.py +11 -11
- package/dist/templates/shared-hooks/research-end-retrieval-pack.py +1 -1
- package/dist/templates/shared-hooks/session-start.py +13 -13
- package/dist/templates/trellis/config.yaml +2 -22
- package/dist/templates/trellis/index.d.ts +2 -2
- package/dist/templates/trellis/index.js +2 -2
- package/dist/templates/trellis/local/README.md +3 -3
- package/dist/templates/trellis/local/patch_wpelc8.py +4 -4
- package/dist/templates/trellis/scripts/add_session.py +20 -20
- package/dist/templates/trellis/scripts/common/active_task.py +2 -2
- package/dist/templates/trellis/scripts/common/artifact_search.py +587 -587
- package/dist/templates/trellis/scripts/common/codebase_retrieval_router.py +6 -6
- package/dist/templates/trellis/scripts/common/config.py +3 -3
- package/dist/templates/trellis/scripts/common/developer.py +2 -2
- package/dist/templates/trellis/scripts/common/packages_context.py +23 -23
- package/dist/templates/trellis/scripts/common/parent_orchestration.py +16 -16
- package/dist/templates/trellis/scripts/common/paths.py +107 -107
- package/dist/templates/trellis/scripts/common/project_file_stats.py +1 -1
- package/dist/templates/trellis/scripts/common/retrieval_agent_instructions.py +1 -1
- package/dist/templates/trellis/scripts/common/safe_commit.py +31 -31
- package/dist/templates/trellis/scripts/common/session_memory.py +360 -360
- package/dist/templates/trellis/scripts/common/smart_search_evidence.py +514 -514
- package/dist/templates/trellis/scripts/common/smart_search_resolve.py +1 -1
- package/dist/templates/trellis/scripts/common/subagent_dispatch.py +2 -2
- package/dist/templates/trellis/scripts/common/task_context.py +1 -1
- package/dist/templates/trellis/scripts/common/task_dashboard.py +140 -140
- package/dist/templates/trellis/scripts/common/task_gates.py +23 -23
- package/dist/templates/trellis/scripts/common/task_store.py +5 -5
- package/dist/templates/trellis/scripts/common/task_utils.py +3 -3
- package/dist/templates/trellis/scripts/common/tasks.py +1 -1
- package/dist/templates/trellis/scripts/common/trellis_config.py +3 -3
- package/dist/templates/trellis/scripts/common/workflow_phase.py +1 -1
- package/dist/templates/trellis/scripts/cursor_retrieval_probe.py +3 -3
- package/dist/templates/trellis/scripts/cursor_retrieval_probe_prompt.md +11 -11
- package/dist/templates/trellis/scripts/hooks/linear_sync.py +8 -8
- package/dist/templates/trellis/scripts/init_developer.py +2 -2
- package/dist/templates/trellis/scripts/retrieval_probe_matrix_template.json +4 -4
- package/dist/templates/trellis/scripts/route_codebase_retrieval.py +1 -1
- package/dist/templates/trellis/scripts/task.py +918 -918
- package/dist/templates/trellis/tasks/templates/release-readiness/implement.md +2 -2
- package/dist/templates/trellis/workflow.md +64 -64
- package/dist/types/migration.d.ts +1 -1
- package/dist/types/migration.d.ts.map +1 -1
- package/dist/utils/agents-md.d.ts +47 -0
- package/dist/utils/agents-md.d.ts.map +1 -0
- package/dist/utils/agents-md.js +107 -0
- package/dist/utils/agents-md.js.map +1 -0
- package/dist/utils/codebase-retrieval-router.js +5 -5
- package/dist/utils/codebase-retrieval-router.js.map +1 -1
- package/dist/utils/manifest-prune.d.ts +2 -2
- package/dist/utils/manifest-prune.js +4 -4
- package/dist/utils/manifest-prune.js.map +1 -1
- package/dist/utils/mirror-check.d.ts +3 -1
- package/dist/utils/mirror-check.d.ts.map +1 -1
- package/dist/utils/mirror-check.js +22 -11
- package/dist/utils/mirror-check.js.map +1 -1
- package/dist/utils/project-capabilities.js +5 -5
- package/dist/utils/project-capabilities.js.map +1 -1
- package/dist/utils/retrieval-agent-instructions.js +1 -1
- package/dist/utils/retrieval-agent-instructions.js.map +1 -1
- package/dist/utils/retrieval-execution-telemetry.js +1 -1
- package/dist/utils/retrieval-execution-telemetry.js.map +1 -1
- package/dist/utils/template-fetcher.js +1 -1
- package/dist/utils/template-fetcher.js.map +1 -1
- package/dist/utils/template-hash.d.ts +2 -2
- package/dist/utils/template-hash.d.ts.map +1 -1
- package/dist/utils/template-hash.js +51 -18
- package/dist/utils/template-hash.js.map +1 -1
- package/dist/utils/workflow-dir.d.ts +13 -0
- package/dist/utils/workflow-dir.d.ts.map +1 -0
- package/dist/utils/workflow-dir.js +35 -0
- package/dist/utils/workflow-dir.js.map +1 -0
- package/dist/utils/workflow-ownership.d.ts +36 -0
- package/dist/utils/workflow-ownership.d.ts.map +1 -0
- package/dist/utils/workflow-ownership.js +137 -0
- package/dist/utils/workflow-ownership.js.map +1 -0
- package/dist/utils/workflow-resolver.d.ts +1 -1
- package/dist/utils/workflow-resolver.js +1 -1
- package/package.json +2 -2
|
@@ -8,7 +8,7 @@ Enter or refresh the Trellis Framework Context. This is a dashboard entry surfac
|
|
|
8
8
|
Identity, git status, selected task, Task Dashboard, journal location.
|
|
9
9
|
|
|
10
10
|
```bash
|
|
11
|
-
{{PYTHON_CMD}} ./.
|
|
11
|
+
{{PYTHON_CMD}} ./.cstl/scripts/get_context.py
|
|
12
12
|
```
|
|
13
13
|
|
|
14
14
|
If this output includes a line beginning `Trellis update available:`, copy the full line verbatim when summarizing session context. Do not shorten operational command hints.
|
|
@@ -17,18 +17,18 @@ If this output includes a line beginning `Trellis update available:`, copy the f
|
|
|
17
17
|
Compact Phase Index, request triage rules, planning artifact contract, and the step-detail command.
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
|
-
{{PYTHON_CMD}} ./.
|
|
20
|
+
{{PYTHON_CMD}} ./.cstl/scripts/get_context.py --mode phase
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
Full guide in `.
|
|
23
|
+
Full guide in `.cstl/workflow.md` (read on demand).
|
|
24
24
|
|
|
25
25
|
## Step 3: Guideline indexes
|
|
26
26
|
Discover packages + spec layers, then read each relevant index file.
|
|
27
27
|
|
|
28
28
|
```bash
|
|
29
|
-
{{PYTHON_CMD}} ./.
|
|
30
|
-
cat .
|
|
31
|
-
cat .
|
|
29
|
+
{{PYTHON_CMD}} ./.cstl/scripts/get_context.py --mode packages
|
|
30
|
+
cat .cstl/spec/guides/index.md
|
|
31
|
+
cat .cstl/spec/<package>/<layer>/index.md # for each relevant layer
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
Index files list the specific guideline docs to read when you actually start coding.
|
|
@@ -47,7 +47,7 @@ If a task is selected, check the task directory:
|
|
|
47
47
|
- **Selected task status `planning` + `prd.md` exists** → stay in Planning / Execution Gate. Lightweight tasks can be PRD-only; complex tasks need `design.md` + `implement.md`. Run `task.py start-execution <task> --check` and request explicit execution approval before execution.
|
|
48
48
|
- **Selected task status `in_progress`** → Phase 2 step 2.1. Load the step detail:
|
|
49
49
|
```bash
|
|
50
|
-
{{PYTHON_CMD}} ./.
|
|
50
|
+
{{PYTHON_CMD}} ./.cstl/scripts/get_context.py --mode phase --step 2.1 --platform {{CLI_FLAG}}
|
|
51
51
|
```
|
|
52
52
|
- **No selected task** → use dashboard routing. Do not auto-select an existing task.
|
|
53
53
|
|
|
@@ -66,4 +66,4 @@ If a task is selected, check the task directory:
|
|
|
66
66
|
| Stuck / fixed same bug multiple times | `cstl-break-loop` |
|
|
67
67
|
| Learned something worth capturing | `cstl-update-spec` |
|
|
68
68
|
|
|
69
|
-
Full rules + anti-rationalization table in `.
|
|
69
|
+
Full rules + anti-rationalization table in `.cstl/workflow.md`.
|
|
@@ -2,14 +2,14 @@ Read the relevant development guidelines before starting your task.
|
|
|
2
2
|
|
|
3
3
|
Execute these steps:
|
|
4
4
|
|
|
5
|
-
1. **Read selected task artifacts**:
|
|
5
|
+
1. **Read selected task artifacts**:
|
|
6
6
|
- `prd.md` for requirements and acceptance criteria
|
|
7
7
|
- `design.md` if present for technical design
|
|
8
8
|
- `implement.md` if present for execution order and validation plan
|
|
9
9
|
|
|
10
10
|
2. **Discover packages and their spec layers**:
|
|
11
11
|
```bash
|
|
12
|
-
python3 ./.
|
|
12
|
+
python3 ./.cstl/scripts/get_context.py --mode packages
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
3. **Identify which specs apply** to your task based on:
|
|
@@ -19,7 +19,7 @@ Execute these steps:
|
|
|
19
19
|
|
|
20
20
|
4. **Read the spec index** for each relevant module:
|
|
21
21
|
```bash
|
|
22
|
-
cat .
|
|
22
|
+
cat .cstl/spec/<package>/<layer>/index.md
|
|
23
23
|
```
|
|
24
24
|
Follow the **"Pre-Development Checklist"** section in the index.
|
|
25
25
|
|
|
@@ -27,7 +27,7 @@ Execute these steps:
|
|
|
27
27
|
|
|
28
28
|
6. **Always read shared guides**:
|
|
29
29
|
```bash
|
|
30
|
-
cat .
|
|
30
|
+
cat .cstl/spec/guides/index.md
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
7. Understand the coding standards and patterns you need to follow, then proceed with your development plan.
|
|
@@ -47,7 +47,7 @@ Use this skill only after task-creation consent has been given and the user is r
|
|
|
47
47
|
If no task exists yet, create one:
|
|
48
48
|
|
|
49
49
|
```bash
|
|
50
|
-
TASK_DIR=$(python ./.
|
|
50
|
+
TASK_DIR=$(python ./.cstl/scripts/task.py create "<short task title>" --slug <slug>)
|
|
51
51
|
```
|
|
52
52
|
|
|
53
53
|
Use a concise title from the user's request. Use a slug without a date prefix. `task.py create` adds the `MM-DD-` directory prefix automatically.
|
|
@@ -72,12 +72,12 @@ Run **before** any user interview questions.
|
|
|
72
72
|
Inspect and record in `prd.md` (sections: **Confirmed facts**, initial **Out of scope**, draft **Goal**):
|
|
73
73
|
|
|
74
74
|
1. **Code & tests** — relevant modules, fixtures, configs, error paths.
|
|
75
|
-
2. **Specs** — `.
|
|
75
|
+
2. **Specs** — `.cstl/spec/` indexes and layer guides for touched packages.
|
|
76
76
|
3. **History** — archived tasks, active task research, developer journal when useful.
|
|
77
|
-
4. **Platform** — project platform hooks, agents, and skills (see `.
|
|
77
|
+
4. **Platform** — project platform hooks, agents, and skills (see `.cstl/spec/guides/cursor-subagent-policy.md` when using Cursor); shared `.agents/skills/` when behavior spans platforms.
|
|
78
78
|
5. **Parent/Child** — if multiple independent deliverables, note child split early in `prd.md`.
|
|
79
79
|
|
|
80
|
-
Use retrieval per `.
|
|
80
|
+
Use retrieval per `.cstl/spec/guides/retrieval-daily-guide.md` (rg for literals, codegraph for structure, fast-context for semantic sweep).
|
|
81
81
|
|
|
82
82
|
Dispatch **`cstl-research`** (writable Agent) when a topic needs a dedicated `{TASK}/research/<topic>.md` file; do **not** use a subagent for PRD Grill itself.
|
|
83
83
|
|
|
@@ -163,7 +163,7 @@ Your recommended answer defaults to Occam's Razor: the **minimal sufficient** op
|
|
|
163
163
|
- ordered implementation checklist
|
|
164
164
|
- validation commands
|
|
165
165
|
- risky files or rollback points
|
|
166
|
-
- **Development Strategy Contract** (`execution_mode`, `isolation`, …): before finalizing, run `python3 ./.
|
|
166
|
+
- **Development Strategy Contract** (`execution_mode`, `isolation`, …): before finalizing, run `python3 ./.cstl/scripts/task.py suggest-execution-strategy <task-dir>` (or `--json`); reconcile suggestion with scope, then paste the approved YAML block into `implement.md`
|
|
167
167
|
- follow-up checks before `task.py start-execution --check`
|
|
168
168
|
|
|
169
169
|
Lightweight tasks may have only `prd.md`. Complex tasks must have `prd.md`, `design.md`, and `implement.md` before `task.py start-execution --check`.
|
|
@@ -55,8 +55,8 @@ What broader problems does this bug reveal?
|
|
|
55
55
|
|
|
56
56
|
Solidify insights into the system:
|
|
57
57
|
|
|
58
|
-
- [ ] Update `.
|
|
59
|
-
- [ ] Update relevant `.
|
|
58
|
+
- [ ] Update `.cstl/spec/guides/` thinking guides
|
|
59
|
+
- [ ] Update relevant `.cstl/spec/` docs
|
|
60
60
|
- [ ] Create issue record (if applicable)
|
|
61
61
|
- [ ] Create feature ticket for root fix
|
|
62
62
|
- [ ] Update check guidelines if needed
|
|
@@ -118,7 +118,7 @@ Three levels of insight:
|
|
|
118
118
|
- If it's a code reuse issue → update `code-reuse-thinking-guide.md`
|
|
119
119
|
- If it's domain-specific → update `backend/*.md` or `frontend/*.md`
|
|
120
120
|
|
|
121
|
-
2. **Sync templates** - After updating `.
|
|
121
|
+
2. **Sync templates** - After updating `.cstl/spec/`, sync to `src/templates/markdown/spec/`
|
|
122
122
|
|
|
123
123
|
3. **Commit the spec updates** - This is the primary output, not just the analysis text
|
|
124
124
|
|
|
@@ -20,13 +20,13 @@ Read the selected task artifacts in order:
|
|
|
20
20
|
- `implement.md` if present
|
|
21
21
|
|
|
22
22
|
```bash
|
|
23
|
-
python ./.
|
|
23
|
+
python ./.cstl/scripts/get_context.py --mode packages
|
|
24
24
|
```
|
|
25
25
|
|
|
26
26
|
For each changed package/layer, read the spec index and follow its **Quality Check** section:
|
|
27
27
|
|
|
28
28
|
```bash
|
|
29
|
-
cat .
|
|
29
|
+
cat .cstl/spec/<package>/<layer>/index.md
|
|
30
30
|
```
|
|
31
31
|
|
|
32
32
|
Read the specific guideline files referenced — the index is a pointer, not the goal.
|
|
@@ -56,12 +56,12 @@ Run the project's lint, type-check, and test commands. Fix any failures before p
|
|
|
56
56
|
- [ ] `verify.md` contains exactly one token: `Learning decision: update-spec` | `no-update` | `unsure`
|
|
57
57
|
- [ ] If `update-spec` or `unsure`: `research/learning-proposal.md` exists (or documented `N/A` with reason) and matches the decision
|
|
58
58
|
- [ ] If `no-update`: includes `no durable learning` (or guide-equivalent) plus brief rationale
|
|
59
|
-
- [ ] If `update-spec`: spec was written only after confirmation; `Spec update evidence:` points at `.
|
|
60
|
-
- [ ] No silent edits to `.
|
|
59
|
+
- [ ] If `update-spec`: spec was written only after confirmation; `Spec update evidence:` points at `.cstl/spec/...`
|
|
60
|
+
- [ ] No silent edits to `.cstl/spec/` without confirmation
|
|
61
61
|
|
|
62
62
|
### Spec Sync
|
|
63
63
|
|
|
64
|
-
- [ ] Does `.
|
|
64
|
+
- [ ] Does `.cstl/spec/` need updates? (route through semi-automatic flow: proposal → confirm → `cstl-update-spec`)
|
|
65
65
|
|
|
66
66
|
> "If I fixed a bug or discovered something non-obvious, should I document it so future me won't hit the same issue?" → If YES, update the relevant spec doc.
|
|
67
67
|
|
|
@@ -9,9 +9,9 @@ When you learn something valuable (from debugging, implementing, or discussion),
|
|
|
9
9
|
## Semi-automatic flow (required for durable learning)
|
|
10
10
|
|
|
11
11
|
1. **Detect** — did this task produce reusable code-spec or guide-worthy learning?
|
|
12
|
-
2. **Proposal** — write `{TASK}/research/learning-proposal.md` (target spec paths, draft bullets; **do not** edit `.
|
|
12
|
+
2. **Proposal** — write `{TASK}/research/learning-proposal.md` (target spec paths, draft bullets; **do not** edit `.cstl/spec/` yet).
|
|
13
13
|
3. **Confirm** — user or task owner explicitly approves (`Learning decision: update-spec` in `verify.md`).
|
|
14
|
-
4. **Write** — only then edit spec files; add `Spec update evidence: .
|
|
14
|
+
4. **Write** — only then edit spec files; add `Spec update evidence: .cstl/spec/...` to `verify.md`.
|
|
15
15
|
|
|
16
16
|
**Forbidden:** silent spec edits; writing spec when `Learning decision: no-update` or `unsure` without follow-up; auto-updating spec from hooks or check alone.
|
|
17
17
|
|
|
@@ -68,7 +68,7 @@ For triggered tasks, include all sections below:
|
|
|
68
68
|
## Spec Structure Overview
|
|
69
69
|
|
|
70
70
|
```
|
|
71
|
-
.
|
|
71
|
+
.cstl/spec/
|
|
72
72
|
├── <layer>/ # Per-layer coding standards (e.g., backend/, frontend/, api/)
|
|
73
73
|
│ ├── index.md # Overview and links
|
|
74
74
|
│ └── *.md # Topic-specific guidelines
|
|
@@ -130,7 +130,7 @@ Before editing, read the current code-spec to:
|
|
|
130
130
|
- Find the right section for your update
|
|
131
131
|
|
|
132
132
|
```bash
|
|
133
|
-
cat .
|
|
133
|
+
cat .cstl/spec/<category>/<file>.md
|
|
134
134
|
```
|
|
135
135
|
|
|
136
136
|
### Step 4: Make the Update
|
|
@@ -7,7 +7,7 @@ tools: Read, Write, Edit, Bash, Glob, Grep, mcp__exa__web_search_exa, mcp__exa__
|
|
|
7
7
|
## Entry points
|
|
8
8
|
|
|
9
9
|
- **Agent session:** Open this agent file manually in a new chat — context from this file + your main-session prompt.
|
|
10
|
-
- **Task dispatch:** Run `python ./.
|
|
10
|
+
- **Task dispatch:** Run `python ./.cstl/scripts/generate_dispatch_prompt.py --agent check` → pass stdout as `Task(..., prompt=...)` — context from the Layer 2 prompt.
|
|
11
11
|
|
|
12
12
|
## Context source
|
|
13
13
|
|
|
@@ -21,7 +21,7 @@ You are the Check Agent in the Trellis workflow.
|
|
|
21
21
|
## Model policy
|
|
22
22
|
|
|
23
23
|
- **Default:** no `model:` → **inherit** parent session.
|
|
24
|
-
- **Per dispatch:** main session asks user → one-shot `model:` overlay → `Task` → restore (architecture review uses the same flow). See `.
|
|
24
|
+
- **Per dispatch:** main session asks user → one-shot `model:` overlay → `Task` → restore (architecture review uses the same flow). See `.cstl/spec/guides/cursor-subagent-policy.md`.
|
|
25
25
|
|
|
26
26
|
## Recursion Guard
|
|
27
27
|
|
|
@@ -47,7 +47,7 @@ Look for the `<!-- cstl-hook-injected -->` marker in your input above.
|
|
|
47
47
|
## Context
|
|
48
48
|
|
|
49
49
|
Before checking, read:
|
|
50
|
-
- `.
|
|
50
|
+
- `.cstl/spec/` - Development guidelines
|
|
51
51
|
- Task `prd.md` - Requirements document
|
|
52
52
|
- Task `design.md` - Technical design (if exists)
|
|
53
53
|
- Task `implement.md` - Execution plan (if exists)
|
|
@@ -65,7 +65,7 @@ Before checking, read:
|
|
|
65
65
|
|
|
66
66
|
- Reviewer id: `cursor`.
|
|
67
67
|
- When `implement.md` quality_gates requires a reviewer gate for the current transition, write human-readable evidence in `verify.md` before recording the machine-checkable gate result. Parent/Child integration evidence may also belong in Parent `task-map.md`.
|
|
68
|
-
- Record non-baseline gates with `python ./.
|
|
68
|
+
- Record non-baseline gates with `python ./.cstl/scripts/task.py record-gate <task> --transition <transition> --gate <gate> --result PASS --reviewer cursor --evidence verify.md`.
|
|
69
69
|
- For FAIL, add `--root-cause implementation-defect|contract-changing-defect|validation-environment-blocker` and `--issue-fingerprint <short-stable-id>`. Route implementation defects back to Execution, contract-changing defects to Planning, and validation blockers to Verification / Review.
|
|
70
70
|
- For SKIPPED, use only explicit user approval: `--skip-approved-by user --skip-reason <reason>`.
|
|
71
71
|
- Never record `baseline-check`; the CLI owns it. Do not pass review bodies, logs, screenshots, or long issue lists through `record-gate` arguments.
|
|
@@ -89,7 +89,7 @@ git diff # View specific changes
|
|
|
89
89
|
|
|
90
90
|
### Step 2: Check Against Specs and Task Artifacts
|
|
91
91
|
|
|
92
|
-
Read the task's prd.md, design.md if present, and implement.md if present, then read relevant specs in `.
|
|
92
|
+
Read the task's prd.md, design.md if present, and implement.md if present, then read relevant specs in `.cstl/spec/` to check code:
|
|
93
93
|
|
|
94
94
|
- Does it satisfy the task requirements
|
|
95
95
|
- Does it follow the technical design and implementation plan when present
|
|
@@ -124,7 +124,7 @@ When the pack exists:
|
|
|
124
124
|
|
|
125
125
|
```bash
|
|
126
126
|
# Optional: confirm path from selected task
|
|
127
|
-
python ./.
|
|
127
|
+
python ./.cstl/scripts/task.py selected --source
|
|
128
128
|
```
|
|
129
129
|
|
|
130
130
|
Read `{TASK}/research/retrieval-pack-latest.json` and use `contextPack.selected` (top items: `title`, `source`, `reference`, `score`). Add or update `verify.md` with:
|
|
@@ -7,7 +7,7 @@ tools: Read, Write, Edit, Bash, Glob, Grep, mcp__exa__web_search_exa, mcp__exa__
|
|
|
7
7
|
## Entry points
|
|
8
8
|
|
|
9
9
|
- **Agent session:** Open this agent file manually in a new chat — context from this file + your main-session prompt.
|
|
10
|
-
- **Task dispatch:** Run `python ./.
|
|
10
|
+
- **Task dispatch:** Run `python ./.cstl/scripts/generate_dispatch_prompt.py --agent implement` → pass stdout as `Task(..., prompt=...)` — context from the Layer 2 prompt.
|
|
11
11
|
|
|
12
12
|
## Context source
|
|
13
13
|
|
|
@@ -21,7 +21,7 @@ You are the Implement Agent in the Trellis workflow.
|
|
|
21
21
|
## Model policy
|
|
22
22
|
|
|
23
23
|
- **Default:** no `model:` → **inherit** parent session.
|
|
24
|
-
- **Per dispatch / Child worker:** main session asks user → one-shot `model:` overlay on this file → `Task` → restore. Child session uses the same overlay pattern on `cstl-implement`. See `.
|
|
24
|
+
- **Per dispatch / Child worker:** main session asks user → one-shot `model:` overlay on this file → `Task` → restore. Child session uses the same overlay pattern on `cstl-implement`. See `.cstl/spec/guides/cursor-subagent-policy.md`.
|
|
25
25
|
|
|
26
26
|
## Recursion Guard
|
|
27
27
|
|
|
@@ -46,15 +46,15 @@ Look for the `<!-- cstl-hook-injected -->` marker in your input above.
|
|
|
46
46
|
## Context
|
|
47
47
|
|
|
48
48
|
Before implementing, read:
|
|
49
|
-
- `.
|
|
50
|
-
- `.
|
|
49
|
+
- `.cstl/workflow.md` - Project workflow
|
|
50
|
+
- `.cstl/spec/` - Development guidelines
|
|
51
51
|
- Task `prd.md` - Requirements document
|
|
52
52
|
- Task `design.md` - Technical design (if exists)
|
|
53
53
|
- Task `implement.md` - Execution plan (if exists)
|
|
54
54
|
|
|
55
55
|
## Core Responsibilities
|
|
56
56
|
|
|
57
|
-
1. **Understand specs** - Read relevant spec files in `.
|
|
57
|
+
1. **Understand specs** - Read relevant spec files in `.cstl/spec/`
|
|
58
58
|
2. **Understand task artifacts** - Read prd.md, design.md if present, and implement.md if present
|
|
59
59
|
3. **Implement features** - Write code following specs and task artifacts
|
|
60
60
|
4. **Self-check** - Ensure code quality
|
|
@@ -76,8 +76,8 @@ Before implementing, read:
|
|
|
76
76
|
|
|
77
77
|
Read relevant specs based on task type:
|
|
78
78
|
|
|
79
|
-
- Spec layers: `.
|
|
80
|
-
- Shared guides: `.
|
|
79
|
+
- Spec layers: `.cstl/spec/<package>/<layer>/`
|
|
80
|
+
- Shared guides: `.cstl/spec/guides/`
|
|
81
81
|
|
|
82
82
|
### 2. Understand Requirements
|
|
83
83
|
|
|
@@ -7,7 +7,7 @@ tools: Read, Write, Glob, Grep, Bash, WebSearch, WebFetch, mcp__exa__web_search_
|
|
|
7
7
|
## Entry points
|
|
8
8
|
|
|
9
9
|
- **Agent session:** Open this agent file manually in a new chat — context from this file + your main-session prompt.
|
|
10
|
-
- **Task dispatch:** Run `python ./.
|
|
10
|
+
- **Task dispatch:** Run `python ./.cstl/scripts/generate_dispatch_prompt.py --agent research` → pass stdout as `Task(..., prompt=...)` — context from the Layer 2 prompt.
|
|
11
11
|
|
|
12
12
|
## Context source
|
|
13
13
|
|
|
@@ -21,7 +21,7 @@ You are the Research Agent in the Trellis workflow.
|
|
|
21
21
|
## Model policy
|
|
22
22
|
|
|
23
23
|
- **Default:** no `model:` in this file → **inherit** parent session at spawn.
|
|
24
|
-
- **Per dispatch:** main session asks the user, writes a **one-shot** `model:` here, runs `Task`, then **removes** `model:` (ephemeral overlay). See `.
|
|
24
|
+
- **Per dispatch:** main session asks the user, writes a **one-shot** `model:` here, runs `Task`, then **removes** `model:` (ephemeral overlay). See `.cstl/spec/guides/cursor-subagent-policy.md`.
|
|
25
25
|
- Dispatch: Cursor **Agent mode** (writable).
|
|
26
26
|
|
|
27
27
|
## Core Principle
|
|
@@ -50,7 +50,7 @@ Conversations get compacted; files don't. Every research output MUST end up as a
|
|
|
50
50
|
|
|
51
51
|
### Step 1: Resolve Selected Task
|
|
52
52
|
|
|
53
|
-
Run `python ./.
|
|
53
|
+
Run `python ./.cstl/scripts/task.py selected --source` → selected task path. If no task is selected, ask the user where to write output; do NOT guess.
|
|
54
54
|
|
|
55
55
|
Ensure `{TASK_DIR}/research/` exists:
|
|
56
56
|
|
|
@@ -68,9 +68,9 @@ Run independent searches in parallel (Glob + Grep + smart-search CLI for externa
|
|
|
68
68
|
|
|
69
69
|
#### External search — provider relevance caveats
|
|
70
70
|
|
|
71
|
-
- **Context7** and generic third-party library docs are often **irrelevant** to Trellis/Cursor platform questions. Prefer **Cursor / Cursor++ official documentation**, `docs.cursor.com`, and **local `.
|
|
71
|
+
- **Context7** and generic third-party library docs are often **irrelevant** to Trellis/Cursor platform questions. Prefer **Cursor / Cursor++ official documentation**, `docs.cursor.com`, and **local `.cstl/spec/`** before trusting Context7 hits.
|
|
72
72
|
- Every smart-search result you persist must **label the provider source** (e.g. `exa`, `context7`, `cursor-docs`, `tavily`) in the research file — in frontmatter or per bullet — so downstream check/finish can audit provenance.
|
|
73
|
-
- Trellis harness facts: `./.
|
|
73
|
+
- Trellis harness facts: `./.cstl/scripts/run_smart_search.py` writes manifests under `{TASK}/research/smart-search/<run-id>/`; scored pack output (when built) is `{TASK}/research/retrieval-pack-latest.json`.
|
|
74
74
|
|
|
75
75
|
#### External search — manual query refinement
|
|
76
76
|
|
|
@@ -80,7 +80,7 @@ When the first smart-search pass returns irrelevant results, **refine before fal
|
|
|
80
80
|
2. Add product scope: `+Trellis`, `+cursor-trellis`, or the exact API/hook name
|
|
81
81
|
3. Switch route: `--intent official-source --include-domain cursor.com` or `--intent docs` for API reference
|
|
82
82
|
4. Narrow time or topic: shorter query, version number, or feature name from local spec
|
|
83
|
-
5. Re-run: `python ./.
|
|
83
|
+
5. Re-run: `python ./.cstl/scripts/run_smart_search.py "<refined query>" --intent deep-research --json`
|
|
84
84
|
|
|
85
85
|
Only use Cursor WebSearch/WebFetch when smart-search is unavailable (`not_configured` / `failed` / timeout) — then persist with `source: cursor-web-fallback`.
|
|
86
86
|
|
|
@@ -110,8 +110,8 @@ Do NOT paste full research content into the reply. The files are the contract.
|
|
|
110
110
|
### Write FORBIDDEN
|
|
111
111
|
|
|
112
112
|
- Code files (`src/`, `lib/`, …)
|
|
113
|
-
- Spec files (`.
|
|
114
|
-
- `.
|
|
113
|
+
- Spec files (`.cstl/spec/`) — main agent should use `update-spec` skill instead
|
|
114
|
+
- `.cstl/scripts/`, `.cstl/workflow.md`, platform config (`.claude/`, `.cursor/`, etc.)
|
|
115
115
|
- Other task directories
|
|
116
116
|
- Any git operation (commit / push / branch / merge)
|
|
117
117
|
|
|
@@ -149,7 +149,7 @@ Each `{TASK_DIR}/research/<topic>.md` should follow:
|
|
|
149
149
|
|
|
150
150
|
### Related Specs
|
|
151
151
|
|
|
152
|
-
- `.
|
|
152
|
+
- `.cstl/spec/xxx.md` — <description>
|
|
153
153
|
|
|
154
154
|
## Caveats / Not Found
|
|
155
155
|
|
|
@@ -10,15 +10,15 @@ Native Cursor API (no Cursor++): stop — this does not apply; agent frontmatter
|
|
|
10
10
|
|
|
11
11
|
Confirm the Cursor++ data directory exists:
|
|
12
12
|
|
|
13
|
-
- `~/.ccursor/providers.json` (or a custom path in `.
|
|
13
|
+
- `~/.ccursor/providers.json` (or a custom path in `.cstl/local/cursor2plus/config.local.json`)
|
|
14
14
|
|
|
15
15
|
If missing, Cursor++ is not set up — ask the user to install/configure it first.
|
|
16
16
|
|
|
17
17
|
## Step 2: List available models + roles
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
|
-
python ./.
|
|
21
|
-
python ./.
|
|
20
|
+
python ./.cstl/local/cursor2plus/patch_wpelc8.py --list-models
|
|
21
|
+
python ./.cstl/local/cursor2plus/patch_wpelc8.py --explain
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
`--list-models` shows the model catalog (apiModel / displayName / slug / provider) from `providers.json`.
|
|
@@ -35,7 +35,7 @@ The user may skip types they don't use — omit those from the map.
|
|
|
35
35
|
|
|
36
36
|
## Step 4: Write the routing map
|
|
37
37
|
|
|
38
|
-
Write `~/.ccursor/trellis-task-models.json5` (or `~/.ccursor/` on Unix) using the structure from `.
|
|
38
|
+
Write `~/.ccursor/trellis-task-models.json5` (or `~/.ccursor/` on Unix) using the structure from `.cstl/local/trellis-task-models.json5.example`:
|
|
39
39
|
|
|
40
40
|
```json5
|
|
41
41
|
// Trellis + Cursor++ BYOK — per-subagent-type model routing
|
|
@@ -49,13 +49,13 @@ Write `~/.ccursor/trellis-task-models.json5` (or `~/.ccursor/` on Unix) using th
|
|
|
49
49
|
}
|
|
50
50
|
```
|
|
51
51
|
|
|
52
|
-
Project-level override (optional, wins on same key): `.
|
|
52
|
+
Project-level override (optional, wins on same key): `.cstl/local/subagent-models.json5`.
|
|
53
53
|
|
|
54
54
|
## Step 5: Apply the patch + verify
|
|
55
55
|
|
|
56
56
|
```bash
|
|
57
|
-
python ./.
|
|
58
|
-
python ./.
|
|
57
|
+
python ./.cstl/local/cursor2plus/patch_wpelc8.py --print-map
|
|
58
|
+
python ./.cstl/local/cursor2plus/patch_wpelc8.py
|
|
59
59
|
```
|
|
60
60
|
|
|
61
61
|
Then tell the user: **Developer: Reload Window** in Cursor (required once per patch for the resolver change to take effect).
|
|
@@ -76,7 +76,7 @@ Then tell the user: **Developer: Reload Window** in Cursor (required once per pa
|
|
|
76
76
|
|
|
77
77
|
- User catalog: `~/.ccursor/providers.json`
|
|
78
78
|
- User routing doc: `~/.ccursor/trellis-task-models.json5` (machine-local, gitignored)
|
|
79
|
-
- Project override (optional): `.
|
|
80
|
-
- Patch bundle: `.
|
|
79
|
+
- Project override (optional): `.cstl/local/subagent-models.json5`
|
|
80
|
+
- Patch bundle: `.cstl/local/cursor2plus/`
|
|
81
81
|
|
|
82
|
-
Policy: `.
|
|
82
|
+
Policy: `.cstl/spec/guides/cursor-subagent-policy.md` (Method 2.5 / 2.6).
|
|
@@ -14,7 +14,7 @@ Before calling `Task(subagent_type="cstl-research|cstl-implement|cstl-check", ..
|
|
|
14
14
|
1. Generate a complete dispatch prompt via CLI:
|
|
15
15
|
|
|
16
16
|
```powershell
|
|
17
|
-
python ./.
|
|
17
|
+
python ./.cstl/scripts/generate_dispatch_prompt.py --agent <research|implement|check> --task "<task-path>" --repo-root "<repo-root>"
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
2. Use the CLI output as the `prompt` parameter value for `Task(...)`.
|
|
@@ -27,7 +27,7 @@ The generated prompt carries role identity ("You are the Trellis Research/Implem
|
|
|
27
27
|
|
|
28
28
|
## Auto-detection
|
|
29
29
|
|
|
30
|
-
If `--task` is omitted, the script resolves the currently selected task. If `--repo-root` is omitted, it auto-detects via `.
|
|
30
|
+
If `--task` is omitted, the script resolves the currently selected task. If `--repo-root` is omitted, it auto-detects via `.cstl` or `.git` upward search.
|
|
31
31
|
|
|
32
32
|
## Exception
|
|
33
33
|
|
|
@@ -33,6 +33,6 @@ If the user declines a task for a simple request, skip Trellis for this session.
|
|
|
33
33
|
|
|
34
34
|
## Why this rule exists
|
|
35
35
|
|
|
36
|
-
Cursor's `sessionStart` hook has a confirmed bug (#158452): `additional_context` is never injected into the agent's system context. The Triage rules in `.
|
|
36
|
+
Cursor's `sessionStart` hook has a confirmed bug (#158452): `additional_context` is never injected into the agent's system context. The Triage rules in `.cstl/workflow.md` therefore never reach you via that channel. This `.cursor/rules` file is the reliable workaround — Cursor prepends rules to your context before every prompt, independent of the broken sessionStart path.
|
|
37
37
|
|
|
38
|
-
Full decision-tree details, trigger-signal keywords, and the Task Ladder table: see `.
|
|
38
|
+
Full decision-tree details, trigger-signal keywords, and the Task Ladder table: see `.cstl/workflow.md` → `### Request Triage`.
|
|
@@ -18,13 +18,13 @@ If the user message or Trellis context contains a block starting with `## 代码
|
|
|
18
18
|
Generate a fresh plan when needed:
|
|
19
19
|
|
|
20
20
|
```powershell
|
|
21
|
-
python ./.
|
|
21
|
+
python ./.cstl/scripts/route_codebase_retrieval.py "<question>" --instructions
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
JSON (includes `agentInstructions`):
|
|
25
25
|
|
|
26
26
|
```powershell
|
|
27
|
-
python ./.
|
|
27
|
+
python ./.cstl/scripts/route_codebase_retrieval.py "<question>" --json
|
|
28
28
|
```
|
|
29
29
|
|
|
30
30
|
## Default tool order (no plan block)
|
|
@@ -36,7 +36,7 @@ python ./.trellis/scripts/route_codebase_retrieval.py "<question>" --json
|
|
|
36
36
|
| Same name across packages (trap) | **codegraph_search** / **codegraph_explore** → Grep |
|
|
37
37
|
| Extension symbols | **codegraph_search** under `extensions/` |
|
|
38
38
|
| Conceptual / how does X work | **Native:** built-in `@codebase` / semantic search. **BYOK:** **fast_context_search** (fast-context MCP). Plans show `cursorEnv`. |
|
|
39
|
-
| Policy / architecture / boundaries / storage rules | **Grep** on `AGENTS.md`, `**/AGENTS.md`, `.
|
|
39
|
+
| Policy / architecture / boundaries / storage rules | **Grep** on `AGENTS.md`, `**/AGENTS.md`, `.cstl/spec/**`, `README.md` (router `policy-docs-rg`) before implementation modules |
|
|
40
40
|
| Definition jump | **codegraph_node** / **codegraph_search**, then **Read** (Agent does not expose GO_TO_DEFINITION / LSP) |
|
|
41
41
|
| Wide cross-cutting explore | **Native:** DEEP_SEARCH or Explore subagent. **BYOK:** **Task explore** subagent, then Grep/codegraph/Read |
|
|
42
42
|
|
|
@@ -56,4 +56,4 @@ Use codegraph for **call chains**, **cross-package trap disambiguation**, **exte
|
|
|
56
56
|
|
|
57
57
|
## External facts
|
|
58
58
|
|
|
59
|
-
Web/current events: **smart-search** first per `.
|
|
59
|
+
Web/current events: **smart-search** first per `.cstl/spec/guides/retrieval-daily-guide.md`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
type TemplateCategory = "scripts" | "markdown" | "commands";
|
|
2
2
|
/**
|
|
3
|
-
* Get the path to the trellis templates directory (.
|
|
3
|
+
* Get the path to the trellis templates directory (.cstl/ scaffolding).
|
|
4
4
|
*/
|
|
5
5
|
export declare function getTrellisTemplatePath(): string;
|
|
6
6
|
/** @deprecated Use getTrellisTemplatePath() instead. */
|
|
@@ -6,7 +6,7 @@ import { replacePythonCommandLiterals } from "../configurators/shared.js";
|
|
|
6
6
|
const __filename = fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = path.dirname(__filename);
|
|
8
8
|
/**
|
|
9
|
-
* Get the path to the trellis templates directory (.
|
|
9
|
+
* Get the path to the trellis templates directory (.cstl/ scaffolding).
|
|
10
10
|
*/
|
|
11
11
|
export function getTrellisTemplatePath() {
|
|
12
12
|
const templatePath = path.join(__dirname, "trellis");
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
# Trellis Instructions
|
|
1
|
+
<!-- CSTL:START -->
|
|
2
|
+
# Cursor-Trellis (cstl) Instructions
|
|
3
3
|
|
|
4
4
|
These instructions are for AI assistants working in this project.
|
|
5
5
|
|
|
6
|
-
This project is managed by
|
|
6
|
+
This project is managed by cursor-trellis. The working knowledge you need lives under `.cstl/`:
|
|
7
7
|
|
|
8
|
-
- `.
|
|
9
|
-
- `.
|
|
10
|
-
- `.
|
|
11
|
-
- `.
|
|
8
|
+
- `.cstl/workflow.md` — development phases, when to create tasks, skill routing
|
|
9
|
+
- `.cstl/spec/` — package- and layer-scoped coding guidelines (read before writing code in a given layer)
|
|
10
|
+
- `.cstl/workspace/` — per-developer journals and session traces
|
|
11
|
+
- `.cstl/tasks/` — active and archived tasks (PRDs, research, jsonl context)
|
|
12
12
|
|
|
13
|
-
If a
|
|
13
|
+
If a cstl command is available on Cursor (e.g. `cstl-finish-work`, `cstl-continue`), prefer it over manual steps.
|
|
14
14
|
|
|
15
15
|
## Command surface (what is user-invocable vs internal)
|
|
16
16
|
|
|
@@ -21,8 +21,8 @@ Only a handful of Trellis entry points are meant for **manual `/` invocation**.
|
|
|
21
21
|
|
|
22
22
|
## Web research routing (smart-search first)
|
|
23
23
|
|
|
24
|
-
For **any external / current / web fact**, run **`python ./.
|
|
24
|
+
For **any external / current / web fact**, run **`python ./.cstl/scripts/run_smart_search.py "<question>" --intent deep-research --json`** first. That script is the **only** Trellis web-research evidence entrypoint (it shells out to the `smart-search` CLI). Do not guess paths under package source trees or sibling repos. Platform built-in web tools (Cursor `WebSearch` / `WebFetch`, or native web tools elsewhere) are **downgrade-only fallbacks**, used solely when smart-search is unavailable (`doctor` not ok, status `not_configured` / `failed`, or search timeout). Do not reach for built-in web search while smart-search is healthy. On Cursor, `smart-search-cli` is an **internal workflow skill name** only (not shipped under `.cursor/skills/`); follow `.cstl/spec/guides/retrieval-daily-guide.md` and `.cursor/rules/retrieval-routing.mdc` for the executable contract.
|
|
25
25
|
|
|
26
|
-
Managed by
|
|
26
|
+
Managed by cursor-trellis. Edits outside this block are preserved; edits inside may be overwritten by a future `cstl update`.
|
|
27
27
|
|
|
28
|
-
<!--
|
|
28
|
+
<!-- CSTL:END -->
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
For each query in `queries-semantic-slice.jsonl`:
|
|
8
8
|
|
|
9
9
|
```powershell
|
|
10
|
-
python .
|
|
10
|
+
python .cstl/scripts/route_codebase_retrieval.py "<question>" --json
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
Record `semantic_in_plan` / route list from the envelope.
|
|
@@ -40,7 +40,7 @@ print("Run: script.py <args>")
|
|
|
40
40
|
|
|
41
41
|
# GOOD - Platform-aware wording
|
|
42
42
|
print("Usage: python on Windows, python3 elsewhere")
|
|
43
|
-
print("Run: {{PYTHON_CMD}} ./.
|
|
43
|
+
print("Run: {{PYTHON_CMD}} ./.cstl/scripts/task.py <args>")
|
|
44
44
|
```
|
|
45
45
|
|
|
46
46
|
**Rule 2**: When generating config files at init time, use placeholder + platform detection:
|
|
@@ -356,7 +356,7 @@ When making platform-related changes, check **all these locations**:
|
|
|
356
356
|
|
|
357
357
|
### Code Locations
|
|
358
358
|
- [ ] `src/templates/` - Template files for new projects
|
|
359
|
-
- [ ] `.
|
|
359
|
+
- [ ] `.cstl/scripts/` - Project's own scripts (if self-hosting)
|
|
360
360
|
- [ ] `dist/` - Built output (rebuild after changes)
|
|
361
361
|
|
|
362
362
|
### Search Pattern
|
|
@@ -530,7 +530,7 @@ subprocess.run(["./script.py"]) # FileNotFoundError
|
|
|
530
530
|
|
|
531
531
|
```
|
|
532
532
|
src/templates/script.py ← Updated
|
|
533
|
-
.
|
|
533
|
+
.cstl/scripts/script.py ← Forgot to sync!
|
|
534
534
|
```
|
|
535
535
|
|
|
536
536
|
### 4. "Python 3 is always python3"
|
|
@@ -606,7 +606,7 @@ included with Trellis, verify the whole distribution path:
|
|
|
606
606
|
- [ ] `pnpm build` copies the asset into `dist/templates/**`.
|
|
607
607
|
- [ ] `npm pack --dry-run --json` includes the expected `dist/**` path.
|
|
608
608
|
- [ ] The built binary installs the asset in a fresh temp repository.
|
|
609
|
-
- [ ] `.
|
|
609
|
+
- [ ] `.cstl/.template-hashes.json` tracks the generated asset path.
|
|
610
610
|
- [ ] `cstl update --dry-run` reports `Already up to date!` in that temp
|
|
611
611
|
repository.
|
|
612
612
|
|
|
@@ -628,7 +628,7 @@ git -C "$tmpdir" init -q
|
|
|
628
628
|
cd "$tmpdir"
|
|
629
629
|
node /path/to/Trellis/packages/cli/bin/trellis.js init -u smoke --yes --cursor
|
|
630
630
|
test -f .cursor/skills/<skill>/SKILL.md
|
|
631
|
-
grep -q '<skill>' .
|
|
631
|
+
grep -q '<skill>' .cstl/.template-hashes.json
|
|
632
632
|
node /path/to/Trellis/packages/cli/bin/trellis.js update --dry-run
|
|
633
633
|
)
|
|
634
634
|
```
|
|
@@ -14,7 +14,7 @@ Cursor has **four** channels that can put text in front of the model. They are *
|
|
|
14
14
|
| `beforeSubmitPrompt` hook → `additional_context` | Per user message; router emits `## 代码库检索计划` | ⚠️ **Verify on your Cursor build** (docs list field; forum reports vary) | `inject-retrieval-plan.py` + `retrieval-routing.mdc` enforcement |
|
|
15
15
|
| `AGENTS.md` (repo root + nested) | Read automatically, treated as an always-on rule | ✅ **Yes** | smart-search-first rule, command surface, remote policy (the `<!-- TRELLIS:START -->` block) |
|
|
16
16
|
| `sessionStart` hook → `additional_context` | Hook fires, JSON parsed... **but content never reaches the model's system context** | ❌ **No (confirmed bug)** | workflow.md Phase Index + Task Dashboard + first-reply notice |
|
|
17
|
-
| `.
|
|
17
|
+
| `.cstl/workflow.md` (read on demand) | Only if the agent explicitly runs `get_context.py` or reads the file | ⚠️ Depends on agent taking action | Full Request Triage section, Task Ladder, workflow-state breadcrumbs |
|
|
18
18
|
| **`task.py generate-dispatch-prompt` → Task `prompt`** (CLI Layer 2) | Main session runs Trellis script before `Task(...)` | ✅ **Yes (primary for subagent task context on Cursor)** | Full embed: marker, `Selected task:`, prd/jsonl/spec bodies |
|
|
19
19
|
|
|
20
20
|
**Key takeaway**: anything that must reach the model **every turn without the agent choosing to load it** must live in `.cursor/rules` or `AGENTS.md`. Subagent task context on Cursor uses **CLI Layer 2** before Task dispatch; `preToolUse` hook injection is best-effort only (see forum reports + 2026-06-22 spike). Anything in `workflow.md` that depends on `sessionStart` injection is **invisible to Cursor agents** until the bug is fixed.
|
|
@@ -45,7 +45,7 @@ Because of the bug, Trellis routes content by reliability on Cursor:
|
|
|
45
45
|
| **Request Triage hard gate** (classify every turn, emit `[Triage: <Mode>]`) | `.cursor/rules/cstl-triage.mdc` (`alwaysApply: true`) | Must be visible every turn; sessionStart path is broken |
|
|
46
46
|
| **smart-search-first web routing** | `AGENTS.md` (TRELLIS:START block) | AGENTS.md is a reliable always-on channel |
|
|
47
47
|
| **Command surface** (what's user-invocable vs internal skill) | `AGENTS.md` (TRELLIS:START block) | Same |
|
|
48
|
-
| **Workflow phases, Task Ladder, workflow-state breadcrumbs** | `.
|
|
48
|
+
| **Workflow phases, Task Ladder, workflow-state breadcrumbs** | `.cstl/workflow.md` | Loaded on demand via `get_context.py` / `cstl-start` / `cstl-continue`; NOT auto-injected on Cursor |
|
|
49
49
|
|
|
50
50
|
**If a new "must-always-be-visible" rule is added to Trellis**: ship it as a `.cursor/rules/*.mdc` (Cursor) — do **not** rely on adding it to `workflow.md` and expecting sessionStart to deliver it.
|
|
51
51
|
|
|
@@ -62,6 +62,6 @@ Because of the bug, Trellis routes content by reliability on Cursor:
|
|
|
62
62
|
## Related
|
|
63
63
|
|
|
64
64
|
- `cursor-subagent-policy.md` — Task tool scenes, model routing (this guide is about **context injection**, that one is about **subagent dispatch**).
|
|
65
|
-
- `.
|
|
65
|
+
- `.cstl/workflow.md` → `### Request Triage` — the full Triage decision tree (the rule in `.cursor/rules/cstl-triage.mdc` is the slim always-apply version pointing here).
|
|
66
66
|
- Task `06-19-cursor-rules-triage` (archive) — the investigation that produced this guide.
|
|
67
67
|
- Cursor forum thread: https://forum.cursor.com/t/sessionstart-hook-additional-context-is-never-injected-into-agents-initial-system-context/158452
|