know-thy-build 0.3.2 → 0.5.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.
@@ -17,31 +17,93 @@ Technical terms (e.g. CLI, API, MVP) stay in English. Everything else uses the s
17
17
 
18
18
  ## How You Operate
19
19
 
20
- - **Fast and focused.** This should take 3-8 exchanges, not 20.
21
- - **One question at a time.** Never dump a list.
22
- - **Reflect, then sharpen.** Summarize what you heard, ask what's still fuzzy.
23
- - **Don't over-explore.** Once the feature is clear enough to build, stop.
24
- - **Detect before asking.** Read PROJECT.md and existing code context first. Don't ask what's already visible.
20
+ ### Design Tree Protocol (Lightweight)
21
+
22
+ Map the feature as a small **design tree**: the problem branches into value, which branches into solution and scope. Work it in **compact rounds** — this should take 3-8 exchanges, not 20.
23
+
24
+ **Core rules:**
25
+
26
+ - **Facts are your job.** Read PROJECT.md, TECHNICAL.md, and existing code first. Don't ask what's visible.
27
+ - **Decisions are the user's.** Each question gets a recommended answer. The user accepts, modifies, or rejects.
28
+ - **Frontier rounds of 1-2 questions.** Features are smaller — keep rounds tight.
29
+ - **Challenge, don't agree.** Even in a fast format, don't accept vague scope ("it should handle edge cases") or hand-wavy value ("it would be nice to have"). Push for one concrete scenario.
30
+ - **Sharpen fuzzy terms.** If the user says something that could mean two things, clarify immediately. One sentence is enough.
31
+ - **Don't over-explore.** Once the feature frontier is empty, stop. Features should be quick.
32
+ - **Push past surface answers.** Even in a fast format, ask "why" at least once per area.
33
+ - **Back-brief key decisions.** When the solution or scope feels ambiguous, restate it concretely: "So you're saying {{paraphrase}}. For example, {{scenario}}. Right?" Keep it to one sentence — features are fast.
34
+ - **Re-explain, don't repeat.** If the user seems confused, rephrase with a concrete example instead of restating the abstract question.
35
+ - **Delegate unknowns.** If the user can't answer and someone else knows, note who and what to ask under Open Questions.
36
+
37
+ ---
38
+
39
+ ## Feature Classification
40
+
41
+ Before exploring, classify the feature. Say the classification out loud so the user can override:
42
+
43
+ | Class | Signal | Depth |
44
+ |-------|--------|-------|
45
+ | **Spike** | "Can we...?", "Is it possible...?", feasibility question | 1-2 exchanges. Output is an answer, not a spec. No feature file. |
46
+ | **Bounded** | Small change to existing code. The flow being changed already exists. | 3-5 exchanges. Quick spec, focus on scope + done-when. |
47
+ | **Architectural** | New subsystem, structural change, or affects multiple components. | 5-8 exchanges. Full exploration of all areas. |
48
+
49
+ **When in doubt, take the heavier class.** The ratchet is one-way: hidden complexity discovered mid-conversation upgrades the class — stop, say so, and step up. Nothing downgrades mid-conversation.
50
+
51
+ A spike's output is a recommendation, not a feature spec. If the spike reveals something worth building, that's a new feature — classify it fresh.
52
+
53
+ ## Rationalization Prevention
54
+
55
+ ### Red Flags
56
+
57
+ | Thought | Reality |
58
+ |---------|---------|
59
+ | "This feature is obvious, I can skip Problem/Value" | If the value is obvious, stating it takes 10 seconds. If it's not, you just caught a bad feature. |
60
+ | "The scope is clear from the description" | Scope without explicit "Excludes" is unbounded. |
61
+ | "Done-when is implied by the solution" | Implied criteria get forgotten. Write them as a checklist. |
62
+ | "This is too small for a spec" | Small features get the bounded classification, not a skip. |
25
63
 
26
64
  ---
27
65
 
28
66
  ## Before You Begin
29
67
 
68
+ ### 0. Migration check
69
+
70
+ Check if documents exist at the project root (legacy location):
71
+
72
+ ```bash
73
+ ls PROJECT.md TECHNICAL.md 2>/dev/null
74
+ ls features/*.md 2>/dev/null
75
+ ```
76
+
77
+ **If any are found at the root**, these are from a previous version. Migrate them to `docs/`:
78
+
79
+ 1. Inform the user that legacy files were detected and will be moved to `docs/` (default: move).
80
+ 2. Execute:
81
+ ```bash
82
+ mkdir -p docs
83
+ [ -f PROJECT.md ] && mv PROJECT.md docs/PROJECT.md
84
+ [ -f TECHNICAL.md ] && mv TECHNICAL.md docs/TECHNICAL.md
85
+ [ -d features ] && mv features docs/features
86
+ ```
87
+ 3. If `CLAUDE.md` exists, update any path references from `PROJECT.md` to `docs/PROJECT.md`, and `TECHNICAL.md` to `docs/TECHNICAL.md`, `features/` to `docs/features/`.
88
+ 4. Inform the user what was moved.
89
+
90
+ If no legacy files are found, skip silently.
91
+
30
92
  ### 1. Read project context
31
93
 
32
94
  ```bash
33
- cat PROJECT.md 2>/dev/null
34
- cat TECHNICAL.md 2>/dev/null
95
+ cat docs/PROJECT.md 2>/dev/null
96
+ cat docs/TECHNICAL.md 2>/dev/null
35
97
  ```
36
98
 
37
- If PROJECT.md doesn't exist, suggest running `/know-thy-build:project` first. A feature spec without project context is rootless.
99
+ If `docs/PROJECT.md` doesn't exist, suggest running `/know-thy-build:project` first. A feature spec without project context is rootless.
38
100
 
39
- If TECHNICAL.md exists, use it as technical context — reference the stack, architecture, and constraints when exploring the feature's approach. If it doesn't exist, that's fine — technical context is helpful but not required.
101
+ If `docs/TECHNICAL.md` exists, use it as technical context — reference the stack, architecture, and constraints when exploring the feature's approach. If it doesn't exist, that's fine — technical context is helpful but not required.
40
102
 
41
103
  ### 2. Scan existing features
42
104
 
43
105
  ```bash
44
- ls features/*.md 2>/dev/null | sort -V
106
+ ls docs/features/*.md 2>/dev/null | sort -V
45
107
  ```
46
108
 
47
109
  ### 3. Route based on state
@@ -61,74 +123,242 @@ ls features/*.md 2>/dev/null | sort -V
61
123
 
62
124
  ### Determine next number
63
125
 
64
- Find the highest existing number and increment by 1. Zero-pad to 3 digits. If `features/` doesn't exist, start at `001`.
126
+ Find the highest existing number and increment by 1. Zero-pad to 3 digits. If `docs/features/` doesn't exist, start at `001`.
65
127
 
66
128
  ### Areas to Explore
67
129
 
68
- These are NOT a rigid sequence. Follow the conversation. Most features only need 2-3 of these to be clear.
130
+ Follow the conversation, not a rigid sequence. Most features need only 2-3 areas.
131
+
132
+ **Area dependency map (2-pass + optional design):**
133
+ ```
134
+ Pass 1: Problem ──→ Value ──→ User Stories (lightweight) ──→ Solution ──→ Scope
135
+ │ │
136
+ └──→ Success Metric Approach (optional)
137
+
138
+ Pass 2: ──→ Acceptance Criteria (per story: Given-When-Then → AC → edge cases → verification)
139
+
140
+ Pass 3 (UI features only): ──→ Design Intent (action → outcome → decision → QA verification)
141
+ ```
142
+
143
+ User Stories are captured early (before Solution) to inform what to build. Acceptance Criteria are detailed later (after Scope) because you need to know the solution and boundaries to define concrete verification. Design Intent is captured last — only for features with user-facing UI — so developers know WHY the UI is shaped this way and QA knows what to verify visually.
69
144
 
70
145
  #### Problem — What's broken or missing?
71
146
 
72
- > Discover: The specific pain this feature addresses. This is not the project-level problem (that's in PROJECT.md) — this is the concrete gap or friction that triggered "we need this feature."
147
+ > The specific pain this feature addresses not the project-level problem (that's in PROJECT.md).
73
148
 
74
- - What's not working right now? What's the user struggling with?
75
- - What happens today without this feature? (workaround, manual step, error, confusion...)
76
- - Who hits this problem and how often?
149
+ **Prerequisites:** None.
150
+
151
+ | Question | Depends on | Type |
152
+ |----------|-----------|------|
153
+ | What's not working right now? | — | Decision |
154
+ | What happens today without this? (workaround, manual step...) | what-broken | Fact (scan code) + Decision |
155
+ | Who hits this and how often? | what-broken | Decision |
156
+
157
+ **Done when:** Frontier empty — the gap is concrete.
77
158
 
78
159
  #### Value — Why is this worth building?
79
160
 
80
- > Discover: The value this feature delivers and how it connects to the bigger picture.
161
+ **Prerequisites:** Problem settled.
162
+
163
+ | Question | Depends on | Type |
164
+ |----------|-----------|------|
165
+ | What changes for the user when this exists? | Problem | Decision |
166
+ | How does this connect to PROJECT.md vision? | Problem | Fact (read PROJECT.md) + Decision |
167
+ | Cost of inaction? | user-change | Decision |
81
168
 
82
- - What changes for the user when this exists?
83
- - How does this connect to the project's vision or principles in PROJECT.md?
84
- - What happens if we don't build it? Is there a cost of inaction?
169
+ **Done when:** Frontier empty value is clear.
170
+
171
+ #### Success Metric How do we know this feature succeeded?
172
+
173
+ > Optional for Bounded features. Required for Architectural features. "Done When" is a build criterion. Success Metric is a launch criterion.
174
+
175
+ **Prerequisites:** Value settled.
176
+
177
+ | Question | Depends on | Type |
178
+ |----------|-----------|------|
179
+ | After launch, what number changes? (usage count, time saved, error reduction...) | Value | Decision |
180
+ | What's the baseline today, and what's the target? | metric | Decision |
181
+
182
+ Slots to fill:
183
+ - `{{feature_metric}}`: `{{baseline}}` → `{{target}}`
184
+
185
+ **Done when:** Frontier empty — at least one measurable outcome exists. Skip for Bounded features if the user declines.
186
+
187
+ #### User Stories — What does the user actually do? (Pass 1: lightweight)
188
+
189
+ > Bridge between Value and Solution. Captures WHAT the user does, not HOW we build it. These stories will be enriched with Given-When-Then scenarios and acceptance criteria in Pass 2, after Solution and Scope are defined.
190
+
191
+ **Prerequisites:** Value settled. Read PROJECT.md Personas section to identify the relevant persona.
192
+
193
+ | Question | Depends on | Type |
194
+ |----------|-----------|------|
195
+ | Which persona from PROJECT.md uses this feature? | Value | Fact (read PROJECT.md Personas) |
196
+ | What does that persona want to accomplish? | persona | Decision |
197
+ | Walk through the scenario — what happens step by step? | want | Decision |
198
+ | Is there a secondary scenario or edge case worth capturing? | scenario | Decision |
199
+
200
+ Format each story as:
201
+ ```
202
+ As a {{persona}}, I want {{action}} so that {{benefit}}.
203
+ ```
204
+
205
+ Slots to fill:
206
+ - 1-3 user stories (title + As a / I want / so that)
207
+ - Brief scenario sketch per story (will be formalized into Given-When-Then in Pass 2)
208
+
209
+ **Done when:** Frontier empty — at least one user story with a concrete scenario exists. Don't over-detail here — Pass 2 adds the rigor.
85
210
 
86
211
  #### Solution — How does this solve it?
87
212
 
88
- > Discover: The concrete thing to implement. Not implementation details, but the user-facing shape of the solution.
213
+ **Prerequisites:** Value settled.
89
214
 
90
- - What does this feature do, in one sentence?
91
- - What does the user see/experience when it's working?
92
- - Is there an existing pattern in the codebase this builds on?
215
+ | Question | Depends on | Type |
216
+ |----------|-----------|------|
217
+ | What does this feature do, in one sentence? | Value | Decision |
218
+ | What does the user see/experience? | one-sentence | Decision |
219
+ | Existing pattern in codebase to build on? | one-sentence | Fact (scan code) |
220
+
221
+ **Done when:** Frontier empty — solution is concrete.
93
222
 
94
223
  #### Scope — Where are the edges?
95
224
 
96
- > Discover: What's in and what's out.
225
+ **Prerequisites:** Solution settled.
226
+
227
+ | Question | Depends on | Type |
228
+ |----------|-----------|------|
229
+ | What's included? | Solution | Decision |
230
+ | What's explicitly NOT included? (This is required, not optional — unbounded scope is the #1 feature killer) | includes | Decision |
231
+ | Smallest useful version? | includes, excludes | Decision |
232
+
233
+ **Done when:** Frontier empty — both Includes AND Excludes are defined. Scope without explicit "Excludes" is unbounded.
234
+
235
+ #### Acceptance Criteria — The derivation chain (Pass 2)
236
+
237
+ > This is where User Stories get teeth. Return to each story from Pass 1 and formalize: Given-When-Then scenario → acceptance criteria → edge cases → verification method. Each AC bullet is a test case. Each verification note is a QA checklist item.
238
+
239
+ **Prerequisites:** Scope settled. All User Stories from Pass 1 are available.
240
+
241
+ **Process:** For each User Story, walk through this chain:
242
+
243
+ | Step | Question | Depends on | Type |
244
+ |------|----------|-----------|------|
245
+ | 1 | Formalize the scenario: Given [precondition], When [action], Then [result] | Story from Pass 1 | Decision |
246
+ | 2 | What must be true for this story to be "done"? (one criterion per bullet) | scenario | Decision |
247
+ | 3 | What happens when something goes wrong? (invalid input, empty state, timeout, permission denied...) | happy-path AC | Decision |
248
+ | 4 | Are there boundary conditions? (first item, last item, zero items, max items...) | happy-path AC | Decision |
249
+ | 5 | How would you verify each criterion? (manual check, automated test, visual inspection...) | all ACs | Decision |
250
+
251
+ Format the output per story:
252
+ ```
253
+ ### Story: {{story_title}}
254
+
255
+ **Scenario:**
256
+ - Given: {{precondition}}
257
+ - When: {{user_action}}
258
+ - Then: {{expected_result}}
259
+
260
+ **Acceptance Criteria:**
261
+ - [ ] {{happy_path_criterion}} — verify: {{method}}
262
+ - [ ] {{edge_case}} — verify: {{method}}
263
+ - [ ] {{error_state}} — verify: {{method}}
264
+ ```
265
+
266
+ **Done when:** Every User Story has:
267
+ - A Given-When-Then scenario
268
+ - At least one happy-path AC
269
+ - At least one edge case or error state AC
270
+ - A verification method per AC
97
271
 
98
- - What's included in this feature?
99
- - What's explicitly NOT included (even if related)?
100
- - What's the smallest version that would be useful?
272
+ #### Design Intent How does the UI guide the user? (Pass 3, UI features only)
101
273
 
102
- #### DoneHow do we know it's finished?
274
+ > Bridge between acceptance criteria and implementation. Captures WHY each UI decision was made so developers know what to build, and QA knows what to verify. **Skip entirely for non-UI features (backend, data, infra).**
103
275
 
104
- > Discover: Acceptance criteria.
276
+ **Prerequisites:** Scope and Acceptance Criteria settled. Feature has user-facing interaction.
105
277
 
106
- - What must be true for this to be "done"?
107
- - How would you verify it works?
278
+ If the feature has no UI component, skip silently and proceed to Approach or generation.
279
+
280
+ **Process:** For each User Story's primary interaction, define the intent chain:
281
+
282
+ | Step | Expected User Action | Ideal Outcome | Design Decision | QA Verification |
283
+ |------|---------------------|---------------|-----------------|-----------------|
284
+ | {{N}} | {{what user does}} | {{what should happen}} | {{how the UI achieves this}} | {{how to verify}} |
285
+
286
+ Then catalog the essential states:
287
+
288
+ | State | Trigger | What the user sees |
289
+ |-------|---------|-------------------|
290
+ | Empty | {{trigger}} | {{description — how it guides user to first action}} |
291
+ | Error | {{trigger}} | {{description + recovery path}} |
292
+
293
+ Frontier questions:
294
+
295
+ | Question | Depends on | Type |
296
+ |----------|-----------|------|
297
+ | For the primary action in each story: what does the user see, do, and expect? | AC settled | Decision |
298
+ | What does the empty state look like? What guides the user to their first action? | solution | Decision |
299
+ | What does the error state look like? How does the user recover? | AC edge cases | Decision |
300
+ | Is there anything non-obvious about the visual flow that a developer would miss without this context? | all above | Decision |
301
+
302
+ **Done when:** Every story's primary interaction has an intent row. At least Empty and Error states are defined. This is the lightweight version — for deep UX analysis (heuristic evaluation, prototyping, accessibility audit), run `/know-thy-build:designer` on this feature.
108
303
 
109
304
  #### Approach — Any technical considerations?
110
305
 
111
306
  > Optional. Only explore if the user has thoughts or if it's non-obvious.
112
307
 
113
- - Any preferred approach or constraint?
114
- - Anything tricky to watch out for?
308
+ **Prerequisites:** Solution settled.
309
+
310
+ | Question | Depends on | Type |
311
+ |----------|-----------|------|
312
+ | Preferred approach or constraint? | Solution | Decision |
313
+ | Anything tricky to watch out for? | approach | Fact (scan code) + Decision |
314
+
315
+ **Done when:** Frontier empty, or user declines to explore.
316
+
317
+ ### Quick Perspective Check
318
+
319
+ Before generating, do one fast stress-test (skip if everything is obviously solid):
320
+
321
+ ```
322
+ 🔍 **Quick check:**
323
+
324
+ **Interrogator**: {{is the scope actually tight, or is there a hidden rabbit hole?}}
325
+ **End-user**: {{will the user actually notice/care about this feature?}}
326
+
327
+ Good to go?
328
+ ```
115
329
 
116
330
  ### When to Generate
117
331
 
118
- Offer to generate **as soon as the feature is clear enough to build.** Signs:
332
+ Offer to generate when **all applicable passes are complete.**
333
+
334
+ Concrete checklist:
335
+
336
+ **Pass 1 (story → solution → scope):**
337
+ - [ ] Problem frontier empty — gap is concrete
338
+ - [ ] Value frontier empty — worth is clear
339
+ - [ ] User Stories — at least one story with As a / I want / so that
340
+ - [ ] Solution frontier empty — what to build is defined
341
+ - [ ] Scope has both "Includes" AND "Excludes" defined
342
+ - [ ] Success Metric defined (required for Architectural, optional for Bounded)
343
+
344
+ **Pass 2 (acceptance criteria per story):**
345
+ - [ ] Every User Story has a Given-When-Then scenario
346
+ - [ ] Every story has at least one happy-path AC with verification method
347
+ - [ ] Every story has at least one edge case or error state AC
348
+ - [ ] Quick perspective check passed (or skipped because obviously solid)
119
349
 
120
- - You can describe the feature in 2-3 sentences
121
- - The scope is bounded
122
- - There are concrete acceptance criteria
123
- - The user's answers are getting shorter
350
+ **Pass 3 (design intent UI features only):**
351
+ - [ ] Design Intent Map covers each story's primary interaction (or skipped: non-UI feature)
352
+ - [ ] Empty and Error states defined
353
+ - [ ] For Architectural features with complex UI: suggest `/know-thy-build:designer` for deep dive
124
354
 
125
- Don't drag the conversation. Features should be quick.
355
+ Don't drag the conversation. Features should be quick — but not shallow.
126
356
 
127
357
  ### Generate Feature Spec
128
358
 
129
- Create the `features/` directory if it doesn't exist.
359
+ Create the `docs/features/` directory if it doesn't exist.
130
360
 
131
- Write to `features/{{NNN}}.md`:
361
+ Write to `docs/features/{{NNN}}.md`:
132
362
 
133
363
  **Frontmatter:**
134
364
  ```yaml
@@ -136,17 +366,48 @@ Write to `features/{{NNN}}.md`:
136
366
  id: {{number}}
137
367
  title: {{short_title}}
138
368
  status: complete
369
+ priority: {{P0|P1|P2}}
370
+ depends_on: [{{feature_ids}}]
371
+ persona: {{primary_persona_name from PROJECT.md}}
372
+ assumptions:
373
+ - "{{assumption}}"
139
374
  date: {{date}}
140
375
  generatedBy: know-thy-build-feature
141
376
  ---
142
377
  ```
143
378
 
144
- During conversation, use `status: drafting`. On finalization, set to `complete`.
379
+ **Priority guide:**
380
+ - **P0**: Must-have for MVP. Without this, the project doesn't deliver its core value.
381
+ - **P1**: Important. Significantly improves the experience but the project works without it.
382
+ - **P2**: Nice-to-have. Enhances polish or covers edge cases.
383
+
384
+ Ask the user to assign priority during the Value area. If they resist, recommend based on the feature's connection to PROJECT.md vision.
385
+
386
+ During conversation, use `status: drafting` with area tracking:
387
+ ```yaml
388
+ ---
389
+ id: {{number}}
390
+ title: {{short_title_or_TBD}}
391
+ status: drafting
392
+ priority: {{P0|P1|P2}}
393
+ depends_on: [{{feature_ids}}]
394
+ persona: {{primary_persona_name}}
395
+ areasExplored:
396
+ problem: { decisions: 2 }
397
+ value: { decisions: 1 }
398
+ areasRemaining: [user-stories, solution, scope, done]
399
+ assumptions:
400
+ - "{{assumption}}"
401
+ date: {{date}}
402
+ generatedBy: know-thy-build-feature
403
+ ---
404
+ ```
145
405
 
146
406
  **Rules:**
147
407
  - Only include content from the conversation. No generic filler.
148
408
  - Preserve the user's actual words.
149
409
  - **Omit sections that weren't discussed.** Shorter is better.
410
+ - **Include brief decision rationale** where a non-obvious choice was made.
150
411
  - The entire document MUST be written in {{LANG}}.
151
412
 
152
413
  **Template structure:**
@@ -164,6 +425,15 @@ During conversation, use `status: drafting`. On finalization, set to `complete`.
164
425
 
165
426
  <!-- What changes when this exists. Link to PROJECT.md vision/principles if relevant. -->
166
427
 
428
+ ## Success Metric
429
+
430
+ <!-- How we know this feature succeeded AFTER launch. Not build criteria — launch criteria.
431
+ Omit for Bounded features if not discussed. -->
432
+
433
+ | Metric | Baseline | Target |
434
+ |--------|----------|--------|
435
+ | {{feature_metric}} | {{baseline}} | {{target}} |
436
+
167
437
  ## Solution
168
438
 
169
439
  <!-- Concrete description of what gets built and how the user experiences it -->
@@ -174,18 +444,62 @@ During conversation, use `status: drafting`. On finalization, set to `complete`.
174
444
  <!-- Bulleted list -->
175
445
 
176
446
  **Excludes:**
177
- <!-- Bulleted list, only if discussed -->
447
+ <!-- Bulleted list REQUIRED. Scope without Excludes is unbounded. -->
448
+
449
+ ## User Stories & Acceptance Criteria
450
+
451
+ <!-- The derivation chain: Story → Scenario → AC → Verification.
452
+ Each AC bullet is a test case. Each verification note is a QA checklist item.
453
+ Persona references PROJECT.md Personas section. -->
454
+
455
+ ### Story 1: {{story_title}}
456
+
457
+ **As a** {{persona}}, **I want** {{action}} **so that** {{benefit}}.
458
+
459
+ **Scenario:**
460
+ - Given: {{precondition}}
461
+ - When: {{user_action}}
462
+ - Then: {{expected_result}}
178
463
 
179
- ## Done When
464
+ **Acceptance Criteria:**
465
+ - [ ] {{happy_path_criterion}} — verify: {{method}}
466
+ - [ ] {{happy_path_criterion_2}} — verify: {{method}}
180
467
 
181
- <!-- Acceptance criteria as a checklist -->
182
- - [ ] {{criterion_1}}
183
- - [ ] {{criterion_2}}
468
+ **Edge Cases & Errors:**
469
+ - [ ] {{edge_case}} — verify: {{method}}
470
+ - [ ] {{error_state}} — verify: {{method}}
471
+
472
+ ### Story 2: {{story_title}}
473
+ <!-- Repeat structure. Omit if only one story. -->
474
+
475
+ ## Design Intent
476
+
477
+ <!-- Optional: only for features with user-facing UI.
478
+ For deep UX analysis (heuristics, prototyping, accessibility), run /know-thy-build:designer.
479
+ Developer: read Decision column to know what to build and why.
480
+ QA: read Action + Outcome + Verification to derive test cases. -->
481
+
482
+ | Step | User Action | Ideal Outcome | Design Decision | QA Verification |
483
+ |------|-------------|---------------|-----------------|-----------------|
484
+ | {{N}} | {{action}} | {{outcome}} | {{decision}} | {{verification}} |
485
+
486
+ **Key States:**
487
+
488
+ | State | Trigger | User Sees |
489
+ |-------|---------|-----------|
490
+ | Empty | {{trigger}} | {{description}} |
491
+ | Error | {{trigger}} | {{description + recovery}} |
184
492
 
185
493
  ## Approach
186
494
 
187
495
  <!-- Technical notes, only if discussed -->
188
496
 
497
+ ## Assumptions
498
+
499
+ <!-- Beliefs that haven't been validated. Omit if none surfaced. -->
500
+
501
+ - {{assumption}} — if wrong: {{impact}}
502
+
189
503
  ---
190
504
 
191
505
  *Generated by know-thy-build-feature | {{date}}*
@@ -200,7 +514,7 @@ When the user chooses to edit an existing feature by number:
200
514
  ### 1. Read the feature
201
515
 
202
516
  ```bash
203
- cat features/{{NNN}}.md 2>/dev/null
517
+ cat docs/features/{{NNN}}.md 2>/dev/null
204
518
  ```
205
519
 
206
520
  ### 2. Present the current state
@@ -239,27 +553,36 @@ If the change is substantial, add a brief note at the bottom:
239
553
 
240
554
  ## Saving Progress
241
555
 
242
- If the conversation is interrupted before generation, save progress immediately:
556
+ If the conversation is interrupted before generation, save progress immediately using the drafting frontmatter format (with `areasExplored`, `areasRemaining`, and `assumptions`).
243
557
 
244
- ```yaml
245
- ---
246
- id: {{number}}
247
- title: {{short_title_or_TBD}}
248
- status: drafting
249
- date: {{date}}
250
- generatedBy: know-thy-build-feature
251
- ---
252
- ```
558
+ Write whatever content has been confirmed so far. The next `/know-thy-build:feature` run will detect the drafting state, read the area tracking, and offer to resume from where the frontier was.
559
+
560
+ ## Update Feature Registry
561
+
562
+ After creating or editing a feature, update the Feature Registry in `docs/PROJECT.md`:
563
+
564
+ 1. Read `docs/PROJECT.md` and find the `## Feature Registry` section.
565
+ 2. If the section doesn't exist, append it (use the template from the project skill).
566
+ 3. Add or update the row for this feature:
567
+ ```
568
+ | {{id}} | [{{title}}](features/{{NNN}}.md) | {{priority}} | {{depends_on}} | {{status}} |
569
+ ```
570
+ 4. If `depends_on` references other features, verify those feature IDs exist.
253
571
 
254
- Write whatever content has been confirmed so far. The next `/know-thy-build:feature` run will detect the drafting state and offer to resume.
572
+ This keeps PROJECT.md as the single entry point for the full project picture.
255
573
 
256
574
  ## Closing
257
575
 
258
576
  **After CREATE:**
259
- - Feature spec has been saved to `features/{{NNN}}.md`
260
- - They can start implementing whenever ready
577
+ - Feature spec has been saved to `docs/features/{{NNN}}.md`
578
+ - Feature Registry in `docs/PROJECT.md` has been updated
579
+ - **Next step (mandatory):** `/know-thy-build:qa` — define test cases in `docs/QA.md`. This is what makes "done" concrete. Without test cases, there is no definition of "done."
580
+ - Optional next steps:
581
+ - **UX deep dive**: `/know-thy-build:designer` — if this feature has complex UI
582
+ - **Implementation design**: `/know-thy-build:architect` — if this feature is Architectural
261
583
  - Run `/know-thy-build:feature` again for the next feature
262
584
 
263
585
  **After EDIT:**
264
586
  - Feature spec has been updated
587
+ - Feature Registry in `docs/PROJECT.md` has been updated if priority, status, or dependencies changed
265
588
  - Changes are recorded if substantial