qfai 1.8.8 → 1.8.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/assets/init/.qfai/assistant/agents/product-experience-architect.md +3 -2
  2. package/assets/init/.qfai/assistant/skills/qfai-discussion/SKILL.md +20 -31
  3. package/assets/init/.qfai/assistant/skills/qfai-discussion/references/design-dna-intake.md +45 -15
  4. package/assets/init/.qfai/assistant/skills/qfai-discussion/references/discussion-artifact-rules.md +2 -4
  5. package/assets/init/.qfai/assistant/skills/qfai-discussion/references/ui-bearing-playbook.md +5 -10
  6. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/14_Review-Request.md +9 -13
  7. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/uiux/00_index.md +16 -13
  8. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/uiux/50_review_input_bundle.md +8 -12
  9. package/assets/init/.qfai/assistant/skills/qfai-implement/SKILL.md +7 -23
  10. package/assets/init/.qfai/assistant/skills/qfai-prototyping/SKILL.md +69 -48
  11. package/assets/init/.qfai/assistant/skills/qfai-prototyping/references/design-md-spec.md +114 -0
  12. package/assets/init/.qfai/assistant/skills/qfai-prototyping/references/generator-prompt.md +77 -19
  13. package/assets/init/.qfai/assistant/skills/qfai-prototyping/references/handoff.md +51 -14
  14. package/assets/init/.qfai/assistant/skills/qfai-prototyping/references/iteration-loop.md +38 -14
  15. package/assets/init/.qfai/assistant/skills/qfai-prototyping/references/reviewer-prompt.md +96 -43
  16. package/assets/init/.qfai/assistant/skills/qfai-prototyping/templates/DESIGN.md.sample +74 -0
  17. package/assets/init/.qfai/assistant/skills/qfai-prototyping/templates/contracts/prototype-handoff.sample.yaml +5 -2
  18. package/assets/init/.qfai/assistant/skills/qfai-sdd/SKILL.md +34 -2
  19. package/assets/init/.qfai/assistant/skills/qfai-sdd/references/contract-artifact-rules.md +1 -1
  20. package/assets/init/.qfai/assistant/skills/qfai-sdd/references/ui-design-contract-normalization.md +62 -25
  21. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/contracts/design-md-lock.sample.yaml +23 -0
  22. package/assets/init/.qfai/assistant/skills/qfai-verify/SKILL.md +3 -10
  23. package/assets/init/.qfai/assistant/steering/ui-definition-protocol.md +5 -10
  24. package/assets/init/root/DESIGN.md +83 -0
  25. package/assets/uix-rev/comparison-review.md +1 -1
  26. package/assets/uix-rev/contracts-review.md +1 -1
  27. package/assets/uix-rev/scoring-review.md +15 -13
  28. package/assets/uix-rev/strategy-review.md +7 -9
  29. package/assets/validators/layoutAntiPatterns.json +42 -0
  30. package/dist/cli/index.cjs +3293 -1248
  31. package/dist/cli/index.cjs.map +1 -1
  32. package/dist/cli/index.mjs +3310 -1265
  33. package/dist/cli/index.mjs.map +1 -1
  34. package/dist/index.cjs +1865 -919
  35. package/dist/index.cjs.map +1 -1
  36. package/dist/index.d.cts +74 -1
  37. package/dist/index.d.ts +74 -1
  38. package/dist/index.mjs +1854 -916
  39. package/dist/index.mjs.map +1 -1
  40. package/package.json +1 -1
  41. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/uiux/30_exploration_brief.md +0 -29
  42. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/uiux/31_reference_pool.md +0 -13
  43. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/uiux/32_design_anti_goals.md +0 -10
  44. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/contracts/brand-design.sample.yaml +0 -19
  45. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/contracts/exploration-brief.sample.yaml +0 -19
  46. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/contracts/reference-pool.sample.yaml +0 -14
  47. package/assets/validators/designSlopPatterns.json +0 -56
@@ -28,8 +28,9 @@ tools: [Read, Write, Edit, Glob, Grep, Bash]
28
28
  - .qfai/specs/spec-\*/09_delta.md
29
29
  - .qfai/specs/spec-\*/01_Spec.md
30
30
  - .github/instructions/principles.instructions.md
31
- - Exploration brief, reference pool, evaluation rubric, evaluator calibration, selected direction, finalized design system,
32
- screen contracts, optional tokens, optional fallback HTML/CSS mock, and Mermaid flows
31
+ - Root `DESIGN.md` (brand SSOT: front-matter tokens plus `# Brand Philosophy` body)
32
+ - Reference pool framed as deviate-from inputs, screen contracts (`uiux/40_screen_contracts.md`), optional tokens, optional fallback HTML/CSS mock, and Mermaid flows
33
+ - Evaluator axes are fixed in `core/prototyping/evaluatorReview.ts#ORDINAL_AXES` (information architecture / navigation flow / usability / functionality) and no longer authored as sidecar files
33
34
  - Runtime screenshots or rendered evidence when available
34
35
 
35
36
  ## Deliverables
@@ -32,47 +32,41 @@ Produce a unified 15-file discussion pack plus exploration-first UI sidecars so
32
32
  ## CRITICAL CONSTRAINTS (Read First)
33
33
 
34
34
  - Output path is fixed: `.qfai/discussion/discussion-YYYYMMDDhhmmssSSS/`.
35
- - Required fixed files (all 15 are mandatory) remain unchanged.
35
+ - All 15 mandatory fixed files remain unchanged.
36
36
  - UI-bearing discussion packs may include `prototyping.yaml` as an optional recommendation artifact; non-ui discussion packs typically omit it.
37
- - Discussion completion requires `Disposition: open` count to be zero in `11_OQ-Register.md`.
37
+ - Completion requires `Disposition: open` count to be zero in `11_OQ-Register.md`.
38
38
  - If UI requirements exist, behavior obligations are primary and HTML+CSS mock is optional fallback only.
39
39
  - Discussion is planner-first: do not select a single visual winner and do not finalize the design system here.
40
40
  - Use artifact files, not conversational summaries, as the downstream handoff.
41
41
 
42
42
  ## UI-bearing Canonical Sidecar Family
43
43
 
44
- UI-bearing packs must produce the following sidecars as primary truth:
44
+ UI-bearing packs must produce, as primary truth: `uiux/40_screen_contracts.md`, `uiux/50_review_input_bundle.md`. They MUST also emit a draft brand SSOT at the **consuming-project root**:
45
45
 
46
- - `uiux/30_exploration_brief.md`
47
- - `uiux/31_reference_pool.md`
48
- - `uiux/32_design_anti_goals.md`
49
- - `uiux/40_screen_contracts.md`
50
- - `uiux/50_review_input_bundle.md`
46
+ - `<consuming-project-root>/DESIGN.md` — brand SSOT consumed by `/qfai-sdd` (freezes its sha256 in `.qfai/contracts/design/DESIGN.md.lock.yaml`) and by `/qfai-prototyping` (iterates against locked tokens). Brand intent (product intent, brand signals, anti-goals, reference pool framed as deviate-from inputs) lives in front-matter + `# Brand Philosophy` body — no separate per-aspect sidecar.
51
47
 
52
48
  ## Required Process
53
49
 
54
50
  1. Run the core interview for concept, scope, stakeholders, and constraints.
55
51
  2. Run Inception Deck and include at least one Mermaid diagram.
56
- 3. Run Story Workshop, capture user stories and user flows, and keep HTML+CSS mock as optional fallback only.
52
+ 3. Run Story Workshop, capture user stories and user flows; HTML+CSS mock is optional fallback only.
57
53
  4. Register source traceability and reference research in `04_Sources.md`.
58
54
  5. Capture scope, REQ, NFR, glossary, constraints, and policies.
59
55
  6. Run Example Mapping and capture `Example Seeds`.
60
56
  7. Update `11_OQ-Register.md`, resolve OQs until open count is zero, and move deferred items to `13_Deferred.md`.
61
57
  8. Generate the exploration-first sidecar family for UI-bearing targets.
62
- 9. Generate `prototyping.yaml` only when the latest discussion pack is UI-bearing and an explicit prototyping recommendation is useful.
63
- 10. Request review and record the Reviewer result.
58
+ 9. **Emit root `DESIGN.md` draft** for UI-bearing targets per `references/design-dna-intake.md`. Required when UI-bearing; skip otherwise.
59
+ 10. Generate `prototyping.yaml` only when the latest discussion pack is UI-bearing and an explicit prototyping recommendation is useful.
60
+ 11. Request review and record the Reviewer result.
64
61
 
65
62
  For UI-bearing targets, follow `references/design-dna-intake.md` while authoring the UI/UX sidecars. Keep this `SKILL.md` compact; put detailed interview prompts and examples in the reference file.
66
63
 
67
64
  ## UI-bearing Authoring Requirements
68
65
 
69
- - `30_exploration_brief.md` must define product intent, brand signals, and differentiation targets.
70
- - `31_reference_pool.md` must define exploration references with adopted points, rejected points, and copy risk framed as **deviate-from** inputs (not imitate-this) for downstream `/qfai-prototyping` reviewer.
71
- - `32_design_anti_goals.md` must contain explicit anti-goals; this also feeds the global anti-slop pattern list consulted by the prototyping reviewer.
72
- - `50_review_input_bundle.md` must document review inputs for downstream skills.
73
-
74
- Evaluation axes are global constants (4-step ordinal: weak / acceptable /
75
- strong / exceptional) and are not authored as discussion sidecars.
66
+ - Root `DESIGN.md` front-matter must define `brand` (name, archetype, voice), `audience` (emotion, do_not_look_like), and the full `visual.*` token tree (colors, typography, spacing, radius, shadow).
67
+ - `# Brand Philosophy` body documents do/don't, brand signals, and exploration references framed as **deviate-from** inputs (not imitate-this) for the downstream `/qfai-prototyping` reviewer.
68
+ - `40_screen_contracts.md` defines each screen contract per the template schema; `50_review_input_bundle.md` documents review inputs for downstream skills.
69
+ - Evaluation axes are global constants (4-step ordinal: weak / acceptable / strong / exceptional) and are not authored as discussion sidecars.
76
70
 
77
71
  ## Completion Contract (Shared)
78
72
 
@@ -84,7 +78,7 @@ Before declaring completion, you MUST:
84
78
  - ensure `Disposition: open` count is zero in `11_OQ-Register.md`;
85
79
  - ensure every deferred item has full metadata in `13_Deferred.md`;
86
80
  - ensure `02_Inception-Deck.md` and `03_Story-Workshop.md` include Mermaid diagrams;
87
- - ensure the UI-bearing sidecar family is complete;
81
+ - ensure the UI-bearing sidecar family is complete and the root `DESIGN.md` draft exists at the consuming-project root and parses as valid front-matter;
88
82
  - run `qfai validate --profile discussion --fail-on error` and fix discussion-owned findings;
89
83
  - avoid selecting a single visual winner in discussion artifacts.
90
84
 
@@ -92,15 +86,12 @@ Before declaring completion, you MUST:
92
86
 
93
87
  Reviewer checks must confirm:
94
88
 
95
- - the 15-file discussion pack is complete
96
- - `Disposition: open` count is zero in `11_OQ-Register.md`
97
- - the UI-bearing sidecar family is complete when the pack is UI-bearing
98
- - discussion stayed planner-first and did not choose a single visual winner
99
- - Drift Protocol is enforced
100
- - review policy is checked against `.qfai/assistant/steering/test-layers.md`
101
- - planning and coverage heuristics are signals, not gates
102
- - review findings end with `Status (PASS/REVISE)`
103
- - Reviewer result is explicit as `PASS` or `REVISE`
89
+ - the 15-file discussion pack is complete; `Disposition: open` count is zero in `11_OQ-Register.md`;
90
+ - the UI-bearing sidecar family is complete when the pack is UI-bearing;
91
+ - discussion stayed planner-first and did not choose a single visual winner;
92
+ - Drift Protocol is enforced; review policy is checked against `.qfai/assistant/steering/test-layers.md`;
93
+ - planning and coverage heuristics are signals, not gates;
94
+ - review findings end with `Status (PASS/REVISE)` and Reviewer result is explicit as `PASS` or `REVISE`.
104
95
 
105
96
  ## Sub-agent Delegation (MANDATORY)
106
97
 
@@ -108,9 +99,7 @@ Follow `.qfai/assistant/instructions/shared-skill-delegation-baseline.md`.
108
99
 
109
100
  ### Orchestrator Protocol (MUST)
110
101
 
111
- - do not self-approve
112
- - use artifact files as the handoff surface
113
- - integrate delegated outputs only after checking pack completeness
102
+ - do not self-approve; use artifact files as the handoff surface; integrate delegated outputs only after checking pack completeness.
114
103
 
115
104
  ### Capability Probe (MUST)
116
105
 
@@ -6,24 +6,54 @@ Use this reference only for UI-bearing discussion packs.
6
6
 
7
7
  - Brand personality: list 3-5 traits the product should express.
8
8
  - Audience emotion: define what users should feel after the primary task.
9
- - Category conventions: name the expected layout and interaction patterns for this market.
10
- - Differentiation targets: state what must feel unlike generic SaaS, generic shadcn, or direct competitors.
11
- - Anti-template constraints: name default visual patterns that must not survive into prototyping.
12
- - Reference strategy: collect competitor, adjacent, aspirational, template-seed, and anti-pattern references.
9
+ - Category conventions: name the expected layout and interaction
10
+ patterns for this market.
11
+ - Differentiation targets: state what must feel unlike generic SaaS or
12
+ direct competitors.
13
+ - Anti-template constraints: name default visual patterns that must
14
+ not survive into prototyping.
15
+ - Reference strategy: collect competitor, adjacent, aspirational,
16
+ template-seed, and anti-pattern references.
13
17
 
14
18
  ## Reference Rules
15
19
 
16
20
  - Treat templates as seeds, not winners.
17
21
  - Capture both adopted and rejected points for every reference.
18
- - Translate references into local product rules instead of copying visual surfaces.
22
+ - Translate references into local product rules instead of copying
23
+ visual surfaces.
19
24
  - Record copy risk as `low`, `medium`, or `high`.
20
- - Record template usage policy as `none`, `reference-only`, or `implementation-seed`.
21
-
22
- ## Output Mapping
23
-
24
- - Put product intent and brand signals in `30_exploration_brief.md`.
25
- - Put all reference decisions in `31_reference_pool.md` (deviate-from input, not imitate).
26
- - Put prohibited visual directions in `32_design_anti_goals.md` (also feeds reviewer anti-slop).
27
-
28
- Evaluation axes are global constants (4-step ordinal: weak / acceptable /
29
- strong / exceptional) and are not authored as discussion sidecars.
25
+ - Record template usage policy as `none`, `reference-only`, or
26
+ `implementation-seed`.
27
+
28
+ ## Output Mapping (new SSOT path)
29
+
30
+ The interview produces **one root `DESIGN.md`** at
31
+ `<consuming-project-root>/DESIGN.md`. This file is the brand SSOT
32
+ consumed by `/qfai-sdd` (which freezes its sha256) and by
33
+ `/qfai-prototyping` (which iterates under its tokens).
34
+
35
+ Map the interview answers into `DESIGN.md` as follows:
36
+
37
+ - Brand personality → `brand.voice` (1..N short trait words) and the
38
+ `# Brand Philosophy` body.
39
+ - Brand archetype → `brand.archetype`. Allowed values are the
40
+ 8-archetype catalog in `design-md-brand-catalog.md`
41
+ (`minimal | bold | corporate | playful | organic | tech | elegant |
42
+ casual`). Use `aesthetic_properties` from the catalog as defaults.
43
+ - Audience emotion → `audience.emotion`.
44
+ - Anti-template constraints + rejected references →
45
+ `audience.do_not_look_like` and the **Don't** subsection of the
46
+ `# Brand Philosophy` body.
47
+ - Visual decisions (color, typography, radius, shadow) → the
48
+ `visual.*` token tree. Schema and validation rules live in
49
+ `.qfai/assistant/skills/qfai-prototyping/references/design-md-spec.md`.
50
+ - Adopted reference points → the **Do** subsection of
51
+ `# Brand Philosophy`.
52
+
53
+ For the schema (12 colors, 3 fonts, 4 radii, 3 shadows, 8 archetypes),
54
+ read `qfai-prototyping/references/design-md-spec.md` and use the
55
+ sample at `qfai-prototyping/templates/DESIGN.md.sample` as a starting
56
+ shape.
57
+
58
+ Evaluation axes are global constants (4-step ordinal: weak / acceptable
59
+ / strong / exceptional) and are not authored as discussion sidecars.
@@ -41,12 +41,10 @@ UI-bearing discussion packs may include `prototyping.yaml` as an optional recomm
41
41
  For UI-bearing packs, use:
42
42
 
43
43
  - `04_Sources.md` for trend translation and competitive reference registry
44
- - `uiux/30_exploration_brief.md`
45
- - `uiux/31_reference_pool.md`
46
- - `uiux/32_design_anti_goals.md`
44
+ - `DESIGN.md` (root) — brand SSOT draft (front-matter + `# Brand Philosophy` body); `/qfai-sdd` Phase 0 freezes it into `.qfai/contracts/design/DESIGN.md.lock.yaml`
47
45
  - `uiux/40_screen_contracts.md`
48
46
 
49
- Discussion is exploration-first and must not choose a single visual winner or final design system. Those are downstream prototyping outputs.
47
+ Discussion is exploration-first and must not choose a single visual winner or final design system. The brand decision is captured once in root `DESIGN.md`; downstream prototyping consumes the frozen tokens.
50
48
 
51
49
  ## `prototyping.yaml`
52
50
 
@@ -26,17 +26,12 @@ Use this file when `/qfai-discussion` needs the full UI-bearing decision logic.
26
26
 
27
27
  ## Sidecar Family SSOT
28
28
 
29
+ For UI-bearing packs the brand SSOT is root `DESIGN.md` (drafted by
30
+ `/qfai-discussion` and frozen by `/qfai-sdd` Phase 0 into
31
+ `.qfai/contracts/design/DESIGN.md.lock.yaml`). The remaining sidecars are
32
+ the screen-level UX inputs:
33
+
29
34
  - `uiux/00_index.md`
30
- - `uiux/10_implementation_strategy.md`
31
- - `uiux/11_design_taste_interview.md`
32
- - `uiux/12_design_system.md`
33
- - `uiux/20_design_eval_invariant.md`
34
- - `uiux/21_design_eval_trend_derived.md`
35
- - `uiux/22_design_eval_product_specific.md`
36
- - `uiux/23_design_eval_aggregate.md`
37
- - `uiux/24_design_eval_dynamic_overrides.md`
38
- - `uiux/30_option_comparison.md`
39
- - `uiux/31_selected_anchor_screen.md`
40
35
  - `uiux/40_screen_contracts.md`
41
36
  - `uiux/50_review_input_bundle.md`
42
37
 
@@ -35,10 +35,10 @@
35
35
  - Acceptance criteria are consistent with flows/state transitions
36
36
  - Security/operations risks are reflected in diagrams where relevant
37
37
  - Mermaid diagrams use ` ```mermaid ` fences only
38
- - Exploration brief completeness and differentiation clarity (when UI-bearing)
39
- - Reference pool freshness and translation quality (when UI-bearing)
40
- - Exploration rubric quality and evaluation traceability (when UI-bearing)
41
- - Evaluator calibration skepticism and blandness rejection quality (when UI-bearing)
38
+ - Root `DESIGN.md` completeness and differentiation clarity (when UI-bearing)
39
+ - Reference pool freshness and translation quality into `DESIGN.md` (when UI-bearing)
40
+ - Evaluator scoring covers all four canonical UX axes — information architecture / navigation flow / usability / functionality, fixed in `core/prototyping/evaluatorReview.ts#ORDINAL_AXES` (when UI-bearing)
41
+ - Evaluator critique skepticism and blandness rejection quality applied against the four axes (when UI-bearing)
42
42
  - Best-of-history handling and winner selection consistency (when UI-bearing)
43
43
  - Screen contract sufficiency and strong schema completeness (when UI-bearing)
44
44
  - Generic fallback risk — ensure no unreviewed generic/placeholder UI remains (when UI-bearing)
@@ -47,21 +47,17 @@
47
47
 
48
48
  ## Exploration Direction Consistency
49
49
 
50
- <!-- Required for UI-bearing packs. Verifies sidecar-family alignment. -->
50
+ <!-- Required for UI-bearing packs. Verifies brand SSOT and sidecar alignment. -->
51
51
 
52
- - Exploration brief: verify `uiux/30_exploration_brief.md` defines product intent, must-preserve interactions, brand signals, and differentiation targets
53
- - Evaluation alignment: verify `uiux/33_exploration_rubric.md` and `uiux/34_evaluator_calibration.md` support skeptical evaluation and originality pressure
52
+ - Brand SSOT: verify root `DESIGN.md` defines `brand`, `audience`, and `visual.*` tokens, and that `# Brand Philosophy` body documents product intent, must-preserve interactions, brand signals, and differentiation targets
53
+ - Evaluator axes: confirm reviewers will score against the four canonical UX axes (information architecture / navigation flow / usability / functionality) — these are fixed in `core/prototyping/evaluatorReview.ts#ORDINAL_AXES` and no longer authored as sidecar files
54
54
  - History handling: verify `uiux/50_review_input_bundle.md` documents best-of-history comparison instead of latest-only preference
55
55
 
56
56
  ## Sidecar Artifact Review Scope
57
57
 
58
- <!-- Required for UI-bearing packs. Reviews uiux/ sidecar artifacts. -->
58
+ <!-- Required for UI-bearing packs. Reviews root DESIGN.md + uiux/ sidecar artifacts. -->
59
59
 
60
- - Verify exploration sidecars are present and complete (`30` to `34`, `40`, `50`)
61
- - Verify `uiux/30_exploration_brief.md` is specific enough to support divergent exploration
62
- - Verify `uiux/31_reference_pool.md` documents adopted, rejected, and locally translated references
63
- - Verify `uiux/33_exploration_rubric.md` weights design quality and originality explicitly
64
- - Verify `uiux/34_evaluator_calibration.md` contains good-critique / too-lenient / blandness-fail / originality-fail examples
60
+ - Verify root `DESIGN.md` is specific enough to support divergent exploration (front-matter populated, `# Brand Philosophy` body written, do/don't and reference notes framed as deviate-from inputs)
65
61
  - Verify `uiux/50_review_input_bundle.md` preserves best-of-history handling
66
62
  - Verify screen contracts use nested strong schema with all 4 required states (default/loading/empty/error) and treat `uiux/40_screen_contracts.md` as the state SSOT
67
63
 
@@ -6,27 +6,30 @@ Manifest of all UI/UX sidecar artifacts produced during a UI-bearing discussion.
6
6
 
7
7
  ## File Inventory
8
8
 
9
- | File | Purpose | Required |
10
- | --------------------------- | -------------------------------------------- | -------- |
11
- | 00_index.md | This manifest | Yes |
12
- | 30_exploration_brief.md | Exploration brief and design intent | Yes |
13
- | 31_reference_pool.md | Exploration references and local translation | Yes |
14
- | 32_design_anti_goals.md | Anti-goals and recurrence prevention | Yes |
15
- | 33_exploration_rubric.md | Evaluator rubric | Yes |
16
- | 34_evaluator_calibration.md | Evaluator calibration examples | Yes |
17
- | 40_screen_contracts.md | Screen interaction contracts (11 fields) | Yes |
18
- | 50_review_input_bundle.md | Review input bundle | Yes |
9
+ Brand-level intent (product intent, brand signals, anti-goals,
10
+ reference pool framed as deviate-from inputs) lives in root
11
+ `DESIGN.md` (front-matter + `# Brand Philosophy` body), not in this
12
+ sidecar family.
13
+
14
+ | File | Purpose | Required |
15
+ | ------------------------- | ---------------------------------------- | -------- |
16
+ | 00_index.md | This manifest | Yes |
17
+ | 40_screen_contracts.md | Screen interaction contracts (11 fields) | Yes |
18
+ | 50_review_input_bundle.md | Review input bundle | Yes |
19
19
 
20
20
  ## Completeness Rule
21
21
 
22
- All required files (8 files) MUST be present for a UI-bearing pack. Partial generation is not permitted (BR-0026-0002).
22
+ All required files MUST be present for a UI-bearing pack alongside root
23
+ `DESIGN.md`. Partial generation is not permitted.
23
24
 
24
25
  ## Forbidden Legacy Files
25
26
 
26
27
  The following files are NOT part of the canonical family and must NOT be created in new packs:
27
28
 
28
- - `30_option_comparison.md` — replaced by `30_exploration_brief.md`
29
- - `31_selected_anchor_screen.md` — replaced by `31_reference_pool.md` + `selected-direction.yaml`
29
+ - `30_option_comparison.md` — replaced by root `DESIGN.md`
30
+ - `31_selected_anchor_screen.md` — replaced by root `DESIGN.md`
31
+ - `33_exploration_rubric.md` — replaced by `core/prototyping/evaluatorReview.ts#ORDINAL_AXES`
32
+ - `34_evaluator_calibration.md` — replaced by `core/prototyping/evaluatorReview.ts#ORDINAL_AXES`
30
33
  - `40_contracts.md` — replaced by `40_screen_contracts.md`
31
34
  - `50_review_bundle.md` — replaced by `50_review_input_bundle.md`
32
35
  - `60_critique_loop.md` — removed (critique integrated into review bundle)
@@ -6,27 +6,23 @@ Consolidate all sidecar artifacts into a review-ready bundle for design reviewer
6
6
 
7
7
  ## Bundle Contents
8
8
 
9
- | Artifact | Path | Status |
10
- | -------------------------- | ---------------------------------- | ------------------------- |
11
- | Exploration brief | `uiux/30_exploration_brief.md` | [draft/reviewed/approved] |
12
- | Reference pool | `uiux/31_reference_pool.md` | [draft/reviewed/approved] |
13
- | Design anti-goals | `uiux/32_design_anti_goals.md` | [draft/reviewed/approved] |
14
- | Exploration rubric | `uiux/33_exploration_rubric.md` | [draft/reviewed/approved] |
15
- | Evaluator calibration | `uiux/34_evaluator_calibration.md` | [draft/reviewed/approved] |
16
- | Screen contracts | `uiux/40_screen_contracts.md` | [draft/reviewed/approved] |
17
- | Prototyping recommendation | `../prototyping.yaml` | [draft/reviewed/approved] |
9
+ | Artifact | Path | Status |
10
+ | -------------------------- | ----------------------------- | ------------------------- |
11
+ | Brand SSOT (root) | `DESIGN.md` | [draft/reviewed/approved] |
12
+ | Screen contracts | `uiux/40_screen_contracts.md` | [draft/reviewed/approved] |
13
+ | Prototyping recommendation | `../prototyping.yaml` | [draft/reviewed/approved] |
18
14
 
19
15
  ## Trend-derived review focus
20
16
 
21
17
  - Required references are all present and complete.
22
18
  - Stale / overused AI slop patterns are explicitly avoided.
23
- - Reference research is translated into exploration and evaluator calibration inputs.
19
+ - Reference research is translated into local design decisions on root `DESIGN.md` and screen contracts.
24
20
  - Later iterations are not automatically preferred over stronger middle iterations.
25
21
 
26
22
  ## Review Checklist
27
23
 
28
- - [ ] Exploration brief aligns with surface type and project constraints
24
+ - [ ] Root `DESIGN.md` aligns with surface type and project constraints
29
25
  - [ ] Reference pool is complete and translated into local design decisions
30
- - [ ] Evaluator calibration includes skeptical critique examples
26
+ - [ ] Evaluator scoring covers all four canonical UX axes (information architecture / navigation flow / usability / functionality) — fixed in `core/prototyping/evaluatorReview.ts#ORDINAL_AXES`
31
27
  - [ ] Best-of-history handling is explicit
32
28
  - [ ] Screen contracts cover all required states
@@ -33,19 +33,13 @@ QFAI Skill Body (SSOT)
33
33
 
34
34
  ## Spec Auto-Discovery Protocol
35
35
 
36
- When no explicit argument is given, detect the candidate spec and constrain execution to one spec only.
37
-
38
- ### One-Spec-at-a-Time Guarantee
39
-
40
- - Auto-discovery selects at most one spec for this run.
41
- - This protocol does NOT enable multi-spec parallel execution.
42
- - If multiple candidate specs are detected, do not start implementation until the user selects exactly one spec.
36
+ When no explicit argument is given, detect the candidate spec and constrain execution to one spec only. Auto-discovery selects at most one spec; this protocol does NOT enable multi-spec parallel execution.
43
37
 
44
38
  ### User Selection Flow
45
39
 
46
- - Single spec detected: announce the detected spec and ask for confirmation when scope is ambiguous.
47
- - Multiple specs detected: display the candidates and require the user to choose one spec.
48
- - Zero specs detected: stop and ask the user to provide the target spec explicitly.
40
+ - Single spec: announce the detected spec; ask for confirmation when scope is ambiguous.
41
+ - Multiple specs: display the candidates and require the user to choose one spec.
42
+ - Zero specs: stop and ask the user to provide the target spec explicitly.
49
43
 
50
44
  ## User Questions (AskUserQuestion Protocol)
51
45
 
@@ -75,20 +69,10 @@ Execute the TDD micro-cycle for each pending item in `test-list.md`, transitioni
75
69
  ## Visual Review Guard
76
70
 
77
71
  - Review rendered output, screenshot evidence, or HTML output before closing any UI-affecting item.
78
- - Read spec + contract inputs first whenever implementation touches UI or critique-driven behavior.
79
- - Read order: `01_Spec.md` → `03_Acceptance-Criteria.md` → `05_Examples.md` →
80
- `.qfai/contracts/design/exploration-brief.yaml` →
81
- `.qfai/contracts/design/reference-pool.yaml` → `.qfai/contracts/design/brand-design.yaml` →
82
- `.qfai/contracts/design/design-system.yaml` (extracted from final iter) →
83
- `.qfai/contracts/design/prototype-handoff.yaml` → `.qfai/contracts/ui/*.yaml` →
84
- canonical prototype evidence under `.qfai/evidence/prototyping/iter-NN/<screen>.{png,html}` →
85
- `.qfai/prototypes/final/index.html`.
72
+ - Read spec + contract inputs first whenever implementation touches UI or critique-driven behavior. Read order: `01_Spec.md` → `03_Acceptance-Criteria.md` → `05_Examples.md` → root `DESIGN.md` → `.qfai/contracts/design/DESIGN.md.lock.yaml` → `.qfai/contracts/design/design-system.yaml` (post-loop token mirror) → `.qfai/contracts/design/prototype-handoff.yaml` → `.qfai/contracts/ui/*.yaml` → `.qfai/evidence/prototyping/iter-NN/<screen>.{png,html}` → `.qfai/prototypes/final/index.html`.
86
73
  - Do not read discussion-pack UI/UX sidecars or fallback mocks.
87
- - Prototype HTML is analysis input, not production source. Reimplement with project-native
88
- patterns while preserving the visual identity captured in `prototype-handoff.yaml`
89
- `implementationNotes` (free-form prose).
90
- - UI-affecting items require product-surface-reviewer prototype parity review before `done`.
91
- - If code intent and rendered output diverge, treat the rendered/HTML result as the blocking review input and reconcile before DONE.
74
+ - Prototype HTML is analysis input, not production source. Reimplement with project-native patterns while preserving the visual identity captured in `prototype-handoff.yaml` `implementationNotes` (free-form prose).
75
+ - UI-affecting items require product-surface-reviewer prototype parity review before `done`. If code intent and rendered output diverge, treat the rendered/HTML result as the blocking review input and reconcile before DONE.
92
76
 
93
77
  ## Non-goals
94
78
 
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: qfai-prototyping
3
- title: QFAI Prototyping (Single-Thread Design Evolution Loop)
4
- description: "Iterate one prototype through up to 15 cycles of generate-capture-review with explicit pivot permission, until 4 axes reach exceptional or the budget is exhausted."
3
+ title: QFAI Prototyping (DESIGN.md-driven UX Loop)
4
+ description: "Iterate one prototype through up to 15 cycles of generate-capture-review against a frozen DESIGN.md, focusing on information architecture, navigation flow, usability, and functionality."
5
5
  argument-hint: ""
6
6
  allowed-tools: [Read, Glob, Write, TodoWrite, Task, Bash]
7
7
  roles: [orchestrator, product-experience-architect, product-surface-reviewer, devops-ci-engineer]
@@ -13,79 +13,95 @@ mode: execution-focused
13
13
 
14
14
  [DRIFT-PROTOCOL:MANDATORY]
15
15
 
16
- This skill runs one prototype through up to 15 iterations. There is no funnel, no parallel candidates, no mode. Iteration count is fixed at 15.
17
-
18
- The workflow is static-first and file-based by default. Supported UI prototyping surfaces are: web, mobile, desktop, mixed. `cli` is not a prototyping execution target and is rejected. `ui_bearing: false` specs are excluded from prototyping execution.
16
+ This skill is static-first and file-based by default: it runs one prototype
17
+ through up to 15 iterations against a frozen brand SSOT (`DESIGN.md`), with
18
+ no parallel candidates, no mode, and a fixed 15-cycle budget. Visual identity
19
+ is fixed for the whole run; every cycle improves information architecture,
20
+ navigation flow, usability, and functionality. Supported UI prototyping
21
+ surfaces are: web, mobile, desktop, mixed. cli is not a prototyping
22
+ execution target and is rejected. ui_bearing: false specs are not prototyping
23
+ execution targets and are excluded.
19
24
 
20
25
  ## Goal
21
26
 
22
- Produce an artifact in which a creative breakthrough has emerged through serial iteration the kind of self-driven "scrap and reimagine" that arises when the model accumulates enough critique signal that staying on the current path is worse than rebuilding (Anthropic Dutch art museum pattern).
27
+ One final prototype satisfying the spec under a locked brand identity, with all four UX axes `exceptional`, no layout anti-patterns, and no DESIGN.md violations.
23
28
 
24
29
  ## Required References
25
30
 
26
- - `references/iteration-loop.md` — flow + evidence paths
27
- - `references/generator-prompt.md` — generator system prompt + pivot permission
28
- - `references/reviewer-prompt.md` reviewer output schema + global anti-slop list
29
- - `references/handoff.md` — design-system extraction + handoff yaml
31
+ - `references/iteration-loop.md` — flow, exit codes, evidence paths
32
+ - `references/generator-prompt.md` — generator system prompt + Tailwind
33
+ CDN + DESIGN.md token injection rules
34
+ - `references/reviewer-prompt.md` — reviewer schema, 4 UX axes,
35
+ layout anti-patterns (`lap-001..006` static regex + `lap-007..008` semantic),
36
+ `designMdViolations`, pivot rules
37
+ - `references/handoff.md` — post-loop `design-system.yaml` (DESIGN.md
38
+ token mirror) and `prototype-handoff.yaml`
39
+ - `references/design-md-spec.md` — DESIGN.md front-matter schema and
40
+ validation rules
41
+ - `templates/DESIGN.md.sample` — reference content shipped at the
42
+ consuming-project root by `qfai init`
30
43
 
31
44
  ## Required Contracts
32
45
 
33
46
  - `.qfai/specs/spec-*/{01_Spec.md, 03_Acceptance-Criteria.md}`
34
47
  - `.qfai/contracts/ui/*.yaml`
35
- - `.qfai/contracts/design/exploration-brief.yaml`
36
- - `.qfai/contracts/design/reference-pool.yaml`
37
- - `.qfai/contracts/design/brand-design.yaml`
48
+ - root `DESIGN.md`
49
+ - `.qfai/contracts/design/DESIGN.md.lock.yaml`
38
50
 
39
- `reference-pool.yaml` is read as **deviate-from**, not imitate-this.
51
+ The brand identity is governed by root `DESIGN.md`. The lock yaml records
52
+ its sha256 at `/qfai-sdd` Phase 0 freeze. The loop refuses to run if the
53
+ current `DESIGN.md` hash does not match the lock.
40
54
 
41
55
  ## Required Process
42
56
 
43
57
  ### Step 2-A — Verify Contract Preconditions
44
58
 
45
- - Confirm the selected spec is UI-bearing and has a supported `surface` value.
46
- - Confirm `.qfai/contracts/ui/*.yaml` and design contracts exist before generation.
47
- - Run `qfai prototyping preflight --target-url <url>` or `qfai doctor --profile prototyping`.
59
+ - Confirm the selected spec is UI-bearing and has a supported `surface`.
60
+ - Confirm root `DESIGN.md` and `.qfai/contracts/design/DESIGN.md.lock.yaml`
61
+ both exist; confirm `.qfai/contracts/ui/*.yaml` exists.
62
+ - Run `qfai prototyping preflight --target-url <url>` (alias for
63
+ `qfai doctor --profile prototyping`) — verifies DESIGN.md parses and
64
+ matches the lock sha256.
48
65
 
49
66
  ### Step 2-B — Verify Environment Preconditions
50
67
 
51
68
  - Confirm a capture route exists for each declared screen.
52
- - Use `npx --no-install playwright-cli` or `node_modules/.bin/playwright-cli` when PATH reachability is uncertain.
53
-
54
- 1. **Seed (cycle 0)**
55
- - Run `qfai prototyping iterate --cycle 0 --target-url <url>`.
56
- - Generator (product-experience-architect) reads contracts + `references/generator-prompt.md`.
57
- - Generator writes `.qfai/prototypes/iter-00/index.html` (one self-contained file).
58
- - Capture + review (steps 2-a / 2-b).
59
- - Append entry to `prototyping.json#iterations[]`. Commit `prototyping: iter-00`.
60
-
61
- 2. **Loop (cycle 1..14)**
62
- - **(a) Capture** (devops-ci-engineer): playwright-cli writes `iter-NN/<screen>.{png,html}`.
63
- - **(b) Review** (product-surface-reviewer): per `references/reviewer-prompt.md`, write `iter-NN/review.json` with 4-axis ordinal scores, 200–500 word prose critique, `slopPatternsDetected[]`, and `pivotDirective`.
64
- - **(c) Update** `prototyping.json#iterations[]` and `progress.md`. Commit `prototyping: iter-NN`.
65
- - **(d) Iterate**: run `qfai prototyping iterate --cycle <n+1>`.
66
- - exit `0` continue. Generator reads `pivotDirective` and produces iter-(n+1).
67
- - exit `64` all axes exceptional, go to step 3.
68
- - exit `65` → 15 cycles reached, go to step 3.
69
-
70
- 3. **Handoff**
71
- - Mirror latest iter to `.qfai/prototypes/final/index.html`.
72
- - Per `references/handoff.md`: extract `design-system.yaml`, write `prototype-handoff.yaml`.
73
- - Run `qfai prototyping certify`.
74
- - Run `qfai validate --profile prototyping --fail-on error` and `/qfai-verify`.
69
+ - Use `npx --no-install playwright-cli` or
70
+ `node_modules/.bin/playwright-cli` when PATH reachability is uncertain.
71
+
72
+ ### Step 2-C Run the Loop
73
+
74
+ | Step | Actor | Action | Output |
75
+ | ------ | --------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------- |
76
+ | C0 | product-experience-architect | `qfai prototyping iterate --cycle 0 --target-url <url>`. CLI computes `sha256(DESIGN.md)`; lock match enforced. Generator reads contracts + `references/generator-prompt.md` + DESIGN.md tokens and writes `.qfai/prototypes/iter-00/index.html`. Capture + review → `iter-00/review.json`. Append entry; commit `prototyping: iter-00`. | iter-00, prototyping.json#designMdSha256 |
77
+ | C1..14 | (a) devops, (b) reviewer, (c) orchestrator, (d) generator | (a) playwright-cli writes `iter-NN/<screen>.{png,html}`; (b) reviewer writes `iter-NN/review.json` per `references/reviewer-prompt.md` (4 UX axes ordinal, 200..500 word critique, `layoutAntiPatternsDetected[]`, `designMdViolations[]`, `pivotDirective`); (c) update `prototyping.json#iterations[]` + `progress.md`, commit `prototyping: iter-NN`; (d) `qfai prototyping iterate --cycle <n+1>` decides exit. | iter-NN, exit ∈ {0, 64, 65, 2} |
78
+ | H | orchestrator | Mirror latest to `.qfai/prototypes/final/index.html`. Per `references/handoff.md`: write `design-system.yaml` (deterministic DESIGN.md token mirror, no HTML extraction) + `prototype-handoff.yaml`. Run `qfai validate --profile prototyping --fail-on error` (produces `validate.json` with `counts.error === 0`), then `/qfai-verify` (produces `verify.json` with `status === "PASS"`), then `qfai prototyping certify` — certify requires both gate files to be present and passing before it will seal the certificate. | DONE |
79
+
80
+ **Exit codes**: `0` continue (read `pivotDirective`); `64` convergence (4
81
+ axes `exceptional` AND `layoutAntiPatternsDetected` empty AND
82
+ `designMdViolations` empty); `65` 15 cycles reached; `2` input error
83
+ (incl. DESIGN.md hash mismatch re-run prototyping from cycle 0 after
84
+ editing `DESIGN.md` and refreezing the lock via `/qfai-sdd` Phase 0).
75
85
 
76
86
  ## Evaluator Inputs (Mandatory)
77
87
 
78
88
  - Screenshot evidence path: `.qfai/evidence/prototyping/iter-NN/<screen>.png`
79
89
  - HTML snapshot path: `.qfai/evidence/prototyping/iter-NN/<screen>.html`
80
- - Review inputs: latest screenshot, latest HTML snapshot, prior `review.json` files, `progress.md`, and `reference-pool.yaml` as deviate-from input.
90
+ - Review inputs: latest screenshot, latest HTML snapshot, prior
91
+ `review.json` files, `progress.md`, root `DESIGN.md` (read-only),
92
+ `axisDefs`, `previousScore`, `designSystemChecklist`.
81
93
 
82
94
  ## Critical Constraints
83
95
 
84
- - DO NOT generate parallel candidates. One lineage only.
85
- - DO NOT preserve elements out of caution; the latest iter is always accepted.
86
- - DO NOT declare DONE before `qfai prototyping certify --check` returns 0.
87
- - DO NOT add `mode/round/polish/branch/concept-fit/design-system-compliance` artifacts.
88
- - DO NOT score similarity to `reference-pool` positively; it is deviate-from input.
96
+ - One lineage only — no parallel candidates, no best-of-history; the
97
+ latest iter is always accepted.
98
+ - `DESIGN.md` is frozen for the run; to change it, edit + rerun
99
+ `/qfai-sdd` to refreeze + start cycle 0.
100
+ - Token-only colors / fonts / radii / shadows non-DESIGN.md hex / rgb /
101
+ rgba / hsl / font / radius / shadow values are recorded in
102
+ `designMdViolations[]` and block exit 64.
103
+ - DONE only when `qfai prototyping certify --check` returns 0.
104
+ - No `mode / round / polish / branch / concept-fit` artifacts.
89
105
 
90
106
  ## Delegation Scope Table
91
107
 
@@ -99,11 +115,16 @@ Produce an artifact in which a creative breakthrough has emerged through serial
99
115
 
100
116
  - Check Drift Protocol compliance before DONE.
101
117
  - Check `.qfai/assistant/steering/test-layers.md` alignment.
102
- - Treat reviewer findings as signals, not gates, unless certify/validate/verify fails.
118
+ - Treat reviewer findings as signals, not gates, unless
119
+ certify/validate/verify fails.
103
120
 
104
121
  ## Completion
105
122
 
106
- DONE = `completion-certificate.json` exists AND `qfai prototyping certify --check` returns 0 AND `/qfai-verify` returns PASS.
123
+ DONE = `completion-certificate.json` exists AND
124
+ `qfai prototyping certify --check` returns 0 AND `/qfai-verify` returns
125
+ PASS.
126
+
127
+ Follow `.qfai/assistant/instructions/shared-skill-operating-baseline.md#gate-failure-autorepair-protocol` for validate, doctor, and quality-gate failures.
107
128
 
108
129
  ## Next
109
130