@mindfoldhq/trellis 0.6.0-beta.8 → 0.6.0-beta.9

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.
Files changed (33) hide show
  1. package/dist/cli/index.d.ts +1 -1
  2. package/dist/cli/index.d.ts.map +1 -1
  3. package/dist/cli/index.js +23 -2
  4. package/dist/cli/index.js.map +1 -1
  5. package/dist/commands/update.d.ts.map +1 -1
  6. package/dist/commands/update.js +2 -2
  7. package/dist/commands/update.js.map +1 -1
  8. package/dist/commands/upgrade.d.ts +28 -0
  9. package/dist/commands/upgrade.d.ts.map +1 -0
  10. package/dist/commands/upgrade.js +84 -0
  11. package/dist/commands/upgrade.js.map +1 -0
  12. package/dist/migrations/manifests/0.5.13.json +9 -0
  13. package/dist/migrations/manifests/0.6.0-beta.9.json +9 -0
  14. package/dist/templates/claude/settings.json +4 -4
  15. package/dist/templates/codebuddy/settings.json +4 -4
  16. package/dist/templates/codex/hooks.json +1 -1
  17. package/dist/templates/codex/skills/brainstorm/SKILL.md +69 -519
  18. package/dist/templates/common/skills/brainstorm.md +68 -518
  19. package/dist/templates/copilot/hooks/session-start.py +12 -11
  20. package/dist/templates/copilot/hooks.json +2 -2
  21. package/dist/templates/copilot/prompts/brainstorm.prompt.md +69 -519
  22. package/dist/templates/cursor/hooks.json +2 -2
  23. package/dist/templates/droid/settings.json +4 -4
  24. package/dist/templates/gemini/settings.json +2 -2
  25. package/dist/templates/markdown/spec/guides/cross-layer-thinking-guide.md.txt +45 -10
  26. package/dist/templates/markdown/spec/guides/cross-platform-thinking-guide.md.txt +10 -4
  27. package/dist/templates/opencode/lib/trellis-context.js +73 -11
  28. package/dist/templates/opencode/plugins/inject-subagent-context.js +112 -26
  29. package/dist/templates/opencode/plugins/inject-workflow-state.js +8 -1
  30. package/dist/templates/opencode/plugins/session-start.js +9 -1
  31. package/dist/templates/qoder/settings.json +4 -4
  32. package/dist/templates/trellis/scripts/common/session_context.py +215 -138
  33. package/package.json +1 -1
@@ -1,557 +1,107 @@
1
- # Brainstorm - Requirements Discovery (AI Coding Enhanced)
1
+ # Trellis Brainstorm
2
2
 
3
- **CoreRule**: 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.
3
+ ## Non-Negotiable Interview Contract
4
4
 
5
- Ask the questions one at a time.
6
-
7
- If a question can be answered by exploring the codebase, explore the codebase instead.
8
-
9
- ---
10
-
11
- Guide AI through collaborative requirements discovery **before implementation**, optimized for AI coding workflows:
12
-
13
- * **Task-first** (capture ideas immediately)
14
- * **Action-before-asking** (reduce low-value questions)
15
- * **Research-first** for technical choices (avoid asking users to invent options)
16
- * **Diverge → Converge** (expand thinking, then lock MVP)
17
-
18
- ---
19
-
20
- ## When to Use
21
-
22
- Triggered from {{CMD_REF:start}} when the user describes a development task, especially when:
23
-
24
- * requirements are unclear or evolving
25
- * there are multiple valid implementation paths
26
- * trade-offs matter (UX, reliability, maintainability, cost, performance)
27
- * the user might not know the best options up front
28
-
29
- ---
30
-
31
- ## Core Principles (Non-negotiable)
32
-
33
- 1. **Task-first (capture early)**
34
- Always ensure a task exists at the start so the user's ideas are recorded immediately.
35
-
36
- 2. **Action before asking**
37
- If you can derive the answer from repo code, docs, configs, conventions, or quick research — do that first.
38
-
39
- 3. **One question per message**
40
- Never overwhelm the user with a list of questions. Ask one, update PRD, repeat.
41
-
42
- 4. **Prefer concrete options**
43
- For preference/decision questions, present 2–3 feasible, specific approaches with trade-offs.
44
-
45
- 5. **Research-first for technical choices**
46
- If the decision depends on industry conventions / similar tools / established patterns, do research first, then propose options.
47
-
48
- 6. **Diverge → Converge**
49
- After initial understanding, proactively consider future evolution, related scenarios, and failure/edge cases — then converge to an MVP with explicit out-of-scope.
50
-
51
- 7. **No meta questions**
52
- Do not ask "should I search?" or "can you paste the code so I can continue?"
53
- If you need information: search/inspect. If blocked: ask the minimal blocking question.
54
-
55
- ---
56
-
57
- ## Step 0: Ensure Task Exists (ALWAYS)
58
-
59
- Before any Q&A, ensure a task exists. If none exists, create one immediately.
60
-
61
- * Use a **temporary working title** derived from the user's message.
62
- * It's OK if the title is imperfect — refine later in PRD.
63
-
64
- ```bash
65
- TASK_DIR=$(python3 ./.trellis/scripts/task.py create "brainstorm: <short goal>" --slug <auto>)
66
- ```
67
-
68
- Use a slug without a date prefix. `task.py create` adds the `MM-DD-`
69
- directory prefix automatically.
70
-
71
- `task.py create` already created a default `prd.md`. Immediately update it with what you know:
72
-
73
- ```markdown
74
- # brainstorm: <short goal>
75
-
76
- ## Goal
77
-
78
- <one paragraph: what + why>
79
-
80
- ## Background / Known Context
81
-
82
- * <facts from user message>
83
- * <facts discovered from repo/docs>
84
-
85
- ## Assumptions (temporary)
86
-
87
- * <assumptions to validate>
88
-
89
- ## Open Questions
90
-
91
- * <ONLY Blocking / Preference questions; keep list short>
92
-
93
- ## Requirements
94
-
95
- * <start with what is known>
96
-
97
- ## Acceptance Criteria
98
-
99
- * [ ] <testable criterion>
100
-
101
- ## Definition of Done (team quality bar)
102
-
103
- * Tests added/updated (unit/integration where appropriate)
104
- * Lint / typecheck / CI green
105
- * Docs/notes updated if behavior changes
106
- * Rollout/rollback considered if risky
107
-
108
- ## Out of Scope (explicit)
109
-
110
- * <what we will not do in this task>
111
-
112
- ## Research References
113
-
114
- * <links to research/*.md or external references>
115
- ```
116
-
117
- For complex tasks, also create/update:
118
-
119
- ```markdown
120
- # design.md
121
-
122
- ## Technical Design
123
-
124
- <boundaries, contracts, data flow, compatibility, tradeoffs>
125
-
126
- ## Rollout / Rollback
127
-
128
- <operational notes if relevant>
129
- ```
130
-
131
- ```markdown
132
- # implement.md
133
-
134
- ## Implementation Checklist
135
-
136
- - [ ] <ordered implementation step>
137
-
138
- ## Validation
139
-
140
- - <lint/typecheck/test command>
141
-
142
- ## Review Gates
143
-
144
- - <human or technical checkpoint before start/finish>
145
- ```
146
-
147
- ---
148
-
149
- ## Step 1: Auto-Context (DO THIS BEFORE ASKING QUESTIONS)
150
-
151
- Before asking questions like "what does the code look like?", gather context yourself:
152
-
153
- ### Repo inspection checklist
154
-
155
- * Identify likely modules/files impacted
156
- * Locate existing patterns (similar features, conventions, error handling style)
157
- * Check configs, scripts, existing command definitions
158
- * Note any constraints (runtime, dependency policy, build tooling)
159
-
160
- ### Documentation checklist
161
-
162
- * Look for existing PRDs/specs/templates
163
- * Look for command usage examples, README, ADRs if any
164
-
165
- Write findings into PRD:
166
-
167
- * Add user-visible facts to `Background / Known Context`
168
- * Write technical findings to `research/*.md`, `design.md`, or `implement.md` as appropriate
169
-
170
- ---
171
-
172
- ## Step 2: Classify Complexity (still useful, not gating task creation)
173
-
174
- | Complexity | Criteria | Action |
175
- | ------------ | ------------------------------------------------------ | ------------------------------------------- |
176
- | **Trivial** | Single-line fix, typo, obvious change | Skip brainstorm, implement directly |
177
- | **Simple** | Clear goal, 1–2 files, scope well-defined | Ask 1 confirm question, then implement |
178
- | **Moderate** | Multiple files, some ambiguity | Light brainstorm (2–3 high-value questions) |
179
- | **Complex** | Vague goal, architectural choices, multiple approaches | Full brainstorm |
180
-
181
- > Note: Task already exists from Step 0. Classification only affects depth of brainstorming.
182
-
183
- ---
184
-
185
- ## Step 3: Question Gate (Ask ONLY high-value questions)
186
-
187
- Before asking ANY question, run the following gate:
188
-
189
- ### Gate A — Can I derive this without the user?
190
-
191
- If answer is available via:
192
-
193
- * repo inspection (code/config)
194
- * docs/specs/conventions
195
- * quick market/OSS research
196
-
197
- → **Do not ask.** Fetch it, summarize, update PRD.
198
-
199
- ### Gate B — Is this a meta/lazy question?
200
-
201
- Examples:
202
-
203
- * "Should I search?"
204
- * "Can you paste the code so I can proceed?"
205
- * "What does the code look like?" (when repo is available)
206
-
207
- → **Do not ask.** Take action.
208
-
209
- ### Gate C — What type of question is it?
210
-
211
- * **Blocking**: cannot proceed without user input
212
- * **Preference**: multiple valid choices, depends on product/UX/risk preference
213
- * **Derivable**: should be answered by inspection/research
214
-
215
- → Only ask **Blocking** or **Preference**.
216
-
217
- ---
218
-
219
- ## Step 4: Research-first Mode (Mandatory for technical choices)
220
-
221
- ### Trigger conditions (any → research-first)
222
-
223
- * The task involves selecting an approach, library, protocol, framework, template system, plugin mechanism, or CLI UX convention
224
- * The user asks for "best practice", "how others do it", "recommendation"
225
- * The user can't reasonably enumerate options
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.
226
6
 
227
- ### Delegate to `trellis-research` sub-agent (don't research inline)
228
-
229
- For each research topic, **spawn a `trellis-research` sub-agent via the Task tool** — don't do WebFetch / WebSearch / `gh api` inline in the main conversation.
230
-
231
- Why:
232
- - The sub-agent has its own context window → doesn't pollute brainstorm context with raw tool output
233
- - It persists findings to `{TASK_DIR}/research/<topic>.md` (the contract — see `workflow.md` Phase 1.2)
234
- - It returns only `{file path, one-line summary}` to the main agent
235
- - Independent topics can be **parallelized** — spawn multiple sub-agents in one tool call
236
-
237
- > **Codex exception**: on Codex CLI, do NOT dispatch `trellis-research` for research-first mode — do the research inline (WebFetch / WebSearch in the main session) and write findings to `{TASK_DIR}/research/<topic>.md` yourself. Reason: Codex `spawn_agent` runs sub-agents with `fork_turns="none"` (isolated context, no parent session inheritance), so the research sub-agent cannot resolve the active task path via `task.py current` and silently aborts without producing files. Inline research on Codex avoids this failure mode. The 3+ inline research calls limit (B rule in `workflow.md`) is relaxed for Codex specifically.
238
-
239
- Agent type: `trellis-research`
240
- Task description template: "Research <specific question>; persist findings to `{TASK_DIR}/research/<topic-slug>.md`."
241
-
242
- ❌ Bad (what you must NOT do):
243
- ```
244
- Main agent: WebFetch(url-A) → WebFetch(url-B) → Bash(gh api ...)
245
- → WebSearch(q1) → WebSearch(q2) → ... (10+ inline calls)
246
- → Write(research/topic.md)
247
- ```
248
- → Pollutes main context with raw HTML/JSON, burns tokens.
249
-
250
- ✅ Good:
251
- ```
252
- Main agent: Task(subagent_type="trellis-research",
253
- prompt="Research topic A; persist to research/topic-a.md")
254
- + Task(subagent_type="trellis-research",
255
- prompt="Research topic B; persist to research/topic-b.md")
256
- + Task(subagent_type="trellis-research",
257
- prompt="Research topic C; persist to research/topic-c.md")
258
- → Reads research/topic-{a,b,c}.md after they finish.
259
- ```
260
-
261
- ### Research steps (to pass into each sub-agent prompt)
262
-
263
- Each `trellis-research` sub-agent should:
264
-
265
- 1. Identify 2–4 comparable tools/patterns for its topic
266
- 2. Summarize common conventions and why they exist
267
- 3. Map conventions onto our repo constraints
268
- 4. Write findings to `{TASK_DIR}/research/<topic>.md`
269
-
270
- Main agent then reads the persisted files and produces **2–3 feasible approaches** in PRD.
271
-
272
- ### Research output format (PRD)
273
-
274
- The PRD itself should only reference the persisted research files, not duplicate their content. Add a `## Research References` section pointing at `research/*.md`.
275
-
276
- Optionally, add a convergence section with feasible approaches derived from the research:
277
-
278
- ```markdown
279
- ## Research References
280
-
281
- * [`research/<topic-a>.md`](research/<topic-a>.md) — <one-line takeaway>
282
- * [`research/<topic-b>.md`](research/<topic-b>.md) — <one-line takeaway>
283
-
284
- ## Research Notes
285
-
286
- ### What similar tools do
287
-
288
- * ...
289
- * ...
290
-
291
- ### Constraints from our repo/project
292
-
293
- * ...
294
-
295
- ### Feasible approaches here
296
-
297
- **Approach A: <name>** (Recommended)
298
-
299
- * How it works:
300
- * Pros:
301
- * Cons:
302
-
303
- **Approach B: <name>**
304
-
305
- * How it works:
306
- * Pros:
307
- * Cons:
308
-
309
- **Approach C: <name>** (optional)
310
-
311
- * ...
312
- ```
313
-
314
- Then ask **one** preference question:
315
-
316
- * "Which approach do you prefer: A / B / C (or other)?"
317
-
318
- ---
319
-
320
- ## Step 5: Expansion Sweep (DIVERGE) — Required after initial understanding
321
-
322
- After you can summarize the goal, proactively broaden thinking before converging.
323
-
324
- ### Expansion categories (keep to 1–2 bullets each)
325
-
326
- 1. **Future evolution**
327
-
328
- * What might this feature become in 1–3 months?
329
- * What extension points are worth preserving now?
330
-
331
- 2. **Related scenarios**
332
-
333
- * What adjacent commands/flows should remain consistent with this?
334
- * Are there parity expectations (create vs update, import vs export, etc.)?
335
-
336
- 3. **Failure & edge cases**
337
-
338
- * Conflicts, offline/network failure, retries, idempotency, compatibility, rollback
339
- * Input validation, security boundaries, permission checks
340
-
341
- ### Expansion message template (to user)
342
-
343
- ```markdown
344
- I understand you want to implement: <current goal>.
345
-
346
- Before diving into design, let me quickly diverge to consider three categories (to avoid rework later):
347
-
348
- 1. Future evolution: <1–2 bullets>
349
- 2. Related scenarios: <1–2 bullets>
350
- 3. Failure/edge cases: <1–2 bullets>
351
-
352
- For this MVP, which would you like to include (or none)?
353
-
354
- 1. Current requirement only (minimal viable)
355
- 2. Add <X> (reserve for future extension)
356
- 3. Add <Y> (improve robustness/consistency)
357
- 4. Other: describe your preference
358
- ```
359
-
360
- Then update PRD:
361
-
362
- * What's in MVP → `Requirements`
363
- * What's excluded → `Out of Scope`
364
-
365
- ---
366
-
367
- ## Step 6: Q&A Loop (CONVERGE)
368
-
369
- ### Rules
370
-
371
- * One question per message
372
- * Prefer multiple-choice when possible
373
- * After each user answer:
374
-
375
- * Update PRD immediately
376
- * Move answered items from `Open Questions` → `Requirements`
377
- * Update `Acceptance Criteria` with testable checkboxes
378
- * Clarify `Out of Scope`
379
-
380
- ### Question priority (recommended)
381
-
382
- 1. **MVP scope boundary** (what is included/excluded)
383
- 2. **Preference decisions** (after presenting concrete options)
384
- 3. **Failure/edge behavior** (only for MVP-critical paths)
385
- 4. **Success metrics & Acceptance Criteria** (what proves it works)
386
-
387
- ### Preferred question format (multiple choice)
388
-
389
- ```markdown
390
- For <topic>, which approach do you prefer?
391
-
392
- 1. **Option A** — <what it means + trade-off>
393
- 2. **Option B** — <what it means + trade-off>
394
- 3. **Option C** — <what it means + trade-off>
395
- 4. **Other** — describe your preference
396
- ```
397
-
398
- ---
399
-
400
- ## Step 7: Propose Approaches + Record Decisions (Complex tasks)
401
-
402
- After requirements are clear enough, propose 2–3 approaches (if not already done via research-first):
403
-
404
- ```markdown
405
- Based on current information, here are 2–3 feasible approaches:
406
-
407
- **Approach A: <name>** (Recommended)
408
-
409
- * How:
410
- * Pros:
411
- * Cons:
412
-
413
- **Approach B: <name>**
414
-
415
- * How:
416
- * Pros:
417
- * Cons:
7
+ Ask the questions one at a time.
418
8
 
419
- Which direction do you prefer?
420
- ```
9
+ ## Non-Negotiable Evidence Rule
421
10
 
422
- Record the outcome in PRD as an ADR-lite section:
11
+ If a question can be answered by exploring the codebase, explore the codebase instead.
423
12
 
424
- ```markdown
425
- ## Decision (ADR-lite)
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.
426
14
 
427
- **Context**: Why this decision was needed
428
- **Decision**: Which approach was chosen
429
- **Consequences**: Trade-offs, risks, potential future improvements
430
- ```
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.
431
16
 
432
17
  ---
433
18
 
434
- ## Step 8: Final Confirmation + Planning Artifacts
435
-
436
- When open questions are resolved, confirm complete requirements with a structured summary:
437
-
438
- ### Final confirmation format
439
-
440
- ```markdown
441
- Here's my understanding of the complete requirements:
442
-
443
- **Goal**: <one sentence>
444
-
445
- **Requirements**:
446
-
447
- * ...
448
- * ...
449
-
450
- **Acceptance Criteria**:
451
-
452
- * [ ] ...
453
- * [ ] ...
454
-
455
- **Definition of Done**:
456
-
457
- * ...
19
+ Use this skill during Phase 1 planning to turn the user's request into clear requirements and planning artifacts.
458
20
 
459
- **Out of Scope**:
21
+ ## Preconditions
460
22
 
461
- * ...
23
+ Use this skill only after task-creation consent has been given and the user is ready to enter Trellis planning.
462
24
 
463
- **Artifact status**:
464
-
465
- * prd.md: <ready / needs update>
466
- * design.md: <not needed for lightweight / ready / missing>
467
- * implement.md: <not needed for lightweight / ready / missing>
468
-
469
- Does this look correct? If yes, the next step is planning review before `task.py start`.
470
- ```
471
-
472
- ### Subtask Decomposition (Complex Tasks)
473
-
474
- For complex tasks with multiple independent work items, create subtasks:
25
+ If no task exists yet, create one:
475
26
 
476
27
  ```bash
477
- # Create child tasks
478
- CHILD1=$(python3 ./.trellis/scripts/task.py create "Child task 1" --slug child1 --parent "$TASK_DIR")
479
- CHILD2=$(python3 ./.trellis/scripts/task.py create "Child task 2" --slug child2 --parent "$TASK_DIR")
480
-
481
- # Or link existing tasks
482
- python3 ./.trellis/scripts/task.py add-subtask "$TASK_DIR" "$CHILD_DIR"
28
+ TASK_DIR=$({{PYTHON_CMD}} ./.trellis/scripts/task.py create "<short task title>" --slug <slug>)
483
29
  ```
484
30
 
485
- ---
31
+ 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.
486
32
 
487
- ## PRD Target Structure (final)
33
+ `task.py create` creates the default `prd.md`. Update that file with the current understanding before asking follow-up questions.
488
34
 
489
- `prd.md` should converge to:
35
+ ## Planning Flow
490
36
 
491
- ```markdown
492
- # <Task Title>
37
+ 1. Capture the user's request and initial known facts in `prd.md`.
38
+ 2. Inspect available evidence before asking questions:
39
+ - code, tests, fixtures, and configs
40
+ - README files, docs, existing specs, and domain notes
41
+ - related Trellis tasks, research files, and session history when present
42
+ 3. Separate what you found into:
43
+ - confirmed facts
44
+ - product intent still needed from the user
45
+ - scope or risk decisions still needed from the user
46
+ - likely out-of-scope items
47
+ 4. Ask the single highest-value remaining question.
48
+ 5. Include your recommended answer with the question.
49
+ 6. After each user answer, update `prd.md` before continuing.
50
+ 7. For complex tasks, create or update `design.md` and `implement.md` before implementation starts.
493
51
 
494
- ## Goal
52
+ Do not invent a project-specific product/spec hierarchy. If the repository already has product, domain, or spec docs, use them. If it does not, proceed with the evidence that exists.
495
53
 
496
- <why + what>
54
+ ## Question Rules
497
55
 
498
- ## Requirements
56
+ Ask only one question per message.
499
57
 
500
- * ...
58
+ Each question must include:
501
59
 
502
- ## Acceptance Criteria
60
+ - the decision needed
61
+ - why the answer matters
62
+ - your recommended answer
63
+ - the trade-off if the user chooses differently
503
64
 
504
- * [ ] ...
65
+ Do not ask process questions such as whether to search, inspect files, or continue brainstorming. Do the evidence work directly. Ask the user only when the remaining issue is a product decision, preference, scope boundary, or risk tolerance choice.
505
66
 
506
- ## Out of Scope
67
+ ## Artifact Rules
507
68
 
508
- * ...
69
+ `prd.md` records requirements and acceptance:
509
70
 
510
- ## Research References
71
+ - goal and user value
72
+ - confirmed facts
73
+ - requirements
74
+ - acceptance criteria
75
+ - out of scope
76
+ - open questions that still block planning
511
77
 
512
- * <links to research/*.md or external references>
513
- ```
78
+ `design.md` records technical design for complex tasks:
514
79
 
515
- ---
80
+ - architecture and boundaries
81
+ - data flow and contracts
82
+ - compatibility and migration notes
83
+ - important trade-offs
84
+ - operational or rollback considerations
516
85
 
517
- ## Anti-Patterns (Hard Avoid)
86
+ `implement.md` records execution planning for complex tasks:
518
87
 
519
- * Asking user for code/context that can be derived from repo
520
- * Asking user to choose an approach before presenting concrete options
521
- * Meta questions about whether to research
522
- * Staying narrowly on the initial request without considering evolution/edges
523
- * Letting brainstorming drift without updating PRD
88
+ - ordered implementation checklist
89
+ - validation commands
90
+ - risky files or rollback points
91
+ - follow-up checks before `task.py start`
524
92
 
525
- ---
93
+ Lightweight tasks may have only `prd.md`. Complex tasks must have `prd.md`, `design.md`, and `implement.md` before `task.py start`.
526
94
 
527
- ## Integration with Start Workflow
528
-
529
- After brainstorm completes (Step 8 confirmation approved), the flow continues to the Task Workflow planning review gate:
530
-
531
- ```text
532
- Brainstorm
533
- Step 0: Create task directory + update PRD
534
- Step 1–7: Discover requirements, research, converge
535
- Step 8: Final confirmation → user approves planning artifacts
536
-
537
- Task Workflow Phase 1 (Plan)
538
- Lightweight task → PRD-only may be enough
539
- Complex task → design.md + implement.md required
540
- Sub-agent platforms → curate implement.jsonl / check.jsonl manifests
541
- → Review gate → task.py start
542
-
543
- Task Workflow Phase 2 (Execute)
544
- Implement → Check → Complete
545
- ```
95
+ `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.
546
96
 
547
- The task directory and PRD already exist from brainstorm, but Phase 1 is not skipped; it owns artifact review and the `task.py start` gate.
97
+ ## Quality Bar
548
98
 
549
- ---
99
+ Before declaring planning ready:
550
100
 
551
- ## Related Commands
101
+ - `prd.md` contains testable acceptance criteria.
102
+ - Repository-answerable questions have already been answered through inspection.
103
+ - Remaining open questions are genuinely about user intent or scope.
104
+ - Complex tasks have `design.md` and `implement.md`.
105
+ - The user has reviewed the final planning artifacts or explicitly approved proceeding.
552
106
 
553
- | Command | When to Use |
554
- |---------|-------------|
555
- | `{{CMD_REF:start}}` | Entry point that triggers brainstorm |
556
- | `{{CMD_REF:finish-work}}` | After implementation is complete |
557
- | `{{CMD_REF:update-spec}}` | If new patterns emerge during work |
107
+ Do not start implementation until the user approves or asks for implementation.
@@ -1,13 +1,18 @@
1
1
  #!/usr/bin/env python3
2
2
  # -*- coding: utf-8 -*-
3
3
  """
4
- Copilot Session Start Hook - Emit Trellis session-start diagnostics.
5
-
6
- GitHub Copilot's documented SessionStart behavior ignores hook output, so this
7
- script must not be treated as proof that model-visible context was injected.
8
- The JSON shape is kept for parity with other Trellis hooks and future host
9
- support, but current Copilot users should rely on UserPromptSubmit breadcrumbs
10
- and hook logs instead.
4
+ Copilot Session Start Hook - Emit Trellis session-start context.
5
+
6
+ Microsoft VS Code Agent hooks are in preview and have been documented since
7
+ VS Code 1.110 (February 2026). The official documentation
8
+ (https://code.visualstudio.com/docs/copilot/customization/hooks) defines
9
+ `SessionStart.hookSpecificOutput.additionalContext` as the field used to inject
10
+ additional context into the agent's conversation.
11
+
12
+ This script emits the spec-compliant SessionStart payload. Whether Copilot
13
+ actually consumes `additionalContext` depends on the user's installed VS Code
14
+ and Copilot versions, which is outside Trellis's control. UserPromptSubmit
15
+ breadcrumbs remain available as a per-turn complement.
11
16
  """
12
17
 
13
18
  from __future__ import annotations
@@ -505,10 +510,6 @@ Context loaded. Follow <task-status>. Load workflow/spec/task details only when
505
510
  context = output.getvalue()
506
511
  result = {
507
512
  "suppressOutput": True,
508
- "systemMessage": (
509
- f"Trellis SessionStart diagnostics emitted ({len(context)} chars); "
510
- "Copilot currently ignores sessionStart hook output."
511
- ),
512
513
  "hookSpecificOutput": {
513
514
  "hookEventName": "SessionStart",
514
515
  "additionalContext": context,
@@ -4,7 +4,7 @@
4
4
  {
5
5
  "type": "command",
6
6
  "command": "{{PYTHON_CMD}} .github/copilot/hooks/session-start.py",
7
- "timeout": 10
7
+ "timeout": 30
8
8
  }
9
9
  ],
10
10
  "userPromptSubmitted": [
@@ -12,7 +12,7 @@
12
12
  "type": "command",
13
13
  "bash": "{{PYTHON_CMD}} .github/copilot/hooks/inject-workflow-state.py",
14
14
  "powershell": "{{PYTHON_CMD}} .github/copilot/hooks/inject-workflow-state.py",
15
- "timeoutSec": 5
15
+ "timeoutSec": 15
16
16
  }
17
17
  ]
18
18
  }