@mindfoldhq/trellis 0.6.0-beta.7 → 0.6.0-beta.8
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/dist/configurators/codex.d.ts.map +1 -1
- package/dist/configurators/codex.js +5 -3
- package/dist/configurators/codex.js.map +1 -1
- package/dist/configurators/shared.js +4 -4
- package/dist/configurators/shared.js.map +1 -1
- package/dist/migrations/manifests/0.6.0-beta.8.json +9 -0
- package/dist/templates/claude/agents/trellis-check.md +2 -2
- package/dist/templates/claude/agents/trellis-implement.md +8 -7
- package/dist/templates/codebuddy/agents/trellis-check.md +2 -2
- package/dist/templates/codebuddy/agents/trellis-implement.md +8 -7
- package/dist/templates/codex/agents/trellis-check.toml +4 -4
- package/dist/templates/codex/agents/trellis-implement.toml +4 -4
- package/dist/templates/codex/hooks/session-start.py +183 -119
- package/dist/templates/codex/skills/before-dev/SKILL.md +12 -6
- package/dist/templates/codex/skills/brainstorm/SKILL.md +113 -51
- package/dist/templates/codex/skills/check/SKILL.md +86 -18
- package/dist/templates/codex/skills/start/SKILL.md +33 -323
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-context-loading.md +7 -4
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-spec-structure.md +1 -1
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-workflow.md +3 -2
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/context-injection.md +5 -5
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/spec-system.md +1 -1
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/task-system.md +8 -6
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/agents.md +5 -4
- package/dist/templates/common/commands/continue.md +6 -5
- package/dist/templates/common/commands/start.md +7 -6
- package/dist/templates/common/skills/before-dev.md +12 -6
- package/dist/templates/common/skills/brainstorm.md +56 -42
- package/dist/templates/common/skills/check.md +7 -1
- package/dist/templates/copilot/hooks/session-start.py +183 -90
- package/dist/templates/copilot/prompts/before-dev.prompt.md +12 -6
- package/dist/templates/copilot/prompts/brainstorm.prompt.md +146 -84
- package/dist/templates/copilot/prompts/check.prompt.md +86 -18
- package/dist/templates/copilot/prompts/parallel.prompt.md +16 -8
- package/dist/templates/copilot/prompts/start.prompt.md +33 -367
- package/dist/templates/cursor/agents/trellis-check.md +2 -2
- package/dist/templates/cursor/agents/trellis-implement.md +8 -7
- package/dist/templates/droid/droids/trellis-check.md +2 -2
- package/dist/templates/droid/droids/trellis-implement.md +8 -7
- package/dist/templates/gemini/agents/trellis-implement.md +7 -6
- package/dist/templates/kiro/agents/trellis-check.json +1 -1
- package/dist/templates/kiro/agents/trellis-implement.json +1 -1
- package/dist/templates/opencode/agents/trellis-check.md +2 -2
- package/dist/templates/opencode/agents/trellis-implement.md +9 -8
- package/dist/templates/opencode/lib/session-utils.js +212 -123
- package/dist/templates/opencode/plugins/inject-subagent-context.js +23 -7
- package/dist/templates/opencode/plugins/inject-workflow-state.js +1 -4
- package/dist/templates/pi/extensions/trellis/index.ts.txt +7 -5
- package/dist/templates/qoder/agents/trellis-implement.md +7 -6
- package/dist/templates/shared-hooks/inject-subagent-context.py +36 -14
- package/dist/templates/shared-hooks/inject-workflow-state.py +18 -42
- package/dist/templates/shared-hooks/session-start.py +197 -163
- package/dist/templates/trellis/scripts/common/task_context.py +3 -3
- package/dist/templates/trellis/scripts/common/task_store.py +39 -7
- package/dist/templates/trellis/scripts/common/workflow_phase.py +7 -10
- package/dist/templates/trellis/scripts/task.py +3 -3
- package/dist/templates/trellis/workflow.md +98 -98
- package/package.json +1 -1
|
@@ -4,394 +4,60 @@ description: "Trellis Copilot prompt: Start Session"
|
|
|
4
4
|
|
|
5
5
|
# Start Session
|
|
6
6
|
|
|
7
|
-
Initialize
|
|
7
|
+
Initialize a Trellis-managed development session. This platform has no session-start hook, so manually load the equivalent context by following these steps (each one mirrors a section the hook would otherwise inject).
|
|
8
8
|
|
|
9
9
|
---
|
|
10
10
|
|
|
11
|
-
##
|
|
12
|
-
|
|
13
|
-
| Marker | Meaning | Executor |
|
|
14
|
-
|--------|---------|----------|
|
|
15
|
-
| `[AI]` | Bash scripts or Task calls executed by AI | You (AI) |
|
|
16
|
-
| `[USER]` | Slash commands executed by user | User |
|
|
17
|
-
|
|
18
|
-
---
|
|
19
|
-
|
|
20
|
-
## Initialization `[AI]`
|
|
21
|
-
|
|
22
|
-
### Step 1: Understand Development Workflow
|
|
23
|
-
|
|
24
|
-
First, read the workflow guide to understand the development process:
|
|
25
|
-
|
|
26
|
-
```bash
|
|
27
|
-
cat .trellis/workflow.md
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
**Follow the instructions in workflow.md** - it contains:
|
|
31
|
-
- Core principles (Read Before Write, Follow Standards, etc.)
|
|
32
|
-
- File system structure
|
|
33
|
-
- Development process
|
|
34
|
-
- Best practices
|
|
35
|
-
|
|
36
|
-
### Step 2: Get Current Context
|
|
37
|
-
|
|
38
|
-
```bash
|
|
39
|
-
python3 ./.trellis/scripts/get_context.py
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
This shows: developer identity, git status, current task (if any), active tasks.
|
|
43
|
-
|
|
44
|
-
### Step 3: Read Guidelines Index
|
|
45
|
-
|
|
46
|
-
```bash
|
|
47
|
-
python3 ./.trellis/scripts/get_context.py --mode packages
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
This shows available packages and their spec layers. Read the relevant spec indexes:
|
|
51
|
-
|
|
52
|
-
```bash
|
|
53
|
-
cat .trellis/spec/<package>/<layer>/index.md # Package-specific guidelines
|
|
54
|
-
cat .trellis/spec/guides/index.md # Thinking guides (always read)
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
> **Important**: The index files are navigation �?they list the actual guideline files (e.g., `error-handling.md`, `conventions.md`, `mock-strategies.md`).
|
|
58
|
-
> At this step, just read the indexes to understand what's available.
|
|
59
|
-
> When you start actual development, you MUST go back and read the specific guideline files relevant to your task, as listed in the index's Pre-Development Checklist.
|
|
60
|
-
|
|
61
|
-
### Step 4: Report and Ask
|
|
62
|
-
|
|
63
|
-
Report what you learned and ask: "What would you like to work on?"
|
|
64
|
-
|
|
65
|
-
---
|
|
66
|
-
|
|
67
|
-
## Task Classification
|
|
68
|
-
|
|
69
|
-
When user describes a task, classify it:
|
|
70
|
-
|
|
71
|
-
| Type | Criteria | Workflow |
|
|
72
|
-
|------|----------|----------|
|
|
73
|
-
| **Question** | User asks about code, architecture, or how something works | Answer directly |
|
|
74
|
-
| **Trivial Fix** | Typo fix, comment update, single-line change | Direct Edit |
|
|
75
|
-
| **Simple Task** | Clear goal, 1-2 files, well-defined scope | Quick confirm �?Implement |
|
|
76
|
-
| **Complex Task** | Vague goal, multiple files, architectural decisions | **Brainstorm �?Task Workflow** |
|
|
77
|
-
|
|
78
|
-
### Classification Signals
|
|
79
|
-
|
|
80
|
-
**Trivial/Simple indicators:**
|
|
81
|
-
- User specifies exact file and change
|
|
82
|
-
- "Fix the typo in X"
|
|
83
|
-
- "Add field Y to component Z"
|
|
84
|
-
- Clear acceptance criteria already stated
|
|
85
|
-
|
|
86
|
-
**Complex indicators:**
|
|
87
|
-
- "I want to add a feature for..."
|
|
88
|
-
- "Can you help me improve..."
|
|
89
|
-
- Mentions multiple areas or systems
|
|
90
|
-
- No clear implementation path
|
|
91
|
-
- User seems unsure about approach
|
|
92
|
-
|
|
93
|
-
### Decision Rule
|
|
94
|
-
|
|
95
|
-
> **If in doubt, use Brainstorm + Task Workflow.**
|
|
96
|
-
>
|
|
97
|
-
> Task Workflow ensures code-spec context is injected to agents, resulting in higher quality code.
|
|
98
|
-
> The overhead is minimal, but the benefit is significant.
|
|
99
|
-
|
|
100
|
-
---
|
|
101
|
-
|
|
102
|
-
## Question / Trivial Fix
|
|
103
|
-
|
|
104
|
-
For questions or trivial fixes, work directly:
|
|
105
|
-
|
|
106
|
-
1. Answer question or make the fix
|
|
107
|
-
2. If code was changed, remind user to run `/`
|
|
108
|
-
|
|
109
|
-
---
|
|
110
|
-
|
|
111
|
-
## Simple Task
|
|
112
|
-
|
|
113
|
-
For simple, well-defined tasks:
|
|
114
|
-
|
|
115
|
-
1. Quick confirm: "I understand you want to [goal]. Shall I proceed?"
|
|
116
|
-
2. If no, clarify and confirm again
|
|
117
|
-
3. **If yes: execute ALL steps below without stopping. Do NOT ask for additional confirmation between steps.**
|
|
118
|
-
- Create task directory (Phase 1 Path B, Step 2)
|
|
119
|
-
- Write PRD (Step 3)
|
|
120
|
-
- Research codebase (Phase 2, Step 5)
|
|
121
|
-
- Configure context (Step 6)
|
|
122
|
-
- Activate task (Step 7)
|
|
123
|
-
- Implement (Phase 3, Step 8)
|
|
124
|
-
- Check quality (Step 9)
|
|
125
|
-
- Complete (Step 10)
|
|
126
|
-
|
|
127
|
-
---
|
|
128
|
-
|
|
129
|
-
## Complex Task - Brainstorm First
|
|
130
|
-
|
|
131
|
-
For complex or vague tasks, **automatically start the brainstorm process** �?do NOT skip directly to implementation.
|
|
132
|
-
|
|
133
|
-
See `/` for the full process. Summary:
|
|
134
|
-
|
|
135
|
-
1. **Acknowledge and classify** - State your understanding
|
|
136
|
-
2. **Create task directory** - Track evolving requirements in `prd.md`
|
|
137
|
-
3. **Ask questions one at a time** - Update PRD after each answer
|
|
138
|
-
4. **Propose approaches** - For architectural decisions
|
|
139
|
-
5. **Confirm final requirements** - Get explicit approval
|
|
140
|
-
6. **Proceed to Task Workflow** - With clear requirements in PRD
|
|
141
|
-
|
|
142
|
-
> **Subtask Decomposition**: If brainstorm reveals multiple independent work items,
|
|
143
|
-
> consider creating subtasks using `--parent` flag or `add-subtask` command.
|
|
144
|
-
> See `/` Step 8 for details.
|
|
145
|
-
|
|
146
|
-
### Key Brainstorm Principles
|
|
147
|
-
|
|
148
|
-
| Principle | Description |
|
|
149
|
-
|-----------|-------------|
|
|
150
|
-
| **One question at a time** | Never overwhelm with multiple questions |
|
|
151
|
-
| **Update PRD immediately** | After each answer, update the document |
|
|
152
|
-
| **Prefer multiple choice** | Easier for users to answer |
|
|
153
|
-
| **YAGNI** | Challenge unnecessary complexity |
|
|
154
|
-
|
|
155
|
-
---
|
|
156
|
-
|
|
157
|
-
## Task Workflow (Development Tasks)
|
|
158
|
-
|
|
159
|
-
**Why this workflow?**
|
|
160
|
-
- Research Agent analyzes what code-spec files are needed
|
|
161
|
-
- Code-spec files are configured in jsonl files
|
|
162
|
-
- Implement Agent receives code-spec context via Hook injection
|
|
163
|
-
- Check Agent verifies against code-spec requirements
|
|
164
|
-
- Result: Code that follows project conventions automatically
|
|
165
|
-
|
|
166
|
-
### Overview: Two Entry Points
|
|
167
|
-
|
|
168
|
-
```
|
|
169
|
-
From Brainstorm (Complex Task):
|
|
170
|
-
PRD confirmed �?Research �?Configure Context �?Activate �?Implement �?Check �?Complete
|
|
171
|
-
|
|
172
|
-
From Simple Task:
|
|
173
|
-
Confirm �?Create Task �?Write PRD �?Research �?Configure Context �?Activate �?Implement �?Check �?Complete
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
**Key principle: Research happens AFTER requirements are clear (PRD exists).**
|
|
177
|
-
|
|
178
|
-
---
|
|
179
|
-
|
|
180
|
-
### Phase 1: Establish Requirements
|
|
181
|
-
|
|
182
|
-
#### Path A: From Brainstorm (skip to Phase 2)
|
|
183
|
-
|
|
184
|
-
PRD and task directory already exist from brainstorm. Skip directly to Phase 2.
|
|
185
|
-
|
|
186
|
-
#### Path B: From Simple Task
|
|
187
|
-
|
|
188
|
-
**Step 1: Confirm Understanding** `[AI]`
|
|
189
|
-
|
|
190
|
-
Quick confirm:
|
|
191
|
-
- What is the goal?
|
|
192
|
-
- What type of development? (frontend / backend / fullstack)
|
|
193
|
-
- Any specific requirements or constraints?
|
|
194
|
-
|
|
195
|
-
**Step 2: Create Task Directory** `[AI]`
|
|
11
|
+
## Step 1: Current state
|
|
12
|
+
Identity, git status, current task, active tasks, journal location.
|
|
196
13
|
|
|
197
14
|
```bash
|
|
198
|
-
|
|
199
|
-
```
|
|
200
|
-
|
|
201
|
-
**Step 3: Write PRD** `[AI]`
|
|
202
|
-
|
|
203
|
-
Create `prd.md` in the task directory with:
|
|
204
|
-
|
|
205
|
-
```markdown
|
|
206
|
-
# <Task Title>
|
|
207
|
-
|
|
208
|
-
## Goal
|
|
209
|
-
<What we're trying to achieve>
|
|
210
|
-
|
|
211
|
-
## Requirements
|
|
212
|
-
- <Requirement 1>
|
|
213
|
-
- <Requirement 2>
|
|
214
|
-
|
|
215
|
-
## Acceptance Criteria
|
|
216
|
-
- [ ] <Criterion 1>
|
|
217
|
-
- [ ] <Criterion 2>
|
|
218
|
-
|
|
219
|
-
## Technical Notes
|
|
220
|
-
<Any technical decisions or constraints>
|
|
221
|
-
```
|
|
222
|
-
|
|
223
|
-
---
|
|
224
|
-
|
|
225
|
-
### Phase 2: Prepare for Implementation (shared)
|
|
226
|
-
|
|
227
|
-
> Both paths converge here. PRD and task directory must exist before proceeding.
|
|
228
|
-
|
|
229
|
-
**Step 4: Code-Spec Depth Check** `[AI]`
|
|
230
|
-
|
|
231
|
-
If the task touches infra or cross-layer contracts, do not start implementation until code-spec depth is defined.
|
|
232
|
-
|
|
233
|
-
Trigger this requirement when the change includes any of:
|
|
234
|
-
- New or changed command/API signatures
|
|
235
|
-
- Database schema or migration changes
|
|
236
|
-
- Infra integrations (storage, queue, cache, secrets, env contracts)
|
|
237
|
-
- Cross-layer payload transformations
|
|
238
|
-
|
|
239
|
-
Must-have before proceeding:
|
|
240
|
-
- [ ] Target code-spec files to update are identified
|
|
241
|
-
- [ ] Concrete contract is defined (signature, fields, env keys)
|
|
242
|
-
- [ ] Validation and error matrix is defined
|
|
243
|
-
- [ ] At least one Good/Base/Bad case is defined
|
|
244
|
-
|
|
245
|
-
**Step 5: Research the Codebase** `[AI]`
|
|
246
|
-
|
|
247
|
-
Based on the confirmed PRD, call Research Agent to find relevant specs and patterns:
|
|
248
|
-
|
|
249
|
-
```
|
|
250
|
-
Task(
|
|
251
|
-
subagent_type: "trellis-research",
|
|
252
|
-
prompt: "Analyze the codebase for this task:
|
|
253
|
-
|
|
254
|
-
Task: <goal from PRD>
|
|
255
|
-
Type: <frontend/backend/fullstack>
|
|
256
|
-
|
|
257
|
-
Please find:
|
|
258
|
-
1. Relevant code-spec files in .trellis/spec/
|
|
259
|
-
2. Existing code patterns to follow (find 2-3 examples)
|
|
260
|
-
3. Files that will likely need modification
|
|
261
|
-
|
|
262
|
-
Output:
|
|
263
|
-
## Relevant Code-Specs
|
|
264
|
-
- <path>: <why it's relevant>
|
|
265
|
-
|
|
266
|
-
## Code Patterns Found
|
|
267
|
-
- <pattern>: <example file path>
|
|
268
|
-
|
|
269
|
-
## Files to Modify
|
|
270
|
-
- <path>: <what change>"
|
|
271
|
-
)
|
|
15
|
+
{{PYTHON_CMD}} ./.trellis/scripts/get_context.py
|
|
272
16
|
```
|
|
273
17
|
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
`implement.jsonl` and `check.jsonl` were seeded on `task.py create` with a single self-describing `_example` line. Curate real entries now (see workflow.md Phase 1.3 for the full rule):
|
|
18
|
+
If this output includes a line beginning `Trellis update available:`, copy the full line verbatim when summarizing session context. Do not shorten operational command hints.
|
|
277
19
|
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
- Split: `implement.jsonl` = specs the implement sub-agent needs; `check.jsonl` = specs the check sub-agent needs.
|
|
281
|
-
|
|
282
|
-
Discover available specs:
|
|
20
|
+
## Step 2: Workflow overview
|
|
21
|
+
Phase Index + skill routing table + DO-NOT-skip rules.
|
|
283
22
|
|
|
284
23
|
```bash
|
|
285
|
-
|
|
24
|
+
{{PYTHON_CMD}} ./.trellis/scripts/get_context.py --mode phase
|
|
286
25
|
```
|
|
287
26
|
|
|
288
|
-
|
|
27
|
+
Full guide in `.trellis/workflow.md` (read on demand).
|
|
289
28
|
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
python3 ./.trellis/scripts/task.py add-context "$TASK_DIR" check "<path>" "<reason>"
|
|
293
|
-
```
|
|
294
|
-
|
|
295
|
-
**Step 7: Activate Task** `[AI]`
|
|
29
|
+
## Step 3: Guideline indexes
|
|
30
|
+
Discover packages + spec layers, then read each relevant index file.
|
|
296
31
|
|
|
297
32
|
```bash
|
|
298
|
-
|
|
33
|
+
{{PYTHON_CMD}} ./.trellis/scripts/get_context.py --mode packages
|
|
34
|
+
cat .trellis/spec/guides/index.md
|
|
35
|
+
cat .trellis/spec/<package>/<layer>/index.md # for each relevant layer
|
|
299
36
|
```
|
|
300
37
|
|
|
301
|
-
|
|
38
|
+
Index files list the specific guideline docs to read when you actually start coding.
|
|
302
39
|
|
|
303
|
-
|
|
40
|
+
## Step 4: Decide next action
|
|
41
|
+
From Step 1 you know the current task and status. Check the task directory:
|
|
304
42
|
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
**
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
Task(
|
|
313
|
-
subagent_type: "trellis-implement",
|
|
314
|
-
prompt: "Implement the task described in prd.md.
|
|
315
|
-
|
|
316
|
-
Follow all code-spec files that have been injected into your context.
|
|
317
|
-
Run lint and typecheck before finishing."
|
|
318
|
-
)
|
|
319
|
-
```
|
|
320
|
-
|
|
321
|
-
**Step 9: Check Quality** `[AI]`
|
|
322
|
-
|
|
323
|
-
Call Check Agent (code-spec context is auto-injected by hook):
|
|
324
|
-
|
|
325
|
-
```
|
|
326
|
-
Task(
|
|
327
|
-
subagent_type: "trellis-check",
|
|
328
|
-
prompt: "Review all code changes against the code-spec requirements.
|
|
329
|
-
|
|
330
|
-
Fix any issues you find directly.
|
|
331
|
-
Ensure lint and typecheck pass."
|
|
332
|
-
)
|
|
333
|
-
```
|
|
334
|
-
|
|
335
|
-
**Step 10: Complete** `[AI]`
|
|
336
|
-
|
|
337
|
-
1. Verify lint and typecheck pass
|
|
338
|
-
2. Report what was implemented
|
|
339
|
-
3. Remind user to:
|
|
340
|
-
- Test the changes
|
|
341
|
-
- Commit when ready
|
|
342
|
-
- Run `/` to record this session
|
|
343
|
-
|
|
344
|
-
---
|
|
345
|
-
|
|
346
|
-
## Continuing Existing Task
|
|
347
|
-
|
|
348
|
-
If `get_context.py` shows a current task:
|
|
349
|
-
|
|
350
|
-
1. Read the task's `prd.md` to understand the goal
|
|
351
|
-
2. Check `task.json` for current status and phase
|
|
352
|
-
3. Ask user: "Continue working on <task-name>?"
|
|
353
|
-
|
|
354
|
-
If yes, resume from the appropriate step (usually Step 7 or 8).
|
|
43
|
+
- **Active task status `planning` + no `prd.md`** → Phase 1.1. Load the `trellis-brainstorm` skill.
|
|
44
|
+
- **Active task status `planning` + `prd.md` exists** → stay in Phase 1. Lightweight tasks can be PRD-only; complex tasks need `design.md` + `implement.md`. Load the relevant Phase 1 step detail before `task.py start`.
|
|
45
|
+
- **Active task status `in_progress`** → Phase 2 step 2.1. Load the step detail:
|
|
46
|
+
```bash
|
|
47
|
+
{{PYTHON_CMD}} ./.trellis/scripts/get_context.py --mode phase --step 2.1 --platform {{CLI_FLAG}}
|
|
48
|
+
```
|
|
49
|
+
- **No active task** → classify first. For simple conversation / small task, ask only whether this turn should create a Trellis task. For complex work, ask whether you may create a Trellis task and enter planning. If the user says no, skip Trellis for this session.
|
|
355
50
|
|
|
356
51
|
---
|
|
357
52
|
|
|
358
|
-
##
|
|
359
|
-
|
|
360
|
-
### User Commands `[USER]`
|
|
361
|
-
|
|
362
|
-
| Command | When to Use |
|
|
363
|
-
|---------|-------------|
|
|
364
|
-
| `/` | Begin a session (this command) |
|
|
365
|
-
| `/` | Clarify vague requirements (called from start) |
|
|
366
|
-
| `/` | Complex tasks needing isolated worktree |
|
|
367
|
-
| `/` | Before committing changes |
|
|
368
|
-
| `/` | After completing a task |
|
|
369
|
-
|
|
370
|
-
### AI Scripts `[AI]`
|
|
371
|
-
|
|
372
|
-
| Script | Purpose |
|
|
373
|
-
|--------|---------|
|
|
374
|
-
| `python3 ./.trellis/scripts/get_context.py` | Get session context |
|
|
375
|
-
| `python3 ./.trellis/scripts/task.py create` | Create task directory (seeds jsonl on sub-agent platforms) |
|
|
376
|
-
| `python3 ./.trellis/scripts/task.py add-context` | Append code-spec/research entry to jsonl |
|
|
377
|
-
| `python3 ./.trellis/scripts/task.py start` | Set current task |
|
|
378
|
-
| `python3 ./.trellis/scripts/task.py finish` | Clear current task |
|
|
379
|
-
| `python3 ./.trellis/scripts/task.py archive` | Archive completed task |
|
|
380
|
-
|
|
381
|
-
### Sub Agents `[AI]`
|
|
382
|
-
|
|
383
|
-
| Agent | Purpose | Hook Injection |
|
|
384
|
-
|-------|---------|----------------|
|
|
385
|
-
| research | Analyze codebase | No (reads directly) |
|
|
386
|
-
| implement | Write code | Yes (implement.jsonl) |
|
|
387
|
-
| check | Review & fix | Yes (check.jsonl) |
|
|
388
|
-
| debug | Fix specific issues | Yes (debug.jsonl) |
|
|
389
|
-
|
|
390
|
-
---
|
|
53
|
+
## Skill routing (quick reference)
|
|
391
54
|
|
|
392
|
-
|
|
55
|
+
| User intent | Skill |
|
|
56
|
+
|---|---|
|
|
57
|
+
| New feature / unclear requirements | `trellis-brainstorm` |
|
|
58
|
+
| About to write code | `trellis-before-dev` |
|
|
59
|
+
| Done coding / quality check | `trellis-check` |
|
|
60
|
+
| Stuck / fixed same bug multiple times | `trellis-break-loop` |
|
|
61
|
+
| Learned something worth capturing | `trellis-update-spec` |
|
|
393
62
|
|
|
394
|
-
|
|
395
|
-
>
|
|
396
|
-
> The Task Workflow ensures agents receive relevant code-spec context automatically.
|
|
397
|
-
> This is more reliable than hoping the AI "remembers" conventions.
|
|
63
|
+
Full rules + anti-rationalization table in `.trellis/workflow.md`.
|
|
@@ -19,8 +19,8 @@ You are already the `trellis-check` sub-agent that the main session dispatched.
|
|
|
19
19
|
|
|
20
20
|
Look for the `<!-- trellis-hook-injected -->` marker in your input above.
|
|
21
21
|
|
|
22
|
-
- **If the marker is present**:
|
|
23
|
-
- **If the marker is absent**: hook injection didn't fire (Windows + Claude Code, `--continue` resume, fork distribution, hooks disabled, etc.). Find the active task path from your dispatch prompt's first line `Active task: <path>`, then Read `<task-path>/prd.md`
|
|
22
|
+
- **If the marker is present**: task artifacts, spec, and research files have already been auto-loaded for you above. Proceed with the check work directly.
|
|
23
|
+
- **If the marker is absent**: hook injection didn't fire (Windows + Claude Code, `--continue` resume, fork distribution, hooks disabled, etc.). Find the active task path from your dispatch prompt's first line `Active task: <path>`, then Read `<task-path>/check.jsonl`, each listed file, `<task-path>/prd.md`, `<task-path>/design.md` if present, and `<task-path>/implement.md` if present before doing the work.
|
|
24
24
|
|
|
25
25
|
## Context
|
|
26
26
|
|
|
@@ -20,7 +20,7 @@ You are already the `trellis-implement` sub-agent that the main session dispatch
|
|
|
20
20
|
Look for the `<!-- trellis-hook-injected -->` marker in your input above.
|
|
21
21
|
|
|
22
22
|
- **If the marker is present**: prd / spec / research files have already been auto-loaded for you above. Proceed with the implementation work directly.
|
|
23
|
-
- **If the marker is absent**: hook injection didn't fire (Windows + Claude Code, `--continue` resume, fork distribution, hooks disabled, etc.). Find the active task path from your dispatch prompt's first line `Active task: <path>`, then Read `<task-path>/prd.md`, `<task-path>/
|
|
23
|
+
- **If the marker is absent**: hook injection didn't fire (Windows + Claude Code, `--continue` resume, fork distribution, hooks disabled, etc.). Find the active task path from your dispatch prompt's first line `Active task: <path>`, then Read `<task-path>/implement.jsonl`, each listed file, `<task-path>/prd.md`, `<task-path>/design.md` if present, and `<task-path>/implement.md` if present before doing the work.
|
|
24
24
|
|
|
25
25
|
## Context
|
|
26
26
|
|
|
@@ -28,13 +28,14 @@ Before implementing, read:
|
|
|
28
28
|
- `.trellis/workflow.md` - Project workflow
|
|
29
29
|
- `.trellis/spec/` - Development guidelines
|
|
30
30
|
- Task `prd.md` - Requirements document
|
|
31
|
-
- Task `
|
|
31
|
+
- Task `design.md` - Technical design (if exists)
|
|
32
|
+
- Task `implement.md` - Execution plan (if exists)
|
|
32
33
|
|
|
33
34
|
## Core Responsibilities
|
|
34
35
|
|
|
35
36
|
1. **Understand specs** - Read relevant spec files in `.trellis/spec/`
|
|
36
|
-
2. **Understand
|
|
37
|
-
3. **Implement features** - Write code following specs and
|
|
37
|
+
2. **Understand task artifacts** - Read prd.md, design.md if present, and implement.md if present
|
|
38
|
+
3. **Implement features** - Write code following specs and task artifacts
|
|
38
39
|
4. **Self-check** - Ensure code quality
|
|
39
40
|
5. **Report results** - Report completion status
|
|
40
41
|
|
|
@@ -59,15 +60,15 @@ Read relevant specs based on task type:
|
|
|
59
60
|
|
|
60
61
|
### 2. Understand Requirements
|
|
61
62
|
|
|
62
|
-
Read the task's prd.md and
|
|
63
|
+
Read the task's prd.md, design.md if present, and implement.md if present:
|
|
63
64
|
|
|
64
65
|
- What are the core requirements
|
|
65
66
|
- Key points of technical design
|
|
66
|
-
-
|
|
67
|
+
- Implementation order, validation commands, and rollback points
|
|
67
68
|
|
|
68
69
|
### 3. Implement Features
|
|
69
70
|
|
|
70
|
-
- Write code following specs and
|
|
71
|
+
- Write code following specs and task artifacts
|
|
71
72
|
- Follow existing code patterns
|
|
72
73
|
- Only do what's required, no over-engineering
|
|
73
74
|
|
|
@@ -12,8 +12,8 @@ You are the Check Agent in the Trellis workflow.
|
|
|
12
12
|
|
|
13
13
|
Look for the `<!-- trellis-hook-injected -->` marker in your input above.
|
|
14
14
|
|
|
15
|
-
- **If the marker is present**:
|
|
16
|
-
- **If the marker is absent**: hook injection didn't fire (Windows + Claude Code, `--continue` resume, fork distribution, hooks disabled, etc.). Find the active task path from your dispatch prompt's first line `Active task: <path>`, then Read `<task-path>/prd.md`
|
|
15
|
+
- **If the marker is present**: task artifacts, spec, and research files have already been auto-loaded for you above. Proceed with the check work directly.
|
|
16
|
+
- **If the marker is absent**: hook injection didn't fire (Windows + Claude Code, `--continue` resume, fork distribution, hooks disabled, etc.). Find the active task path from your dispatch prompt's first line `Active task: <path>`, then Read `<task-path>/check.jsonl`, each listed file, `<task-path>/prd.md`, `<task-path>/design.md` if present, and `<task-path>/implement.md` if present before doing the work.
|
|
17
17
|
|
|
18
18
|
## Context
|
|
19
19
|
|
|
@@ -13,7 +13,7 @@ You are the Implement Agent in the Trellis workflow.
|
|
|
13
13
|
Look for the `<!-- trellis-hook-injected -->` marker in your input above.
|
|
14
14
|
|
|
15
15
|
- **If the marker is present**: prd / spec / research files have already been auto-loaded for you above. Proceed with the implementation work directly.
|
|
16
|
-
- **If the marker is absent**: hook injection didn't fire (Windows + Claude Code, `--continue` resume, fork distribution, hooks disabled, etc.). Find the active task path from your dispatch prompt's first line `Active task: <path>`, then Read `<task-path>/prd.md`, `<task-path>/
|
|
16
|
+
- **If the marker is absent**: hook injection didn't fire (Windows + Claude Code, `--continue` resume, fork distribution, hooks disabled, etc.). Find the active task path from your dispatch prompt's first line `Active task: <path>`, then Read `<task-path>/implement.jsonl`, each listed file, `<task-path>/prd.md`, `<task-path>/design.md` if present, and `<task-path>/implement.md` if present before doing the work.
|
|
17
17
|
|
|
18
18
|
## Context
|
|
19
19
|
|
|
@@ -21,13 +21,14 @@ Before implementing, read:
|
|
|
21
21
|
- `.trellis/workflow.md` - Project workflow
|
|
22
22
|
- `.trellis/spec/` - Development guidelines
|
|
23
23
|
- Task `prd.md` - Requirements document
|
|
24
|
-
- Task `
|
|
24
|
+
- Task `design.md` - Technical design (if exists)
|
|
25
|
+
- Task `implement.md` - Execution plan (if exists)
|
|
25
26
|
|
|
26
27
|
## Core Responsibilities
|
|
27
28
|
|
|
28
29
|
1. **Understand specs** - Read relevant spec files in `.trellis/spec/`
|
|
29
|
-
2. **Understand
|
|
30
|
-
3. **Implement features** - Write code following specs and
|
|
30
|
+
2. **Understand task artifacts** - Read prd.md, design.md if present, and implement.md if present
|
|
31
|
+
3. **Implement features** - Write code following specs and task artifacts
|
|
31
32
|
4. **Self-check** - Ensure code quality
|
|
32
33
|
5. **Report results** - Report completion status
|
|
33
34
|
|
|
@@ -52,15 +53,15 @@ Read relevant specs based on task type:
|
|
|
52
53
|
|
|
53
54
|
### 2. Understand Requirements
|
|
54
55
|
|
|
55
|
-
Read the task's prd.md and
|
|
56
|
+
Read the task's prd.md, design.md if present, and implement.md if present:
|
|
56
57
|
|
|
57
58
|
- What are the core requirements
|
|
58
59
|
- Key points of technical design
|
|
59
|
-
-
|
|
60
|
+
- Implementation order, validation commands, and rollback points
|
|
60
61
|
|
|
61
62
|
### 3. Implement Features
|
|
62
63
|
|
|
63
|
-
- Write code following specs and
|
|
64
|
+
- Write code following specs and task artifacts
|
|
64
65
|
- Follow existing code patterns
|
|
65
66
|
- Only do what's required, no over-engineering
|
|
66
67
|
|
|
@@ -21,13 +21,14 @@ Before implementing, read:
|
|
|
21
21
|
- `.trellis/workflow.md` - Project workflow
|
|
22
22
|
- `.trellis/spec/` - Development guidelines
|
|
23
23
|
- Task `prd.md` - Requirements document
|
|
24
|
-
- Task `
|
|
24
|
+
- Task `design.md` - Technical design (if exists)
|
|
25
|
+
- Task `implement.md` - Execution plan (if exists)
|
|
25
26
|
|
|
26
27
|
## Core Responsibilities
|
|
27
28
|
|
|
28
29
|
1. **Understand specs** - Read relevant spec files in `.trellis/spec/`
|
|
29
|
-
2. **Understand
|
|
30
|
-
3. **Implement features** - Write code following specs and
|
|
30
|
+
2. **Understand task artifacts** - Read prd.md, design.md if present, and implement.md if present
|
|
31
|
+
3. **Implement features** - Write code following specs and task artifacts
|
|
31
32
|
4. **Self-check** - Ensure code quality
|
|
32
33
|
5. **Report results** - Report completion status
|
|
33
34
|
|
|
@@ -52,15 +53,15 @@ Read relevant specs based on task type:
|
|
|
52
53
|
|
|
53
54
|
### 2. Understand Requirements
|
|
54
55
|
|
|
55
|
-
Read the task's prd.md and
|
|
56
|
+
Read the task's prd.md, design.md if present, and implement.md if present:
|
|
56
57
|
|
|
57
58
|
- What are the core requirements
|
|
58
59
|
- Key points of technical design
|
|
59
|
-
-
|
|
60
|
+
- Implementation order, validation commands, and rollback points
|
|
60
61
|
|
|
61
62
|
### 3. Implement Features
|
|
62
63
|
|
|
63
|
-
- Write code following specs and
|
|
64
|
+
- Write code following specs and task artifacts
|
|
64
65
|
- Follow existing code patterns
|
|
65
66
|
- Only do what's required, no over-engineering
|
|
66
67
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "trellis-check",
|
|
3
3
|
"description": "Code quality check expert. Reviews code changes against specs and self-fixes issues.",
|
|
4
|
-
"prompt": "# Check Agent\n\nYou are the Check Agent in the Trellis workflow.\n\n## Recursion Guard\n\nYou are already the `trellis-check` sub-agent that the main session dispatched. Do the review and fixes directly.\n\n- Do NOT spawn another `trellis-check` or `trellis-implement` sub-agent.\n- If SessionStart context, workflow-state breadcrumbs, or workflow.md say to dispatch `trellis-implement` / `trellis-check`, treat that as a main-session instruction that is already satisfied by your current role.\n- Only the main session may dispatch Trellis implement/check agents. If more implementation work is needed, report that recommendation instead of spawning.\n\n## Trellis Context Loading Protocol\n\nLook for the `<!-- trellis-hook-injected -->` marker in your input above.\n\n- **If the marker is present**:
|
|
4
|
+
"prompt": "# Check Agent\n\nYou are the Check Agent in the Trellis workflow.\n\n## Recursion Guard\n\nYou are already the `trellis-check` sub-agent that the main session dispatched. Do the review and fixes directly.\n\n- Do NOT spawn another `trellis-check` or `trellis-implement` sub-agent.\n- If SessionStart context, workflow-state breadcrumbs, or workflow.md say to dispatch `trellis-implement` / `trellis-check`, treat that as a main-session instruction that is already satisfied by your current role.\n- Only the main session may dispatch Trellis implement/check agents. If more implementation work is needed, report that recommendation instead of spawning.\n\n## Trellis Context Loading Protocol\n\nLook for the `<!-- trellis-hook-injected -->` marker in your input above.\n\n- **If the marker is present**: task artifacts, spec, and research files have already been auto-loaded for you above. Proceed with the check work directly.\n- **If the marker is absent**: hook injection didn't fire (Windows + Claude Code, `--continue` resume, fork distribution, hooks disabled, etc.). Find the active task path from your dispatch prompt's first line `Active task: <path>`, then Read `<task-path>/check.jsonl`, each listed file, `<task-path>/prd.md`, `<task-path>/design.md` if present, and `<task-path>/implement.md` if present before doing the work.\n\n## Context\n\nBefore checking, read:\n- `.trellis/spec/` - Development guidelines\n- Pre-commit checklist for quality standards\n\n## Core Responsibilities\n\n1. **Get code changes** - Use git diff to get uncommitted code\n2. **Check against specs** - Verify code follows guidelines\n3. **Self-fix** - Fix issues yourself, not just report them\n4. **Run verification** - typecheck and lint\n\n## Important\n\n**Fix issues yourself**, don't just report them.\n\nYou have write and edit tools, you can modify code directly.\n\n---\n\n## Workflow\n\n### Step 1: Get Changes\n\n```bash\ngit diff --name-only # List changed files\ngit diff # View specific changes\n```\n\n### Step 2: Check Against Specs\n\nRead relevant specs in `.trellis/spec/` to check code:\n\n- Does it follow directory structure conventions\n- Does it follow naming conventions\n- Does it follow code patterns\n- Are there missing types\n- Are there potential bugs\n\n### Step 3: Self-Fix\n\nAfter finding issues:\n\n1. Fix the issue directly (use edit tool)\n2. Record what was fixed\n3. Continue checking other issues\n\n### Step 4: Run Verification\n\nRun project's lint and typecheck commands to verify changes.\n\nIf failed, fix issues and re-run.\n\n---\n\n## Report Format\n\n```markdown\n## Self-Check Complete\n\n### Files Checked\n\n- src/components/Feature.tsx\n- src/hooks/useFeature.ts\n\n### Issues Found and Fixed\n\n1. `<file>:<line>` - <what was fixed>\n2. `<file>:<line>` - <what was fixed>\n\n### Issues Not Fixed\n\n(If there are issues that cannot be self-fixed, list them here with reasons)\n\n### Verification Results\n\n- TypeCheck: Passed\n- Lint: Passed\n\n### Summary\n\nChecked X files, found Y issues, all fixed.\n```",
|
|
5
5
|
"tools": [
|
|
6
6
|
"read",
|
|
7
7
|
"write",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "trellis-implement",
|
|
3
3
|
"description": "Code implementation expert. Understands specs and requirements, then implements features. No git commit allowed.",
|
|
4
|
-
"prompt": "# Implement Agent\n\nYou are the Implement Agent in the Trellis workflow.\n\n## Recursion Guard\n\nYou are already the `trellis-implement` sub-agent that the main session dispatched. Do the implementation work directly.\n\n- Do NOT spawn another `trellis-implement` or `trellis-check` sub-agent.\n- If SessionStart context, workflow-state breadcrumbs, or workflow.md say to dispatch `trellis-implement` / `trellis-check`, treat that as a main-session instruction that is already satisfied by your current role.\n- Only the main session may dispatch Trellis implement/check agents. If more parallel work is needed, report that recommendation instead of spawning.\n\n## Trellis Context Loading Protocol\n\nLook for the `<!-- trellis-hook-injected -->` marker in your input above.\n\n- **If the marker is present**: prd / spec / research files have already been auto-loaded for you above. Proceed with the implementation work directly.\n- **If the marker is absent**: hook injection didn't fire (Windows + Claude Code, `--continue` resume, fork distribution, hooks disabled, etc.). Find the active task path from your dispatch prompt's first line `Active task: <path>`, then Read `<task-path>/prd.md`, `<task-path>/
|
|
4
|
+
"prompt": "# Implement Agent\n\nYou are the Implement Agent in the Trellis workflow.\n\n## Recursion Guard\n\nYou are already the `trellis-implement` sub-agent that the main session dispatched. Do the implementation work directly.\n\n- Do NOT spawn another `trellis-implement` or `trellis-check` sub-agent.\n- If SessionStart context, workflow-state breadcrumbs, or workflow.md say to dispatch `trellis-implement` / `trellis-check`, treat that as a main-session instruction that is already satisfied by your current role.\n- Only the main session may dispatch Trellis implement/check agents. If more parallel work is needed, report that recommendation instead of spawning.\n\n## Trellis Context Loading Protocol\n\nLook for the `<!-- trellis-hook-injected -->` marker in your input above.\n\n- **If the marker is present**: prd / spec / research files have already been auto-loaded for you above. Proceed with the implementation work directly.\n- **If the marker is absent**: hook injection didn't fire (Windows + Claude Code, `--continue` resume, fork distribution, hooks disabled, etc.). Find the active task path from your dispatch prompt's first line `Active task: <path>`, then Read `<task-path>/implement.jsonl`, each listed file, `<task-path>/prd.md`, `<task-path>/design.md` if present, and `<task-path>/implement.md` if present before doing the work.\n\n## Context\n\nBefore implementing, read:\n- `.trellis/workflow.md` - Project workflow\n- `.trellis/spec/` - Development guidelines\n- Task `prd.md` - Requirements document\n- Task `design.md` - Technical design (if exists)\n- Task `implement.md` - Execution plan (if exists)\n\n## Core Responsibilities\n\n1. **Understand specs** - Read relevant spec files in `.trellis/spec/`\n2. **Understand task artifacts** - Read prd.md, design.md if present, and implement.md if present\n3. **Implement features** - Write code following specs and task artifacts\n4. **Self-check** - Ensure code quality\n5. **Report results** - Report completion status\n\n## Forbidden Operations\n\n**Do NOT execute these git commands:**\n\n- `git commit`\n- `git push`\n- `git merge`\n\n---\n\n## Workflow\n\n### 1. Understand Specs\n\nRead relevant specs based on task type:\n\n- Spec layers: `.trellis/spec/<package>/<layer>/`\n- Shared guides: `.trellis/spec/guides/`\n\n### 2. Understand Requirements\n\nRead the task's prd.md, design.md if present, and implement.md if present:\n\n- What are the core requirements\n- Key points of technical design\n- Implementation order, validation commands, and rollback points\n\n### 3. Implement Features\n\n- Write code following specs and task artifacts\n- Follow existing code patterns\n- Only do what's required, no over-engineering\n\n### 4. Verify\n\nRun project's lint and typecheck commands to verify changes.\n\n---\n\n## Report Format\n\n```markdown\n## Implementation Complete\n\n### Files Modified\n\n- `src/components/Feature.tsx` - New component\n- `src/hooks/useFeature.ts` - New hook\n\n### Implementation Summary\n\n1. Created Feature component...\n2. Added useFeature hook...\n\n### Verification Results\n\n- Lint: Passed\n- TypeCheck: Passed\n```\n\n---\n\n## Code Standards\n\n- Follow existing code patterns\n- Don't add unnecessary abstractions\n- Only do what's required, no over-engineering\n- Keep code readable",
|
|
5
5
|
"tools": [
|
|
6
6
|
"read",
|
|
7
7
|
"write",
|
|
@@ -27,8 +27,8 @@ You are already the `trellis-check` sub-agent that the main session dispatched.
|
|
|
27
27
|
|
|
28
28
|
Look for the `<!-- trellis-hook-injected -->` marker in your input above.
|
|
29
29
|
|
|
30
|
-
- **If the marker is present**:
|
|
31
|
-
- **If the marker is absent**: hook injection didn't fire (Windows + Claude Code, `--continue` resume, fork distribution, hooks disabled, etc.). Find the active task path from your dispatch prompt's first line `Active task: <path>` (or run `python3 ./.trellis/scripts/task.py current --source` as a fallback), then Read `<task-path>/prd.md`
|
|
30
|
+
- **If the marker is present**: task artifacts, spec, and research files have already been auto-loaded for you above. Proceed with the check work directly.
|
|
31
|
+
- **If the marker is absent**: hook injection didn't fire (Windows + Claude Code, `--continue` resume, fork distribution, hooks disabled, etc.). Find the active task path from your dispatch prompt's first line `Active task: <path>` (or run `python3 ./.trellis/scripts/task.py current --source` as a fallback), then Read `<task-path>/check.jsonl`, each listed file, `<task-path>/prd.md`, `<task-path>/design.md` if present, and `<task-path>/implement.md` if present before doing the work.
|
|
32
32
|
|
|
33
33
|
## Context
|
|
34
34
|
|