@blxzer/cursor-trellis 0.1.2 → 0.2.1
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 +58 -0
- package/README.md +45 -21
- package/dist/configurators/workflow.d.ts +1 -1
- package/dist/configurators/workflow.d.ts.map +1 -1
- package/dist/configurators/workflow.js +20 -9
- package/dist/configurators/workflow.js.map +1 -1
- package/dist/migrations/manifests/0.1.3.json +9 -0
- package/dist/migrations/manifests/0.1.4.json +9 -0
- package/dist/templates/cursor/rules/retrieval-routing.mdc +9 -7
- package/dist/templates/markdown/agents.md +1 -1
- package/dist/templates/markdown/index.d.ts +1 -0
- package/dist/templates/markdown/index.d.ts.map +1 -1
- package/dist/templates/markdown/index.js +1 -0
- package/dist/templates/markdown/index.js.map +1 -1
- package/dist/templates/markdown/prompts/run-semantic-slice-12.md.txt +13 -29
- package/dist/templates/markdown/spec/guides/code-reuse-thinking-guide.md.txt +0 -49
- package/dist/templates/markdown/spec/guides/cross-layer-thinking-guide.md.txt +0 -85
- package/dist/templates/markdown/spec/guides/cursor-semantic-compliance.md.txt +7 -21
- package/dist/templates/markdown/spec/guides/cursor-subagent-policy.md.txt +6 -10
- package/dist/templates/markdown/spec/guides/retrieval-daily-guide.md.txt +17 -18
- package/dist/templates/shared-hooks/inject-retrieval-plan.py +42 -23
- package/dist/templates/shared-hooks/inject-subagent-context.py +6 -2
- package/dist/templates/shared-hooks/session-start.py +17 -9
- package/dist/templates/trellis/index.d.ts +8 -4
- package/dist/templates/trellis/index.d.ts.map +1 -1
- package/dist/templates/trellis/index.js +13 -7
- package/dist/templates/trellis/index.js.map +1 -1
- package/dist/templates/trellis/scripts/common/codebase_retrieval_router.py +80 -31
- package/dist/templates/trellis/scripts/common/config.py +1 -1
- package/dist/templates/trellis/scripts/common/cursor_retrieval_env.py +92 -0
- package/dist/templates/trellis/scripts/common/parent_orchestration.py +27 -15
- package/dist/templates/trellis/scripts/common/retrieval_adapter_metadata.py +100 -9
- package/dist/templates/trellis/scripts/common/retrieval_agent_instructions.py +76 -31
- package/dist/templates/trellis/scripts/common/retrieval_tool_classification.py +18 -3
- package/dist/templates/trellis/scripts/common/semantic_plan_gate.py +19 -0
- package/dist/templates/trellis/scripts/common/smart_search_evidence.py +5 -2
- package/dist/templates/trellis/scripts/common/smart_search_resolve.py +28 -3
- package/dist/templates/trellis/scripts/common/task_gates.py +372 -73
- package/dist/templates/trellis/scripts/common/task_map.py +29 -1
- package/dist/templates/trellis/scripts/cursor_retrieval_probe.py +396 -0
- package/dist/templates/trellis/scripts/cursor_retrieval_probe_prompt.md +300 -0
- package/dist/templates/trellis/scripts/retrieval_probe_matrix_template.json +126 -0
- package/dist/templates/trellis/workflow.md +9 -53
- package/dist/utils/codebase-retrieval-router.d.ts +5 -0
- package/dist/utils/codebase-retrieval-router.d.ts.map +1 -1
- package/dist/utils/codebase-retrieval-router.js +48 -28
- package/dist/utils/codebase-retrieval-router.js.map +1 -1
- package/dist/utils/cursor-retrieval-env.d.ts +28 -0
- package/dist/utils/cursor-retrieval-env.d.ts.map +1 -0
- package/dist/utils/cursor-retrieval-env.js +89 -0
- package/dist/utils/cursor-retrieval-env.js.map +1 -0
- package/dist/utils/project-capabilities.d.ts.map +1 -1
- package/dist/utils/project-capabilities.js +22 -15
- package/dist/utils/project-capabilities.js.map +1 -1
- package/dist/utils/retrieval-agent-instructions.d.ts.map +1 -1
- package/dist/utils/retrieval-agent-instructions.js +37 -21
- package/dist/utils/retrieval-agent-instructions.js.map +1 -1
- package/dist/utils/retrieval-tool-classification.d.ts +2 -0
- package/dist/utils/retrieval-tool-classification.d.ts.map +1 -1
- package/dist/utils/retrieval-tool-classification.js +10 -2
- package/dist/utils/retrieval-tool-classification.js.map +1 -1
- package/dist/utils/semantic-plan-gate.d.ts +8 -0
- package/dist/utils/semantic-plan-gate.d.ts.map +1 -0
- package/dist/utils/semantic-plan-gate.js +42 -0
- package/dist/utils/semantic-plan-gate.js.map +1 -0
- package/package.json +5 -43
- package/bin/smart-search.js +0 -79
- package/dist/templates/trellis/scripts/aggregate_retrieval_telemetry.py +0 -342
- package/dist/templates/trellis/scripts/batch_plan_envelope.py +0 -105
- package/vendor/smart-search/LICENSE +0 -21
- package/vendor/smart-search/README.md +0 -412
- package/vendor/smart-search/README.zh-CN.md +0 -430
- package/vendor/smart-search/npm/bin/smart-search.js +0 -63
- package/vendor/smart-search/npm/scripts/postinstall.js +0 -87
- package/vendor/smart-search/npm/scripts/resolve-prerelease-version.js +0 -108
- package/vendor/smart-search/npm/scripts/set-package-version.js +0 -35
- package/vendor/smart-search/npm/scripts/sync-python-version.js +0 -22
- package/vendor/smart-search/npm/scripts/test-wrapper-repair.js +0 -99
- package/vendor/smart-search/npm/scripts/test.js +0 -85
- package/vendor/smart-search/package.json +0 -42
- package/vendor/smart-search/pyproject.toml +0 -37
- package/vendor/smart-search/skills/smart-search-cli/SKILL.md +0 -387
- package/vendor/smart-search/skills/smart-search-cli/agents/openai.yaml +0 -3
- package/vendor/smart-search/skills/smart-search-cli/examples/batch-search.md +0 -98
- package/vendor/smart-search/skills/smart-search-cli/examples/evidence-gathering.md +0 -89
- package/vendor/smart-search/skills/smart-search-cli/references/cli-contract.md +0 -337
- package/vendor/smart-search/src/smart_search/__init__.py +0 -1
- package/vendor/smart-search/src/smart_search/assets/skills/smart-search-cli/SKILL.md +0 -387
- package/vendor/smart-search/src/smart_search/assets/skills/smart-search-cli/agents/openai.yaml +0 -3
- package/vendor/smart-search/src/smart_search/assets/skills/smart-search-cli/examples/batch-search.md +0 -98
- package/vendor/smart-search/src/smart_search/assets/skills/smart-search-cli/examples/evidence-gathering.md +0 -89
- package/vendor/smart-search/src/smart_search/assets/skills/smart-search-cli/references/cli-contract.md +0 -337
- package/vendor/smart-search/src/smart_search/cli.py +0 -2003
- package/vendor/smart-search/src/smart_search/config.py +0 -580
- package/vendor/smart-search/src/smart_search/logger.py +0 -43
- package/vendor/smart-search/src/smart_search/providers/__init__.py +0 -16
- package/vendor/smart-search/src/smart_search/providers/base.py +0 -41
- package/vendor/smart-search/src/smart_search/providers/context7.py +0 -141
- package/vendor/smart-search/src/smart_search/providers/exa.py +0 -206
- package/vendor/smart-search/src/smart_search/providers/jina.py +0 -136
- package/vendor/smart-search/src/smart_search/providers/openai_compatible.py +0 -370
- package/vendor/smart-search/src/smart_search/providers/zhipu.py +0 -143
- package/vendor/smart-search/src/smart_search/service.py +0 -2865
- package/vendor/smart-search/src/smart_search/sources.py +0 -429
- package/vendor/smart-search/src/smart_search/utils.py +0 -220
package/CHANGELOG.md
CHANGED
|
@@ -9,6 +9,64 @@ SemVer: [semver.org](https://semver.org/spec/v2.0.0.html).
|
|
|
9
9
|
|
|
10
10
|
---
|
|
11
11
|
|
|
12
|
+
## [0.1.4] - 2026-06-24
|
|
13
|
+
|
|
14
|
+
Aligned **@blxzer/cursor-trellis** and **@blxzer/cursor-trellis-core** at `0.1.4` (fixes core/cli version drift since the in-repo `0.1.3` bump).
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
|
|
18
|
+
- Gate verify transition contract: stricter Parent archive, Full Child accept, `record-gate` placeholder rejection, integrate-through guards (7 CLI integration tests).
|
|
19
|
+
- `cursor-context-injection-guide.md` included in default `trellis init` spec guides.
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
|
|
23
|
+
- `trellis init` writes `.trellis/scripts/` from `getAllScripts()` only (same source as `trellis update`) — maintainer probe/eval scripts no longer copied into user projects.
|
|
24
|
+
- User-facing spec guides and `workflow.md` cleaned of Trellis maintainer / harness paths; default workflow no longer documents npm release execution.
|
|
25
|
+
- Removed shipped `aggregate_retrieval_telemetry.py` and `batch_plan_envelope.py` (maintainer eval tooling).
|
|
26
|
+
|
|
27
|
+
### Upgrade
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npm install -g @blxzer/cursor-trellis@0.1.4
|
|
31
|
+
# In each project:
|
|
32
|
+
trellis update
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
**Behavior change:** archive and gate checks may fail where placeholder evidence or incomplete Parent/Child handoff previously passed. Review `verify.md` and run `task.py archive <task> --check` after upgrade.
|
|
36
|
+
|
|
37
|
+
[0.1.4]: https://github.com/blxzer77/cursor-trellis/releases/tag/v0.1.4
|
|
38
|
+
|
|
39
|
+
## [0.1.3] - 2026-06-23
|
|
40
|
+
|
|
41
|
+
In-repo bump only (never published as an aligned core/cli pair). Included here for continuity.
|
|
42
|
+
|
|
43
|
+
### Added
|
|
44
|
+
|
|
45
|
+
- Cursor BYOK/native semantic routing, Experiment D retrieval probes, adapter metadata.
|
|
46
|
+
- Hook health fixes for Native Cursor and Cursor++ BYOK paths.
|
|
47
|
+
|
|
48
|
+
### Changed
|
|
49
|
+
|
|
50
|
+
- Smart-search wrapper status detection and timeout handling; clearer npm CLI resolver paths.
|
|
51
|
+
|
|
52
|
+
## [0.1.2] - 2026-06-22
|
|
53
|
+
|
|
54
|
+
### Added
|
|
55
|
+
|
|
56
|
+
- `task.py generate-dispatch-prompt` (Layer 2 subagent context assembly before `Task(...)`).
|
|
57
|
+
- Shared `common/subagent_dispatch.py` builder; slim `preToolUse` hook wrapper.
|
|
58
|
+
|
|
59
|
+
[0.1.2]: https://github.com/blxzer77/cursor-trellis/releases/tag/v0.1.2
|
|
60
|
+
|
|
61
|
+
## [0.1.1] - 2026-06-21
|
|
62
|
+
|
|
63
|
+
### Changed
|
|
64
|
+
|
|
65
|
+
- Cursor-only product trim: platform registry, init/update/uninstall, and retrieval router reduced to Cursor.
|
|
66
|
+
- Workflow, AGENTS, README, and guides aligned to Cursor-only surface.
|
|
67
|
+
|
|
68
|
+
[0.1.1]: https://github.com/blxzer77/cursor-trellis/releases/tag/v0.1.1
|
|
69
|
+
|
|
12
70
|
## [0.1.0] - 2026-06-20
|
|
13
71
|
|
|
14
72
|
First public release under `@blxzer/cursor-trellis` / `@blxzer/cursor-trellis-core`.
|
package/README.md
CHANGED
|
@@ -2,23 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
English | [简体中文](README.zh-CN.md)
|
|
4
4
|
|
|
5
|
-
**Trellis** is a
|
|
5
|
+
**Trellis** is a progressive context management system for AI coding agents. It structures agent instructions as `.trellis/` (workflow, specs, tasks, workspace) instead of a single large file, and generates platform-specific integration files (`.cursor/` for Cursor).
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Based on the [Trellis framework by mindfold-ai](https://github.com/mindfold-ai/Trellis), this version is adapted for Cursor with rules, commands, agents, and hooks.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
| --- | --- |
|
|
11
|
-
| **npm CLI** | `@blxzer/cursor-trellis` (`trellis`, `tl`, `smart-search`) |
|
|
12
|
-
| **Core SDK** | `@blxzer/cursor-trellis-core` |
|
|
13
|
-
| **This repo** | https://github.com/blxzer77/cursor-trellis |
|
|
9
|
+
## What it does
|
|
14
10
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
- **Platform drift**: Cursor rules, commands, hooks, and agents each need the right shape.
|
|
20
|
-
|
|
21
|
-
Trellis generates the **Cursor adapter** (`.cursor/`) for your stack. This fork is **Cursor-only** for init and public docs (see [docs/cursor.md](docs/cursor.md)).
|
|
11
|
+
- Task artifacts (PRD, design, implementation plan) persist in `.trellis/tasks/`
|
|
12
|
+
- Resume work across chat sessions with `/trellis-continue`
|
|
13
|
+
- Load specs progressively based on files being edited
|
|
14
|
+
- Route requests through structured workflow: triage → plan → gate → execute → verify
|
|
22
15
|
|
|
23
16
|
## Quick start (Cursor)
|
|
24
17
|
|
|
@@ -79,6 +72,35 @@ Walkthrough: [docs/workflow.md](docs/workflow.md).
|
|
|
79
72
|
|
|
80
73
|
Deep dive: [docs/cursor.md](docs/cursor.md).
|
|
81
74
|
|
|
75
|
+
## When to use
|
|
76
|
+
|
|
77
|
+
- Multi-file refactoring that needs architecture consistency
|
|
78
|
+
- Long-running feature development spanning multiple sessions
|
|
79
|
+
- Projects with custom coding standards agents must follow
|
|
80
|
+
- Tasks requiring research → design → implement → verify workflow
|
|
81
|
+
|
|
82
|
+
Not needed for quick one-file edits or exploratory coding.
|
|
83
|
+
|
|
84
|
+
## smart-search integration
|
|
85
|
+
|
|
86
|
+
Trellis integrates with [smart-search](https://github.com/blxzer77/smart-search), a CLI tool for agents to retrieve current information from the web. smart-search is automatically installed as a dependency when you install cursor-trellis.
|
|
87
|
+
|
|
88
|
+
**Installation:**
|
|
89
|
+
|
|
90
|
+
When you install cursor-trellis, smart-search is installed automatically:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
npm install -g @blxzer/cursor-trellis
|
|
94
|
+
# smart-search is now available
|
|
95
|
+
smart-search --version
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
**Links:**
|
|
99
|
+
- npm package: https://www.npmjs.com/package/@blxzer/smart-search
|
|
100
|
+
- GitHub repository: https://github.com/blxzer77/smart-search
|
|
101
|
+
|
|
102
|
+
The workflow routes external fact queries to smart-search when available. See the repository for configuration and usage details.
|
|
103
|
+
|
|
82
104
|
## Common commands
|
|
83
105
|
|
|
84
106
|
| Command | Purpose |
|
|
@@ -87,15 +109,17 @@ Deep dive: [docs/cursor.md](docs/cursor.md).
|
|
|
87
109
|
| `trellis update` | Refresh templates from the installed CLI version |
|
|
88
110
|
| `trellis uninstall` | Remove Trellis-managed files from the project |
|
|
89
111
|
|
|
90
|
-
|
|
112
|
+
Full CLI reference: [packages/cli/README.md](packages/cli/README.md).
|
|
91
113
|
|
|
92
|
-
|
|
114
|
+
## Package information
|
|
93
115
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
116
|
+
| | |
|
|
117
|
+
| --- | --- |
|
|
118
|
+
| **npm CLI** | `@blxzer/cursor-trellis` (`trellis`, `tl`) |
|
|
119
|
+
| **Core SDK** | `@blxzer/cursor-trellis-core` |
|
|
120
|
+
| **smart-search** | `@blxzer/smart-search` (auto-installed dependency) |
|
|
121
|
+
| **Repository** | https://github.com/blxzer77/cursor-trellis |
|
|
122
|
+
| **Original Trellis** | [mindfold-ai/Trellis](https://github.com/mindfold-ai/Trellis) |
|
|
99
123
|
|
|
100
124
|
## Development and verification
|
|
101
125
|
|
|
@@ -33,7 +33,7 @@ export interface WorkflowOptions {
|
|
|
33
33
|
* Create workflow structure based on project type
|
|
34
34
|
*
|
|
35
35
|
* This function creates the .trellis/ directory structure by:
|
|
36
|
-
* 1.
|
|
36
|
+
* 1. Writing scripts/ from getAllScripts() (user-shipped subset only)
|
|
37
37
|
* 2. Copying workflow.md and .gitignore (dogfooding)
|
|
38
38
|
* 3. Creating workspace/ with index.md
|
|
39
39
|
* 4. Creating tasks/ directory
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../../src/configurators/workflow.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../../src/configurators/workflow.ts"],"names":[],"mappings":"AA0CA,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,eAAe,EACrB,MAAM,8BAA8B,CAAC;AAOtC;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,yCAAyC;IACzC,WAAW,EAAE,WAAW,CAAC;IACzB,yFAAyF;IACzF,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,kEAAkE;IAClE,QAAQ,CAAC,EAAE,eAAe,EAAE,CAAC;IAC7B,0EAA0E;IAC1E,kBAAkB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACjC;;;;;;OAMG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;;;;;OAOG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,uBAAuB,CAC3C,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,eAAe,GACxB,OAAO,CAAC,IAAI,CAAC,CAsDf"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import { DIR_NAMES, PATHS } from "../constants/paths.js";
|
|
3
|
-
import {
|
|
4
|
-
// Import trellis templates (generic, not project-specific)
|
|
5
|
-
import { workflowMdTemplate, configYamlTemplate, gitignoreTemplate, } from "../templates/trellis/index.js";
|
|
3
|
+
import { getAllScripts, workflowMdTemplate, configYamlTemplate, gitignoreTemplate, } from "../templates/trellis/index.js";
|
|
6
4
|
// Import markdown templates
|
|
7
5
|
import { agentProgressIndexContent,
|
|
8
6
|
// Backend structure (multi-doc)
|
|
@@ -10,7 +8,7 @@ backendIndexContent, backendDirectoryStructureContent, backendDatabaseGuidelines
|
|
|
10
8
|
// Frontend structure (multi-doc)
|
|
11
9
|
frontendIndexContent, frontendDirectoryStructureContent, frontendTypeSafetyContent, frontendHookGuidelinesContent, frontendComponentGuidelinesContent, frontendQualityGuidelinesContent, frontendStateManagementContent,
|
|
12
10
|
// Guides structure
|
|
13
|
-
guidesIndexContent, guidesCrossLayerThinkingGuideContent, guidesCodeReuseThinkingGuideContent, guidesDurableLearningDecisionGuideContent, guidesRetrievalDailyGuideContent, guidesCursorSemanticComplianceContent, guidesCursorSubagentPolicyContent, } from "../templates/markdown/index.js";
|
|
11
|
+
guidesIndexContent, guidesCrossLayerThinkingGuideContent, guidesCodeReuseThinkingGuideContent, guidesDurableLearningDecisionGuideContent, guidesRetrievalDailyGuideContent, guidesCursorSemanticComplianceContent, guidesCursorSubagentPolicyContent, guidesCursorContextInjectionGuideContent, } from "../templates/markdown/index.js";
|
|
14
12
|
import { writeFile, ensureDir } from "../utils/file-writer.js";
|
|
15
13
|
import { replacePythonCommandLiterals } from "./shared.js";
|
|
16
14
|
import { writeCursor2plusLocalBundle } from "./cursor2plus-local.js";
|
|
@@ -19,7 +17,7 @@ import { sanitizePkgName, } from "../utils/project-detector.js";
|
|
|
19
17
|
* Create workflow structure based on project type
|
|
20
18
|
*
|
|
21
19
|
* This function creates the .trellis/ directory structure by:
|
|
22
|
-
* 1.
|
|
20
|
+
* 1. Writing scripts/ from getAllScripts() (user-shipped subset only)
|
|
23
21
|
* 2. Copying workflow.md and .gitignore (dogfooding)
|
|
24
22
|
* 3. Creating workspace/ with index.md
|
|
25
23
|
* 4. Creating tasks/ directory
|
|
@@ -36,10 +34,8 @@ export async function createWorkflowStructure(cwd, options) {
|
|
|
36
34
|
const workflowMd = options?.workflowMdOverride ?? workflowMdTemplate;
|
|
37
35
|
// Create base .trellis directory
|
|
38
36
|
ensureDir(path.join(cwd, DIR_NAMES.WORKFLOW));
|
|
39
|
-
//
|
|
40
|
-
await
|
|
41
|
-
executable: true,
|
|
42
|
-
});
|
|
37
|
+
// Write user-shipped Python scripts (same source of truth as trellis update)
|
|
38
|
+
await writeScriptTemplates(path.join(cwd, PATHS.SCRIPTS));
|
|
43
39
|
// Copy workflow.md (native bundled template or selected marketplace variant)
|
|
44
40
|
await writeFile(path.join(cwd, PATHS.WORKFLOW_GUIDE_FILE), replacePythonCommandLiterals(workflowMd));
|
|
45
41
|
// Copy .gitignore from templates
|
|
@@ -65,6 +61,17 @@ export async function createWorkflowStructure(cwd, options) {
|
|
|
65
61
|
await createSpecTemplates(cwd, projectType);
|
|
66
62
|
}
|
|
67
63
|
}
|
|
64
|
+
async function writeScriptTemplates(scriptsRoot) {
|
|
65
|
+
ensureDir(scriptsRoot);
|
|
66
|
+
for (const [scriptPath, content] of getAllScripts()) {
|
|
67
|
+
const destPath = path.join(scriptsRoot, scriptPath);
|
|
68
|
+
ensureDir(path.dirname(destPath));
|
|
69
|
+
const isExecutable = scriptPath.endsWith(".py");
|
|
70
|
+
await writeFile(destPath, replacePythonCommandLiterals(content), {
|
|
71
|
+
executable: isExecutable,
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}
|
|
68
75
|
/**
|
|
69
76
|
* Write backend spec docs into a target spec directory.
|
|
70
77
|
*/
|
|
@@ -160,6 +167,10 @@ async function createSpecTemplates(cwd, projectType, packages, remoteSpecPackage
|
|
|
160
167
|
name: "cursor-subagent-policy.md",
|
|
161
168
|
content: guidesCursorSubagentPolicyContent,
|
|
162
169
|
},
|
|
170
|
+
{
|
|
171
|
+
name: "cursor-context-injection-guide.md",
|
|
172
|
+
content: guidesCursorContextInjectionGuideContent,
|
|
173
|
+
},
|
|
163
174
|
];
|
|
164
175
|
for (const doc of guidesDocs) {
|
|
165
176
|
await writeFile(path.join(guidesDir, doc.name), doc.content);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow.js","sourceRoot":"","sources":["../../src/configurators/workflow.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,
|
|
1
|
+
{"version":3,"file":"workflow.js","sourceRoot":"","sources":["../../src/configurators/workflow.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,+BAA+B,CAAC;AAEvC,4BAA4B;AAC5B,OAAO,EACL,yBAAyB;AACzB,gCAAgC;AAChC,mBAAmB,EACnB,gCAAgC,EAChC,gCAAgC,EAChC,+BAA+B,EAC/B,+BAA+B,EAC/B,2BAA2B;AAC3B,iCAAiC;AACjC,oBAAoB,EACpB,iCAAiC,EACjC,yBAAyB,EACzB,6BAA6B,EAC7B,kCAAkC,EAClC,gCAAgC,EAChC,8BAA8B;AAC9B,mBAAmB;AACnB,kBAAkB,EAClB,oCAAoC,EACpC,mCAAmC,EACnC,yCAAyC,EACzC,gCAAgC,EAChC,qCAAqC,EACrC,iCAAiC,EACjC,wCAAwC,GACzC,MAAM,gCAAgC,CAAC;AAExC,OAAO,EAAE,SAAS,EAA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B,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE,WAAW,CAAC,CAAC;IAClE,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "0.1.3",
|
|
3
|
+
"description": "v0.1.3 — Retrieval BYOK/native semantic routing, Experiment D probes, smart-search resolver fixes, hook health for Native/BYOK.",
|
|
4
|
+
"breaking": false,
|
|
5
|
+
"recommendMigrate": false,
|
|
6
|
+
"changelog": "**Retrieval and hook reliability (unpublished aligned pair; core stayed 0.1.2 on disk — fixed in 0.1.4).**\n\n- feat(retrieval): Cursor BYOK/native semantic routing, codegraph LSP guidance, Experiment D probes, adapter metadata.\n- fix(smart-search): wrapper status detection, timeout handling, clearer npm CLI entrypoint paths.\n- fix(hooks): hook health repairs for Native and Cursor++ BYOK; session-start and subagent hook sync.\n- fix(templates): register `cursor_retrieval_probe` in template index.\n\nRun `trellis update` in each project to sync `.trellis/scripts`, hooks, and rules.",
|
|
7
|
+
"migrations": [],
|
|
8
|
+
"notes": "Backfilled manifest — v0.1.3 was bumped in-repo but never published as an aligned core/cli pair. Users on 0.1.2 should jump to 0.1.4."
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "0.1.4",
|
|
3
|
+
"description": "v0.1.4 — Aligned core/cli release, gate verify transition contract, init template boundary cleanup.",
|
|
4
|
+
"breaking": false,
|
|
5
|
+
"recommendMigrate": true,
|
|
6
|
+
"changelog": "**Aligned @blxzer/cursor-trellis + @blxzer/cursor-trellis-core at 0.1.4.**\n\n### Added\n- feat(cli): gate verify transition contract — Parent archive, Full Child accept, `record-gate` placeholder rejection, integrate-through guards (7 integration tests).\n- feat(guides): `cursor-context-injection-guide.md` shipped on `trellis init` (fixes index dead link).\n\n### Changed\n- fix(init): scripts written from `getAllScripts()` only (same as `trellis update`) — no longer copies maintainer probe/eval files into user projects.\n- refactor(templates): user-facing guides stripped of MyHarness / `packages/cli` / rsync maintainer prose; `workflow.md` release-execution section removed from default init.\n- chore(scripts): removed `aggregate_retrieval_telemetry.py` and `batch_plan_envelope.py` from shipped templates (maintainer eval tools).\n\n### Upgrade notes\n- Run `trellis update` in each project. If `.trellis/scripts/` still contains probe or telemetry scripts from an older init, update removes stale paths not in `getAllScripts()`.\n- **Behavior change:** `task.py archive --check` and Parent/Child gate flows are stricter — see gate integration tests and release notes.",
|
|
7
|
+
"migrations": [],
|
|
8
|
+
"notes": "First npm release with core and cli on the same version since 0.1.2."
|
|
9
|
+
}
|
|
@@ -13,7 +13,7 @@ If the user message or Trellis context contains a block starting with `## 代码
|
|
|
13
13
|
|
|
14
14
|
1. Execute steps **in order** before stating file paths or behavior claims.
|
|
15
15
|
2. Treat each step as mandatory tooling (not suggestions).
|
|
16
|
-
3. Finish with **Read**
|
|
16
|
+
3. Finish with **Read** verification on cited sources (definition jumps use **codegraph_node**, not LSP).
|
|
17
17
|
|
|
18
18
|
Generate a fresh plan when needed:
|
|
19
19
|
|
|
@@ -35,14 +35,16 @@ python ./.trellis/scripts/route_codebase_retrieval.py "<question>" --json
|
|
|
35
35
|
| Who calls / blast radius | **codegraph_callers** → Grep for imports/callbacks |
|
|
36
36
|
| Same name across packages (trap) | **codegraph_search** / **codegraph_explore** → Grep |
|
|
37
37
|
| Extension symbols | **codegraph_search** under `extensions/` |
|
|
38
|
-
| Conceptual / how does X work |
|
|
38
|
+
| Conceptual / how does X work | **Native:** built-in `@codebase` / semantic search. **BYOK:** **fast_context_search** (fast-context MCP). Plans show `cursorEnv`. |
|
|
39
39
|
| Policy / architecture / boundaries / storage rules | **Grep** on `AGENTS.md`, `**/AGENTS.md`, `.trellis/spec/**`, `README.md` (router `policy-docs-rg`) before implementation modules |
|
|
40
|
-
| Definition jump | **
|
|
41
|
-
| Wide cross-cutting explore | **DEEP_SEARCH
|
|
40
|
+
| Definition jump | **codegraph_node** / **codegraph_search**, then **Read** (Agent does not expose GO_TO_DEFINITION / LSP) |
|
|
41
|
+
| Wide cross-cutting explore | **Native:** DEEP_SEARCH or Explore subagent. **BYOK:** **Task explore** subagent, then Grep/codegraph/Read |
|
|
42
42
|
|
|
43
|
-
## Semantic on Cursor
|
|
43
|
+
## Semantic on Cursor (`platform-semantic`)
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
- **cursorEnv native:** built-in codebase semantic search (`platformNative`). Do **not** use fast-context MCP for semantic Primary.
|
|
46
|
+
- **cursorEnv byok:** **fast-context MCP** is **required** for concept retrieval; built-in `@codebase` is not available in the agent tool list.
|
|
47
|
+
- Override detection: `TRELLIS_CURSOR_BYOK=0|1` or `~/.ccursor/routes.json` `byokMode`.
|
|
46
48
|
|
|
47
49
|
## Result-layer ranking (B / E / D)
|
|
48
50
|
|
|
@@ -50,7 +52,7 @@ When the plan block includes **结果层排序**, apply it **after** collecting
|
|
|
50
52
|
|
|
51
53
|
## codegraph-only value
|
|
52
54
|
|
|
53
|
-
Use codegraph for **call chains**, **cross-package trap disambiguation**, **extension symbol resolution**, and **
|
|
55
|
+
Use codegraph for **call chains**, **cross-package trap disambiguation**, **extension symbol resolution**, **impact**, and **definition/reference** (replaces unavailable Agent LSP) — not for pure literal search (Grep) or BYOK concept Primary (use fast-context).
|
|
54
56
|
|
|
55
57
|
## External facts
|
|
56
58
|
|
|
@@ -21,7 +21,7 @@ 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**,
|
|
24
|
+
For **any external / current / web fact**, run **`python ./.trellis/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 `.trellis/spec/guides/retrieval-daily-guide.md` and `.cursor/rules/retrieval-routing.mdc` for the executable contract.
|
|
25
25
|
|
|
26
26
|
Managed by Trellis. Edits outside this block are preserved; edits inside may be overwritten by a future `trellis update`.
|
|
27
27
|
|
|
@@ -28,4 +28,5 @@ export declare const guidesDurableLearningDecisionGuideContent: string;
|
|
|
28
28
|
export declare const guidesRetrievalDailyGuideContent: string;
|
|
29
29
|
export declare const guidesCursorSemanticComplianceContent: string;
|
|
30
30
|
export declare const guidesCursorSubagentPolicyContent: string;
|
|
31
|
+
export declare const guidesCursorContextInjectionGuideContent: string;
|
|
31
32
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/markdown/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAqBH,eAAO,MAAM,eAAe,EAAE,MAAuC,CAAC;AAGtE,eAAO,MAAM,qBAAqB,EAAE,MACK,CAAC;AAG1C,eAAO,MAAM,yBAAyB,QAAwB,CAAC;AAG/D,eAAO,MAAM,wBAAwB,EAAE,MACH,CAAC;AAQrC,eAAO,MAAM,mBAAmB,EAAE,MAEjC,CAAC;AACF,eAAO,MAAM,gCAAgC,EAAE,MAE9C,CAAC;AACF,eAAO,MAAM,gCAAgC,EAAE,MAE9C,CAAC;AACF,eAAO,MAAM,+BAA+B,EAAE,MAE7C,CAAC;AACF,eAAO,MAAM,+BAA+B,EAAE,MAE7C,CAAC;AACF,eAAO,MAAM,2BAA2B,EAAE,MAEzC,CAAC;AAGF,eAAO,MAAM,oBAAoB,EAAE,MAElC,CAAC;AACF,eAAO,MAAM,iCAAiC,EAAE,MAE/C,CAAC;AACF,eAAO,MAAM,yBAAyB,EAAE,MAEvC,CAAC;AACF,eAAO,MAAM,6BAA6B,EAA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ACF,eAAO,MAAM,gCAAgC,EAAE,MAE9C,CAAC;AACF,eAAO,MAAM,8BAA8B,EAAE,MAE5C,CAAC;AAGF,eAAO,MAAM,kBAAkB,EAAE,MAEhC,CAAC;AACF,eAAO,MAAM,oCAAoC,EAAE,MAElD,CAAC;AACF,eAAO,MAAM,mCAAmC,EAAE,MAEjD,CAAC;AACF,eAAO,MAAM,yCAAyC,EAAE,MACiB,CAAC;AAC1E,eAAO,MAAM,gCAAgC,EAAE,MAE9C,CAAC;AACF,eAAO,MAAM,qCAAqC,EAAE,MAEnD,CAAC;AACF,eAAO,MAAM,iCAAiC,EAAE,MAE/C,CAAC;AACF,eAAO,MAAM,wCAAwC,EAAE,MACiB,CAAC"}
|
|
@@ -53,4 +53,5 @@ export const guidesDurableLearningDecisionGuideContent = readLocalTemplate("spec
|
|
|
53
53
|
export const guidesRetrievalDailyGuideContent = readLocalTemplate("spec/guides/retrieval-daily-guide.md.txt");
|
|
54
54
|
export const guidesCursorSemanticComplianceContent = readLocalTemplate("spec/guides/cursor-semantic-compliance.md.txt");
|
|
55
55
|
export const guidesCursorSubagentPolicyContent = readLocalTemplate("spec/guides/cursor-subagent-policy.md.txt");
|
|
56
|
+
export const guidesCursorContextInjectionGuideContent = readLocalTemplate("spec/guides/cursor-context-injection-guide.md.txt");
|
|
56
57
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/templates/markdown/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC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AAiC,GAAW,iBAAiB,CACxE,0CAA0C,CAC3C,CAAC;AACF,MAAM,CAAC,MAAM,yBAAyB,GAAW,iBAAiB,CAChE,kCAAkC,CACnC,CAAC;AACF,MAAM,CAAC,MAAM,6BAA6B,GAAW,iBAAiB,CACpE,sCAAsC,CACvC,CAAC;AACF,MAAM,CAAC,MAAM,kCAAkC,GAAW,iBAAiB,CACzE,2CAA2C,CAC5C,CAAC;AACF,MAAM,CAAC,MAAM,gCAAgC,GAAW,iBAAiB,CACvE,yCAAyC,CAC1C,CAAC;AACF,MAAM,CAAC,MAAM,8BAA8B,GAAW,iBAAiB,CACrE,uCAAuC,CACxC,CAAC;AAEF,mBAAmB;AACnB,MAAM,CAAC,MAAM,kBAAkB,GAAW,iBAAiB,CACzD,0BAA0B,CAC3B,CAAC;AACF,MAAM,CAAC,MAAM,oCAAoC,GAAW,iBAAiB,CAC3E,+CAA+C,CAChD,CAAC;AACF,MAAM,CAAC,MAAM,mCAAmC,GAAW,iBAAiB,CAC1E,8CAA8C,CAC/C,CAAC;AACF,MAAM,CAAC,MAAM,yCAAyC,GACpD,iBAAiB,CAAC,oDAAoD,CAAC,CAAC;AAC1E,MAAM,CAAC,MAAM,gCAAgC,GAAW,iBAAiB,CACvE,0CAA0C,CAC3C,CAAC;AACF,MAAM,CAAC,MAAM,qCAAqC,GAAW,iBAAiB,CAC5E,+CAA+C,CAChD,CAAC;AACF,MAAM,CAAC,MAAM,iCAAiC,GAAW,iBAAiB,CACxE,2CAA2C,CAC5C,CAAC;AACF,MAAM,CAAC,MAAM,wCAAwC,GACnD,iBAAiB,CAAC,mDAAmD,CAAC,CAAC"}
|
|
@@ -1,41 +1,25 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Cursor semantic slice — 12-query eval (maintainer)
|
|
2
2
|
|
|
3
|
-
>
|
|
4
|
-
> 数据:`queries-semantic-slice.jsonl`(S01–S12)。
|
|
3
|
+
> **Note:** `batch_plan_envelope.py` and `aggregate_retrieval_telemetry.py` were removed from user-shipped templates. Use `route_codebase_retrieval.py` per query and record JSONL manually, or restore those scripts from Trellis git history for batch eval runs.
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
## Plan phase
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
### 目的
|
|
11
|
-
|
|
12
|
-
测量 **semantic plan → semantic exec** 裂隙:计划含 `platform-semantic` 时,Agent 是否至少调用 **1 次 Cursor 内置代码库语义搜索**(**不要** fast-context MCP)。
|
|
13
|
-
|
|
14
|
-
### 约束
|
|
15
|
-
|
|
16
|
-
1. 代码根:`openclaw/`(pin `092075534e545ab4e0fe7824a3abe7e9784b3df7`)。
|
|
17
|
-
2. 每条只用 JSONL 里 **`query` 原文**;盲测阶段不看 `expected_files`。
|
|
18
|
-
3. 自然遵循 Trellis Rules + hook 注入的检索计划;若计划含 **语义合规** / **platform-semantic** 步骤,**必须执行**一次内置语义再定 Top-1。
|
|
19
|
-
4. 每条记录:**完整 `tools_called` 列表**(Cursor 显示的工具名原样)、是否看到 `## 代码库检索计划`、是否执行内置语义。
|
|
20
|
-
|
|
21
|
-
### 跑前
|
|
7
|
+
For each query in `queries-semantic-slice.jsonl`:
|
|
22
8
|
|
|
23
9
|
```powershell
|
|
24
|
-
python .trellis/scripts/
|
|
10
|
+
python .trellis/scripts/route_codebase_retrieval.py "<question>" --json
|
|
25
11
|
```
|
|
26
12
|
|
|
27
|
-
|
|
13
|
+
Record `semantic_in_plan` / route list from the envelope.
|
|
28
14
|
|
|
29
|
-
|
|
30
|
-
2. `runs/cursor-semantic-slice-<YYYYMMDD>/telemetry.jsonl`:每行含 `query_id`、`platform":"cursor"`、`tools_called`、`plan_block_in_prompt`、`semantic_in_plan`(可先 `batch_plan_envelope` 填 plan 字段)。
|
|
31
|
-
3. 汇总:
|
|
15
|
+
## Exec phase
|
|
32
16
|
|
|
33
|
-
|
|
34
|
-
python .trellis/scripts/aggregate_retrieval_telemetry.py runs/cursor-semantic-slice-<YYYYMMDD>/telemetry.jsonl --markdown
|
|
35
|
-
```
|
|
17
|
+
Run each query in a live Cursor session. Append one JSON object per line to `runs/cursor-semantic-slice-<YYYYMMDD>/telemetry.jsonl` with:
|
|
36
18
|
|
|
37
|
-
|
|
19
|
+
- `query_id`, `platform`: `"cursor"`
|
|
20
|
+
- `tools_called`, `plan_block_in_prompt`, `semantic_in_plan`
|
|
21
|
+
- Classify with `common/retrieval_tool_classification.py` (see `cursor-semantic-compliance.md`)
|
|
38
22
|
|
|
39
|
-
|
|
23
|
+
## Report
|
|
40
24
|
|
|
41
|
-
|
|
25
|
+
Summarize `semantic_plan_rate` and `semantic_exec_rate` from the JSONL (manual or your own aggregation script).
|
|
@@ -172,52 +172,3 @@ def hook_kind(self) -> str:
|
|
|
172
172
|
```
|
|
173
173
|
|
|
174
174
|
**Prevention**: When adding a new value to a Python `Literal` type, search for ALL if/elif/else chains that switch on that type and add explicit branches. Don't rely on `else` being correct for new values.
|
|
175
|
-
|
|
176
|
-
---
|
|
177
|
-
|
|
178
|
-
## Gotcha: Asymmetric Mechanisms Producing Same Output
|
|
179
|
-
|
|
180
|
-
**Problem**: When two different mechanisms must produce the same file set (e.g., recursive directory copy for init vs. manual `files.set()` for update), structural changes (renaming, moving, adding subdirectories) only propagate through the automatic mechanism. The manual one silently drifts.
|
|
181
|
-
|
|
182
|
-
**Symptom**: Init works perfectly, but update creates files at wrong paths or misses files entirely.
|
|
183
|
-
|
|
184
|
-
**Prevention**:
|
|
185
|
-
- **Best**: Eliminate the asymmetry — have the manual path call the automatic one (e.g., `collectTemplateFiles()` calls `getAllScripts()` instead of maintaining its own list)
|
|
186
|
-
- **If asymmetry is unavoidable**: Add a regression test that compares outputs from both mechanisms
|
|
187
|
-
- When migrating directory structures, search for ALL code paths that reference the old structure
|
|
188
|
-
|
|
189
|
-
**Real example**: `trellis update` had a manual `files.set()` list for 11 scripts that `getAllScripts()` already tracked. Fix: replaced the manual list with a `for..of getAllScripts()` loop. See `update.ts` refactor in v0.4.0-beta.3.
|
|
190
|
-
|
|
191
|
-
---
|
|
192
|
-
|
|
193
|
-
## Template File Registration (Trellis-specific)
|
|
194
|
-
|
|
195
|
-
When adding new files to `src/templates/trellis/scripts/`:
|
|
196
|
-
|
|
197
|
-
**Single registration point**: `src/templates/trellis/index.ts`
|
|
198
|
-
|
|
199
|
-
1. Add `export const xxxScript = readTemplate("scripts/path/file.py");`
|
|
200
|
-
2. Add to `getAllScripts()` Map
|
|
201
|
-
|
|
202
|
-
That's it. `commands/update.ts` uses `getAllScripts()` directly — no manual sync needed.
|
|
203
|
-
|
|
204
|
-
**Why this matters**: Without registration in `getAllScripts()`, `trellis update` won't sync the file to user projects. Bug fixes and features won't propagate.
|
|
205
|
-
|
|
206
|
-
**History**: Before v0.4.0-beta.3, `update.ts` had its own hand-maintained file list that frequently fell out of sync with `getAllScripts()`. This caused 11 Python files to be silently skipped during `trellis update`. The fix was to eliminate the duplicate list and use `getAllScripts()` as the single source of truth.
|
|
207
|
-
|
|
208
|
-
### Quick Checklist for New Scripts
|
|
209
|
-
|
|
210
|
-
```bash
|
|
211
|
-
# After adding a new .py file, verify it's in getAllScripts():
|
|
212
|
-
grep -l "newFileName" src/templates/trellis/index.ts # Should match
|
|
213
|
-
```
|
|
214
|
-
|
|
215
|
-
### Template Sync Convention
|
|
216
|
-
|
|
217
|
-
`.trellis/scripts/` (dogfooded) and `packages/cli/src/templates/trellis/scripts/` (template) must stay identical. After editing `.trellis/scripts/`, always sync:
|
|
218
|
-
|
|
219
|
-
```bash
|
|
220
|
-
rsync -av --delete --exclude='__pycache__' .trellis/scripts/ packages/cli/src/templates/trellis/scripts/
|
|
221
|
-
```
|
|
222
|
-
|
|
223
|
-
**Gotcha**: Running rsync with wrong source/destination paths can create nested garbage directories (e.g., `.trellis/scripts/packages/cli/...`). Always double-check paths before running.
|
|
@@ -123,91 +123,6 @@ After implementation:
|
|
|
123
123
|
|
|
124
124
|
---
|
|
125
125
|
|
|
126
|
-
## Cross-Package Template Consistency
|
|
127
|
-
|
|
128
|
-
In Trellis, command templates (e.g., `record-session.md`) exist in **multiple locations** with identical or near-identical content — the published template (`packages/cli/src/templates/cursor/commands/...`) and the dogfooded copy (`.cursor/commands/...`). This is a cross-layer boundary.
|
|
129
|
-
|
|
130
|
-
### Checklist: After Modifying Any Command Template
|
|
131
|
-
|
|
132
|
-
- [ ] Find every copy that owns the same command: `find packages/cli/src/templates -name "<command>.*"` plus the dogfood mirror under `.cursor/commands/`
|
|
133
|
-
- [ ] Update every copy (Markdown `.md` and any TOML sidecar)
|
|
134
|
-
- [ ] Run `/trellis:check-cross-layer` to verify nothing was missed
|
|
135
|
-
|
|
136
|
-
**Real-world example**: Updated `record-session.md` in the dogfooded `.cursor/commands/` to use `--mode record`, but forgot to mirror it under `packages/cli/src/templates/cursor/commands/` — caught by cross-layer check.
|
|
137
|
-
|
|
138
|
-
---
|
|
139
|
-
|
|
140
|
-
## Generated Runtime Template Upgrade Consistency
|
|
141
|
-
|
|
142
|
-
Some generated files are both documentation and runtime input. In Trellis,
|
|
143
|
-
`.trellis/workflow.md` is parsed by `get_context.py`, `workflow_phase.py`,
|
|
144
|
-
SessionStart filters, and per-turn hooks. Template changes must be validated
|
|
145
|
-
against both fresh init and upgrade paths.
|
|
146
|
-
|
|
147
|
-
### Checklist: After Modifying A Runtime-Parsed Template
|
|
148
|
-
|
|
149
|
-
- [ ] Identify every runtime parser that reads the template, not just the file
|
|
150
|
-
writer that installs it
|
|
151
|
-
- [ ] Check whether relevant syntax lives outside obvious managed regions
|
|
152
|
-
such as tag blocks
|
|
153
|
-
- [ ] Verify fresh `init` output and a versioned `update` scenario that writes
|
|
154
|
-
the older `.trellis/.version`
|
|
155
|
-
- [ ] Add an upgrade regression using an older pristine template fixture, then
|
|
156
|
-
assert the installed file reaches the current packaged shape
|
|
157
|
-
- [ ] Update the backend spec that owns the runtime contract
|
|
158
|
-
|
|
159
|
-
---
|
|
160
|
-
|
|
161
|
-
## Versioned Documentation Boundary
|
|
162
|
-
|
|
163
|
-
Versioned documentation is a cross-layer boundary: source paths, `docs.json`
|
|
164
|
-
version routing, and the rendered version selector must all describe the same
|
|
165
|
-
release line.
|
|
166
|
-
|
|
167
|
-
### Checklist: Before Editing Versioned Docs
|
|
168
|
-
|
|
169
|
-
- [ ] Identify the target release line: stable, beta, or RC
|
|
170
|
-
- [ ] Verify the edited MDX path matches that line:
|
|
171
|
-
- stable: `docs-site/{start,advanced,...}` and `docs-site/zh/{start,advanced,...}`
|
|
172
|
-
- beta: `docs-site/beta/**` and `docs-site/zh/beta/**`
|
|
173
|
-
- RC: `docs-site/rc/**` and `docs-site/zh/rc/**`
|
|
174
|
-
- [ ] Verify `docs.json` navigation points the version label to the same paths
|
|
175
|
-
- [ ] Grep the opposite tree for release-line-specific terms before committing
|
|
176
|
-
- [ ] Treat beta content appearing under root release paths as a source-path bug,
|
|
177
|
-
not a rendering bug
|
|
178
|
-
|
|
179
|
-
**Real-world example**: A beta-only task workflow change documented `prd.md` + `design.md` + `implement.md` and task-creation consent under root `start/` and `advanced/` paths. The docs site then served 0.6 beta behavior under the Release selector. The fix was to restore root release docs, move the 0.6 content to `beta/` and `zh/beta/`, and add a grep audit for beta markers against the root release tree.
|
|
180
|
-
|
|
181
|
-
**Real-world example**: A workflow-phase marker refactor rewrote `[workflow-state:*]` blocks in `.trellis/workflow.md`. Fresh `init` was correct, but `trellis update` only merged the tagged `[workflow-state:*]` blocks and preserved stale free-text routing between them. Result: upgraded projects got new hook scripts but old workflow routing, so `get_context.py --mode phase` could return empty Phase 2.1 detail. (Historical note: the affected markers used to be platform-tagged when Trellis supported multiple AI platforms; the platform tags were removed when Trellis converged on Cursor-only.)
|
|
182
|
-
|
|
183
|
-
---
|
|
184
|
-
|
|
185
|
-
## Mode-Detection Probe Checklist
|
|
186
|
-
|
|
187
|
-
When a CLI auto-detects a mode by probing a remote resource (e.g., checking if `index.json` exists to decide marketplace vs direct download):
|
|
188
|
-
|
|
189
|
-
### Before implementing:
|
|
190
|
-
|
|
191
|
-
- [ ] Probe runs in **ALL** code paths that use the result (interactive, `-y`, `--flag` combos)
|
|
192
|
-
- [ ] 404 vs transient error are distinguished — don't treat both as "not found"
|
|
193
|
-
- [ ] Transient errors **abort or retry**, never silently switch modes
|
|
194
|
-
- [ ] Shared state (caches, prefetched data) is **reset** when context changes (e.g., user switches source)
|
|
195
|
-
- [ ] **Shortcut paths** (e.g., `--template` skipping picker) must have the same error-handling quality as the probed path — check that downstream functions don't call catch-all wrappers
|
|
196
|
-
|
|
197
|
-
### After implementing:
|
|
198
|
-
|
|
199
|
-
- [ ] Trace every path from probe result to the mode-decision branch — no fallthrough
|
|
200
|
-
- [ ] External format contracts (giget URI, raw URLs) are tested or at least documented as comments
|
|
201
|
-
- [ ] Metadata reads consume a complete response or use a streaming parser — never parse a fixed-size prefix as full JSON
|
|
202
|
-
- [ ] When reconstructing a composite identifier from parsed parts, verify **all** fields are included and in the **correct position** (e.g., `provider:repo/path#ref` not `provider:repo#ref/path`)
|
|
203
|
-
- [ ] Verify that **action functions** called after a shortcut don't internally use the old catch-all fetch — they must use the probe-quality variant when error distinction matters
|
|
204
|
-
|
|
205
|
-
**Real-world example**: Custom registry flow had 8 bugs across 3 review rounds: (1) probe only ran in interactive mode, (2) transient errors fell through to wrong mode, (3) giget URI had `#ref` in wrong position, (4) prefetched templates leaked across source switches, (5) `--template` shortcut bypassed probe but `downloadTemplateById` internally used catch-all `fetchTemplateIndex`, turning timeouts into "Template not found".
|
|
206
|
-
|
|
207
|
-
**Real-world example**: Agent-session update hints fetched npm `latest` metadata with `response.read(4096)` and then parsed it as complete JSON. The `@blxzer/cursor-trellis` package metadata exceeded 4 KB, so the JSON was truncated, parse failed silently, and the first session injection showed no update hint. Fix: read the complete response before parsing, and add a regression where `version` is followed by an 8 KB metadata tail.
|
|
208
|
-
|
|
209
|
-
---
|
|
210
|
-
|
|
211
126
|
## When to Create Flow Documentation
|
|
212
127
|
|
|
213
128
|
Create detailed flow docs when:
|