@blxzer/cursor-trellis 0.1.0 → 0.1.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/README.md +124 -5
- package/README.zh-CN.md +170 -0
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +1 -33
- package/dist/cli/index.js.map +1 -1
- package/dist/commands/init.d.ts +0 -13
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +7 -14
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/uninstall.d.ts.map +1 -1
- package/dist/commands/uninstall.js +3 -32
- package/dist/commands/uninstall.js.map +1 -1
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +7 -84
- package/dist/commands/update.js.map +1 -1
- package/dist/configurators/index.d.ts +7 -8
- package/dist/configurators/index.d.ts.map +1 -1
- package/dist/configurators/index.js +11 -236
- package/dist/configurators/index.js.map +1 -1
- package/dist/configurators/workflow.d.ts.map +1 -1
- package/dist/configurators/workflow.js +5 -1
- package/dist/configurators/workflow.js.map +1 -1
- package/dist/templates/common/bundled-skills/smart-search-cli/SKILL.md +3 -3
- package/dist/templates/common/bundled-skills/trellis-meta/SKILL.md +4 -2
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-agents.md +8 -15
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-hooks.md +7 -7
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-skills-or-commands.md +18 -21
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/overview.md +2 -2
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/generated-files.md +10 -7
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/overview.md +4 -4
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/agents.md +20 -31
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/hooks-and-settings.md +20 -31
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/overview.md +24 -40
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/platform-map.md +28 -59
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/skills-and-commands.md +12 -28
- package/dist/templates/common/bundled-skills/trellis-skill-creator/references/trellis-skill-locations.md +2 -2
- package/dist/templates/cursor/hooks.json +6 -0
- package/dist/templates/cursor/rules/retrieval-routing.mdc +57 -0
- package/dist/templates/extract.d.ts +0 -14
- package/dist/templates/extract.d.ts.map +1 -1
- package/dist/templates/extract.js +0 -34
- package/dist/templates/extract.js.map +1 -1
- package/dist/templates/markdown/agents.md +2 -6
- 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 +41 -0
- package/dist/templates/markdown/spec/guides/code-reuse-thinking-guide.md.txt +14 -14
- package/dist/templates/markdown/spec/guides/cross-layer-thinking-guide.md.txt +8 -20
- package/dist/templates/markdown/spec/guides/cross-platform-thinking-guide.md.txt +15 -14
- package/dist/templates/markdown/spec/guides/cursor-context-injection-guide.md.txt +2 -1
- package/dist/templates/markdown/spec/guides/cursor-semantic-compliance.md.txt +49 -0
- package/dist/templates/markdown/spec/guides/cursor-subagent-policy.md.txt +2 -2
- package/dist/templates/markdown/spec/guides/retrieval-daily-guide.md.txt +68 -20
- package/dist/templates/shared-hooks/index.d.ts +1 -1
- package/dist/templates/shared-hooks/index.d.ts.map +1 -1
- package/dist/templates/shared-hooks/index.js +1 -0
- package/dist/templates/shared-hooks/index.js.map +1 -1
- package/dist/templates/shared-hooks/inject-retrieval-plan.py +163 -0
- package/dist/templates/shared-hooks/research-end-retrieval-pack.py +2 -11
- package/dist/templates/trellis/index.d.ts +11 -0
- package/dist/templates/trellis/index.d.ts.map +1 -1
- package/dist/templates/trellis/index.js +22 -0
- package/dist/templates/trellis/index.js.map +1 -1
- package/dist/templates/trellis/scripts/aggregate_retrieval_telemetry.py +342 -0
- package/dist/templates/trellis/scripts/batch_plan_envelope.py +105 -0
- package/dist/templates/trellis/scripts/codegraph_session_smoke.py +76 -0
- package/dist/templates/trellis/scripts/common/active_task.py +116 -147
- package/dist/templates/trellis/scripts/common/cli_adapter.py +34 -710
- package/dist/templates/trellis/scripts/common/codebase_retrieval_router.py +49 -106
- package/dist/templates/trellis/scripts/common/git_context.py +17 -2
- package/dist/templates/trellis/scripts/common/project_file_stats.py +91 -0
- package/dist/templates/trellis/scripts/common/retrieval_adapter_metadata.py +9 -11
- package/dist/templates/trellis/scripts/common/retrieval_agent_instructions.py +313 -0
- package/dist/templates/trellis/scripts/common/retrieval_pack.py +0 -6
- package/dist/templates/trellis/scripts/common/retrieval_pack_context.py +0 -4
- package/dist/templates/trellis/scripts/common/retrieval_plan_gate.py +76 -0
- package/dist/templates/trellis/scripts/common/retrieval_result_ranking.py +253 -0
- package/dist/templates/trellis/scripts/common/retrieval_tool_classification.py +157 -0
- package/dist/templates/trellis/scripts/common/semantic_plan_gate.py +52 -0
- package/dist/templates/trellis/scripts/common/workflow_phase.py +3 -24
- package/dist/templates/trellis/scripts/rank_retrieval_candidates.py +80 -0
- package/dist/templates/trellis/scripts/route_codebase_retrieval.py +38 -11
- package/dist/templates/trellis/scripts/score_evidence.py +112 -0
- package/dist/templates/trellis/workflow.md +861 -960
- package/dist/types/ai-tools.d.ts +13 -16
- package/dist/types/ai-tools.d.ts.map +1 -1
- package/dist/types/ai-tools.js +5 -238
- package/dist/types/ai-tools.js.map +1 -1
- package/dist/utils/codebase-retrieval-router.d.ts +1 -8
- package/dist/utils/codebase-retrieval-router.d.ts.map +1 -1
- package/dist/utils/codebase-retrieval-router.js +39 -180
- package/dist/utils/codebase-retrieval-router.js.map +1 -1
- package/dist/utils/project-capabilities.d.ts.map +1 -1
- package/dist/utils/project-capabilities.js +10 -24
- package/dist/utils/project-capabilities.js.map +1 -1
- package/dist/utils/retrieval-agent-instructions.d.ts +14 -0
- package/dist/utils/retrieval-agent-instructions.d.ts.map +1 -0
- package/dist/utils/retrieval-agent-instructions.js +221 -0
- package/dist/utils/retrieval-agent-instructions.js.map +1 -0
- package/dist/utils/retrieval-execution-telemetry.d.ts +43 -85
- package/dist/utils/retrieval-execution-telemetry.d.ts.map +1 -1
- package/dist/utils/retrieval-execution-telemetry.js +289 -22
- package/dist/utils/retrieval-execution-telemetry.js.map +1 -1
- package/dist/utils/retrieval-result-ranking.js +1 -1
- package/dist/utils/retrieval-result-ranking.js.map +1 -1
- package/dist/utils/retrieval-tool-classification.d.ts +32 -0
- package/dist/utils/retrieval-tool-classification.d.ts.map +1 -0
- package/dist/utils/retrieval-tool-classification.js +113 -0
- package/dist/utils/retrieval-tool-classification.js.map +1 -0
- package/dist/utils/uninstall-scrubbers.d.ts +0 -36
- package/dist/utils/uninstall-scrubbers.d.ts.map +1 -1
- package/dist/utils/uninstall-scrubbers.js +0 -184
- package/dist/utils/uninstall-scrubbers.js.map +1 -1
- package/package.json +4 -2
- package/dist/commands/mem.d.ts +0 -30
- package/dist/commands/mem.d.ts.map +0 -1
- package/dist/commands/mem.js +0 -424
- package/dist/commands/mem.js.map +0 -1
- package/dist/configurators/antigravity.d.ts +0 -7
- package/dist/configurators/antigravity.d.ts.map +0 -1
- package/dist/configurators/antigravity.js +0 -19
- package/dist/configurators/antigravity.js.map +0 -1
- package/dist/configurators/claude.d.ts +0 -9
- package/dist/configurators/claude.d.ts.map +0 -1
- package/dist/configurators/claude.js +0 -72
- package/dist/configurators/claude.js.map +0 -1
- package/dist/configurators/codebuddy.d.ts +0 -10
- package/dist/configurators/codebuddy.d.ts.map +0 -1
- package/dist/configurators/codebuddy.js +0 -30
- package/dist/configurators/codebuddy.js.map +0 -1
- package/dist/configurators/codex.d.ts +0 -8
- package/dist/configurators/codex.d.ts.map +0 -1
- package/dist/configurators/codex.js +0 -87
- package/dist/configurators/codex.js.map +0 -1
- package/dist/configurators/copilot.d.ts +0 -10
- package/dist/configurators/copilot.d.ts.map +0 -1
- package/dist/configurators/copilot.js +0 -51
- package/dist/configurators/copilot.js.map +0 -1
- package/dist/configurators/droid.d.ts +0 -10
- package/dist/configurators/droid.d.ts.map +0 -1
- package/dist/configurators/droid.js +0 -30
- package/dist/configurators/droid.js.map +0 -1
- package/dist/configurators/gemini.d.ts +0 -16
- package/dist/configurators/gemini.d.ts.map +0 -1
- package/dist/configurators/gemini.js +0 -38
- package/dist/configurators/gemini.js.map +0 -1
- package/dist/configurators/kilo.d.ts +0 -7
- package/dist/configurators/kilo.d.ts.map +0 -1
- package/dist/configurators/kilo.js +0 -19
- package/dist/configurators/kilo.js.map +0 -1
- package/dist/configurators/kiro.d.ts +0 -8
- package/dist/configurators/kiro.d.ts.map +0 -1
- package/dist/configurators/kiro.js +0 -24
- package/dist/configurators/kiro.js.map +0 -1
- package/dist/configurators/opencode.d.ts +0 -14
- package/dist/configurators/opencode.d.ts.map +0 -1
- package/dist/configurators/opencode.js +0 -96
- package/dist/configurators/opencode.js.map +0 -1
- package/dist/configurators/pi.d.ts +0 -3
- package/dist/configurators/pi.d.ts.map +0 -1
- package/dist/configurators/pi.js +0 -45
- package/dist/configurators/pi.js.map +0 -1
- package/dist/configurators/qoder.d.ts +0 -11
- package/dist/configurators/qoder.d.ts.map +0 -1
- package/dist/configurators/qoder.js +0 -31
- package/dist/configurators/qoder.js.map +0 -1
- package/dist/configurators/windsurf.d.ts +0 -7
- package/dist/configurators/windsurf.d.ts.map +0 -1
- package/dist/configurators/windsurf.js +0 -19
- package/dist/configurators/windsurf.js.map +0 -1
- package/dist/templates/claude/agents/trellis-check.md +0 -124
- package/dist/templates/claude/agents/trellis-implement.md +0 -110
- package/dist/templates/claude/agents/trellis-research.md +0 -137
- package/dist/templates/claude/index.d.ts +0 -22
- package/dist/templates/claude/index.d.ts.map +0 -1
- package/dist/templates/claude/index.js +0 -46
- package/dist/templates/claude/index.js.map +0 -1
- package/dist/templates/claude/settings.json +0 -84
- package/dist/templates/codebuddy/agents/trellis-check.md +0 -115
- package/dist/templates/codebuddy/agents/trellis-implement.md +0 -110
- package/dist/templates/codebuddy/agents/trellis-research.md +0 -137
- package/dist/templates/codebuddy/index.d.ts +0 -15
- package/dist/templates/codebuddy/index.d.ts.map +0 -1
- package/dist/templates/codebuddy/index.js +0 -15
- package/dist/templates/codebuddy/index.js.map +0 -1
- package/dist/templates/codebuddy/settings.json +0 -70
- package/dist/templates/codex/agents/trellis-check.toml +0 -67
- package/dist/templates/codex/agents/trellis-implement.toml +0 -40
- package/dist/templates/codex/agents/trellis-research.toml +0 -73
- package/dist/templates/codex/config.toml +0 -28
- package/dist/templates/codex/hooks/session-start.py +0 -575
- package/dist/templates/codex/hooks.json +0 -15
- package/dist/templates/codex/index.d.ts +0 -39
- package/dist/templates/codex/index.d.ts.map +0 -1
- package/dist/templates/codex/index.js +0 -85
- package/dist/templates/codex/index.js.map +0 -1
- package/dist/templates/codex/skills/before-dev/SKILL.md +0 -40
- package/dist/templates/codex/skills/brainstorm/SKILL.md +0 -112
- package/dist/templates/codex/skills/break-loop/SKILL.md +0 -130
- package/dist/templates/codex/skills/check/SKILL.md +0 -98
- package/dist/templates/codex/skills/check-cross-layer/SKILL.md +0 -158
- package/dist/templates/codex/skills/create-command/SKILL.md +0 -101
- package/dist/templates/codex/skills/finish-work/SKILL.md +0 -90
- package/dist/templates/codex/skills/improve-ut/SKILL.md +0 -69
- package/dist/templates/codex/skills/integrate-skill/SKILL.md +0 -221
- package/dist/templates/codex/skills/onboard/SKILL.md +0 -363
- package/dist/templates/codex/skills/record-session/SKILL.md +0 -67
- package/dist/templates/codex/skills/start/SKILL.md +0 -66
- package/dist/templates/codex/skills/update-spec/SKILL.md +0 -335
- package/dist/templates/copilot/hooks/session-start.py +0 -557
- package/dist/templates/copilot/hooks.json +0 -19
- package/dist/templates/copilot/index.d.ts +0 -23
- package/dist/templates/copilot/index.d.ts.map +0 -1
- package/dist/templates/copilot/index.js +0 -54
- package/dist/templates/copilot/index.js.map +0 -1
- package/dist/templates/copilot/prompts/before-dev.prompt.md +0 -39
- package/dist/templates/copilot/prompts/brainstorm.prompt.md +0 -111
- package/dist/templates/copilot/prompts/break-loop.prompt.md +0 -129
- package/dist/templates/copilot/prompts/check-cross-layer.prompt.md +0 -157
- package/dist/templates/copilot/prompts/check.prompt.md +0 -97
- package/dist/templates/copilot/prompts/create-command.prompt.md +0 -116
- package/dist/templates/copilot/prompts/finish-work.prompt.md +0 -99
- package/dist/templates/copilot/prompts/integrate-skill.prompt.md +0 -223
- package/dist/templates/copilot/prompts/onboard.prompt.md +0 -362
- package/dist/templates/copilot/prompts/parallel.prompt.md +0 -204
- package/dist/templates/copilot/prompts/record-session.prompt.md +0 -66
- package/dist/templates/copilot/prompts/start.prompt.md +0 -63
- package/dist/templates/copilot/prompts/update-spec.prompt.md +0 -358
- package/dist/templates/droid/droids/trellis-check.md +0 -107
- package/dist/templates/droid/droids/trellis-implement.md +0 -102
- package/dist/templates/droid/droids/trellis-research.md +0 -137
- package/dist/templates/droid/index.d.ts +0 -15
- package/dist/templates/droid/index.d.ts.map +0 -1
- package/dist/templates/droid/index.js +0 -15
- package/dist/templates/droid/index.js.map +0 -1
- package/dist/templates/droid/settings.json +0 -70
- package/dist/templates/gemini/agents/trellis-check.md +0 -107
- package/dist/templates/gemini/agents/trellis-implement.md +0 -102
- package/dist/templates/gemini/agents/trellis-research.md +0 -136
- package/dist/templates/gemini/index.d.ts +0 -13
- package/dist/templates/gemini/index.d.ts.map +0 -1
- package/dist/templates/gemini/index.js +0 -13
- package/dist/templates/gemini/index.js.map +0 -1
- package/dist/templates/gemini/settings.json +0 -28
- package/dist/templates/kiro/agents/trellis-check.json +0 -26
- package/dist/templates/kiro/agents/trellis-implement.json +0 -26
- package/dist/templates/kiro/agents/trellis-research.json +0 -30
- package/dist/templates/kiro/index.d.ts +0 -18
- package/dist/templates/kiro/index.d.ts.map +0 -1
- package/dist/templates/kiro/index.js +0 -18
- package/dist/templates/kiro/index.js.map +0 -1
- package/dist/templates/opencode/agents/trellis-check.md +0 -122
- package/dist/templates/opencode/agents/trellis-implement.md +0 -118
- package/dist/templates/opencode/agents/trellis-research.md +0 -145
- package/dist/templates/opencode/lib/session-utils.js +0 -667
- package/dist/templates/opencode/lib/trellis-context.js +0 -336
- package/dist/templates/opencode/package.json +0 -5
- package/dist/templates/opencode/plugins/inject-subagent-context.js +0 -495
- package/dist/templates/opencode/plugins/inject-workflow-state.js +0 -159
- package/dist/templates/opencode/plugins/session-start.js +0 -101
- package/dist/templates/pi/agents/trellis-check.md +0 -37
- package/dist/templates/pi/agents/trellis-implement.md +0 -42
- package/dist/templates/pi/agents/trellis-research.md +0 -25
- package/dist/templates/pi/extensions/trellis/index.ts.txt +0 -1600
- package/dist/templates/pi/index.d.ts +0 -5
- package/dist/templates/pi/index.d.ts.map +0 -1
- package/dist/templates/pi/index.js +0 -12
- package/dist/templates/pi/index.js.map +0 -1
- package/dist/templates/pi/settings.json +0 -12
- package/dist/templates/qoder/agents/trellis-check.md +0 -108
- package/dist/templates/qoder/agents/trellis-implement.md +0 -103
- package/dist/templates/qoder/agents/trellis-research.md +0 -137
- package/dist/templates/qoder/index.d.ts +0 -15
- package/dist/templates/qoder/index.d.ts.map +0 -1
- package/dist/templates/qoder/index.js +0 -15
- package/dist/templates/qoder/index.js.map +0 -1
- package/dist/templates/qoder/settings.json +0 -47
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Trellis codebase retrieval on Cursor — follow router-derived plans; Rules are the primary injection channel (not sessionStart hooks)"
|
|
3
|
+
alwaysApply: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Codebase retrieval routing (Cursor)
|
|
7
|
+
|
|
8
|
+
Before answering **code-location / architecture / caller-chain / config-schema** questions in this repo, use the retrieval layer deliberately. On Cursor, **`.cursor/rules` is the reliable policy channel**; **per-query `## 代码库检索计划` blocks** are injected by the **`beforeSubmitPrompt`** hook (`.cursor/hooks/inject-retrieval-plan.py`) when the user message looks like a codebase question. Do **not** depend on `sessionStart` hook `additional_context` (#158452) or end-of-turn retrieval-pack hooks for plans.
|
|
9
|
+
|
|
10
|
+
## When a retrieval plan block is present
|
|
11
|
+
|
|
12
|
+
If the user message or Trellis context contains a block starting with `## 代码库检索计划` or `## Codebase retrieval plan`:
|
|
13
|
+
|
|
14
|
+
1. Execute steps **in order** before stating file paths or behavior claims.
|
|
15
|
+
2. Treat each step as mandatory tooling (not suggestions).
|
|
16
|
+
3. Finish with **Read** (or GO_TO_DEFINITION) verification on cited sources.
|
|
17
|
+
|
|
18
|
+
Generate a fresh plan when needed:
|
|
19
|
+
|
|
20
|
+
```powershell
|
|
21
|
+
python ./.trellis/scripts/route_codebase_retrieval.py "<question>" --instructions
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
JSON (includes `agentInstructions`):
|
|
25
|
+
|
|
26
|
+
```powershell
|
|
27
|
+
python ./.trellis/scripts/route_codebase_retrieval.py "<question>" --json
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Default tool order (no plan block)
|
|
31
|
+
|
|
32
|
+
| Need | Tool (Cursor) |
|
|
33
|
+
| --- | --- |
|
|
34
|
+
| Exact string / path | **Grep** (Instant Grep) |
|
|
35
|
+
| Who calls / blast radius | **codegraph_callers** → Grep for imports/callbacks |
|
|
36
|
+
| Same name across packages (trap) | **codegraph_search** / **codegraph_explore** → Grep |
|
|
37
|
+
| Extension symbols | **codegraph_search** under `extensions/` |
|
|
38
|
+
| Conceptual / how does X work | Cursor **built-in codebase semantic search** (@codebase-class; **not** fast-context MCP) |
|
|
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 | **GO_TO_DEFINITION** / find references **when the host exposes them**; otherwise **Read** + **Grep** on known candidates (LSP is optional, not a guaranteed Agent default) |
|
|
41
|
+
| Wide cross-cutting explore | **DEEP_SEARCH** or Explore subagent, then verify with Grep/codegraph |
|
|
42
|
+
|
|
43
|
+
## Semantic on Cursor
|
|
44
|
+
|
|
45
|
+
Router id: `platform-semantic` (`platformNative: true`). Use Cursor **built-in semantic / codebase search**. Do **not** call `fast_context_search` on Cursor.
|
|
46
|
+
|
|
47
|
+
## Result-layer ranking (B / E / D)
|
|
48
|
+
|
|
49
|
+
When the plan block includes **结果层排序**, apply it **after** collecting path candidates and **before** stating Top-1 / Top-5: caller concrete sites over assembly files; trap demotion; env scripts/e2e/bench over generic `src/auth`/`paths`. Offline reorder: `rank_retrieval_candidates.py`.
|
|
50
|
+
|
|
51
|
+
## codegraph-only value
|
|
52
|
+
|
|
53
|
+
Use codegraph for **call chains**, **cross-package trap disambiguation**, **extension symbol resolution**, and **impact** — not for pure literal search (Grep) or single-hop definition (LSP).
|
|
54
|
+
|
|
55
|
+
## External facts
|
|
56
|
+
|
|
57
|
+
Web/current events: **smart-search** first per `.trellis/spec/guides/retrieval-daily-guide.md`.
|
|
@@ -5,20 +5,6 @@ type TemplateCategory = "scripts" | "markdown" | "commands";
|
|
|
5
5
|
export declare function getTrellisTemplatePath(): string;
|
|
6
6
|
/** @deprecated Use getTrellisTemplatePath() instead. */
|
|
7
7
|
export declare function getTrellisSourcePath(): string;
|
|
8
|
-
/**
|
|
9
|
-
* Get the path to the claude templates directory (hooks, agents, settings).
|
|
10
|
-
*/
|
|
11
|
-
export declare function getClaudeTemplatePath(): string;
|
|
12
|
-
/**
|
|
13
|
-
* Get the path to the opencode templates directory (agents, plugins, lib).
|
|
14
|
-
*/
|
|
15
|
-
export declare function getOpenCodeTemplatePath(): string;
|
|
16
|
-
/**
|
|
17
|
-
* Get the path to the Pi Agent templates directory (agents, extension, settings).
|
|
18
|
-
*/
|
|
19
|
-
export declare function getPiTemplatePath(): string;
|
|
20
|
-
/** @deprecated Use getPiTemplatePath() instead. */
|
|
21
|
-
export declare function getPiSourcePath(): string;
|
|
22
8
|
/**
|
|
23
9
|
* Read a file from the trellis template directory.
|
|
24
10
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extract.d.ts","sourceRoot":"","sources":["../../src/templates/extract.ts"],"names":[],"mappings":"AASA,KAAK,gBAAgB,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;AAE5D;;GAEG;AACH,wBAAgB,sBAAsB,IAAI,MAAM,CAQ/C;AAED,wDAAwD;AACxD,wBAAgB,oBAAoB,IAAI,MAAM,CAE7C;AAED;;GAEG;AACH,wBAAgB,
|
|
1
|
+
{"version":3,"file":"extract.d.ts","sourceRoot":"","sources":["../../src/templates/extract.ts"],"names":[],"mappings":"AASA,KAAK,gBAAgB,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;AAE5D;;GAEG;AACH,wBAAgB,sBAAsB,IAAI,MAAM,CAQ/C;AAED,wDAAwD;AACxD,wBAAgB,oBAAoB,IAAI,MAAM,CAE7C;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAI5D;AAED;;GAEG;AACH,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,gBAAgB,EAC1B,QAAQ,EAAE,MAAM,GACf,MAAM,CAGR;AAED,wBAAgB,UAAU,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED,wBAAgB,YAAY,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED;;GAEG;AACH,wBAAsB,cAAc,CAClC,eAAe,EAAE,MAAM,EACvB,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE;IAAE,UAAU,CAAC,EAAE,OAAO,CAAA;CAAE,GACjC,OAAO,CAAC,IAAI,CAAC,CAIf"}
|
|
@@ -19,40 +19,6 @@ export function getTrellisTemplatePath() {
|
|
|
19
19
|
export function getTrellisSourcePath() {
|
|
20
20
|
return getTrellisTemplatePath();
|
|
21
21
|
}
|
|
22
|
-
/**
|
|
23
|
-
* Get the path to the claude templates directory (hooks, agents, settings).
|
|
24
|
-
*/
|
|
25
|
-
export function getClaudeTemplatePath() {
|
|
26
|
-
const templatePath = path.join(__dirname, "claude");
|
|
27
|
-
if (fs.existsSync(templatePath)) {
|
|
28
|
-
return templatePath;
|
|
29
|
-
}
|
|
30
|
-
throw new Error("Could not find claude templates directory. Expected at templates/claude/");
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Get the path to the opencode templates directory (agents, plugins, lib).
|
|
34
|
-
*/
|
|
35
|
-
export function getOpenCodeTemplatePath() {
|
|
36
|
-
const templatePath = path.join(__dirname, "opencode");
|
|
37
|
-
if (fs.existsSync(templatePath)) {
|
|
38
|
-
return templatePath;
|
|
39
|
-
}
|
|
40
|
-
throw new Error("Could not find opencode templates directory. Expected at templates/opencode/");
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Get the path to the Pi Agent templates directory (agents, extension, settings).
|
|
44
|
-
*/
|
|
45
|
-
export function getPiTemplatePath() {
|
|
46
|
-
const templatePath = path.join(__dirname, "pi");
|
|
47
|
-
if (fs.existsSync(templatePath)) {
|
|
48
|
-
return templatePath;
|
|
49
|
-
}
|
|
50
|
-
throw new Error("Could not find pi templates directory. Expected at templates/pi/");
|
|
51
|
-
}
|
|
52
|
-
/** @deprecated Use getPiTemplatePath() instead. */
|
|
53
|
-
export function getPiSourcePath() {
|
|
54
|
-
return getPiTemplatePath();
|
|
55
|
-
}
|
|
56
22
|
/**
|
|
57
23
|
* Read a file from the trellis template directory.
|
|
58
24
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extract.js","sourceRoot":"","sources":["../../src/templates/extract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,aAAa,EA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,IAAI,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC;IACxD,MAAM,gBAAgB,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;AACrD,CAAC;AAED,KAAK,UAAU,gBAAgB,CAC7B,GAAW,EACX,IAAY,EACZ,OAAkC;IAElC,SAAS,CAAC,IAAI,CAAC,CAAC;IAEhB,KAAK,MAAM,KAAK,IAAI,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,CAAC;QACxC,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACtC,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QACxC,MAAM,IAAI,GAAG,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAElC,IAAI,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;YACvB,MAAM,gBAAgB,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;QACrD,CAAC;aAAM,CAAC;YACN,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YAClD,MAAM,YAAY,GAChB,OAAO,EAAE,UAAU,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;YAC1E,MAAM,SAAS,CAAC,QAAQ,EAAE,4BAA4B,CAAC,OAAO,CAAC,EAAE;gBAC/D,UAAU,EAAE,YAAY;aACzB,CAAC,CAAC;QACL,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -10,23 +10,19 @@ This project is managed by Trellis. The working knowledge you need lives under `
|
|
|
10
10
|
- `.trellis/workspace/` — per-developer journals and session traces
|
|
11
11
|
- `.trellis/tasks/` — active and archived tasks (PRDs, research, jsonl context)
|
|
12
12
|
|
|
13
|
-
If a Trellis command is available on
|
|
13
|
+
If a Trellis command is available on Cursor (e.g. `/trellis:finish-work`, `/trellis:continue`), prefer it over manual steps.
|
|
14
14
|
|
|
15
15
|
## Command surface (what is user-invocable vs internal)
|
|
16
16
|
|
|
17
17
|
Only a handful of Trellis entry points are meant for **manual `/` invocation**. Everything else is an **internal auto-triggered skill** — the agent loads it via the skill matcher or workflow routing, not by being called directly. Do **not** manually invoke internal skills through the slash palette.
|
|
18
18
|
|
|
19
|
-
- **User-invocable (manual)**: `/trellis-continue`, `/trellis-finish-work` (and `/trellis-start`
|
|
19
|
+
- **User-invocable (manual)**: `/trellis-continue`, `/trellis-finish-work` (and `/trellis-start` when needed).
|
|
20
20
|
- **Internal auto-triggered (do NOT call manually)**: `trellis-brainstorm`, `trellis-before-dev`, `trellis-check`, `trellis-break-loop`, `trellis-update-spec`, `trellis-micro-grill`, `trellis-meta`, `trellis-spec-bootstrap`, `trellis-skill-creator`, `smart-search-cli`. These activate on their own when the workflow/skill matcher decides they fit.
|
|
21
21
|
|
|
22
22
|
## Web research routing (smart-search first)
|
|
23
23
|
|
|
24
24
|
For **any external / current / web fact**, use **smart-search** (`run_smart_search.py`) **first**. 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. See `.trellis/spec/guides/retrieval-daily-guide.md` and the `smart-search-cli` skill.
|
|
25
25
|
|
|
26
|
-
If you're using Codex or another agent-capable tool, additional project-scoped helpers may live in:
|
|
27
|
-
- `.agents/skills/` — reusable Trellis skills
|
|
28
|
-
- `.codex/agents/` — optional custom subagents
|
|
29
|
-
|
|
30
26
|
Managed by Trellis. Edits outside this block are preserved; edits inside may be overwritten by a future `trellis update`.
|
|
31
27
|
|
|
32
28
|
<!-- TRELLIS:END -->
|
|
@@ -26,5 +26,6 @@ export declare const guidesCrossLayerThinkingGuideContent: string;
|
|
|
26
26
|
export declare const guidesCodeReuseThinkingGuideContent: string;
|
|
27
27
|
export declare const guidesDurableLearningDecisionGuideContent: string;
|
|
28
28
|
export declare const guidesRetrievalDailyGuideContent: string;
|
|
29
|
+
export declare const guidesCursorSemanticComplianceContent: string;
|
|
29
30
|
export declare const guidesCursorSubagentPolicyContent: string;
|
|
30
31
|
//# 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,EAAE,MAE3C,CAAC;AACF,eAAO,MAAM,kCAAkC,EAAE,MAEhD,CAAC;AACF,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,M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,eAAO,MAAM,qCAAqC,EAAE,MAEnD,CAAC;AACF,eAAO,MAAM,iCAAiC,EAAE,MAE/C,CAAC"}
|
|
@@ -51,5 +51,6 @@ export const guidesCrossLayerThinkingGuideContent = readLocalTemplate("spec/guid
|
|
|
51
51
|
export const guidesCodeReuseThinkingGuideContent = readLocalTemplate("spec/guides/code-reuse-thinking-guide.md.txt");
|
|
52
52
|
export const guidesDurableLearningDecisionGuideContent = readLocalTemplate("spec/guides/durable-learning-decision-guide.md.txt");
|
|
53
53
|
export const guidesRetrievalDailyGuideContent = readLocalTemplate("spec/guides/retrieval-daily-guide.md.txt");
|
|
54
|
+
export const guidesCursorSemanticComplianceContent = readLocalTemplate("spec/guides/cursor-semantic-compliance.md.txt");
|
|
54
55
|
export const guidesCursorSubagentPolicyContent = readLocalTemplate("spec/guides/cursor-subagent-policy.md.txt");
|
|
55
56
|
//# 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,UAAU,CAAC,CAAC;AAEtC;;GAEG;AACH,SAAS,iBAAiB,CAAC,QAAgB;IACzC,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IAC3C,OAAO,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AACzC,CAAC;AAED,gFAAgF;AAChF,8BAA8B;AAC9B,gFAAgF;AAEhF,MAAM,CAAC,MAAM,eAA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,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"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# REC-06 — 12 题 semantic 切片实验(Cursor)
|
|
2
|
+
|
|
3
|
+
> 复制 `---BEGIN---` … `---END---` 到 **openclaw-retrieval-eval** 工作区新会话。
|
|
4
|
+
> 数据:`queries-semantic-slice.jsonl`(S01–S12)。
|
|
5
|
+
|
|
6
|
+
---BEGIN---
|
|
7
|
+
|
|
8
|
+
在 **`D:\openclaw-retrieval-eval`** 对 **`queries-semantic-slice.jsonl`** 共 **12 条**做 codebase 检索实验(非全 50 条)。
|
|
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
|
+
### 跑前
|
|
22
|
+
|
|
23
|
+
```powershell
|
|
24
|
+
python .trellis/scripts/batch_plan_envelope.py --queries queries-semantic-slice.jsonl --pretty
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### 产出
|
|
28
|
+
|
|
29
|
+
1. `runs/cursor-semantic-slice-<YYYYMMDD>.md`:12 条明细 + 工具表。
|
|
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. 汇总:
|
|
32
|
+
|
|
33
|
+
```powershell
|
|
34
|
+
python .trellis/scripts/aggregate_retrieval_telemetry.py runs/cursor-semantic-slice-<YYYYMMDD>/telemetry.jsonl --markdown
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
报告须含:`semantic_plan_rate`、`semantic_exec_rate`、`platform_semantic_exec_rate`、`cursor_fast_context_misuse_rate`。
|
|
38
|
+
|
|
39
|
+
从 **S01** 开始,逐条执行。
|
|
40
|
+
|
|
41
|
+
---END---
|
|
@@ -146,29 +146,29 @@ of that replay model.
|
|
|
146
146
|
|
|
147
147
|
## Gotcha: Python if/elif/else Exhaustive Check
|
|
148
148
|
|
|
149
|
-
**Problem**: Python's if/elif/else chains have no compile-time exhaustive check. When you add a new value to a `Literal` type (e.g.,
|
|
149
|
+
**Problem**: Python's if/elif/else chains have no compile-time exhaustive check. When you add a new value to a `Literal` type (e.g., a hook event name), existing if/elif/else chains silently fall through to `else` with wrong defaults.
|
|
150
150
|
|
|
151
|
-
**Symptom**: New
|
|
151
|
+
**Symptom**: New value works partially — some methods return the default branch instead of the new value's specific behavior. No error is raised.
|
|
152
152
|
|
|
153
153
|
**Example** (`cli_adapter.py`):
|
|
154
154
|
```python
|
|
155
|
-
# BAD: "
|
|
155
|
+
# BAD: "on_session_end" falls through to else, returns session-start defaults
|
|
156
156
|
@property
|
|
157
|
-
def
|
|
158
|
-
if self.
|
|
159
|
-
return "
|
|
157
|
+
def hook_kind(self) -> str:
|
|
158
|
+
if self.event == "on_session_start":
|
|
159
|
+
return "session-start"
|
|
160
160
|
else:
|
|
161
|
-
return "
|
|
161
|
+
return "session-start" # on_session_end silently gets "session-start"!
|
|
162
162
|
|
|
163
|
-
# GOOD: explicit branch for every
|
|
163
|
+
# GOOD: explicit branch for every value
|
|
164
164
|
@property
|
|
165
|
-
def
|
|
166
|
-
if self.
|
|
167
|
-
return "
|
|
168
|
-
elif self.
|
|
169
|
-
return "
|
|
165
|
+
def hook_kind(self) -> str:
|
|
166
|
+
if self.event == "on_session_start":
|
|
167
|
+
return "session-start"
|
|
168
|
+
elif self.event == "on_session_end":
|
|
169
|
+
return "session-end"
|
|
170
170
|
else:
|
|
171
|
-
return "
|
|
171
|
+
return "session-start"
|
|
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.
|
|
@@ -123,18 +123,17 @@ After implementation:
|
|
|
123
123
|
|
|
124
124
|
---
|
|
125
125
|
|
|
126
|
-
## Cross-
|
|
126
|
+
## Cross-Package Template Consistency
|
|
127
127
|
|
|
128
|
-
In Trellis, command templates (e.g., `record-session.md`) exist in **multiple
|
|
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
129
|
|
|
130
130
|
### Checklist: After Modifying Any Command Template
|
|
131
131
|
|
|
132
|
-
- [ ] Find
|
|
133
|
-
- [ ] Update
|
|
134
|
-
- [ ] For Gemini TOML: adapt line continuations (`\\` vs `\`) and triple-quoted strings
|
|
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)
|
|
135
134
|
- [ ] Run `/trellis:check-cross-layer` to verify nothing was missed
|
|
136
135
|
|
|
137
|
-
**Real-world example**: Updated `record-session.md` in
|
|
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.
|
|
138
137
|
|
|
139
138
|
---
|
|
140
139
|
|
|
@@ -177,20 +176,9 @@ release line.
|
|
|
177
176
|
- [ ] Treat beta content appearing under root release paths as a source-path bug,
|
|
178
177
|
not a rendering bug
|
|
179
178
|
|
|
180
|
-
**Real-world example**: A beta-only task workflow change documented
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
served 0.6 beta behavior under the Release selector. The fix was to restore root
|
|
184
|
-
release docs, move the 0.6 content to `beta/` and `zh/beta/`, and add a grep
|
|
185
|
-
audit for beta markers against the root release tree.
|
|
186
|
-
|
|
187
|
-
**Real-world example**: Codex inline mode changed workflow platform markers from
|
|
188
|
-
`[Codex]` / `[Kilo, Antigravity, Windsurf]` to `[codex-sub-agent]` /
|
|
189
|
-
`[codex-inline, Kilo, Antigravity, Windsurf]`. Fresh init was correct, but
|
|
190
|
-
`trellis update` only merged `[workflow-state:*]` blocks and preserved stale
|
|
191
|
-
markers outside those blocks. Result: upgraded projects got new hook scripts
|
|
192
|
-
but old workflow routing, so `get_context.py --mode phase --platform codex`
|
|
193
|
-
could return empty Phase 2.1 detail.
|
|
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.)
|
|
194
182
|
|
|
195
183
|
---
|
|
196
184
|
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
# Cross-Platform Thinking Guide
|
|
1
|
+
# Cross-Platform Thinking Guide (OS / path)
|
|
2
2
|
|
|
3
|
-
> **Purpose**: Catch
|
|
3
|
+
> **Purpose**: Catch OS and path assumptions before they become bugs.
|
|
4
|
+
>
|
|
5
|
+
> **Note (cursor-only fork):** This guide covers **operating-system and filesystem** portability (Windows vs macOS/Linux). AI platform adapter sync is Cursor-only; see `cross-layer-thinking-guide.md` for template consistency.
|
|
4
6
|
|
|
5
7
|
---
|
|
6
8
|
|
|
@@ -45,7 +47,7 @@ print("Run: {{PYTHON_CMD}} ./.trellis/scripts/task.py <args>")
|
|
|
45
47
|
|
|
46
48
|
```typescript
|
|
47
49
|
// In template file (settings.json):
|
|
48
|
-
{ "command": "{{PYTHON_CMD}} .
|
|
50
|
+
{ "command": "{{PYTHON_CMD}} .cursor/hooks/script.py" }
|
|
49
51
|
|
|
50
52
|
// In configurator:
|
|
51
53
|
function getPythonCommand(): string {
|
|
@@ -85,7 +87,7 @@ function warnIfPythonTooOld(): void {
|
|
|
85
87
|
}
|
|
86
88
|
```
|
|
87
89
|
|
|
88
|
-
**Rule 5**: Don't assume the Python version the AI CLI uses matches your shell's `python3`. The user's terminal may resolve `python3` → homebrew 3.11, but
|
|
90
|
+
**Rule 5**: Don't assume the Python version the AI CLI uses matches your shell's `python3`. The user's terminal may resolve `python3` → homebrew 3.11, but Cursor spawns hook subprocesses with a minimal PATH that resolves `python3` → `/usr/bin/python3` → macOS system 3.9. Distributed templates must either target the lowest plausible version or use `from __future__ import annotations` for PEP 604 syntax. See `cli/backend/script-conventions.md` → **CRITICAL: PEP 604 Annotations Require `from __future__ import annotations`** for the hard rule and audit check.
|
|
89
91
|
|
|
90
92
|
**Rule 6**: When calling Python from Python, use `sys.executable`:
|
|
91
93
|
|
|
@@ -137,7 +139,7 @@ A path string has two distinct roles. **Treat them differently.**
|
|
|
137
139
|
function collectTemplates(): Map<string, string> {
|
|
138
140
|
const files = new Map<string, string>();
|
|
139
141
|
for (const entry of walk(dir)) {
|
|
140
|
-
files.set(path.join(".
|
|
142
|
+
files.set(path.join(".cursor", entry), readFile(entry)); // \ on Windows
|
|
141
143
|
}
|
|
142
144
|
return files;
|
|
143
145
|
}
|
|
@@ -148,7 +150,7 @@ import { toPosix } from "../utils/posix.js";
|
|
|
148
150
|
function collectTemplates(): Map<string, string> {
|
|
149
151
|
const files = new Map<string, string>();
|
|
150
152
|
for (const entry of walk(dir)) {
|
|
151
|
-
files.set(toPosix(path.join(".
|
|
153
|
+
files.set(toPosix(path.join(".cursor", entry)), readFile(entry));
|
|
152
154
|
}
|
|
153
155
|
return files;
|
|
154
156
|
}
|
|
@@ -340,10 +342,10 @@ result = subprocess.run(
|
|
|
340
342
|
When making platform-related changes, check **all these locations**:
|
|
341
343
|
|
|
342
344
|
### Commands / Skills Sync
|
|
343
|
-
- [ ] New command/skill added to
|
|
344
|
-
- [ ]
|
|
345
|
-
- [ ]
|
|
346
|
-
- [ ]
|
|
345
|
+
- [ ] New command/skill added to the Cursor templates (`src/templates/cursor/` and `src/templates/common/`)
|
|
346
|
+
- [ ] Cursor test file updated with new entry in `EXPECTED_COMMAND_NAMES` / `EXPECTED_SKILL_NAMES`
|
|
347
|
+
- [ ] Command format matches Cursor convention (see `platform-integration.md` → Command Format)
|
|
348
|
+
- [ ] If the command exists in the dogfooded copy (`.cursor/`), sync it too
|
|
347
349
|
|
|
348
350
|
### Documentation & Help Text
|
|
349
351
|
- [ ] Docstrings at top of Python files
|
|
@@ -388,7 +390,7 @@ Before committing cross-platform code:
|
|
|
388
390
|
|
|
389
391
|
### 7. External Tool API Contracts
|
|
390
392
|
|
|
391
|
-
When integrating with external tools (
|
|
393
|
+
When integrating with external tools (Cursor, etc.), their API contracts are **implicit assumptions**.
|
|
392
394
|
|
|
393
395
|
**Rule**: Verify API formats from official documentation, don't guess.
|
|
394
396
|
|
|
@@ -624,9 +626,8 @@ printf '{"name":"trellis-smoke","version":"0.0.0"}\n' > "$tmpdir/package.json"
|
|
|
624
626
|
git -C "$tmpdir" init -q
|
|
625
627
|
(
|
|
626
628
|
cd "$tmpdir"
|
|
627
|
-
node /path/to/Trellis/packages/cli/bin/trellis.js init -u smoke --yes --
|
|
628
|
-
test -f .
|
|
629
|
-
test -f .agents/skills/<skill>/SKILL.md
|
|
629
|
+
node /path/to/Trellis/packages/cli/bin/trellis.js init -u smoke --yes --cursor
|
|
630
|
+
test -f .cursor/skills/<skill>/SKILL.md
|
|
630
631
|
grep -q '<skill>' .trellis/.template-hashes.json
|
|
631
632
|
node /path/to/Trellis/packages/cli/bin/trellis.js update --dry-run
|
|
632
633
|
)
|
|
@@ -11,6 +11,7 @@ Cursor has **four** channels that can put text in front of the model. They are *
|
|
|
11
11
|
| Channel | How it loads | Reliable on Cursor? | Trellis content here |
|
|
12
12
|
|---|---|---|---|
|
|
13
13
|
| `.cursor/rules/*.mdc` (`alwaysApply: true`) | Prepended before **every** prompt, independent path | ✅ **Yes** | `trellis-triage.mdc` (Request Triage hard gate) |
|
|
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 |
|
|
14
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) |
|
|
15
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 |
|
|
16
17
|
| `.trellis/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 |
|
|
@@ -23,7 +24,7 @@ Cursor has **four** channels that can put text in front of the model. They are *
|
|
|
23
24
|
|
|
24
25
|
- **Bug**: Cursor forum #158452 — `sessionStart` hook `additional_context` is executed and JSON-parsed correctly, but the value is **never added to the agent's initial system context**.
|
|
25
26
|
- **Status**: Confirmed by Cursor team (deanrie), internal bug filed, **no ETA** as of 2026-06-19.
|
|
26
|
-
- **Scope**: Affects `sessionStart` and `postToolUse` `additional_context` on Cursor IDE. The `env` field of the same hook **does** work (separate storage path).
|
|
27
|
+
- **Scope**: Affects `sessionStart` and `postToolUse` `additional_context` on Cursor IDE. The `env` field of the same hook **does** work (separate storage path).
|
|
27
28
|
- **Symptom**: hook runs (verifiable via side-channel log), valid JSON emitted, but the agent has zero awareness of the injected text (e.g. won't say a first-reply notice phrase).
|
|
28
29
|
|
|
29
30
|
### How to diagnose "is sessionStart injection actually reaching the model?"
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Cursor semantic compliance (REC-06)
|
|
2
|
+
|
|
3
|
+
## Plan vs exec
|
|
4
|
+
|
|
5
|
+
| Layer | What counts |
|
|
6
|
+
| --- | --- |
|
|
7
|
+
| **Plan** | Router route `platform-semantic` (`platformNative: true`) or injected plan step「内置代码库语义搜索」 |
|
|
8
|
+
| **Exec (Cursor)** | Tool log matches **platform semantic** patterns only — see `retrieval_tool_classification` |
|
|
9
|
+
| **Not semantic exec on Cursor** | `fast_context_search`, pure Grep/Read/codegraph |
|
|
10
|
+
|
|
11
|
+
## Classifying tool names from session logs
|
|
12
|
+
|
|
13
|
+
Use the same patterns as telemetry:
|
|
14
|
+
|
|
15
|
+
```powershell
|
|
16
|
+
python -c "from common.retrieval_tool_classification import classify_tool_calls; print(classify_tool_calls(['Grep','codebase_search'], platform='cursor'))"
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
(Run from `.trellis/scripts` with `PYTHONPATH` set to that directory.)
|
|
20
|
+
|
|
21
|
+
On **cursor**, `semantic_executed` = `platform_semantic_executed`. Track `fast_context_count` and `cursor_fast_context_misuse` separately.
|
|
22
|
+
|
|
23
|
+
## Plan-only metrics (eval)
|
|
24
|
+
|
|
25
|
+
```powershell
|
|
26
|
+
python .trellis/scripts/batch_plan_envelope.py --queries queries-semantic-slice.jsonl --pretty
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Do **not** use legacy `scripts/batch-plan-envelope.py` (looks for `semantic-fast-context` on all platforms).
|
|
30
|
+
|
|
31
|
+
## 12-query slice experiment
|
|
32
|
+
|
|
33
|
+
Prompt: `prompts/run-semantic-slice-12.md` in openclaw-retrieval-eval (or Trellis template copy).
|
|
34
|
+
|
|
35
|
+
Record per query:
|
|
36
|
+
|
|
37
|
+
- `plan_block_in_prompt` (visible `## 代码库检索计划` + 语义合规 block)
|
|
38
|
+
- `tools_called` verbatim from Cursor
|
|
39
|
+
- `platform_semantic_executed` / `fast_context_count` from classifier
|
|
40
|
+
|
|
41
|
+
Aggregate:
|
|
42
|
+
|
|
43
|
+
```powershell
|
|
44
|
+
python .trellis/scripts/aggregate_retrieval_telemetry.py runs/<run>/telemetry.jsonl --markdown
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Agent instructions
|
|
48
|
+
|
|
49
|
+
When `platform-semantic` is in the route list, `render_agent_instructions` appends **语义合规(Cursor)** requiring one built-in semantic search before Top-1 and logging the host tool name.
|
|
@@ -288,13 +288,13 @@ trellis_task_subagents:
|
|
|
288
288
|
| `beforeShellExecution` | Short-lived ticket for `task.py select` / `selected` / `exit` in shells |
|
|
289
289
|
| `stop` | Optional `retrieval-pack-latest.json` when task has `research/` |
|
|
290
290
|
|
|
291
|
-
**Per-turn workflow-state on Cursor:** deferred — use `sessionStart` + `/trellis-continue` / `get_context.py --mode phase` instead of
|
|
291
|
+
**Per-turn workflow-state on Cursor:** deferred — use `sessionStart` + `/trellis-continue` / `get_context.py --mode phase` instead of a per-turn hook injection (the relevant Cursor channel has a confirmed `additional_context` bug, see `cursor-context-injection-guide.md`).
|
|
292
292
|
|
|
293
293
|
---
|
|
294
294
|
|
|
295
295
|
## Parent/Child alignment
|
|
296
296
|
|
|
297
|
-
- `generate-child-prompt --mode subagent` → Parent **Task** `trellis-implement` by default; inline mode
|
|
297
|
+
- `generate-child-prompt --mode subagent` → Parent **Task** `trellis-implement` by default; inline mode is the portable default when dispatching without spawning a subagent.
|
|
298
298
|
- Child workers call `task.py set-child-state <parent> <child> <open|working|blocked|review> --evidence <ref>` — **no** session identity required for this command.
|
|
299
299
|
- Integration states (`accepted`, `integrating`, `integrated`, …) are **Parent-only** via `integrate-child` / `review-child`.
|
|
300
300
|
|