@yan-geroge/omg 0.1.0

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 (59) hide show
  1. package/.claude/agents/trellis-check.md +109 -0
  2. package/.claude/agents/trellis-implement.md +109 -0
  3. package/.claude/agents/trellis-research.md +137 -0
  4. package/.claude/commands/trellis/continue.md +55 -0
  5. package/.claude/commands/trellis/finish-work.md +66 -0
  6. package/.claude/hooks/inject-subagent-context.py +749 -0
  7. package/.claude/hooks/inject-workflow-state.py +387 -0
  8. package/.claude/hooks/session-start.py +797 -0
  9. package/.claude/settings.json +73 -0
  10. package/.claude/skills/trellis-before-dev/SKILL.md +34 -0
  11. package/.claude/skills/trellis-brainstorm/SKILL.md +548 -0
  12. package/.claude/skills/trellis-break-loop/SKILL.md +130 -0
  13. package/.claude/skills/trellis-check/SKILL.md +92 -0
  14. package/.claude/skills/trellis-meta/SKILL.md +73 -0
  15. package/.claude/skills/trellis-meta/references/customize-local/add-project-local-conventions.md +83 -0
  16. package/.claude/skills/trellis-meta/references/customize-local/change-agents.md +54 -0
  17. package/.claude/skills/trellis-meta/references/customize-local/change-context-loading.md +81 -0
  18. package/.claude/skills/trellis-meta/references/customize-local/change-hooks.md +57 -0
  19. package/.claude/skills/trellis-meta/references/customize-local/change-skills-or-commands.md +78 -0
  20. package/.claude/skills/trellis-meta/references/customize-local/change-spec-structure.md +83 -0
  21. package/.claude/skills/trellis-meta/references/customize-local/change-task-lifecycle.md +90 -0
  22. package/.claude/skills/trellis-meta/references/customize-local/change-workflow.md +64 -0
  23. package/.claude/skills/trellis-meta/references/customize-local/overview.md +55 -0
  24. package/.claude/skills/trellis-meta/references/local-architecture/context-injection.md +68 -0
  25. package/.claude/skills/trellis-meta/references/local-architecture/generated-files.md +80 -0
  26. package/.claude/skills/trellis-meta/references/local-architecture/overview.md +51 -0
  27. package/.claude/skills/trellis-meta/references/local-architecture/spec-system.md +102 -0
  28. package/.claude/skills/trellis-meta/references/local-architecture/task-system.md +101 -0
  29. package/.claude/skills/trellis-meta/references/local-architecture/workflow.md +75 -0
  30. package/.claude/skills/trellis-meta/references/local-architecture/workspace-memory.md +71 -0
  31. package/.claude/skills/trellis-meta/references/platform-files/agents.md +79 -0
  32. package/.claude/skills/trellis-meta/references/platform-files/hooks-and-settings.md +69 -0
  33. package/.claude/skills/trellis-meta/references/platform-files/overview.md +59 -0
  34. package/.claude/skills/trellis-meta/references/platform-files/platform-map.md +74 -0
  35. package/.claude/skills/trellis-meta/references/platform-files/skills-and-commands.md +83 -0
  36. package/.claude/skills/trellis-spec-bootstarp/SKILL.md +41 -0
  37. package/.claude/skills/trellis-spec-bootstarp/references/mcp-setup.md +90 -0
  38. package/.claude/skills/trellis-spec-bootstarp/references/repository-analysis.md +59 -0
  39. package/.claude/skills/trellis-spec-bootstarp/references/spec-task-planning.md +61 -0
  40. package/.claude/skills/trellis-spec-bootstarp/references/spec-writing.md +70 -0
  41. package/.claude/skills/trellis-update-spec/SKILL.md +356 -0
  42. package/CLAUDE.md +88 -0
  43. package/agents/architect.md +80 -0
  44. package/agents/executor.md +79 -0
  45. package/agents/planner.md +76 -0
  46. package/agents/reviewer.md +81 -0
  47. package/agents/tdd-guide.md +95 -0
  48. package/agents/verifier.md +81 -0
  49. package/hooks/keyword-detector.mjs +115 -0
  50. package/hooks/lib/keyword-detector.js +89 -0
  51. package/hooks/session-start.mjs +104 -0
  52. package/marketplace.json +12 -0
  53. package/package.json +34 -0
  54. package/plugin.json +14 -0
  55. package/scripts/diagnose-marketplace.js +84 -0
  56. package/scripts/e2e-diagnose.mjs +118 -0
  57. package/scripts/validate-with-csc-schema.mjs +87 -0
  58. package/skills/costrict-autopilot/SKILL.md +53 -0
  59. package/skills/costrict-team/SKILL.md +65 -0
@@ -0,0 +1,73 @@
1
+ {
2
+ "env": {
3
+ "CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR": "1"
4
+ },
5
+ "hooks": {
6
+ "SessionStart": [
7
+ {
8
+ "matcher": "startup",
9
+ "hooks": [
10
+ {
11
+ "type": "command",
12
+ "command": "python .claude/hooks/session-start.py",
13
+ "timeout": 30
14
+ }
15
+ ]
16
+ },
17
+ {
18
+ "matcher": "clear",
19
+ "hooks": [
20
+ {
21
+ "type": "command",
22
+ "command": "python .claude/hooks/session-start.py",
23
+ "timeout": 30
24
+ }
25
+ ]
26
+ },
27
+ {
28
+ "matcher": "compact",
29
+ "hooks": [
30
+ {
31
+ "type": "command",
32
+ "command": "python .claude/hooks/session-start.py",
33
+ "timeout": 30
34
+ }
35
+ ]
36
+ }
37
+ ],
38
+ "PreToolUse": [
39
+ {
40
+ "matcher": "Task",
41
+ "hooks": [
42
+ {
43
+ "type": "command",
44
+ "command": "python .claude/hooks/inject-subagent-context.py",
45
+ "timeout": 30
46
+ }
47
+ ]
48
+ },
49
+ {
50
+ "matcher": "Agent",
51
+ "hooks": [
52
+ {
53
+ "type": "command",
54
+ "command": "python .claude/hooks/inject-subagent-context.py",
55
+ "timeout": 30
56
+ }
57
+ ]
58
+ }
59
+ ],
60
+ "UserPromptSubmit": [
61
+ {
62
+ "hooks": [
63
+ {
64
+ "type": "command",
65
+ "command": "python .claude/hooks/inject-workflow-state.py",
66
+ "timeout": 15
67
+ }
68
+ ]
69
+ }
70
+ ]
71
+ },
72
+ "enabledPlugins": {}
73
+ }
@@ -0,0 +1,34 @@
1
+ ---
2
+ name: trellis-before-dev
3
+ description: "Discovers and injects project-specific coding guidelines from .trellis/spec/ before implementation begins. Reads spec indexes, pre-development checklists, and shared thinking guides for the target package. Use when starting a new coding task, before writing any code, switching to a different package, or needing to refresh project conventions and standards."
4
+ ---
5
+
6
+ Read the relevant development guidelines before starting your task.
7
+
8
+ Execute these steps:
9
+
10
+ 1. **Discover packages and their spec layers**:
11
+ ```bash
12
+ python ./.trellis/scripts/get_context.py --mode packages
13
+ ```
14
+
15
+ 2. **Identify which specs apply** to your task based on:
16
+ - Which package you're modifying (e.g., `cli/`, `docs-site/`)
17
+ - What type of work (backend, frontend, unit-test, docs, etc.)
18
+
19
+ 3. **Read the spec index** for each relevant module:
20
+ ```bash
21
+ cat .trellis/spec/<package>/<layer>/index.md
22
+ ```
23
+ Follow the **"Pre-Development Checklist"** section in the index.
24
+
25
+ 4. **Read the specific guideline files** listed in the Pre-Development Checklist that are relevant to your task. The index is NOT the goal — it points you to the actual guideline files (e.g., `error-handling.md`, `conventions.md`, `mock-strategies.md`). Read those files to understand the coding standards and patterns.
26
+
27
+ 5. **Always read shared guides**:
28
+ ```bash
29
+ cat .trellis/spec/guides/index.md
30
+ ```
31
+
32
+ 6. Understand the coding standards and patterns you need to follow, then proceed with your development plan.
33
+
34
+ This step is **mandatory** before writing any code.
@@ -0,0 +1,548 @@
1
+ ---
2
+ name: trellis-brainstorm
3
+ description: "Guides collaborative requirements discovery before implementation. Creates task directory, seeds PRD, asks high-value questions one at a time, researches technical choices, and converges on MVP scope. Use when requirements are unclear, there are multiple valid approaches, or the user describes a new feature or complex task."
4
+ ---
5
+
6
+ # Brainstorm - Requirements Discovery (AI Coding Enhanced)
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.
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 /trellis: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=$(python ./.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
+ Create/seed `prd.md` immediately with what you know:
77
+
78
+ ```markdown
79
+ # brainstorm: <short goal>
80
+
81
+ ## Goal
82
+
83
+ <one paragraph: what + why>
84
+
85
+ ## What I already know
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 (evolving)
99
+
100
+ * <start with what is known>
101
+
102
+ ## Acceptance Criteria (evolving)
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
+ ## Technical Notes
118
+
119
+ * <files inspected, constraints, links, references>
120
+ * <research notes summary if applicable>
121
+ ```
122
+
123
+ ---
124
+
125
+ ## Step 1: Auto-Context (DO THIS BEFORE ASKING QUESTIONS)
126
+
127
+ Before asking questions like "what does the code look like?", gather context yourself:
128
+
129
+ ### Repo inspection checklist
130
+
131
+ * Identify likely modules/files impacted
132
+ * Locate existing patterns (similar features, conventions, error handling style)
133
+ * Check configs, scripts, existing command definitions
134
+ * Note any constraints (runtime, dependency policy, build tooling)
135
+
136
+ ### Documentation checklist
137
+
138
+ * Look for existing PRDs/specs/templates
139
+ * Look for command usage examples, README, ADRs if any
140
+
141
+ Write findings into PRD:
142
+
143
+ * Add to `What I already know`
144
+ * Add constraints/links to `Technical Notes`
145
+
146
+ ---
147
+
148
+ ## Step 2: Classify Complexity (still useful, not gating task creation)
149
+
150
+ | Complexity | Criteria | Action |
151
+ | ------------ | ------------------------------------------------------ | ------------------------------------------- |
152
+ | **Trivial** | Single-line fix, typo, obvious change | Skip brainstorm, implement directly |
153
+ | **Simple** | Clear goal, 1–2 files, scope well-defined | Ask 1 confirm question, then implement |
154
+ | **Moderate** | Multiple files, some ambiguity | Light brainstorm (2–3 high-value questions) |
155
+ | **Complex** | Vague goal, architectural choices, multiple approaches | Full brainstorm |
156
+
157
+ > Note: Task already exists from Step 0. Classification only affects depth of brainstorming.
158
+
159
+ ---
160
+
161
+ ## Step 3: Question Gate (Ask ONLY high-value questions)
162
+
163
+ Before asking ANY question, run the following gate:
164
+
165
+ ### Gate A — Can I derive this without the user?
166
+
167
+ If answer is available via:
168
+
169
+ * repo inspection (code/config)
170
+ * docs/specs/conventions
171
+ * quick market/OSS research
172
+
173
+ → **Do not ask.** Fetch it, summarize, update PRD.
174
+
175
+ ### Gate B — Is this a meta/lazy question?
176
+
177
+ Examples:
178
+
179
+ * "Should I search?"
180
+ * "Can you paste the code so I can proceed?"
181
+ * "What does the code look like?" (when repo is available)
182
+
183
+ → **Do not ask.** Take action.
184
+
185
+ ### Gate C — What type of question is it?
186
+
187
+ * **Blocking**: cannot proceed without user input
188
+ * **Preference**: multiple valid choices, depends on product/UX/risk preference
189
+ * **Derivable**: should be answered by inspection/research
190
+
191
+ → Only ask **Blocking** or **Preference**.
192
+
193
+ ---
194
+
195
+ ## Step 4: Research-first Mode (Mandatory for technical choices)
196
+
197
+ ### Trigger conditions (any → research-first)
198
+
199
+ * The task involves selecting an approach, library, protocol, framework, template system, plugin mechanism, or CLI UX convention
200
+ * The user asks for "best practice", "how others do it", "recommendation"
201
+ * The user can't reasonably enumerate options
202
+
203
+ ### Delegate to `trellis-research` sub-agent (don't research inline)
204
+
205
+ 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.
206
+
207
+ Why:
208
+ - The sub-agent has its own context window → doesn't pollute brainstorm context with raw tool output
209
+ - It persists findings to `{TASK_DIR}/research/<topic>.md` (the contract — see `workflow.md` Phase 1.2)
210
+ - It returns only `{file path, one-line summary}` to the main agent
211
+ - Independent topics can be **parallelized** — spawn multiple sub-agents in one tool call
212
+
213
+ > **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.
214
+
215
+ Agent type: `trellis-research`
216
+ Task description template: "Research <specific question>; persist findings to `{TASK_DIR}/research/<topic-slug>.md`."
217
+
218
+ ❌ Bad (what you must NOT do):
219
+ ```
220
+ Main agent: WebFetch(url-A) → WebFetch(url-B) → Bash(gh api ...)
221
+ → WebSearch(q1) → WebSearch(q2) → ... (10+ inline calls)
222
+ → Write(research/topic.md)
223
+ ```
224
+ → Pollutes main context with raw HTML/JSON, burns tokens.
225
+
226
+ ✅ Good:
227
+ ```
228
+ Main agent: Task(subagent_type="trellis-research",
229
+ prompt="Research topic A; persist to research/topic-a.md")
230
+ + Task(subagent_type="trellis-research",
231
+ prompt="Research topic B; persist to research/topic-b.md")
232
+ + Task(subagent_type="trellis-research",
233
+ prompt="Research topic C; persist to research/topic-c.md")
234
+ → Reads research/topic-{a,b,c}.md after they finish.
235
+ ```
236
+
237
+ ### Research steps (to pass into each sub-agent prompt)
238
+
239
+ Each `trellis-research` sub-agent should:
240
+
241
+ 1. Identify 2–4 comparable tools/patterns for its topic
242
+ 2. Summarize common conventions and why they exist
243
+ 3. Map conventions onto our repo constraints
244
+ 4. Write findings to `{TASK_DIR}/research/<topic>.md`
245
+
246
+ Main agent then reads the persisted files and produces **2–3 feasible approaches** in PRD.
247
+
248
+ ### Research output format (PRD)
249
+
250
+ The PRD itself should only reference the persisted research files, not duplicate their content. Add a `## Research References` section pointing at `research/*.md`.
251
+
252
+ Optionally, add a convergence section with feasible approaches derived from the research:
253
+
254
+ ```markdown
255
+ ## Research References
256
+
257
+ * [`research/<topic-a>.md`](research/<topic-a>.md) — <one-line takeaway>
258
+ * [`research/<topic-b>.md`](research/<topic-b>.md) — <one-line takeaway>
259
+
260
+ ## Research Notes
261
+
262
+ ### What similar tools do
263
+
264
+ * ...
265
+ * ...
266
+
267
+ ### Constraints from our repo/project
268
+
269
+ * ...
270
+
271
+ ### Feasible approaches here
272
+
273
+ **Approach A: <name>** (Recommended)
274
+
275
+ * How it works:
276
+ * Pros:
277
+ * Cons:
278
+
279
+ **Approach B: <name>**
280
+
281
+ * How it works:
282
+ * Pros:
283
+ * Cons:
284
+
285
+ **Approach C: <name>** (optional)
286
+
287
+ * ...
288
+ ```
289
+
290
+ Then ask **one** preference question:
291
+
292
+ * "Which approach do you prefer: A / B / C (or other)?"
293
+
294
+ ---
295
+
296
+ ## Step 5: Expansion Sweep (DIVERGE) — Required after initial understanding
297
+
298
+ After you can summarize the goal, proactively broaden thinking before converging.
299
+
300
+ ### Expansion categories (keep to 1–2 bullets each)
301
+
302
+ 1. **Future evolution**
303
+
304
+ * What might this feature become in 1–3 months?
305
+ * What extension points are worth preserving now?
306
+
307
+ 2. **Related scenarios**
308
+
309
+ * What adjacent commands/flows should remain consistent with this?
310
+ * Are there parity expectations (create vs update, import vs export, etc.)?
311
+
312
+ 3. **Failure & edge cases**
313
+
314
+ * Conflicts, offline/network failure, retries, idempotency, compatibility, rollback
315
+ * Input validation, security boundaries, permission checks
316
+
317
+ ### Expansion message template (to user)
318
+
319
+ ```markdown
320
+ I understand you want to implement: <current goal>.
321
+
322
+ Before diving into design, let me quickly diverge to consider three categories (to avoid rework later):
323
+
324
+ 1. Future evolution: <1–2 bullets>
325
+ 2. Related scenarios: <1–2 bullets>
326
+ 3. Failure/edge cases: <1–2 bullets>
327
+
328
+ For this MVP, which would you like to include (or none)?
329
+
330
+ 1. Current requirement only (minimal viable)
331
+ 2. Add <X> (reserve for future extension)
332
+ 3. Add <Y> (improve robustness/consistency)
333
+ 4. Other: describe your preference
334
+ ```
335
+
336
+ Then update PRD:
337
+
338
+ * What's in MVP → `Requirements`
339
+ * What's excluded → `Out of Scope`
340
+
341
+ ---
342
+
343
+ ## Step 6: Q&A Loop (CONVERGE)
344
+
345
+ ### Rules
346
+
347
+ * One question per message
348
+ * Prefer multiple-choice when possible
349
+ * After each user answer:
350
+
351
+ * Update PRD immediately
352
+ * Move answered items from `Open Questions` → `Requirements`
353
+ * Update `Acceptance Criteria` with testable checkboxes
354
+ * Clarify `Out of Scope`
355
+
356
+ ### Question priority (recommended)
357
+
358
+ 1. **MVP scope boundary** (what is included/excluded)
359
+ 2. **Preference decisions** (after presenting concrete options)
360
+ 3. **Failure/edge behavior** (only for MVP-critical paths)
361
+ 4. **Success metrics & Acceptance Criteria** (what proves it works)
362
+
363
+ ### Preferred question format (multiple choice)
364
+
365
+ ```markdown
366
+ For <topic>, which approach do you prefer?
367
+
368
+ 1. **Option A** — <what it means + trade-off>
369
+ 2. **Option B** — <what it means + trade-off>
370
+ 3. **Option C** — <what it means + trade-off>
371
+ 4. **Other** — describe your preference
372
+ ```
373
+
374
+ ---
375
+
376
+ ## Step 7: Propose Approaches + Record Decisions (Complex tasks)
377
+
378
+ After requirements are clear enough, propose 2–3 approaches (if not already done via research-first):
379
+
380
+ ```markdown
381
+ Based on current information, here are 2–3 feasible approaches:
382
+
383
+ **Approach A: <name>** (Recommended)
384
+
385
+ * How:
386
+ * Pros:
387
+ * Cons:
388
+
389
+ **Approach B: <name>**
390
+
391
+ * How:
392
+ * Pros:
393
+ * Cons:
394
+
395
+ Which direction do you prefer?
396
+ ```
397
+
398
+ Record the outcome in PRD as an ADR-lite section:
399
+
400
+ ```markdown
401
+ ## Decision (ADR-lite)
402
+
403
+ **Context**: Why this decision was needed
404
+ **Decision**: Which approach was chosen
405
+ **Consequences**: Trade-offs, risks, potential future improvements
406
+ ```
407
+
408
+ ---
409
+
410
+ ## Step 8: Final Confirmation + Implementation Plan
411
+
412
+ When open questions are resolved, confirm complete requirements with a structured summary:
413
+
414
+ ### Final confirmation format
415
+
416
+ ```markdown
417
+ Here's my understanding of the complete requirements:
418
+
419
+ **Goal**: <one sentence>
420
+
421
+ **Requirements**:
422
+
423
+ * ...
424
+ * ...
425
+
426
+ **Acceptance Criteria**:
427
+
428
+ * [ ] ...
429
+ * [ ] ...
430
+
431
+ **Definition of Done**:
432
+
433
+ * ...
434
+
435
+ **Out of Scope**:
436
+
437
+ * ...
438
+
439
+ **Technical Approach**:
440
+ <brief summary + key decisions>
441
+
442
+ **Implementation Plan (small PRs)**:
443
+
444
+ * PR1: <scaffolding + tests + minimal plumbing>
445
+ * PR2: <core behavior>
446
+ * PR3: <edge cases + docs + cleanup>
447
+
448
+ Does this look correct? If yes, I'll proceed with implementation.
449
+ ```
450
+
451
+ ### Subtask Decomposition (Complex Tasks)
452
+
453
+ For complex tasks with multiple independent work items, create subtasks:
454
+
455
+ ```bash
456
+ # Create child tasks
457
+ CHILD1=$(python ./.trellis/scripts/task.py create "Child task 1" --slug child1 --parent "$TASK_DIR")
458
+ CHILD2=$(python ./.trellis/scripts/task.py create "Child task 2" --slug child2 --parent "$TASK_DIR")
459
+
460
+ # Or link existing tasks
461
+ python ./.trellis/scripts/task.py add-subtask "$TASK_DIR" "$CHILD_DIR"
462
+ ```
463
+
464
+ ---
465
+
466
+ ## PRD Target Structure (final)
467
+
468
+ `prd.md` should converge to:
469
+
470
+ ```markdown
471
+ # <Task Title>
472
+
473
+ ## Goal
474
+
475
+ <why + what>
476
+
477
+ ## Requirements
478
+
479
+ * ...
480
+
481
+ ## Acceptance Criteria
482
+
483
+ * [ ] ...
484
+
485
+ ## Definition of Done
486
+
487
+ * ...
488
+
489
+ ## Technical Approach
490
+
491
+ <key design + decisions>
492
+
493
+ ## Decision (ADR-lite)
494
+
495
+ Context / Decision / Consequences
496
+
497
+ ## Out of Scope
498
+
499
+ * ...
500
+
501
+ ## Technical Notes
502
+
503
+ <constraints, references, files, research notes>
504
+ ```
505
+
506
+ ---
507
+
508
+ ## Anti-Patterns (Hard Avoid)
509
+
510
+ * Asking user for code/context that can be derived from repo
511
+ * Asking user to choose an approach before presenting concrete options
512
+ * Meta questions about whether to research
513
+ * Staying narrowly on the initial request without considering evolution/edges
514
+ * Letting brainstorming drift without updating PRD
515
+
516
+ ---
517
+
518
+ ## Integration with Start Workflow
519
+
520
+ After brainstorm completes (Step 8 confirmation approved), the flow continues to the Task Workflow's **Phase 2: Prepare for Implementation**:
521
+
522
+ ```text
523
+ Brainstorm
524
+ Step 0: Create task directory + seed PRD
525
+ Step 1–7: Discover requirements, research, converge
526
+ Step 8: Final confirmation → user approves
527
+
528
+ Task Workflow Phase 2 (Prepare for Implementation)
529
+ Code-Spec Depth Check (if applicable)
530
+ → Research codebase (based on confirmed PRD)
531
+ → Configure code-spec context (jsonl files)
532
+ → Activate task
533
+
534
+ Task Workflow Phase 3 (Execute)
535
+ Implement → Check → Complete
536
+ ```
537
+
538
+ The task directory and PRD already exist from brainstorm, so Phase 1 of the Task Workflow is skipped entirely.
539
+
540
+ ---
541
+
542
+ ## Related Commands
543
+
544
+ | Command | When to Use |
545
+ |---------|-------------|
546
+ | `/trellis:start` | Entry point that triggers brainstorm |
547
+ | `/trellis:finish-work` | After implementation is complete |
548
+ | `/trellis:update-spec` | If new patterns emerge during work |