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