qfai 2.3.0 → 2.4.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 (128) hide show
  1. package/README.md +23 -3
  2. package/assets/init/.claude/settings.json +35 -1
  3. package/assets/init/.codex/hooks.json +24 -0
  4. package/assets/init/.github/instructions/code-review.instructions.md +1 -1
  5. package/assets/init/.qfai/assistant/agent/architecture-reviewer.md +2 -2
  6. package/assets/init/.qfai/assistant/agent/fullstack-engineer.md +32 -4
  7. package/assets/init/.qfai/assistant/agent/implementation-reviewer.md +4 -4
  8. package/assets/init/.qfai/assistant/agent/product-surface-reviewer.md +7 -3
  9. package/assets/init/.qfai/assistant/agent/requirements-reviewer.md +2 -2
  10. package/assets/init/.qfai/assistant/rule/agent-selection.md +1 -1
  11. package/assets/init/.qfai/assistant/rule/communication.md +1 -1
  12. package/assets/init/.qfai/assistant/rule/constitution.md +77 -242
  13. package/assets/init/.qfai/assistant/rule/drift-protocol.md +30 -164
  14. package/assets/init/.qfai/assistant/rule/references/asset-authoring.md +3 -2
  15. package/assets/init/.qfai/assistant/rule/references/gate-failure-autorepair.md +2 -2
  16. package/assets/init/.qfai/assistant/rule/references/placeholder-scan.md +2 -3
  17. package/assets/init/.qfai/assistant/rule/references/reviewer-findings.md +3 -3
  18. package/assets/init/.qfai/assistant/rule/references/worker-edit-boundary.md +12 -3
  19. package/assets/init/.qfai/assistant/rule/review-convergence.md +6 -6
  20. package/assets/init/.qfai/assistant/rule/shared-skill-delegation-baseline.md +6 -6
  21. package/assets/init/.qfai/assistant/rule/shared-skill-operating-baseline.md +17 -17
  22. package/assets/init/.qfai/assistant/rule/test-layers.md +1 -1
  23. package/assets/init/.qfai/assistant/rule/thinking.md +2 -2
  24. package/assets/init/.qfai/assistant/rule/ui-definition-protocol.md +5 -5
  25. package/assets/init/.qfai/assistant/rule/ui-procurement.md +1 -1
  26. package/assets/init/.qfai/assistant/rule/workflow.md +12 -12
  27. package/assets/init/.qfai/assistant/skill/qfai-configure/SKILL.md +12 -14
  28. package/assets/init/.qfai/assistant/skill/qfai-discussion/SKILL.md +2 -4
  29. package/assets/init/.qfai/assistant/skill/qfai-discussion/templates/03_Story-Workshop.md +1 -2
  30. package/assets/init/.qfai/assistant/skill/qfai-discussion/templates/uiux/50_review_input_bundle.md +4 -3
  31. package/assets/init/.qfai/assistant/skill/qfai-grill/SKILL.md +1 -3
  32. package/assets/init/.qfai/assistant/skill/qfai-grilling/SKILL.md +30 -43
  33. package/assets/init/.qfai/assistant/skill/qfai-grilling/references/confirmation-sheet.md +71 -0
  34. package/assets/init/.qfai/assistant/skill/qfai-grilling/references/delegated-session.md +18 -1
  35. package/assets/init/.qfai/assistant/skill/qfai-implement/SKILL.md +2 -4
  36. package/assets/init/.qfai/assistant/skill/qfai-implement/references/parallelization-policy.md +3 -3
  37. package/assets/init/.qfai/assistant/skill/qfai-implement/references/ui-affecting.md +35 -2
  38. package/assets/init/.qfai/assistant/skill/qfai-maintain/SKILL.md +2 -4
  39. package/assets/init/.qfai/assistant/skill/qfai-migration-v1-to-v2/SKILL.md +0 -2
  40. package/assets/init/.qfai/assistant/skill/qfai-migration-v1-to-v2/references/migration-guide.md +2 -3
  41. package/assets/init/.qfai/assistant/skill/qfai-prototyping/SKILL.md +5 -6
  42. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/generator-prompt.md +75 -4
  43. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/handoff.md +2 -1
  44. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/iteration-loop.md +58 -3
  45. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/review-payload-schema.md +11 -2
  46. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/reviewer-prompt.md +41 -10
  47. package/assets/init/.qfai/assistant/skill/qfai-run/SKILL.md +7 -8
  48. package/assets/init/.qfai/assistant/skill/qfai-run/references/extraction.md +12 -7
  49. package/assets/init/.qfai/assistant/skill/qfai-run/references/stage-points.md +1 -1
  50. package/assets/init/.qfai/assistant/skill/qfai-sdd/SKILL.md +10 -12
  51. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/concrete-abstract-cycle.md +25 -27
  52. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/contract-artifact-rules.md +8 -10
  53. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/design-anti-patterns.md +36 -3
  54. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/design-md-authoring.md +8 -9
  55. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/requirements-decomposition.md +6 -6
  56. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-execution-playbook.md +6 -6
  57. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-phase-checklists.md +5 -5
  58. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-pre-draft-grilling.md +5 -5
  59. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-quality-gate.md +3 -3
  60. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-triage.md +115 -199
  61. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/spec-traceability-rules.md +25 -25
  62. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/ui-contract-guide.md +23 -113
  63. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/ui-design-contract-normalization.md +2 -2
  64. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/contracts/ui-contract.sample.yaml +8 -7
  65. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/spec/03_contract/tech.md +1 -0
  66. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/spec/decisions/page-NNNN.md +2 -2
  67. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/spec/decisions.md +59 -31
  68. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/spec/open-questions.md +15 -11
  69. package/assets/init/.qfai/assistant/skill/qfai-triage/SKILL.md +1 -3
  70. package/assets/init/.qfai/assistant/skill/qfai-verify/SKILL.md +2 -4
  71. package/assets/init/.qfai/assistant/skill/qfai-verify/references/verify-output-contract.md +1 -1
  72. package/assets/init/.qfai/assistant/skill/web-research/SKILL.md +1 -3
  73. package/assets/init/.qfai/assistant/step/common-design-md/STEP.md +9 -9
  74. package/assets/init/.qfai/assistant/step/common-gate-run/STEP.md +2 -2
  75. package/assets/init/.qfai/assistant/step/common-grilling-record/STEP.md +3 -3
  76. package/assets/init/.qfai/assistant/step/common-policy-check/STEP.md +1 -1
  77. package/assets/init/.qfai/assistant/step/common-review-cycle/STEP.md +6 -4
  78. package/assets/init/.qfai/assistant/step/discussion-interview/STEP.md +7 -7
  79. package/assets/init/.qfai/assistant/step/discussion-pack/STEP.md +43 -0
  80. package/assets/init/.qfai/assistant/step/implement-acceptance/STEP.md +1 -1
  81. package/assets/init/.qfai/assistant/step/implement-dep-bump/STEP.md +11 -13
  82. package/assets/init/.qfai/assistant/step/implement-procedure/STEP.md +1 -1
  83. package/assets/init/.qfai/assistant/step/implement-regression-fix/STEP.md +2 -2
  84. package/assets/init/.qfai/assistant/step/implement-scaffold/STEP.md +5 -5
  85. package/assets/init/.qfai/assistant/step/implement-tdd/STEP.md +7 -8
  86. package/assets/init/.qfai/assistant/step/maintain-edit/STEP.md +17 -17
  87. package/assets/init/.qfai/assistant/step/prototyping-grill/STEP.md +1 -1
  88. package/assets/init/.qfai/assistant/step/prototyping-loop/STEP.md +89 -12
  89. package/assets/init/.qfai/assistant/step/sdd-contract/STEP.md +16 -15
  90. package/assets/init/.qfai/assistant/step/sdd-cycle/STEP.md +7 -8
  91. package/assets/init/.qfai/assistant/step/sdd-flow/STEP.md +25 -4
  92. package/assets/init/.qfai/assistant/step/sdd-story/STEP.md +6 -6
  93. package/assets/init/.qfai/assistant/step/sdd-triage/STEP.md +66 -75
  94. package/assets/init/.qfai/assistant/step/triage-operate/STEP.md +29 -15
  95. package/assets/init/.qfai/assistant/step/verify-commit/STEP.md +2 -4
  96. package/assets/init/.qfai/assistant/step/verify-context/STEP.md +1 -1
  97. package/assets/init/root/.agents/rules/ai-readable-markdown.md +8 -1
  98. package/assets/init/root/.agents/rules/delegation-steering.md +69 -0
  99. package/assets/init/root/.agents/rules/grilling.md +72 -43
  100. package/assets/init/root/.agents/rules/minimal-implementation.md +5 -5
  101. package/assets/init/root/.agents/rules/reply-forms.md +191 -0
  102. package/assets/init/root/.agents/rules/session-feedback.md +104 -27
  103. package/assets/init/root/.agents/rules/user-questions.md +6 -1
  104. package/assets/init/root/.gitattributes +5 -6
  105. package/assets/init/root/AGENTS.md +4 -2
  106. package/assets/mdschema/story/03_contract/tech.mdschema.yml +1 -1
  107. package/assets/mdschema/story/decisions/page-NNNN.mdschema.yml +3 -3
  108. package/assets/mdschema/story/decisions.mdschema.yml +4 -4
  109. package/assets/mdschema/story/open-questions.mdschema.yml +3 -3
  110. package/assets/schemas/workflow/extraction.schema.json +0 -2
  111. package/dist/cli/index.cjs +3749 -3029
  112. package/dist/cli/index.cjs.map +1 -1
  113. package/dist/cli/index.mjs +3718 -3006
  114. package/dist/cli/index.mjs.map +1 -1
  115. package/dist/hook/turn-end.cjs +1022 -0
  116. package/dist/hook/turn-end.cjs.map +1 -0
  117. package/dist/hook/turn-end.d.cts +2 -0
  118. package/dist/hook/turn-end.d.ts +2 -0
  119. package/dist/hook/turn-end.mjs +998 -0
  120. package/dist/hook/turn-end.mjs.map +1 -0
  121. package/dist/index.cjs +3626 -3577
  122. package/dist/index.cjs.map +1 -1
  123. package/dist/index.d.cts +19 -3
  124. package/dist/index.d.ts +19 -3
  125. package/dist/index.mjs +3544 -3498
  126. package/dist/index.mjs.map +1 -1
  127. package/package.json +2 -2
  128. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/change-request.md +0 -52
@@ -7,8 +7,6 @@ allowed-tools: [Read, Glob, Write, Edit, Bash]
7
7
 
8
8
  ## /qfai-migration-v1-to-v2
9
9
 
10
- [DRIFT-PROTOCOL:REQUIRED]
11
-
12
10
  ## User Questions (AskUserQuestion Protocol)
13
11
 
14
12
  Follow `.qfai/assistant/rule/shared-skill-operating-baseline.md#user-questions-askuserquestion-protocol`
@@ -200,13 +200,12 @@ Finish each kind of item that a step leaves as follows:
200
200
  when step 8 rewrote the old annotations to the example level. Finish each
201
201
  with the test, or with a `decisions.md` row whose Content is `Test exception:`
202
202
  followed by the ID of the example or criterion, whose Approach holds the
203
- reason and whose Status is DONE.
203
+ reason.
204
204
  - **A test-case annotation in an E2E file.** Step 8 leaves it unchanged,
205
205
  because an example annotation there is an error, and lists its file, line,
206
206
  annotation and example. Settle it with a test outside the E2E layer annotated
207
207
  with that example, or with a `decisions.md` row whose Content is
208
- `Test exception: <EX>`, whose Approach holds the reason and whose Status is
209
- DONE. Then delete the old annotation, because step 8 lists it on each run
208
+ `Test exception: <EX>`, whose Approach holds the reason. Then delete the old annotation, because step 8 lists it on each run
210
209
  until it is deleted.
211
210
  - **An annotation of an unplaced example.** Step 8 keeps it as written and lists
212
211
  its file and line. Edit an annotation by hand only for an example step 4 left
@@ -11,10 +11,8 @@ mode: execution-focused
11
11
 
12
12
  ## /qfai-prototyping
13
13
 
14
- [DRIFT-PROTOCOL:REQUIRED]
15
-
16
14
  Run the entry check of
17
- `.qfai/assistant/rule/shared-skill-operating-baseline.md#workflow-run-entry-check-mandatory`
15
+ `.qfai/assistant/rule/shared-skill-operating-baseline.md#workflow-run-entry-check`
18
16
  first.
19
17
 
20
18
  The loop is static-first and file-based by default. Supported surfaces: web,
@@ -36,9 +34,10 @@ prototyping completes when the user confirms the prototype.
36
34
  Every file the loop writes stays under `.qfai/prototype/`: the session record,
37
35
  each iteration and its reviews, and the handoff. A `restyle` loop also edits
38
36
  the project's stylesheet and motion entry points its handoff names. No `qfai`
39
- command writes any of these files. The one file a command reads is the handoff record
37
+ command writes any of these files. A command reads the handoff record
40
38
  `.qfai/prototype/final/handoff.json`, which
41
- `npx qfai validate --profile saas-package` checks against the CLI-HANDOFF schema.
39
+ `npx qfai validate --profile saas-package` checks against the CLI-HANDOFF schema, and the plain text of the
40
+ current `index.html` pages, which `npx qfai validate` checks.
42
41
 
43
42
  ## Inputs Priority
44
43
 
@@ -106,4 +105,4 @@ no question. Under a no-question mode, list any remaining actions instead.
106
105
  project_memory:
107
106
 
108
107
  - Prototyping completes on the user's confirmation; no command certifies it.
109
- - Every file the loop writes is under `.qfai/prototype/`, except the stylesheet and motion entry points a `restyle` loop edits; a `qfai` command reads only `final/handoff.json`.
108
+ - Every file the loop writes is under `.qfai/prototype/`, except the stylesheet and motion entry points a `restyle` loop edits; a `qfai` command reads only `final/handoff.json` and the plain text of the current `index.html` pages.
@@ -8,7 +8,7 @@ identity.
8
8
  ## Contents
9
9
 
10
10
  - Read order
11
- - HTML envelope (mandatory on every iter)
11
+ - HTML envelope (every iteration)
12
12
  - Hard constraints
13
13
  - Output layout
14
14
  - The first iteration (seed)
@@ -37,13 +37,15 @@ identity.
37
37
  `iter-(NN-1)/review.json` (critique, scores,
38
38
  `layoutAntiPatternsDetected`, `designMdViolations`,
39
39
  `pivotDirective`), `iter-(NN-2)/review.json` when present, and
40
- `progress.md`. A review or confirmation from an earlier run is not one of
40
+ `progress.md`. Where one of them is an iteration with variants, read
41
+ the review of the variant the user picked in its place, and none after a
42
+ combination or a rejection. A review or confirmation from an earlier run is not one of
41
43
  them: the run's first iteration is the first after `progress.md` records
42
44
  its `runScope`, present or absent.
43
45
  6. In a scoped run, every iteration: `runScope` in `progress.md` and
44
46
  `.qfai/prototype/final/index.html`.
45
47
 
46
- ## HTML envelope (mandatory on every iter)
48
+ ## HTML envelope (every iteration)
47
49
 
48
50
  Every `iter-NN/index.html` must start with the head below; replace
49
51
  `{{...}}` with literal values read from DESIGN.md front-matter:
@@ -261,6 +263,32 @@ The generator must express every styled surface as one of:
261
263
  entry in `designMdViolations[]`. Fix the value once and the finding clears —
262
264
  do not expect the count to track the number of places it appears.
263
265
 
266
+ ### Plain text needs a reason
267
+
268
+ `npx qfai validate` reads `final/index.html` and the latest `iter-NN/index.html`
269
+ under `.qfai/prototype/` and reports, as an error, a plain text with no reason
270
+ comment directly before it or before its parent element. Sample data in a
271
+ static page is plain text too. Plain text is a literal text node outside a heading, `label`,
272
+ `button`, `a`, `legend`, `th`, `caption`, `option`, `summary`, `title`,
273
+ `script`, `style` and `role="alert"` or `role="status"`. For a text you cannot
274
+ justify, in this order:
275
+
276
+ 1. Delete it.
277
+ 2. Replace it with another component: an icon with an accessible name, a
278
+ disabled state, a badge.
279
+ 3. Move its job to an element already there: a label, a heading, the button
280
+ wording, the empty state.
281
+ 4. Only then write the reason.
282
+
283
+ ```html
284
+ <!-- qfai-text: why=the fee is charged only on this step; without=users pay a fee they never saw -->
285
+ <p>A 2% fee applies to card payments.</p>
286
+ ```
287
+
288
+ Both keys are required, no other key is allowed, and `why` and `without` say
289
+ different things. "Helps the user" is not a reason; the reviewer rejects a
290
+ generic one.
291
+
264
292
  ## Output layout
265
293
 
266
294
  Write `.qfai/prototype/iter-NN/index.html` and nothing else. The reviewer
@@ -290,6 +318,26 @@ envelope, the one self-contained file, the `<link rel="stylesheet">` ban and
290
318
  - The seed and pivot rules below do not apply as written. The first restyle
291
319
  iteration restyles the screens as they are, and a restyle `pivot` rethinks
292
320
  only the visual treatment: screens, fields and behaviour stay.
321
+ - Change only what the `restyleLevel` in `progress.md` allows: at `targeted`,
322
+ only what the audit found, keeping the palette, type and layout; at `none`,
323
+ only the refinements the user accepted, as `progress.md` lists them.
324
+ - Keep every text the screens show: figures, proper names, field values and
325
+ copy. Changing displayed text, an icon or an image is not a restyle; report
326
+ it as a change the contract needs.
327
+
328
+ Edit the aspects a stylesheet and motion reach in this order, and finish each
329
+ across every screen in scope before starting the next: spacing, color, type,
330
+ layout, details such as radius, borders, shadows and states, then motion.
331
+ Layout means only what the stylesheet arranges; new markup is a contract
332
+ change. The order follows what depends on what:
333
+
334
+ - Spacing comes first, because once the rhythm is right every other element
335
+ reads differently.
336
+ - Type comes before layout, because a heading's size decides where it sits.
337
+ - Motion comes last, because it fits a screen that already works without it.
338
+
339
+ When nearly every rule changes, plan the aspects in this order and write the
340
+ result in one pass, as long as each aspect is applied.
293
341
 
294
342
  ### Scoped runs
295
343
 
@@ -304,10 +352,33 @@ change the scope needs outside those parts is reported, not made.
304
352
 
305
353
  ## The first iteration (seed)
306
354
 
307
- Produce one self-contained `iter-00/index.html` that satisfies the spec
355
+ Produce one self-contained `iter-NN/index.html` for the run's first
356
+ iteration (`iter-00` in a first run) that satisfies the spec
308
357
  under the DESIGN.md tokens. Lead with the user's primary task;
309
358
  respect `audience.do_not_look_like`.
310
359
 
360
+ Take the sample data from the examples that the in-scope UI contract's rules
361
+ cite: their figures, names and values. Where no example gives a value the
362
+ screen needs, write a neutral one, use it the same way on every screen, and
363
+ list it in `progress.md` as sample data no example supplies. A neutral value
364
+ is never a claim: invent no metric, customer count, customer name or
365
+ testimonial, which the design anti-pattern list names as invented proof.
366
+
367
+ When `progress.md` records `variants` other than `none`, the file holds each
368
+ listed variant of the in-scope screens:
369
+
370
+ - Each answers the same spec with a different structure: a different
371
+ grouping, layout or navigation model. Variants that differ only in colour,
372
+ spacing or copy are one variant.
373
+ - `?variant=<id>` selects one, and a small floating switcher changes it in
374
+ place. The selection survives navigation between the screen routes, so
375
+ every route of a variant is reachable with its `?variant=<id>`.
376
+ - The switcher is the only element outside the screens. Brand tokens stay
377
+ locked in every variant.
378
+
379
+ The next iteration builds one prototype: the variant the user picked, the
380
+ parts they combined, or a pivot carrying their rejection. Drop the switcher.
381
+
311
382
  ## Later iterations
312
383
 
313
384
  The user's answer comes first. The reviewer's `pivotDirective` is your
@@ -12,7 +12,8 @@
12
12
 
13
13
  `.qfai/prototype/iter-<final>/index.html` — the iteration the user
14
14
  confirmed. It is one self-contained file with one client-side route per
15
- declared screen, written by the generator.
15
+ declared screen, written by the generator. It is never an iteration with
16
+ variants: the user's answer to one runs a further iteration.
16
17
  A `restyle` loop has no such file: its iterations restyled the live app
17
18
  in place, and its handoff is the short form under Restyle handoff below.
18
19
  A scoped run also reads the `final/index.html` and `final/handoff.json` an
@@ -1,9 +1,23 @@
1
1
  # Iteration Loop
2
2
 
3
+ ## Contents
4
+
5
+ - Phases
6
+ - Per-iteration files
7
+ - When the loop ends
8
+ - First-iteration variants
9
+ - Best-of-history is gone
10
+ - Restyle iterations
11
+ - Surface profile
12
+ - Contracts read
13
+ - Produced after the loop
14
+ - Brand identity
15
+
3
16
  ## Phases
4
17
 
5
18
  ```text
6
19
  [Build] iteration NN: generate iter-NN/index.html under DESIGN.md tokens
20
+ (an open direction's first iteration: two or three variants)
7
21
  [Review] iteration NN: the reviewer operates Playwright and returns the reviews
8
22
  [Ask] iteration NN: the user confirms the prototype, or answers with a change
9
23
  [Handoff] confirmed: final/index.html + final/handoff.json (restyle: handoff.json only)
@@ -21,7 +35,8 @@ The session agent writes the reviewer's payload for each `(UI contract, screen)`
21
35
  per-iteration `review.json` summary, from the first iteration on (the payload schema and the aggregation rule are
22
36
  in the reviewer references the loop step names). That holds for a single-contract run as much
23
37
  as for a multi-contract one. A scoped run writes payloads only for the pairs it
24
- reviews: its in-scope and render-check screens.
38
+ reviews: its in-scope and render-check screens. An iteration with variants
39
+ writes them per variant, as First-iteration variants below says.
25
40
 
26
41
  The reviewer operates Playwright live. A screenshot or HTML snapshot is an
27
42
  additional input, taken only when someone needs it.
@@ -34,13 +49,51 @@ one-line summary at the end of each iteration.
34
49
  The loop ends when the user confirms the prototype. Until then each answer the
35
50
  user gives runs another iteration. No score, finding count or command decides
36
51
  that the loop is done, and a blocking finding still open at the confirmation is
37
- named in the final report rather than holding the loop open.
52
+ named in the final report rather than holding the loop open. A restyle whose
53
+ audit found nothing to fix, and whose refinements the user declined, stops
54
+ before iteration 00 with no edit.
55
+
56
+ ## First-iteration variants
57
+
58
+ A `prototype` run has an open direction when neither
59
+ `.qfai/prototype/grilling.md` `## Session` nor the root `DESIGN.md` settles
60
+ which layout carries the in-scope screens' task. An `## Escalated` row settles
61
+ nothing, and a feel left open alone does not open it: variants differ in
62
+ structure. The run's first iteration then builds two or three variants, `A`,
63
+ `B` and optionally `C`, of the in-scope screens. They differ in grouping,
64
+ layout or navigation, not only in style, all under the root `DESIGN.md`
65
+ tokens, on one `iter-NN/index.html`, switchable in place through
66
+ `?variant=<id>`. The session agent records the IDs as `variants` in
67
+ `progress.md` before the iteration is built, and sets `variants` to `none`
68
+ before the next one.
69
+
70
+ A `restyle` loop, a run with a `runScope`, a run whose `## Session` or
71
+ `DESIGN.md` settles the layout, and a run under a no-question mode, where
72
+ nobody can pick, record `variants` `none` and build one prototype.
73
+
74
+ Each variant is reviewed on its own, by a reviewer started fresh for it at
75
+ `<url>/iter-NN/?variant=<id>`, and its files take the place of the
76
+ iteration's:
77
+
78
+ ```text
79
+ .qfai/prototype/iter-NN/variant-<id>/review.json
80
+ .qfai/prototype/iter-NN/variant-<id>/<ui-contract-id>/<screen>.review.json
81
+ ```
82
+
83
+ The variants exist to make the choice answerable; they do not make it. The
84
+ user picks one, combines parts or rejects all, and the next iteration builds
85
+ one prototype from that answer. A compare reply whose `keep from` line names
86
+ another variant is a combination, not a pick. Its prior review is the picked variant's
87
+ summary, or none after a combination or a rejection. Every later read of the
88
+ variant iteration's review, as the review before the prior one or as
89
+ `previousScore`, reads the same. Every later iteration builds one prototype.
38
90
 
39
91
  ## Best-of-history is gone
40
92
 
41
93
  The latest iteration is always the one put to the user. Temporary regressions
42
94
  are allowed; a leap backwards is a normal path to a breakthrough on the IA and
43
- flow axes.
95
+ flow axes. The variants of a first iteration are one iteration, not a history
96
+ to reach back to.
44
97
 
45
98
  ## Restyle iterations
46
99
 
@@ -48,6 +101,8 @@ A loop whose `progress.md` records `iterationKind` `restyle` restyles the
48
101
  live app in place. Each `iter-NN/index.html` lists the live routes in scope,
49
102
  the reviewer drives those routes in the running app, and the handoff is a
50
103
  short form that names the routes and the stylesheet and motion entry points.
104
+ Before iteration 00, the loop step saves each route's text as a baseline and
105
+ audits the routes to set `restyleLevel`.
51
106
 
52
107
  ## Surface profile
53
108
 
@@ -24,14 +24,23 @@ whole file.
24
24
  .qfai/prototype/iter-NN/<ui-contract-id>/<screen>.review.json
25
25
  ```
26
26
 
27
- One file per (UI contract × screen × iteration). `<ui-contract-id>` is the full
27
+ In an iteration with variants, each variant's payloads are under its own
28
+ directory, and the schema is unchanged:
29
+
30
+ ```text
31
+ .qfai/prototype/iter-NN/variant-<id>/<ui-contract-id>/<screen>.review.json
32
+ ```
33
+
34
+ One file per (UI contract × screen × iteration), and per variant where
35
+ there are variants. `<ui-contract-id>` is the full
28
36
  `UI-NNNN` ID, and `<screen>` is declared in that contract's `screens[]`.
29
37
  `<screen>.review.json` is the **only**
30
38
  per-(UI contract × screen) artifact written for a review — no `.html`, no
31
39
  `.png`, no `.interaction.json`.
32
40
 
33
41
  The Reviewer's other result is the per-iteration summary
34
- `iter-NN/review.json` (one per iteration, a different shape, set by
42
+ `iter-NN/review.json` (one per iteration, or one per variant under
43
+ `iter-NN/variant-<id>/`, a different shape, set by
35
44
  the reviewer prompt). It is not a per-screen artifact and
36
45
  is never read against this schema.
37
46
 
@@ -41,7 +41,9 @@ transition-pass percentages as a substitute for the qualitative review.
41
41
  scope: open each listed route in the running app and review it there.
42
42
  The list page is not a screen, and the screens are the project's own.
43
43
  Read the edited stylesheet and motion files as well when filling
44
- `designMdViolations[]`.
44
+ `designMdViolations[]`. Compare each route with its baseline,
45
+ `.qfai/prototype/baseline/<ui-contract-id>/<screen>.txt`, as
46
+ [What blocks](#what-blocks) says.
45
47
  When `progress.md` records a `runScope`, review its in-scope screens in
46
48
  full. On each render-check screen, check only that the in-scope component
47
49
  renders there: one that does not render, or that breaks the screen around
@@ -51,12 +53,21 @@ transition-pass percentages as a substitute for the qualitative review.
51
53
  When the scope names components only, the render-check screens are the
52
54
  whole review, and the summary's four scores rate the component as those
53
55
  screens render it.
56
+ - When the URL you are given carries `?variant=<id>`, the iteration has
57
+ variants and you review that variant alone. Review it as if it were the
58
+ only one, keep `?variant=<id>` on every route, and never open another
59
+ variant: its own payloads, summary and `pivotDirective` are written under
60
+ `iter-NN/variant-<id>/`. Do not rank it against others or call it
61
+ preferred; the user chooses between the variants. The variant switcher is not part of any
62
+ screen: do not review, count or report it.
54
63
  - A screenshot or HTML snapshot, only when one was taken. Name any mandatory
55
64
  input you did not receive in a finding.
56
65
  - The layout anti-pattern registry the package ships.
57
66
  - Prior reviews: `iter-(NN-1)/review.json`, `iter-(NN-2)/review.json`
58
67
  (when present), from this run only: the run's first iteration, the first
59
- after `progress.md` records its `runScope`, has none.
68
+ after `progress.md` records its `runScope`, has none. Where one of them is
69
+ an iteration with variants, read the picked variant's summary in its
70
+ place, or none after a combination or a rejection.
60
71
  - Progress log: `.qfai/prototype/progress.md`
61
72
  - Root `DESIGN.md` (read-only context: `# Brand Philosophy`,
62
73
  `audience.emotion`, `audience.do_not_look_like`).
@@ -79,14 +90,17 @@ below and are relative to the project root.
79
90
 
80
91
  1. **Per-contract / per-screen payload** —
81
92
  `.qfai/prototype/iter-NN/<ui-contract-id>/<screen>.review.json`,
82
- one per screen. `<ui-contract-id>` is the full `UI-NNNN` ID. The
93
+ or `iter-NN/variant-<id>/<ui-contract-id>/<screen>.review.json` in an
94
+ iteration with variants, one per screen. `<ui-contract-id>` is the full
95
+ `UI-NNNN` ID. The
83
96
  per-UI-contract subdirectory is mandatory for every run that declares UI
84
97
  screens, including a run with one contract. Its schema is closed
85
98
  (11 required top-level fields, unknown keys rejected) and lives in
86
99
  the payload schema reference. Build it from that
87
100
  reference, not from the block below.
88
101
  2. **Per-iteration summary** —
89
- `.qfai/prototype/iter-NN/review.json`, one per iteration. Its shape is
102
+ `.qfai/prototype/iter-NN/review.json`, one per iteration, or one per
103
+ variant under `iter-NN/variant-<id>/`. Its shape is
90
104
  the block below.
91
105
 
92
106
  The two share `blockingFindings`, `layoutAntiPatternsDetected` and
@@ -240,12 +254,21 @@ Hint text survives only where a need was demonstrated, the control was
240
254
  improved first and the need remained, and it is one sentence at most. Longer
241
255
  means the question needs clarifying or splitting.
242
256
 
243
- Compare the rendered text with the screen's UI contract in both directions. The
244
- screen shows its `title`, the group headings of its `structure`, its labels and
245
- the `supplements` it declares. A text shown that none of them declares is excess,
246
- and a declared supplement that is not shown is an unmet need. The finding names
247
- the screen, the task or state, the meaning that is duplicated or the need that is
248
- unmet, and the text to remove or the control or structure to repair. Apply the
257
+ `npx qfai validate` checks only that every plain text in the prototype source has a
258
+ well-formed `qfai-text` reason comment. Whether the reason is strong is yours to
259
+ judge:
260
+
261
+ - Reject a generic reason ("helps the user", "for clarity") and a reason that
262
+ restates the text.
263
+ - A text that could be deleted, replaced by another component (an icon with an
264
+ accessible name, a disabled state, a badge) or moved into a label, heading,
265
+ button wording or empty state is excess even with a reason.
266
+ - Judge whether the copy the UI contract describes (`supplements`, group
267
+ headings) is needed at all.
268
+
269
+ These are review findings, not validate findings. The finding names the screen,
270
+ the task or state, the meaning that is duplicated or the need that is unmet, and
271
+ the text to remove or the control or structure to repair. Apply the
249
272
  patterns of the section on copy that adds no meaning, which the loop step names; the
250
273
  rest of the design anti-patterns list stays with the direction review.
251
274
 
@@ -314,6 +337,14 @@ content, a task that cannot be completed, a state the spec requires and
314
337
  the screen does not show, a control whose effect is unknowable until it
315
338
  is pressed.
316
339
 
340
+ In a `restyle` iteration, text the screen showed before the restyle and no
341
+ longer shows unchanged also blocks: a figure, a proper name, a field value or
342
+ any other text in the route's baseline that the screen now changes, drops or
343
+ replaces with prose. The finding names the screen, the baseline text and what
344
+ the screen shows instead. A restyle keeps the screens, fields and behaviour it
345
+ found, so this needs no other authority. A missing baseline is a missing
346
+ mandatory input.
347
+
317
348
  An observation that something could be better is not a finding. It goes
318
349
  in `proseCritique`, where it informs the next iteration. Whether the
319
350
  prototype is done is the user's decision, not a score's.
@@ -11,15 +11,13 @@ mode: execution-focused
11
11
 
12
12
  ## /qfai-run - Change request entry
13
13
 
14
- [DRIFT-PROTOCOL:REQUIRED]
15
-
16
14
  In a git worktree, read and follow the worktree's own `.qfai/assistant/skill/qfai-run/SKILL.md`, whatever copy the host loaded. Follow the CLI plan's steps in order. Read no reference up front; each line says when.
17
15
 
18
16
  - `references/extraction.md`: for an extraction step 1 does not give.
19
17
  - `references/plan.md`: for a plan field this file does not name, or a refused plan.
20
18
  - `references/operator-screens.md`: when a line below or a step names it, such as to ask or report.
21
19
  - `references/stage-points.md`: at a step the plan marks with a point.
22
- - Run preflight before planning, as `.qfai/assistant/rule/shared-skill-operating-baseline.md#canonical-qfai-launcher-mandatory` says.
20
+ - Run preflight before planning, as `.qfai/assistant/rule/shared-skill-operating-baseline.md#canonical-qfai-launcher` says.
23
21
  If the launcher is missing or preflight fails, read `references/operator-screens.md` for recovery.
24
22
  - Read `references/codex-cloud-install.md` before configuring an environment-owned Install script or Start skill, or preparing dependencies for a fresh checkout. Use the reviewed target's successful preparation and canonical proof before planning.
25
23
 
@@ -59,7 +57,7 @@ values plan nothing.
59
57
 
60
58
  1. **Extract.** A question one read answers is `{ intent: question-why, qualifiers: [session-answerable] }`
61
59
  (or `question-how`, `question-help`); an operation on finished work, or on a device or system the session reaches, that the session runs itself and
62
- that deletes nothing is `{ intent: order, artifacts: [] }`. Every other field is empty, with `confidence: high`; neither needs a reference.
60
+ that deletes nothing is `{ intent: order, artifacts: [] }`. Write every other required list field as `[]`, since `plan` refuses an omitted one, with `confidence: high`; neither needs a reference.
63
61
  Read any other request as `references/extraction.md` sets out. Then run the launcher preflight above; after it passes, hand the extraction to `npx qfai workflow plan --in <file>`, or `--in -`.
64
62
  The session-run operation that deletes nothing, read above as `{ intent: order, artifacts: [] }`, goes to `npx qfai workflow plan --order` instead, with no file; an order read through `references/extraction.md` keeps `--in`.
65
63
  2. **Candidates.** When `plan` returns `candidates`, put one single-select
@@ -73,7 +71,7 @@ values plan nothing.
73
71
  plan's one step is `triage-answer` or `triage-operate`. On a route that changes no file, one that
74
72
  closes, answers or asks, it reads and reports and writes nothing.
75
73
  5. **Run the stages.** Run each stage in plan order, and each of its steps in
76
- order, as `.qfai/assistant/rule/shared-skill-operating-baseline.md#running-steps-mandatory` says.
74
+ order, as `.qfai/assistant/rule/shared-skill-operating-baseline.md#running-steps` says.
77
75
  Note each step's status for the final report; when a step is short or passes without edits, read `references/operator-screens.md`.
78
76
  Do the work and write every artifact yourself. Start a sub-agent only for the two reasons the delegation baseline states: an independent judgement, or parallel units that pass the parallel-unit gate. A worker starts no finder, griller or reviewer: run each step that starts one yourself, as the delegation baseline's Session Agent Protocol says.
79
77
  At a step the plan marks with a point, follow `references/stage-points.md`:
@@ -87,8 +85,9 @@ values plan nothing.
87
85
  reviewed sides, or a route code review of a small literal-only change, as `common-review-cycle` defines, gets no reviewer. A conflict resolution the plan's own edit stage made in the story tree, a contract or a register still gets one.
88
86
  No agent reviews its own work; no step adds a review. Each returns PASS or REVISE.
89
87
  Fix or answer each finding once; a behaviour fix gets one re-review, as `common-review-cycle` says. Stop a step that exceeds the request.
90
- 7. **Approvals.** Each approval of a specification change, a critical decision or a release is one `decisions.md` row: what was approved, who approved it, when, and the chosen option's label, in the `qfai-sdd` decisions template's form. A decision you took appends no row.
91
- When the release change is produced outside this run (by a release workflow or bot), record its approval in the final report with the same four items and list the row as a pending follow-up;
88
+ 7. **Approvals.** An approval of a critical decision or a release is one `decisions.md` row only when it is hard to reverse, would surprise a reader without context, and was the result of a real trade-off:
89
+ what was approved, who approved it, when, and the chosen option's label, in the `qfai-sdd` decisions template's short form. Otherwise the final report states the approval with the same items. A decision you took appends no row.
90
+ When the release change is produced outside this run (by a release workflow or bot), record its approval in the final report in the same short form, and, when it is to be a row, list the row as a pending follow-up;
92
91
  the next change that touches `decisions.md` appends the row, and a `qfai-run` that writes `decisions.md` appends any pending approval row first.
93
92
  8. **A finding no stage serves.** Stop, and name the finding, its owner and the stage skill to invoke by name.
94
93
  9. **Commit.** `verify-commit` runs last, after any release point; never pushes. A push, pull request, merge or branch update the user asks for after the plan ends is planned next as `{ intent: order, artifacts: [] }` with `npx qfai workflow plan --order`, and its `triage-operate` delivers it.
@@ -114,7 +113,7 @@ Follow `.qfai/assistant/rule/shared-skill-operating-baseline.md#user-questions-a
114
113
  - P3: the story tree under `<paths.specsDir>` and the contracts under `<paths.contractsDir>`
115
114
  - P4: the user's request
116
115
 
117
- ## Sub-agent Delegation (MANDATORY)
116
+ ## Sub-agent Delegation
118
117
 
119
118
  Follow `.qfai/assistant/rule/shared-skill-delegation-baseline.md`.
120
119
 
@@ -210,7 +210,7 @@ Each flag is followed by what the request does when it is set, then, where one a
210
210
  - `fix`: proposes a concrete fix: a patch, a linked change, a specific edit. Not when the author only offers to implement.
211
211
  - `expect`: states what should happen, directly or by reference to documents, a specification, an earlier version or another implementation. Not when it only says "it does not work".
212
212
  - `decision`: shows the work cannot start until someone chooses: options listed, "should we", which side wins left open. On `feature`, `behaviour-change`, `design` or `deprecation`, set it unless acceptance is shown; on a `behaviour-change` that explicitly asks to change the prototype, only when a choice is left open. Not when the fix is obvious and the request names the right side.
213
- - `upstream`: cites a decision already made elsewhere: an approved change request, a parent item with a settled design, a documented lifting condition. Not when the parent is itself undecided.
213
+ - `upstream`: cites a decision already made elsewhere: an approved decision, a parent item with a settled design, a documented lifting condition. Not when the parent is itself undecided.
214
214
  - `bundle`: holds two or more independent findings, each fixable alone. Not when the parts are steps of one fix.
215
215
  - `vague`: gives too little to act on: no version, no steps, no expected result, empty template fields, "it stopped working". Not when the text is only short.
216
216
  - `last-good`: names a version, commit or change where it worked, a version pair or a bisect result. Not when it only says "recently".
@@ -244,10 +244,12 @@ only after reading what it depends on.
244
244
  - `mixed-bundle`, with `bundle`: The bundled findings differ in kind. Findings that share one intent take that intent instead.
245
245
  - `human-run`, with `order`: Only a person can run the operation: it is paid, bound to a host, or needs credentials the session does not hold.
246
246
  - `owned-temporary-cleanup`, with `order`: Existing user authority permits deleting specific repository-local, Git-ignored temporary directories the current task owns, without a tracked change or files still needed for a deliverable.
247
- - `meaning-preserving`, with `stale-record` or `order`: The change keeps every record's meaning. It only resolves the conflicts of a merge or a branch update, or renumbers an ID the branch added that the base also took, and adds no content neither side had. It lists the artifacts the conflict touches; a conflict in code, a generated file or a lockfile is not this qualifier.
247
+ - `meaning-preserving`, with `stale-record` or `order`: The change keeps every record's meaning. It only resolves the conflicts of a merge or a branch update, or gives a story-tree item the branch added a free ID when the base took the same ID, and adds no content neither side had.
248
+ A conflict confined to `decisions.md`, its pages and `open-questions.md` is resolved by merging the base, whose union merge keeps both sides' rows; no register row is edited or renumbered.
249
+ It lists the artifacts the conflict touches; a conflict in code, a generated file or a lockfile is not this qualifier.
248
250
  - `distribution-incident`, with `release`: A published key, certificate, feed or package is broken.
249
251
  - `release-delegated`, with `release`: The user's own instruction for this run, quoted word for word with its source, has the agent carry out the release, its preparation up to an open release pull request, or its version edit, for a version the user named. A request only for a release, a version with no one named to carry it out, a branch name or a project policy delegates nothing.
250
- - `settled-design`, with `upstream`: The cited record exists, is in force, and settles the design.
252
+ - `settled-design`, with `upstream`: The cited record exists, no later decision row supersedes it, and it settles the design.
251
253
  - `red-since-change`, with `ci`: CI fails since a named change, and a correct existing test catches it.
252
254
  - `check-misses`, with `unenforced`: A check exists and misses cases, or a check the declaration needs is absent.
253
255
  - `mechanism-inert`, with `unenforced`: A declared mechanism does nothing: a key never read, a check that never fires, an obligation nothing produces.
@@ -281,7 +283,6 @@ Each signal is followed by what the request does.
281
283
 
282
284
  - `approved-record-task`: Cites an approved record and carries a task section and a done-when block.
283
285
  - `grilling-required`: States that a decision session is needed before work.
284
- - `decide-by-change-request`: States that a change request decides it.
285
286
  - `disabled-test`: Names a test in the form `DISABLED test_…`.
286
287
  - `flaky-label`: Carries a flaky label.
287
288
  - `backport`: Asks for a backport or a cherry-pick to a release branch.
@@ -349,7 +350,11 @@ stage once per flow. Leave it out when no flow is named.
349
350
 
350
351
  ## Examples
351
352
 
352
- Each request is followed by its extraction. Fields not shown are empty.
353
+ Each request is followed by its extraction. Fields not shown are empty. The examples leave them out
354
+ for brevity; the file handed to `plan` writes every required field (`intent`, `entryFlags`,
355
+ `qualifiers`, `signals`, `risks`, `artifacts`, `confidence`), each empty list as `[]`, or `plan`
356
+ refuses it. `flows` and `alternatives` stay absent when unused: `plan` refuses an empty
357
+ `alternatives`, and any `alternatives` at `confidence: high`.
353
358
 
354
359
  - "An empty phone number returns 500; the spec says 400." → `{ intent: defect, entryFlags: [repro, expect], artifacts: [code, tests], confidence: high }`
355
360
  - "Is the work complete?", asked of the session that did it → `{ intent: question-why, qualifiers: [session-answerable], confidence: high }`
@@ -365,9 +370,9 @@ Each request is followed by its extraction. Fields not shown are empty.
365
370
  - "We only handle one kind of engagement now: remove its form field and list filter, and every mention of the other kind." → `{ intent: behaviour-change, qualifiers: [removal-requested], artifacts: [spec, contract, ui, code, tests, docs], confidence: high }`
366
371
  - "Rename workspace to project everywhere: the specification, the code, the screens and the tests." → `{ intent: behaviour-change, qualifiers: [rename-requested], artifacts: [spec, contract, ui, code, tests, docs], confidence: high }`
367
372
  - "Remove the configuration key nothing reads." → `{ intent: unenforced, qualifiers: [mechanism-inert, removal-requested], artifacts: [code, tests, config], risks: [breaking], confidence: high }`
368
- - An approved change request cited with a task section and a done-when block → `{ intent: order, entryFlags: [upstream], qualifiers: [settled-design], signals: [approved-record-task], artifacts: [spec, contract], confidence: high }`
373
+ - An approved decision cited with a task section and a done-when block → `{ intent: order, entryFlags: [upstream], qualifiers: [settled-design], signals: [approved-record-task], artifacts: [spec, contract], confidence: high }`
369
374
  - "The import fails and the `catch` logs nothing, so the cause cannot be read; log the error there." → `{ intent: defect, entryFlags: [cause, fix, expect], artifacts: [code, tests], confidence: high }`
370
- - "Merging main left conflicts in the decision register; renumber our colliding rows and keep both sides." → `{ intent: stale-record, qualifiers: [meaning-preserving], artifacts: [spec], confidence: high }`
375
+ - "Merging main left conflicts in our story files; give our colliding story the next free ID and keep both sides." → `{ intent: stale-record, qualifiers: [meaning-preserving], artifacts: [spec], confidence: high }`
371
376
  - "Take main's shared fix into the branches feature-a and feature-b, keeping what each side means.", read once for each named branch and run one after another → `{ intent: order, qualifiers: [meaning-preserving], artifacts: [spec, docs], confidence: high }`
372
377
  - "Release 2.4.0. You run the preparation and merge the release pull request; I only approve the publish." → `{ intent: release, qualifiers: [release-delegated], artifacts: [release], confidence: high }`
373
378
  - "Give the live dashboard a calmer palette and softer page transitions; keep every screen and field as it is." → `{ intent: feature, qualifiers: [visual-open, restyle], artifacts: [ui], confidence: high }`
@@ -5,7 +5,7 @@ What `qfai-run` does at a step the plan marks with a release point, a decision p
5
5
  ## Release point
6
6
 
7
7
  Before a step `releasePoint` names runs, ask the user to approve the release; where it is `end`, ask once the last stage's gates have passed.
8
- Record the approval as step 7 of `SKILL.md` says: a `decisions.md` row the run writes, or, when the release change is produced outside this run, the final report, with the row appended by the next change that touches `decisions.md`.
8
+ Record the approval as step 7 of `SKILL.md` says: a `decisions.md` row the run writes when the approval meets the recording test, the final report otherwise, or, when the release change is produced outside this run, the final report, with any row appended by the next change that touches `decisions.md`.
9
9
  Rerun the gates over any row written. `verify-commit` runs after that, so the commit holds any approval row written. Nothing after it
10
10
  runs without the approval, which authorizes no push, merge, tag or publication.
11
11
 
@@ -13,10 +13,8 @@ mode: approval-gated
13
13
 
14
14
  ## /qfai-sdd
15
15
 
16
- [DRIFT-PROTOCOL:REQUIRED]
17
-
18
16
  Run the entry check of
19
- `.qfai/assistant/rule/shared-skill-operating-baseline.md#workflow-run-entry-check-mandatory`
17
+ `.qfai/assistant/rule/shared-skill-operating-baseline.md#workflow-run-entry-check`
20
18
  first.
21
19
 
22
20
  Turn a requirement into a checkable story tree: BF → US → AC → EX, with each BR
@@ -45,15 +43,15 @@ Run the steps in this order, as
45
43
  states: read `.qfai/assistant/step/<id>/STEP.md` for the current step only, run
46
44
  it, then move to the next.
47
45
 
48
- | Step | What it does | Skipped when |
49
- | ------------------ | -------------------------------------------------------------- | ---------------------------------------------------------- |
50
- | `sdd-triage` | Source, preflight, triage, approvals and ID allocation | Never |
51
- | `sdd-flow` | Policy, `tech.md` and business flows | Triage changed no policy fact and no flow |
52
- | `sdd-story` | Stories, Gherkin AC and EX | Never |
53
- | `sdd-contract` | Contracts and the BRs they enforce, or the `--contract` repair | Triage changed no BR and no contract |
54
- | `common-design-md` | Root `DESIGN.md` | The flow is not UI-bearing, or its surface is CLI-only |
55
- | `sdd-cycle` | The concrete-abstract cycle between BRs and EXs | `sdd-contract` wrote or changed no BR Statement or Example |
56
- | `sdd-gate` | Per-flow `validate --profile sdd` and the flow report | Never |
46
+ | Step | What it does | Skipped when |
47
+ | ------------------ | --------------------------------------------------------------- | ---------------------------------------------------------- |
48
+ | `sdd-triage` | Source, preflight, triage, critical decisions and ID allocation | Never |
49
+ | `sdd-flow` | Policy, `tech.md` and business flows | Triage changed no policy fact and no flow |
50
+ | `sdd-story` | Stories, Gherkin AC and EX | Never |
51
+ | `sdd-contract` | Contracts and the BRs they enforce, or the `--contract` repair | Triage changed no BR and no contract |
52
+ | `common-design-md` | Root `DESIGN.md` | The flow is not UI-bearing, or its surface is CLI-only |
53
+ | `sdd-cycle` | The concrete-abstract cycle between BRs and EXs | `sdd-contract` wrote or changed no BR Statement or Example |
54
+ | `sdd-gate` | Per-flow `validate --profile sdd` and the flow report | Never |
57
55
 
58
56
  `sdd-triage` records whether each affected flow is UI-bearing. A step that
59
57
  changes an input an earlier step consumed reruns that step's authors and