@jahanxu/trellis 0.5.9 → 0.6.1

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 (107) hide show
  1. package/README.md +74 -130
  2. package/dist/cli/index.js +1 -0
  3. package/dist/cli/index.js.map +1 -1
  4. package/dist/commands/init.d.ts +1 -0
  5. package/dist/commands/init.d.ts.map +1 -1
  6. package/dist/commands/init.js +30 -2
  7. package/dist/commands/init.js.map +1 -1
  8. package/dist/commands/update.d.ts.map +1 -1
  9. package/dist/commands/update.js +11 -39
  10. package/dist/commands/update.js.map +1 -1
  11. package/dist/configurators/index.d.ts.map +1 -1
  12. package/dist/configurators/index.js +15 -3
  13. package/dist/configurators/index.js.map +1 -1
  14. package/dist/configurators/kilo.d.ts +1 -1
  15. package/dist/configurators/kilo.d.ts.map +1 -1
  16. package/dist/configurators/kilo.js +2 -1
  17. package/dist/configurators/kilo.js.map +1 -1
  18. package/dist/configurators/qoder.d.ts +8 -0
  19. package/dist/configurators/qoder.d.ts.map +1 -0
  20. package/dist/configurators/qoder.js +52 -0
  21. package/dist/configurators/qoder.js.map +1 -0
  22. package/dist/configurators/workflow.d.ts.map +1 -1
  23. package/dist/configurators/workflow.js +3 -1
  24. package/dist/configurators/workflow.js.map +1 -1
  25. package/dist/migrations/manifests/0.3.2.json +9 -0
  26. package/dist/migrations/manifests/0.3.3.json +9 -0
  27. package/dist/migrations/manifests/0.3.4.json +21 -0
  28. package/dist/migrations/manifests/0.3.5.json +9 -0
  29. package/dist/templates/claude/commands/trellis/record-session.md +12 -16
  30. package/dist/templates/codex/skills/record-session/SKILL.md +13 -17
  31. package/dist/templates/cursor/commands/trellis-record-session.md +12 -16
  32. package/dist/templates/extract.d.ts +7 -0
  33. package/dist/templates/extract.d.ts.map +1 -1
  34. package/dist/templates/extract.js +13 -0
  35. package/dist/templates/extract.js.map +1 -1
  36. package/dist/templates/gemini/commands/trellis/record-session.toml +12 -16
  37. package/dist/templates/iflow/commands/trellis/record-session.md +12 -16
  38. package/dist/templates/iflow/hooks/session-start.py +1 -0
  39. package/dist/templates/kilo/commands/trellis/record-session.md +12 -16
  40. package/dist/templates/kilo/index.d.ts +3 -3
  41. package/dist/templates/kilo/index.d.ts.map +1 -1
  42. package/dist/templates/kilo/index.js +7 -7
  43. package/dist/templates/kilo/index.js.map +1 -1
  44. package/dist/templates/kilo/workflows/before-backend-dev.md +13 -0
  45. package/dist/templates/kilo/workflows/before-frontend-dev.md +13 -0
  46. package/dist/templates/kilo/workflows/brainstorm.md +474 -0
  47. package/dist/templates/kilo/workflows/break-loop.md +125 -0
  48. package/dist/templates/kilo/workflows/check-backend.md +13 -0
  49. package/dist/templates/kilo/workflows/check-cross-layer.md +153 -0
  50. package/dist/templates/kilo/workflows/check-frontend.md +13 -0
  51. package/dist/templates/kilo/workflows/create-command.md +152 -0
  52. package/dist/templates/kilo/workflows/finish-work.md +129 -0
  53. package/dist/templates/kilo/workflows/integrate-skill.md +219 -0
  54. package/dist/templates/kilo/workflows/onboard.md +358 -0
  55. package/dist/templates/kilo/workflows/parallel.md +194 -0
  56. package/dist/templates/kilo/workflows/record-session.md +58 -0
  57. package/dist/templates/kilo/workflows/start.md +321 -0
  58. package/dist/templates/kilo/workflows/update-spec.md +285 -0
  59. package/dist/templates/kiro/skills/record-session/SKILL.md +13 -17
  60. package/dist/templates/opencode/commands/trellis/record-session.md +12 -16
  61. package/dist/templates/qoder/index.d.ts +18 -0
  62. package/dist/templates/qoder/index.d.ts.map +1 -0
  63. package/dist/templates/qoder/index.js +40 -0
  64. package/dist/templates/qoder/index.js.map +1 -0
  65. package/dist/templates/qoder/skills/before-backend-dev/SKILL.md +18 -0
  66. package/dist/templates/qoder/skills/before-frontend-dev/SKILL.md +18 -0
  67. package/dist/templates/qoder/skills/brainstorm/SKILL.md +479 -0
  68. package/dist/templates/qoder/skills/break-loop/SKILL.md +130 -0
  69. package/dist/templates/qoder/skills/check-backend/SKILL.md +18 -0
  70. package/dist/templates/qoder/skills/check-cross-layer/SKILL.md +158 -0
  71. package/dist/templates/qoder/skills/check-frontend/SKILL.md +18 -0
  72. package/dist/templates/qoder/skills/create-command/SKILL.md +101 -0
  73. package/dist/templates/qoder/skills/finish-work/SKILL.md +134 -0
  74. package/dist/templates/qoder/skills/integrate-skill/SKILL.md +221 -0
  75. package/dist/templates/qoder/skills/onboard/SKILL.md +363 -0
  76. package/dist/templates/qoder/skills/record-session/SKILL.md +63 -0
  77. package/dist/templates/qoder/skills/start/SKILL.md +326 -0
  78. package/dist/templates/qoder/skills/update-spec/SKILL.md +290 -0
  79. package/dist/templates/trellis/config.yaml +15 -0
  80. package/dist/templates/trellis/index.d.ts +3 -0
  81. package/dist/templates/trellis/index.d.ts.map +1 -1
  82. package/dist/templates/trellis/index.js +4 -0
  83. package/dist/templates/trellis/index.js.map +1 -1
  84. package/dist/templates/trellis/scripts/add_session.py +52 -21
  85. package/dist/templates/trellis/scripts/common/__init__.py +3 -1
  86. package/dist/templates/trellis/scripts/common/cli_adapter.py +125 -20
  87. package/dist/templates/trellis/scripts/common/config.py +52 -0
  88. package/dist/templates/trellis/scripts/common/git_context.py +121 -11
  89. package/dist/templates/trellis/scripts/multi_agent/plan.py +4 -1
  90. package/dist/templates/trellis/scripts/multi_agent/start.py +5 -1
  91. package/dist/templates/trellis/scripts/task.py +26 -0
  92. package/dist/types/ai-tools.d.ts +3 -3
  93. package/dist/types/ai-tools.d.ts.map +1 -1
  94. package/dist/types/ai-tools.js +8 -0
  95. package/dist/types/ai-tools.js.map +1 -1
  96. package/dist/utils/proxy.d.ts +25 -0
  97. package/dist/utils/proxy.d.ts.map +1 -0
  98. package/dist/utils/proxy.js +60 -0
  99. package/dist/utils/proxy.js.map +1 -0
  100. package/dist/utils/template-fetcher.d.ts +11 -2
  101. package/dist/utils/template-fetcher.d.ts.map +1 -1
  102. package/dist/utils/template-fetcher.js +92 -19
  103. package/dist/utils/template-fetcher.js.map +1 -1
  104. package/dist/utils/template-hash.d.ts.map +1 -1
  105. package/dist/utils/template-hash.js +1 -0
  106. package/dist/utils/template-hash.js.map +1 -1
  107. package/package.json +10 -9
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Qoder skill templates
3
+ *
4
+ * These are GENERIC templates for user projects.
5
+ * Do NOT use Trellis project's own .qoder/ directory (which may be customized).
6
+ *
7
+ * Directory structure:
8
+ * qoder/
9
+ * └── skills/
10
+ * └── <skill-name>/
11
+ * └── SKILL.md
12
+ */
13
+ export interface SkillTemplate {
14
+ name: string;
15
+ content: string;
16
+ }
17
+ export declare function getAllSkills(): SkillTemplate[];
18
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/qoder/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAwBH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,YAAY,IAAI,aAAa,EAAE,CAS9C"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Qoder skill templates
3
+ *
4
+ * These are GENERIC templates for user projects.
5
+ * Do NOT use Trellis project's own .qoder/ directory (which may be customized).
6
+ *
7
+ * Directory structure:
8
+ * qoder/
9
+ * └── skills/
10
+ * └── <skill-name>/
11
+ * └── SKILL.md
12
+ */
13
+ import { readdirSync, readFileSync } from "node:fs";
14
+ import { dirname, join } from "node:path";
15
+ import { fileURLToPath } from "node:url";
16
+ const __filename = fileURLToPath(import.meta.url);
17
+ const __dirname = dirname(__filename);
18
+ function readTemplate(relativePath) {
19
+ return readFileSync(join(__dirname, relativePath), "utf-8");
20
+ }
21
+ function listSkillNames() {
22
+ try {
23
+ return readdirSync(join(__dirname, "skills"), { withFileTypes: true })
24
+ .filter((entry) => entry.isDirectory())
25
+ .map((entry) => entry.name)
26
+ .sort();
27
+ }
28
+ catch {
29
+ return [];
30
+ }
31
+ }
32
+ export function getAllSkills() {
33
+ const skills = [];
34
+ for (const name of listSkillNames()) {
35
+ const content = readTemplate(`skills/${name}/SKILL.md`);
36
+ skills.push({ name, content });
37
+ }
38
+ return skills;
39
+ }
40
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/templates/qoder/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEtC,SAAS,YAAY,CAAC,YAAoB;IACxC,OAAO,YAAY,CAAC,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,EAAE,OAAO,CAAC,CAAC;AAC9D,CAAC;AAED,SAAS,cAAc;IACrB,IAAI,CAAC;QACH,OAAO,WAAW,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC;aACnE,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;aACtC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC;aAC1B,IAAI,EAAE,CAAC;IACZ,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAOD,MAAM,UAAU,YAAY;IAC1B,MAAM,MAAM,GAAoB,EAAE,CAAC;IAEnC,KAAK,MAAM,IAAI,IAAI,cAAc,EAAE,EAAE,CAAC;QACpC,MAAM,OAAO,GAAG,YAAY,CAAC,UAAU,IAAI,WAAW,CAAC,CAAC;QACxD,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;IACjC,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,18 @@
1
+ ---
2
+ name: before-backend-dev
3
+ description: "Read the backend development guidelines before starting your development task."
4
+ ---
5
+
6
+ Read the backend development guidelines before starting your development task.
7
+
8
+ Execute these steps:
9
+ 1. Read `.trellis/spec/backend/index.md` to understand available guidelines
10
+ 2. Based on your task, read the relevant guideline files:
11
+ - Database work → `.trellis/spec/backend/database-guidelines.md`
12
+ - Error handling → `.trellis/spec/backend/error-handling.md`
13
+ - Logging → `.trellis/spec/backend/logging-guidelines.md`
14
+ - Type questions → `.trellis/spec/backend/type-safety.md`
15
+ 3. Understand the coding standards and patterns you need to follow
16
+ 4. Then proceed with your development plan
17
+
18
+ This step is **mandatory** before writing any backend code.
@@ -0,0 +1,18 @@
1
+ ---
2
+ name: before-frontend-dev
3
+ description: "Read the frontend development guidelines before starting your development task."
4
+ ---
5
+
6
+ Read the frontend development guidelines before starting your development task.
7
+
8
+ Execute these steps:
9
+ 1. Read `.trellis/spec/frontend/index.md` to understand available guidelines
10
+ 2. Based on your task, read the relevant guideline files:
11
+ - Component work → `.trellis/spec/frontend/component-guidelines.md`
12
+ - Hook work → `.trellis/spec/frontend/hook-guidelines.md`
13
+ - State management → `.trellis/spec/frontend/state-management.md`
14
+ - Type questions → `.trellis/spec/frontend/type-safety.md`
15
+ 3. Understand the coding standards and patterns you need to follow
16
+ 4. Then proceed with your development plan
17
+
18
+ This step is **mandatory** before writing any frontend code.
@@ -0,0 +1,479 @@
1
+ ---
2
+ name: brainstorm
3
+ description: "Brainstorm - Requirements Discovery (AI Coding Enhanced)"
4
+ ---
5
+
6
+ # Brainstorm - Requirements Discovery (AI Coding Enhanced)
7
+
8
+ Guide AI through collaborative requirements discovery **before implementation**, optimized for AI coding workflows:
9
+
10
+ * **Task-first** (capture ideas immediately)
11
+ * **Action-before-asking** (reduce low-value questions)
12
+ * **Research-first** for technical choices (avoid asking users to invent options)
13
+ * **Diverge → Converge** (expand thinking, then lock MVP)
14
+
15
+ ---
16
+
17
+ ## When to Use
18
+
19
+ Triggered from `$start` when the user describes a development task, especially when:
20
+
21
+ * requirements are unclear or evolving
22
+ * there are multiple valid implementation paths
23
+ * trade-offs matter (UX, reliability, maintainability, cost, performance)
24
+ * the user might not know the best options up front
25
+
26
+ ---
27
+
28
+ ## Core Principles (Non-negotiable)
29
+
30
+ 1. **Task-first (capture early)**
31
+ Always ensure a task exists at the start so the user's ideas are recorded immediately.
32
+
33
+ 2. **Action before asking**
34
+ If you can derive the answer from repo code, docs, configs, conventions, or quick research — do that first.
35
+
36
+ 3. **One question per message**
37
+ Never overwhelm the user with a list of questions. Ask one, update PRD, repeat.
38
+
39
+ 4. **Prefer concrete options**
40
+ For preference/decision questions, present 2–3 feasible, specific approaches with trade-offs.
41
+
42
+ 5. **Research-first for technical choices**
43
+ If the decision depends on industry conventions / similar tools / established patterns, do research first, then propose options.
44
+
45
+ 6. **Diverge → Converge**
46
+ After initial understanding, proactively consider future evolution, related scenarios, and failure/edge cases — then converge to an MVP with explicit out-of-scope.
47
+
48
+ 7. **No meta questions**
49
+ Do not ask "should I search?" or "can you paste the code so I can continue?"
50
+ If you need information: search/inspect. If blocked: ask the minimal blocking question.
51
+
52
+ ---
53
+
54
+ ## Step 0: Ensure Task Exists (ALWAYS)
55
+
56
+ Before any Q&A, ensure a task exists. If none exists, create one immediately.
57
+
58
+ * Use a **temporary working title** derived from the user's message.
59
+ * It's OK if the title is imperfect — refine later in PRD.
60
+
61
+ ```bash
62
+ TASK_DIR=$(python3 ./.trellis/scripts/task.py create "brainstorm: <short goal>" --slug <auto>)
63
+ ```
64
+
65
+ Create/seed `prd.md` immediately with what you know:
66
+
67
+ ```markdown
68
+ # brainstorm: <short goal>
69
+
70
+ ## Goal
71
+
72
+ <one paragraph: what + why>
73
+
74
+ ## What I already know
75
+
76
+ * <facts from user message>
77
+ * <facts discovered from repo/docs>
78
+
79
+ ## Assumptions (temporary)
80
+
81
+ * <assumptions to validate>
82
+
83
+ ## Open Questions
84
+
85
+ * <ONLY Blocking / Preference questions; keep list short>
86
+
87
+ ## Requirements (evolving)
88
+
89
+ * <start with what is known>
90
+
91
+ ## Acceptance Criteria (evolving)
92
+
93
+ * [ ] <testable criterion>
94
+
95
+ ## Definition of Done (team quality bar)
96
+
97
+ * Tests added/updated (unit/integration where appropriate)
98
+ * Lint / typecheck / CI green
99
+ * Docs/notes updated if behavior changes
100
+ * Rollout/rollback considered if risky
101
+
102
+ ## Out of Scope (explicit)
103
+
104
+ * <what we will not do in this task>
105
+
106
+ ## Technical Notes
107
+
108
+ * <files inspected, constraints, links, references>
109
+ * <research notes summary if applicable>
110
+ ```
111
+
112
+ ---
113
+
114
+ ## Step 1: Auto-Context (DO THIS BEFORE ASKING QUESTIONS)
115
+
116
+ Before asking questions like "what does the code look like?", gather context yourself:
117
+
118
+ ### Repo inspection checklist
119
+
120
+ * Identify likely modules/files impacted
121
+ * Locate existing patterns (similar features, conventions, error handling style)
122
+ * Check configs, scripts, existing command definitions
123
+ * Note any constraints (runtime, dependency policy, build tooling)
124
+
125
+ ### Documentation checklist
126
+
127
+ * Look for existing PRDs/specs/templates
128
+ * Look for command usage examples, README, ADRs if any
129
+
130
+ Write findings into PRD:
131
+
132
+ * Add to `What I already know`
133
+ * Add constraints/links to `Technical Notes`
134
+
135
+ ---
136
+
137
+ ## Step 2: Classify Complexity (still useful, not gating task creation)
138
+
139
+ | Complexity | Criteria | Action |
140
+ | ------------ | ------------------------------------------------------ | ------------------------------------------- |
141
+ | **Trivial** | Single-line fix, typo, obvious change | Skip brainstorm, implement directly |
142
+ | **Simple** | Clear goal, 1–2 files, scope well-defined | Ask 1 confirm question, then implement |
143
+ | **Moderate** | Multiple files, some ambiguity | Light brainstorm (2–3 high-value questions) |
144
+ | **Complex** | Vague goal, architectural choices, multiple approaches | Full brainstorm |
145
+
146
+ > Note: Task already exists from Step 0. Classification only affects depth of brainstorming.
147
+
148
+ ---
149
+
150
+ ## Step 3: Question Gate (Ask ONLY high-value questions)
151
+
152
+ Before asking ANY question, run the following gate:
153
+
154
+ ### Gate A — Can I derive this without the user?
155
+
156
+ If answer is available via:
157
+
158
+ * repo inspection (code/config)
159
+ * docs/specs/conventions
160
+ * quick market/OSS research
161
+
162
+ → **Do not ask.** Fetch it, summarize, update PRD.
163
+
164
+ ### Gate B — Is this a meta/lazy question?
165
+
166
+ Examples:
167
+
168
+ * "Should I search?"
169
+ * "Can you paste the code so I can proceed?"
170
+ * "What does the code look like?" (when repo is available)
171
+
172
+ → **Do not ask.** Take action.
173
+
174
+ ### Gate C — What type of question is it?
175
+
176
+ * **Blocking**: cannot proceed without user input
177
+ * **Preference**: multiple valid choices, depends on product/UX/risk preference
178
+ * **Derivable**: should be answered by inspection/research
179
+
180
+ → Only ask **Blocking** or **Preference**.
181
+
182
+ ---
183
+
184
+ ## Step 4: Research-first Mode (Mandatory for technical choices)
185
+
186
+ ### Trigger conditions (any → research-first)
187
+
188
+ * The task involves selecting an approach, library, protocol, framework, template system, plugin mechanism, or CLI UX convention
189
+ * The user asks for "best practice", "how others do it", "recommendation"
190
+ * The user can't reasonably enumerate options
191
+
192
+ ### Research steps
193
+
194
+ 1. Identify 2–4 comparable tools/patterns
195
+ 2. Summarize common conventions and why they exist
196
+ 3. Map conventions onto our repo constraints
197
+ 4. Produce **2–3 feasible approaches** for our project
198
+
199
+ ### Research output format (PRD)
200
+
201
+ Add a section in PRD (either within Technical Notes or as its own):
202
+
203
+ ```markdown
204
+ ## Research Notes
205
+
206
+ ### What similar tools do
207
+
208
+ * ...
209
+ * ...
210
+
211
+ ### Constraints from our repo/project
212
+
213
+ * ...
214
+
215
+ ### Feasible approaches here
216
+
217
+ **Approach A: <name>** (Recommended)
218
+
219
+ * How it works:
220
+ * Pros:
221
+ * Cons:
222
+
223
+ **Approach B: <name>**
224
+
225
+ * How it works:
226
+ * Pros:
227
+ * Cons:
228
+
229
+ **Approach C: <name>** (optional)
230
+
231
+ * ...
232
+ ```
233
+
234
+ Then ask **one** preference question:
235
+
236
+ * "Which approach do you prefer: A / B / C (or other)?"
237
+
238
+ ---
239
+
240
+ ## Step 5: Expansion Sweep (DIVERGE) — Required after initial understanding
241
+
242
+ After you can summarize the goal, proactively broaden thinking before converging.
243
+
244
+ ### Expansion categories (keep to 1–2 bullets each)
245
+
246
+ 1. **Future evolution**
247
+
248
+ * What might this feature become in 1–3 months?
249
+ * What extension points are worth preserving now?
250
+
251
+ 2. **Related scenarios**
252
+
253
+ * What adjacent commands/flows should remain consistent with this?
254
+ * Are there parity expectations (create vs update, import vs export, etc.)?
255
+
256
+ 3. **Failure & edge cases**
257
+
258
+ * Conflicts, offline/network failure, retries, idempotency, compatibility, rollback
259
+ * Input validation, security boundaries, permission checks
260
+
261
+ ### Expansion message template (to user)
262
+
263
+ ```markdown
264
+ I understand you want to implement: <current goal>.
265
+
266
+ Before diving into design, let me quickly diverge to consider three categories (to avoid rework later):
267
+
268
+ 1. Future evolution: <1–2 bullets>
269
+ 2. Related scenarios: <1–2 bullets>
270
+ 3. Failure/edge cases: <1–2 bullets>
271
+
272
+ For this MVP, which would you like to include (or none)?
273
+
274
+ 1. Current requirement only (minimal viable)
275
+ 2. Add <X> (reserve for future extension)
276
+ 3. Add <Y> (improve robustness/consistency)
277
+ 4. Other: describe your preference
278
+ ```
279
+
280
+ Then update PRD:
281
+
282
+ * What's in MVP → `Requirements`
283
+ * What's excluded → `Out of Scope`
284
+
285
+ ---
286
+
287
+ ## Step 6: Q&A Loop (CONVERGE)
288
+
289
+ ### Rules
290
+
291
+ * One question per message
292
+ * Prefer multiple-choice when possible
293
+ * After each user answer:
294
+
295
+ * Update PRD immediately
296
+ * Move answered items from `Open Questions` → `Requirements`
297
+ * Update `Acceptance Criteria` with testable checkboxes
298
+ * Clarify `Out of Scope`
299
+
300
+ ### Question priority (recommended)
301
+
302
+ 1. **MVP scope boundary** (what is included/excluded)
303
+ 2. **Preference decisions** (after presenting concrete options)
304
+ 3. **Failure/edge behavior** (only for MVP-critical paths)
305
+ 4. **Success metrics & Acceptance Criteria** (what proves it works)
306
+
307
+ ### Preferred question format (multiple choice)
308
+
309
+ ```markdown
310
+ For <topic>, which approach do you prefer?
311
+
312
+ 1. **Option A** — <what it means + trade-off>
313
+ 2. **Option B** — <what it means + trade-off>
314
+ 3. **Option C** — <what it means + trade-off>
315
+ 4. **Other** — describe your preference
316
+ ```
317
+
318
+ ---
319
+
320
+ ## Step 7: Propose Approaches + Record Decisions (Complex tasks)
321
+
322
+ After requirements are clear enough, propose 2–3 approaches (if not already done via research-first):
323
+
324
+ ```markdown
325
+ Based on current information, here are 2–3 feasible approaches:
326
+
327
+ **Approach A: <name>** (Recommended)
328
+
329
+ * How:
330
+ * Pros:
331
+ * Cons:
332
+
333
+ **Approach B: <name>**
334
+
335
+ * How:
336
+ * Pros:
337
+ * Cons:
338
+
339
+ Which direction do you prefer?
340
+ ```
341
+
342
+ Record the outcome in PRD as an ADR-lite section:
343
+
344
+ ```markdown
345
+ ## Decision (ADR-lite)
346
+
347
+ **Context**: Why this decision was needed
348
+ **Decision**: Which approach was chosen
349
+ **Consequences**: Trade-offs, risks, potential future improvements
350
+ ```
351
+
352
+ ---
353
+
354
+ ## Step 8: Final Confirmation + Implementation Plan
355
+
356
+ When open questions are resolved, confirm complete requirements with a structured summary:
357
+
358
+ ### Final confirmation format
359
+
360
+ ```markdown
361
+ Here's my understanding of the complete requirements:
362
+
363
+ **Goal**: <one sentence>
364
+
365
+ **Requirements**:
366
+
367
+ * ...
368
+ * ...
369
+
370
+ **Acceptance Criteria**:
371
+
372
+ * [ ] ...
373
+ * [ ] ...
374
+
375
+ **Definition of Done**:
376
+
377
+ * ...
378
+
379
+ **Out of Scope**:
380
+
381
+ * ...
382
+
383
+ **Technical Approach**:
384
+ <brief summary + key decisions>
385
+
386
+ **Implementation Plan (small PRs)**:
387
+
388
+ * PR1: <scaffolding + tests + minimal plumbing>
389
+ * PR2: <core behavior>
390
+ * PR3: <edge cases + docs + cleanup>
391
+
392
+ Does this look correct? If yes, I'll proceed with implementation.
393
+ ```
394
+
395
+ ---
396
+
397
+ ## PRD Target Structure (final)
398
+
399
+ `prd.md` should converge to:
400
+
401
+ ```markdown
402
+ # <Task Title>
403
+
404
+ ## Goal
405
+
406
+ <why + what>
407
+
408
+ ## Requirements
409
+
410
+ * ...
411
+
412
+ ## Acceptance Criteria
413
+
414
+ * [ ] ...
415
+
416
+ ## Definition of Done
417
+
418
+ * ...
419
+
420
+ ## Technical Approach
421
+
422
+ <key design + decisions>
423
+
424
+ ## Decision (ADR-lite)
425
+
426
+ Context / Decision / Consequences
427
+
428
+ ## Out of Scope
429
+
430
+ * ...
431
+
432
+ ## Technical Notes
433
+
434
+ <constraints, references, files, research notes>
435
+ ```
436
+
437
+ ---
438
+
439
+ ## Anti-Patterns (Hard Avoid)
440
+
441
+ * Asking user for code/context that can be derived from repo
442
+ * Asking user to choose an approach before presenting concrete options
443
+ * Meta questions about whether to research
444
+ * Staying narrowly on the initial request without considering evolution/edges
445
+ * Letting brainstorming drift without updating PRD
446
+
447
+ ---
448
+
449
+ ## Integration with Start Workflow
450
+
451
+ After brainstorm completes (Step 8 confirmation approved), the flow continues to the Task Workflow's **Phase 2: Prepare for Implementation**:
452
+
453
+ ```text
454
+ Brainstorm
455
+ Step 0: Create task directory + seed PRD
456
+ Step 1–7: Discover requirements, research, converge
457
+ Step 8: Final confirmation → user approves
458
+
459
+ Task Workflow Phase 2 (Prepare for Implementation)
460
+ Code-Spec Depth Check (if applicable)
461
+ → Research codebase (based on confirmed PRD)
462
+ → Configure code-spec context (jsonl files)
463
+ → Activate task
464
+
465
+ Task Workflow Phase 3 (Execute)
466
+ Implement → Check → Complete
467
+ ```
468
+
469
+ The task directory and PRD already exist from brainstorm, so Phase 1 of the Task Workflow is skipped entirely.
470
+
471
+ ---
472
+
473
+ ## Related Commands
474
+
475
+ | Command | When to Use |
476
+ |---------|-------------|
477
+ | `$start` | Entry point that triggers brainstorm |
478
+ | `$finish-work` | After implementation is complete |
479
+ | `$update-spec` | If new patterns emerge during work |