@blxzer/cursor-trellis 0.2.5 → 0.2.7
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 +30 -0
- package/README.md +13 -4
- package/bin/smart-search.js +2 -2
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +2 -1
- package/dist/commands/update.js.map +1 -1
- package/dist/configurators/workflow.d.ts.map +1 -1
- package/dist/configurators/workflow.js +8 -2
- package/dist/configurators/workflow.js.map +1 -1
- package/dist/migrations/manifests/0.2.2.json +9 -0
- package/dist/migrations/manifests/0.2.4.json +9 -0
- package/dist/migrations/manifests/0.2.5.json +9 -0
- package/dist/migrations/manifests/0.2.6.json +9 -0
- package/dist/migrations/manifests/0.2.7.json +9 -0
- package/dist/templates/common/skills/brainstorm.md +164 -163
- 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/spec/guides/execution-strategy.md.txt +43 -0
- package/dist/templates/markdown/spec/guides/index.md.txt +102 -101
- package/dist/templates/trellis/config/execution-strategy-rules.json +31 -0
- package/dist/templates/trellis/index.d.ts +2 -0
- package/dist/templates/trellis/index.d.ts.map +1 -1
- package/dist/templates/trellis/index.js +3 -0
- package/dist/templates/trellis/index.js.map +1 -1
- package/dist/templates/trellis/scripts/common/execution_strategy.py +268 -0
- package/dist/templates/trellis/scripts/common/task_store.py +1594 -1565
- package/dist/templates/trellis/scripts/task.py +906 -877
- package/dist/templates/trellis/workflow.md +805 -800
- package/package.json +2 -2
|
@@ -1,164 +1,165 @@
|
|
|
1
|
-
# Trellis Brainstorm
|
|
2
|
-
|
|
3
|
-
## Non-Negotiable Interview Contract
|
|
4
|
-
|
|
5
|
-
Interview me relentlessly about every aspect of this plan until we reach a shared understanding. Walk down each branch of the design tree, resolving dependencies between decisions one-by-one. For each question, provide your recommended answer.
|
|
6
|
-
|
|
7
|
-
Ask the questions one at a time.
|
|
8
|
-
|
|
9
|
-
## Non-Negotiable Evidence Rule
|
|
10
|
-
|
|
11
|
-
If a question can be answered by exploring the codebase, explore the codebase instead.
|
|
12
|
-
|
|
13
|
-
This is mandatory. Before asking the user a question, first check whether the answer is already available in code, tests, configs, docs, existing specs, or task history.
|
|
14
|
-
|
|
15
|
-
Do not ask the user to confirm facts that the repository can answer. Ask only for product intent, preference, scope, risk tolerance, or decisions that remain ambiguous after inspection.
|
|
16
|
-
|
|
17
|
-
---
|
|
18
|
-
|
|
19
|
-
Use this skill during Phase 1 planning to turn the user's request into clear requirements and planning artifacts.
|
|
20
|
-
|
|
21
|
-
**Agent-capable platforms:** Do **not** use legacy Claude-only grill subagents as a hard gate. Complete **PRD Grill** (below) and **`trellis-micro-grill`** for blocking open questions before treating planning as ready for `design.md` / `implement.md` / `start-execution --check`.
|
|
22
|
-
|
|
23
|
-
## Preconditions
|
|
24
|
-
|
|
25
|
-
Use this skill only after task-creation consent has been given and the user is ready to enter Trellis planning.
|
|
26
|
-
|
|
27
|
-
If no task exists yet, create one:
|
|
28
|
-
|
|
29
|
-
```bash
|
|
30
|
-
TASK_DIR=$(python ./.trellis/scripts/task.py create "<short task title>" --slug <slug>)
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
Use a concise title from the user's request. Use a slug without a date prefix. `task.py create` adds the `MM-DD-` directory prefix automatically.
|
|
34
|
-
|
|
35
|
-
`task.py create` creates the default `prd.md`. Update that file with the current understanding before asking follow-up questions.
|
|
36
|
-
|
|
37
|
-
## Two-phase planning overview
|
|
38
|
-
|
|
39
|
-
| Phase | Name | User questions |
|
|
40
|
-
| --- | --- | --- |
|
|
41
|
-
| **A** | Discovery Before Questions + PRD draft | None until repo evidence is exhausted |
|
|
42
|
-
| **B** | PRD Grill pass + Micro-grill unresolved | Only blocking business / risk / preference |
|
|
43
|
-
|
|
44
|
-
External facts during Discovery or Research: load `smart-search-cli`; on CLI/doctor failure use Cursor WebSearch/WebFetch and persist under `{TASK}/research/` with `source: cursor-web-fallback`.
|
|
45
|
-
|
|
46
|
-
---
|
|
47
|
-
|
|
48
|
-
## Phase A — Discovery Before Questions
|
|
49
|
-
|
|
50
|
-
Run **before** any user interview questions.
|
|
51
|
-
|
|
52
|
-
Inspect and record in `prd.md` (sections: **Confirmed facts**, initial **Out of scope**, draft **Goal**):
|
|
53
|
-
|
|
54
|
-
1. **Code & tests** — relevant modules, fixtures, configs, error paths.
|
|
55
|
-
2. **Specs** — `.trellis/spec/` indexes and layer guides for touched packages.
|
|
56
|
-
3. **History** — archived tasks, active task research, developer journal when useful.
|
|
57
|
-
4. **Platform** — project platform hooks, agents, and skills (see `.trellis/spec/guides/cursor-subagent-policy.md` when using Cursor); shared `.agents/skills/` when behavior spans platforms.
|
|
58
|
-
5. **Parent/Child** — if multiple independent deliverables, note child split early in `prd.md`.
|
|
59
|
-
|
|
60
|
-
Use retrieval per `.trellis/spec/guides/retrieval-daily-guide.md` (rg for literals, codegraph for structure, fast-context for semantic sweep).
|
|
61
|
-
|
|
62
|
-
Dispatch **`trellis-research`** (writable Agent) when a topic needs a dedicated `{TASK}/research/<topic>.md` file; do **not** use a subagent for PRD Grill itself.
|
|
63
|
-
|
|
64
|
-
## Phase A — PRD draft
|
|
65
|
-
|
|
66
|
-
After Discovery, flesh out `prd.md`:
|
|
67
|
-
|
|
68
|
-
- goal and user value
|
|
69
|
-
- confirmed facts (not restated as unverified requirements)
|
|
70
|
-
- requirements
|
|
71
|
-
- draft acceptance criteria
|
|
72
|
-
- out of scope
|
|
73
|
-
- open questions (tag **blocking** vs **nice-to-have**)
|
|
74
|
-
|
|
75
|
-
For complex tasks, start `design.md` / `implement.md` skeletons only when boundaries are already clear from Discovery; otherwise wait until Phase B.
|
|
76
|
-
|
|
77
|
-
## Phase B — PRD Grill pass
|
|
78
|
-
|
|
79
|
-
Treat `prd.md` (+ existing `design.md` fragments) as the **only document surface**. Run this checklist; fix the PRD in place (no new subagent):
|
|
80
|
-
|
|
81
|
-
| # | Check |
|
|
82
|
-
| --- | --- |
|
|
83
|
-
| 1 | **Goal & user value** — single clear statement |
|
|
84
|
-
| 2 | **Confirmed facts vs assumptions** — repo facts not listed as assumptions |
|
|
85
|
-
| 3 | **Testable acceptance criteria** |
|
|
86
|
-
| 4 | **Out of scope** explicit |
|
|
87
|
-
| 5 | **Dependencies & sequencing** |
|
|
88
|
-
| 6 | **Parent/Child & deliverables** when applicable |
|
|
89
|
-
| 7 | **Research & external facts** — smart-search or documented fallback |
|
|
90
|
-
| 8 | **Execution gate & artifacts** — `design.md` / `implement.md` / `verify.md` expectations |
|
|
91
|
-
| 9 | **Durable Learning** — Phase 3.3 will need `update-spec` \| `no-update` \| `unsure` |
|
|
92
|
-
| 10 | **Platform** — Cursor-first; PRD Grill in-session (no legacy grill-me / grill-with-docs subagent gate) |
|
|
93
|
-
| 11 | **Risk & rollback** for complex tasks |
|
|
94
|
-
| 12 | **Open questions** — only **blocking** strategic/preference items remain |
|
|
95
|
-
|
|
96
|
-
## Phase B — Micro-grill unresolved
|
|
97
|
-
|
|
98
|
-
For each **blocking** open question after the checklist, embed the **`trellis-micro-grill` contract**:
|
|
99
|
-
|
|
100
|
-
- exactly **one** question per message
|
|
101
|
-
- **Simplified Chinese** for user-facing text
|
|
102
|
-
- recommended answer + trade-off
|
|
103
|
-
- **update `prd.md` after every answer** before the next question
|
|
104
|
-
|
|
105
|
-
Stop micro-grill when no blocking open questions remain.
|
|
106
|
-
|
|
107
|
-
Do not ask process questions ("should I search?"). Do not re-ask facts Discovery already confirmed.
|
|
108
|
-
|
|
109
|
-
## Question Rules (Phase B only)
|
|
110
|
-
|
|
111
|
-
Each question must include:
|
|
112
|
-
|
|
113
|
-
- the decision needed
|
|
114
|
-
- why the answer matters
|
|
115
|
-
- your recommended answer
|
|
116
|
-
- the trade-off if the user chooses differently
|
|
117
|
-
|
|
118
|
-
## Artifact Rules
|
|
119
|
-
|
|
120
|
-
`prd.md` records requirements and acceptance:
|
|
121
|
-
|
|
122
|
-
- goal and user value
|
|
123
|
-
- confirmed facts
|
|
124
|
-
- requirements
|
|
125
|
-
- acceptance criteria
|
|
126
|
-
- out of scope
|
|
127
|
-
- open questions that still block planning
|
|
128
|
-
|
|
129
|
-
`design.md` records technical design for complex tasks:
|
|
130
|
-
|
|
131
|
-
- architecture and boundaries
|
|
132
|
-
- data flow and contracts
|
|
133
|
-
- compatibility and migration notes
|
|
134
|
-
- important trade-offs
|
|
135
|
-
- operational or rollback considerations
|
|
136
|
-
|
|
137
|
-
`implement.md` records execution planning for complex tasks:
|
|
138
|
-
|
|
139
|
-
- ordered implementation checklist
|
|
140
|
-
- validation commands
|
|
141
|
-
- risky files or rollback points
|
|
142
|
-
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
-
|
|
154
|
-
-
|
|
155
|
-
-
|
|
156
|
-
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
1
|
+
# Trellis Brainstorm
|
|
2
|
+
|
|
3
|
+
## Non-Negotiable Interview Contract
|
|
4
|
+
|
|
5
|
+
Interview me relentlessly about every aspect of this plan until we reach a shared understanding. Walk down each branch of the design tree, resolving dependencies between decisions one-by-one. For each question, provide your recommended answer.
|
|
6
|
+
|
|
7
|
+
Ask the questions one at a time.
|
|
8
|
+
|
|
9
|
+
## Non-Negotiable Evidence Rule
|
|
10
|
+
|
|
11
|
+
If a question can be answered by exploring the codebase, explore the codebase instead.
|
|
12
|
+
|
|
13
|
+
This is mandatory. Before asking the user a question, first check whether the answer is already available in code, tests, configs, docs, existing specs, or task history.
|
|
14
|
+
|
|
15
|
+
Do not ask the user to confirm facts that the repository can answer. Ask only for product intent, preference, scope, risk tolerance, or decisions that remain ambiguous after inspection.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
Use this skill during Phase 1 planning to turn the user's request into clear requirements and planning artifacts.
|
|
20
|
+
|
|
21
|
+
**Agent-capable platforms:** Do **not** use legacy Claude-only grill subagents as a hard gate. Complete **PRD Grill** (below) and **`trellis-micro-grill`** for blocking open questions before treating planning as ready for `design.md` / `implement.md` / `start-execution --check`.
|
|
22
|
+
|
|
23
|
+
## Preconditions
|
|
24
|
+
|
|
25
|
+
Use this skill only after task-creation consent has been given and the user is ready to enter Trellis planning.
|
|
26
|
+
|
|
27
|
+
If no task exists yet, create one:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
TASK_DIR=$(python ./.trellis/scripts/task.py create "<short task title>" --slug <slug>)
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Use a concise title from the user's request. Use a slug without a date prefix. `task.py create` adds the `MM-DD-` directory prefix automatically.
|
|
34
|
+
|
|
35
|
+
`task.py create` creates the default `prd.md`. Update that file with the current understanding before asking follow-up questions.
|
|
36
|
+
|
|
37
|
+
## Two-phase planning overview
|
|
38
|
+
|
|
39
|
+
| Phase | Name | User questions |
|
|
40
|
+
| --- | --- | --- |
|
|
41
|
+
| **A** | Discovery Before Questions + PRD draft | None until repo evidence is exhausted |
|
|
42
|
+
| **B** | PRD Grill pass + Micro-grill unresolved | Only blocking business / risk / preference |
|
|
43
|
+
|
|
44
|
+
External facts during Discovery or Research: load `smart-search-cli`; on CLI/doctor failure use Cursor WebSearch/WebFetch and persist under `{TASK}/research/` with `source: cursor-web-fallback`.
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Phase A — Discovery Before Questions
|
|
49
|
+
|
|
50
|
+
Run **before** any user interview questions.
|
|
51
|
+
|
|
52
|
+
Inspect and record in `prd.md` (sections: **Confirmed facts**, initial **Out of scope**, draft **Goal**):
|
|
53
|
+
|
|
54
|
+
1. **Code & tests** — relevant modules, fixtures, configs, error paths.
|
|
55
|
+
2. **Specs** — `.trellis/spec/` indexes and layer guides for touched packages.
|
|
56
|
+
3. **History** — archived tasks, active task research, developer journal when useful.
|
|
57
|
+
4. **Platform** — project platform hooks, agents, and skills (see `.trellis/spec/guides/cursor-subagent-policy.md` when using Cursor); shared `.agents/skills/` when behavior spans platforms.
|
|
58
|
+
5. **Parent/Child** — if multiple independent deliverables, note child split early in `prd.md`.
|
|
59
|
+
|
|
60
|
+
Use retrieval per `.trellis/spec/guides/retrieval-daily-guide.md` (rg for literals, codegraph for structure, fast-context for semantic sweep).
|
|
61
|
+
|
|
62
|
+
Dispatch **`trellis-research`** (writable Agent) when a topic needs a dedicated `{TASK}/research/<topic>.md` file; do **not** use a subagent for PRD Grill itself.
|
|
63
|
+
|
|
64
|
+
## Phase A — PRD draft
|
|
65
|
+
|
|
66
|
+
After Discovery, flesh out `prd.md`:
|
|
67
|
+
|
|
68
|
+
- goal and user value
|
|
69
|
+
- confirmed facts (not restated as unverified requirements)
|
|
70
|
+
- requirements
|
|
71
|
+
- draft acceptance criteria
|
|
72
|
+
- out of scope
|
|
73
|
+
- open questions (tag **blocking** vs **nice-to-have**)
|
|
74
|
+
|
|
75
|
+
For complex tasks, start `design.md` / `implement.md` skeletons only when boundaries are already clear from Discovery; otherwise wait until Phase B.
|
|
76
|
+
|
|
77
|
+
## Phase B — PRD Grill pass
|
|
78
|
+
|
|
79
|
+
Treat `prd.md` (+ existing `design.md` fragments) as the **only document surface**. Run this checklist; fix the PRD in place (no new subagent):
|
|
80
|
+
|
|
81
|
+
| # | Check |
|
|
82
|
+
| --- | --- |
|
|
83
|
+
| 1 | **Goal & user value** — single clear statement |
|
|
84
|
+
| 2 | **Confirmed facts vs assumptions** — repo facts not listed as assumptions |
|
|
85
|
+
| 3 | **Testable acceptance criteria** |
|
|
86
|
+
| 4 | **Out of scope** explicit |
|
|
87
|
+
| 5 | **Dependencies & sequencing** |
|
|
88
|
+
| 6 | **Parent/Child & deliverables** when applicable |
|
|
89
|
+
| 7 | **Research & external facts** — smart-search or documented fallback |
|
|
90
|
+
| 8 | **Execution gate & artifacts** — `design.md` / `implement.md` / `verify.md` expectations |
|
|
91
|
+
| 9 | **Durable Learning** — Phase 3.3 will need `update-spec` \| `no-update` \| `unsure` |
|
|
92
|
+
| 10 | **Platform** — Cursor-first; PRD Grill in-session (no legacy grill-me / grill-with-docs subagent gate) |
|
|
93
|
+
| 11 | **Risk & rollback** for complex tasks |
|
|
94
|
+
| 12 | **Open questions** — only **blocking** strategic/preference items remain |
|
|
95
|
+
|
|
96
|
+
## Phase B — Micro-grill unresolved
|
|
97
|
+
|
|
98
|
+
For each **blocking** open question after the checklist, embed the **`trellis-micro-grill` contract**:
|
|
99
|
+
|
|
100
|
+
- exactly **one** question per message
|
|
101
|
+
- **Simplified Chinese** for user-facing text
|
|
102
|
+
- recommended answer + trade-off
|
|
103
|
+
- **update `prd.md` after every answer** before the next question
|
|
104
|
+
|
|
105
|
+
Stop micro-grill when no blocking open questions remain.
|
|
106
|
+
|
|
107
|
+
Do not ask process questions ("should I search?"). Do not re-ask facts Discovery already confirmed.
|
|
108
|
+
|
|
109
|
+
## Question Rules (Phase B only)
|
|
110
|
+
|
|
111
|
+
Each question must include:
|
|
112
|
+
|
|
113
|
+
- the decision needed
|
|
114
|
+
- why the answer matters
|
|
115
|
+
- your recommended answer
|
|
116
|
+
- the trade-off if the user chooses differently
|
|
117
|
+
|
|
118
|
+
## Artifact Rules
|
|
119
|
+
|
|
120
|
+
`prd.md` records requirements and acceptance:
|
|
121
|
+
|
|
122
|
+
- goal and user value
|
|
123
|
+
- confirmed facts
|
|
124
|
+
- requirements
|
|
125
|
+
- acceptance criteria
|
|
126
|
+
- out of scope
|
|
127
|
+
- open questions that still block planning
|
|
128
|
+
|
|
129
|
+
`design.md` records technical design for complex tasks:
|
|
130
|
+
|
|
131
|
+
- architecture and boundaries
|
|
132
|
+
- data flow and contracts
|
|
133
|
+
- compatibility and migration notes
|
|
134
|
+
- important trade-offs
|
|
135
|
+
- operational or rollback considerations
|
|
136
|
+
|
|
137
|
+
`implement.md` records execution planning for complex tasks:
|
|
138
|
+
|
|
139
|
+
- ordered implementation checklist
|
|
140
|
+
- validation commands
|
|
141
|
+
- risky files or rollback points
|
|
142
|
+
- **Development Strategy Contract** (`execution_mode`, `isolation`, …): before finalizing, run `python3 ./.trellis/scripts/task.py suggest-execution-strategy <task-dir>` (or `--json`); reconcile suggestion with scope, then paste the approved YAML block into `implement.md`
|
|
143
|
+
- follow-up checks before `task.py start-execution --check`
|
|
144
|
+
|
|
145
|
+
Lightweight tasks may have only `prd.md`. Complex tasks must have `prd.md`, `design.md`, and `implement.md` before `task.py start-execution --check`.
|
|
146
|
+
|
|
147
|
+
`implement.md` is not a replacement for `implement.jsonl`. Use JSONL files only for manifest-style spec and research references when the task needs them.
|
|
148
|
+
|
|
149
|
+
## Completion criteria — PRD Grill done
|
|
150
|
+
|
|
151
|
+
Planning is ready for execution gate when **all** hold:
|
|
152
|
+
|
|
153
|
+
- PRD Grill checklist (12 items) satisfied or explicitly N/A with rationale in `prd.md`
|
|
154
|
+
- **No blocking** open questions in `prd.md`
|
|
155
|
+
- Acceptance criteria are testable; out of scope is explicit
|
|
156
|
+
- Complex tasks: `design.md` and `implement.md` present
|
|
157
|
+
- User reviewed artifacts or explicitly approved proceeding
|
|
158
|
+
|
|
159
|
+
Then proceed to Phase 1.2 Research (if needed), Phase 1.4 `task.py start-execution --check`, and implementation only after user approval.
|
|
160
|
+
|
|
161
|
+
Do not start implementation until the user approves or asks for implementation.
|
|
162
|
+
|
|
163
|
+
## Legacy planning flow (summary)
|
|
164
|
+
|
|
164
165
|
The former single "Planning Flow" is now Phase A + B above. Steps 4–6 map to Phase B micro-grill and artifact updates.
|
|
@@ -28,5 +28,6 @@ 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 guidesExecutionStrategyContent: string;
|
|
31
32
|
export declare const guidesCursorContextInjectionGuideContent: string;
|
|
32
33
|
//# 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,MAEjD,CAAC;AACF,eAAO,MAAM,yCAAyC,EAAE,MACiB,CAAC;AAC1E,eAAO,MAAM,gCAAgC,EAAE,M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AAO,MAAM,qCAAqC,EAAE,MAEnD,CAAC;AACF,eAAO,MAAM,iCAAiC,EAAE,MAE/C,CAAC;AACF,eAAO,MAAM,8BAA8B,EAAE,MAE5C,CAAC;AACF,eAAO,MAAM,wCAAwC,EAAE,MACiB,CAAC"}
|
|
@@ -53,5 +53,6 @@ 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 guidesExecutionStrategyContent = readLocalTemplate("spec/guides/execution-strategy.md.txt");
|
|
56
57
|
export const guidesCursorContextInjectionGuideContent = readLocalTemplate("spec/guides/cursor-context-injection-guide.md.txt");
|
|
57
58
|
//# 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,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,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,8BAA8B,GAAW,iBAAiB,CACrE,uCAAuC,CACxC,CAAC;AACF,MAAM,CAAC,MAAM,wCAAwC,GACnD,iBAAiB,CAAC,mDAAmD,CAAC,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Execution strategy (execution_mode / isolation)
|
|
2
|
+
|
|
3
|
+
> **Purpose**: Suggest a Development Strategy Contract before you freeze `implement.md`, and align Phase 2 dispatch with the approved contract.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Two orthogonal dimensions
|
|
8
|
+
|
|
9
|
+
| Field | Question |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| `execution_mode` | **Who** implements and checks? (`inline` main session, `worker` trellis-implement/check agents, `child-task` Child worker) |
|
|
12
|
+
| `isolation` | **Where** are files edited? (`main-worktree` vs `git-worktree` for Child) |
|
|
13
|
+
|
|
14
|
+
Non-git repo roots do **not** force `inline` for code Full tasks; they only affect whether `git-worktree` / `prepare-child-worktree` is recommended.
|
|
15
|
+
|
|
16
|
+
## Suggest (planning)
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
python3 ./.trellis/scripts/task.py suggest-execution-strategy <task-dir>
|
|
20
|
+
python3 ./.trellis/scripts/task.py suggest-execution-strategy <task-dir> --json
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Run during brainstorm / before finalizing the YAML block in `implement.md`. Reconcile suggestion with product intent; the contract in `implement.md` is authoritative after approval.
|
|
24
|
+
|
|
25
|
+
## Default policy (v1)
|
|
26
|
+
|
|
27
|
+
| Profile / signal | Suggested `execution_mode` | Suggested `isolation` |
|
|
28
|
+
| --- | --- | --- |
|
|
29
|
+
| Lite | (no contract) | — |
|
|
30
|
+
| Full + touches code | `worker` | `main-worktree` |
|
|
31
|
+
| Full + doc-only capabilities | `inline` | `main-worktree` |
|
|
32
|
+
| Parent / has children | `inline` | `main-worktree` |
|
|
33
|
+
| Child (`task.json` parent set) | `child-task` | `git-worktree` when git package root resolves; else `main-worktree` + WARN |
|
|
34
|
+
|
|
35
|
+
`touches_code` is deterministic: code `optional_capabilities`, `package`/`scope` path segments (`src`, `packages`, `scripts`, …), or Full with `design.md` and non-doc-only capabilities. Rules live in `.trellis/config/execution-strategy-rules.json`.
|
|
36
|
+
|
|
37
|
+
## Drift warning (preflight)
|
|
38
|
+
|
|
39
|
+
`task.py start-execution <task> --check` prints `[execution-strategy] WARN` when the approved contract differs from a fresh suggestion. **Advisory only** — does not fail the gate.
|
|
40
|
+
|
|
41
|
+
## Phase 2 alignment
|
|
42
|
+
|
|
43
|
+
See `workflow.md` Phase 2.1 / 2.2 tables: spawn `trellis-implement` / `trellis-check` only when `execution_mode: worker`.
|
|
@@ -1,101 +1,102 @@
|
|
|
1
|
-
# Thinking Guides
|
|
2
|
-
|
|
3
|
-
> **Purpose**: Expand your thinking to catch things you might not have considered.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Why Thinking Guides?
|
|
8
|
-
|
|
9
|
-
**Most bugs and tech debt come from "didn't think of that"**, not from lack of skill:
|
|
10
|
-
|
|
11
|
-
- Didn't think about what happens at layer boundaries → cross-layer bugs
|
|
12
|
-
- Didn't think about code patterns repeating → duplicated code everywhere
|
|
13
|
-
- Didn't think about edge cases → runtime errors
|
|
14
|
-
- Didn't think about future maintainers → unreadable code
|
|
15
|
-
|
|
16
|
-
These guides help you **ask the right questions before coding**.
|
|
17
|
-
|
|
18
|
-
---
|
|
19
|
-
|
|
20
|
-
## Available Guides
|
|
21
|
-
|
|
22
|
-
| Guide | Purpose | When to Use |
|
|
23
|
-
|-------|---------|-------------|
|
|
24
|
-
| [Durable Learning Decision Guide](./durable-learning-decision-guide.md) | Choose no-learning vs spec update vs learning artifact before archive | Finishing a task, parent review, or after `/trellis:break-loop` |
|
|
25
|
-
| [Code Reuse Thinking Guide](./code-reuse-thinking-guide.md) | Identify patterns and reduce duplication | When you notice repeated patterns |
|
|
26
|
-
| [Cross-Layer Thinking Guide](./cross-layer-thinking-guide.md) | Think through data flow across layers | Features spanning multiple layers |
|
|
27
|
-
| [Retrieval daily guide](./retrieval-daily-guide.md) | rg / codegraph / fast-context / smart-search / pack / router | Planning, research, finish verification |
|
|
28
|
-
| [Cursor subagent policy](./cursor-subagent-policy.md) | Task tool scenes, Agent mode, `model_policy: cursor-configured`, Cursor++ | Parent/Child dispatch, research/implement/check, parallel execution |
|
|
29
|
-
| [
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
- [ ]
|
|
39
|
-
- [ ]
|
|
40
|
-
- [ ]
|
|
41
|
-
- [ ] You
|
|
42
|
-
- [ ]
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
- [ ] You
|
|
50
|
-
- [ ] You
|
|
51
|
-
- [ ]
|
|
52
|
-
- [ ] **You're
|
|
53
|
-
- [ ]
|
|
54
|
-
- [ ]
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
- [ ] Reviewer
|
|
62
|
-
- [ ] Reviewer
|
|
63
|
-
- [ ] Reviewer
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
1
|
+
# Thinking Guides
|
|
2
|
+
|
|
3
|
+
> **Purpose**: Expand your thinking to catch things you might not have considered.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Why Thinking Guides?
|
|
8
|
+
|
|
9
|
+
**Most bugs and tech debt come from "didn't think of that"**, not from lack of skill:
|
|
10
|
+
|
|
11
|
+
- Didn't think about what happens at layer boundaries → cross-layer bugs
|
|
12
|
+
- Didn't think about code patterns repeating → duplicated code everywhere
|
|
13
|
+
- Didn't think about edge cases → runtime errors
|
|
14
|
+
- Didn't think about future maintainers → unreadable code
|
|
15
|
+
|
|
16
|
+
These guides help you **ask the right questions before coding**.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Available Guides
|
|
21
|
+
|
|
22
|
+
| Guide | Purpose | When to Use |
|
|
23
|
+
|-------|---------|-------------|
|
|
24
|
+
| [Durable Learning Decision Guide](./durable-learning-decision-guide.md) | Choose no-learning vs spec update vs learning artifact before archive | Finishing a task, parent review, or after `/trellis:break-loop` |
|
|
25
|
+
| [Code Reuse Thinking Guide](./code-reuse-thinking-guide.md) | Identify patterns and reduce duplication | When you notice repeated patterns |
|
|
26
|
+
| [Cross-Layer Thinking Guide](./cross-layer-thinking-guide.md) | Think through data flow across layers | Features spanning multiple layers |
|
|
27
|
+
| [Retrieval daily guide](./retrieval-daily-guide.md) | rg / codegraph / fast-context / smart-search / pack / router | Planning, research, finish verification |
|
|
28
|
+
| [Cursor subagent policy](./cursor-subagent-policy.md) | Task tool scenes, Agent mode, `model_policy: cursor-configured`, Cursor++ | Parent/Child dispatch, research/implement/check, parallel execution |
|
|
29
|
+
| [Execution strategy](./execution-strategy.md) | `suggest-execution-strategy`, rules JSON, inline vs worker vs child-task | Writing `implement.md` contract, Phase 2 dispatch |
|
|
30
|
+
| [Cursor context injection guide](./cursor-context-injection-guide.md) | Which Cursor channels reach the model (sessionStart bug, .cursor/rules, AGENTS.md) | "Agent ignored instructions" on Cursor, adding always-visible rules |
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Quick Reference: Thinking Triggers
|
|
35
|
+
|
|
36
|
+
### When to Think About Cross-Layer Issues
|
|
37
|
+
|
|
38
|
+
- [ ] Feature touches 3+ layers (API, Service, Component, Database)
|
|
39
|
+
- [ ] Data format changes between layers
|
|
40
|
+
- [ ] Multiple consumers need the same data
|
|
41
|
+
- [ ] You're not sure where to put some logic
|
|
42
|
+
- [ ] You are adding an event kind, JSONL record, RPC payload, or config field
|
|
43
|
+
- [ ] UI / command code starts casting raw payload fields directly
|
|
44
|
+
|
|
45
|
+
→ Read [Cross-Layer Thinking Guide](./cross-layer-thinking-guide.md)
|
|
46
|
+
|
|
47
|
+
### When to Think About Code Reuse
|
|
48
|
+
|
|
49
|
+
- [ ] You're writing similar code to something that exists
|
|
50
|
+
- [ ] You see the same pattern repeated 3+ times
|
|
51
|
+
- [ ] You're adding a new field to multiple places
|
|
52
|
+
- [ ] **You're modifying any constant or config**
|
|
53
|
+
- [ ] **You're creating a new utility/helper function** ← Search first!
|
|
54
|
+
- [ ] Two files read the same untyped payload field with local casts
|
|
55
|
+
- [ ] Multiple branches update the same derived state from `kind` / `action`
|
|
56
|
+
|
|
57
|
+
→ Read [Code Reuse Thinking Guide](./code-reuse-thinking-guide.md)
|
|
58
|
+
|
|
59
|
+
### When Verifying AI Cross-Review Results
|
|
60
|
+
|
|
61
|
+
- [ ] Reviewer claims "user input can be malicious" → Check the actual data source (internal manifest? user config? external API?)
|
|
62
|
+
- [ ] Reviewer flags "missing validation" → Is the data from a trusted internal source?
|
|
63
|
+
- [ ] Reviewer says "behavior change" → Read the code comments — is it intentional design?
|
|
64
|
+
- [ ] Reviewer identifies a "bug" in test → Mentally delete the feature being tested — does the test still pass? If yes → tautological test
|
|
65
|
+
|
|
66
|
+
**Common AI reviewer false-positive patterns**:
|
|
67
|
+
1. **Trust boundary confusion**: Treating internal data (bundled JSON manifests) as untrusted external input
|
|
68
|
+
2. **Ignoring design comments**: Flagging intentional behavior documented in code comments as bugs
|
|
69
|
+
3. **Variable misreading**: Not tracing a variable to its actual definition (e.g., Map keyed by path vs name)
|
|
70
|
+
|
|
71
|
+
**Verification rule**: Every CRITICAL/WARNING finding must be verified against the actual code before prioritizing. Budget ~35% false-positive rate for AI reviews.
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## Pre-Modification Rule (CRITICAL)
|
|
76
|
+
|
|
77
|
+
> **Before changing ANY value, ALWAYS search first!**
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
# Search for the value you're about to change
|
|
81
|
+
grep -r "value_to_change" .
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
This single habit prevents most "forgot to update X" bugs.
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## How to Use This Directory
|
|
89
|
+
|
|
90
|
+
1. **Before coding**: Skim the relevant thinking guide
|
|
91
|
+
2. **During coding**: If something feels repetitive or complex, check the guides
|
|
92
|
+
3. **After bugs**: Add new insights to the relevant guide (learn from mistakes)
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## Contributing
|
|
97
|
+
|
|
98
|
+
Found a new "didn't think of that" moment? Add it to the relevant guide.
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
**Core Principle**: 30 minutes of thinking saves 3 hours of debugging.
|