qfai 1.7.13 → 1.7.15

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 (74) hide show
  1. package/README.md +35 -8
  2. package/assets/init/.qfai/assistant/agents/frontend-engineer.md +2 -2
  3. package/assets/init/.qfai/assistant/agents/product-experience-architect.md +2 -2
  4. package/assets/init/.qfai/assistant/agents/product-surface-reviewer.md +1 -1
  5. package/assets/init/.qfai/assistant/instructions/agent-selection.md +2 -0
  6. package/assets/init/.qfai/assistant/instructions/shared-skill-delegation-baseline.md +88 -0
  7. package/assets/init/.qfai/assistant/instructions/shared-skill-operating-baseline.md +49 -0
  8. package/assets/init/.qfai/assistant/skills/qfai-atdd/SKILL.md +28 -88
  9. package/assets/init/.qfai/assistant/skills/qfai-configure/SKILL.md +50 -114
  10. package/assets/init/.qfai/assistant/skills/qfai-discussion/SKILL.md +137 -208
  11. package/assets/init/.qfai/assistant/skills/qfai-discussion/references/design-md-brand-catalog.md +90 -0
  12. package/assets/init/.qfai/assistant/skills/qfai-discussion/references/discussion-completion-matrix.md +26 -0
  13. package/assets/init/.qfai/assistant/skills/qfai-discussion/references/discussion-coverage-checklist.md +20 -0
  14. package/assets/init/.qfai/assistant/skills/qfai-discussion/references/example-mapping-guide.md +18 -0
  15. package/assets/init/.qfai/assistant/skills/qfai-discussion/references/oq-and-deferred-rules.md +41 -0
  16. package/assets/init/.qfai/assistant/skills/qfai-discussion/references/review-cycle-playbook.md +22 -0
  17. package/assets/init/.qfai/assistant/skills/qfai-discussion/references/ui-bearing-playbook.md +50 -0
  18. package/assets/init/.qfai/assistant/skills/qfai-discussion/references/ui_ux/platform_baselines.md +107 -0
  19. package/assets/init/.qfai/assistant/skills/qfai-discussion/references/ui_ux/review_audit_playbook.md +104 -0
  20. package/assets/init/.qfai/assistant/skills/qfai-discussion/references/ui_ux/trend_scan_playbook.md +76 -0
  21. package/assets/init/.qfai/assistant/skills/qfai-discussion/references/ui_ux_best_practices.md +143 -1005
  22. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/01_Context.md +9 -0
  23. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/03_Story-Workshop.md +1 -1
  24. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/04_Sources.md +83 -32
  25. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/14_Review-Request.md +7 -7
  26. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/prototyping.yaml +12 -4
  27. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/review/Rxx_reviewer.md +2 -2
  28. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/review/review_request.md +2 -2
  29. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/uiux/10_implementation_strategy.md +31 -13
  30. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/uiux/12_design_system.md +115 -0
  31. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/uiux/21_design_eval_trend_derived.md +86 -24
  32. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/uiux/23_design_eval_aggregate.md +12 -0
  33. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/uiux/40_screen_contracts.md +1 -1
  34. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/uiux/50_review_input_bundle.md +2 -0
  35. package/assets/init/.qfai/assistant/skills/qfai-implement/SKILL.md +27 -27
  36. package/assets/init/.qfai/assistant/skills/qfai-prototyping/SKILL.md +145 -155
  37. package/assets/init/.qfai/assistant/skills/qfai-sdd/SKILL.md +118 -355
  38. package/assets/init/.qfai/assistant/skills/qfai-sdd/references/review-cycle-playbook.md +30 -0
  39. package/assets/init/.qfai/assistant/skills/qfai-sdd/references/sdd-execution-playbook.md +29 -0
  40. package/assets/init/.qfai/assistant/skills/qfai-sdd/references/sdd-phase-checklists.md +37 -0
  41. package/assets/init/.qfai/assistant/skills/qfai-sdd/references/sdd-quality-gate.md +32 -0
  42. package/assets/init/.qfai/assistant/skills/qfai-sdd/references/spec-traceability-rules.md +33 -0
  43. package/assets/init/.qfai/assistant/skills/qfai-verify/SKILL.md +50 -115
  44. package/assets/init/.qfai/assistant/steering/agent-catalog.yml +1 -1
  45. package/assets/init/.qfai/assistant/steering/agent-routing.yml +20 -8
  46. package/assets/init/.qfai/assistant/steering/manifest.md +4 -7
  47. package/assets/init/.qfai/assistant/steering/product.md +6 -6
  48. package/assets/init/.qfai/assistant/steering/review-profiles.yml +3 -0
  49. package/assets/init/.qfai/assistant/steering/ui-definition-protocol.md +7 -7
  50. package/assets/init/.qfai/contracts/README.md +15 -8
  51. package/assets/init/.qfai/contracts/ui/README.md +24 -26
  52. package/assets/init/.qfai/discussion/README.md +35 -32
  53. package/assets/init/.qfai/evidence/README.md +65 -181
  54. package/assets/init/.qfai/evidence/calibration.yaml +26 -0
  55. package/assets/init/.qfai/review/README.md +56 -11
  56. package/assets/init/.qfai/specs/README.md +2 -2
  57. package/assets/init/root/qfai.config.yaml +5 -6
  58. package/assets/scripts/capture-screenshots.js +128 -0
  59. package/assets/uix-rev/comparison-review.md +3 -15
  60. package/assets/uix-rev/contracts-review.md +5 -2
  61. package/assets/uix-rev/scoring-review.md +10 -2
  62. package/assets/uix-rev/strategy-review.md +11 -7
  63. package/dist/cli/index.cjs +8532 -4204
  64. package/dist/cli/index.cjs.map +1 -1
  65. package/dist/cli/index.mjs +8599 -4271
  66. package/dist/cli/index.mjs.map +1 -1
  67. package/dist/index.cjs +9808 -5532
  68. package/dist/index.cjs.map +1 -1
  69. package/dist/index.d.cts +467 -277
  70. package/dist/index.d.ts +467 -277
  71. package/dist/index.mjs +8909 -4647
  72. package/dist/index.mjs.map +1 -1
  73. package/package.json +1 -1
  74. package/assets/uix-rev/migration-review.md +0 -17
@@ -49,14 +49,12 @@ When no explicit argument is given, detect the candidate spec and constrain exec
49
49
 
50
50
  ## User Questions (AskUserQuestion Protocol)
51
51
 
52
- - When a question to the user is needed (e.g., exception handling, scope confirmation),
53
- the agent MUST use AskUserQuestion if the tool is available.
54
- - When AskUserQuestion supports structured choices (radio/multi-select),
55
- the agent MUST prefer structured choices over free-text input.
56
- - If AskUserQuestion is technically unavailable, present the same question as a normal message
57
- with explicit numbered choices.
58
- The agent SHOULD preserve structured choice semantics (enumerated options, selection constraints).
59
- The reason for unavailability MUST be stated.
52
+ Follow `.qfai/assistant/instructions/shared-skill-operating-baseline.md#user-questions-askuserquestion-protocol`.
53
+
54
+ Skill-specific examples:
55
+
56
+ - exception handling
57
+ - scope confirmation
60
58
 
61
59
  ## CRITICAL CONSTRAINTS (Read First)
62
60
 
@@ -77,8 +75,12 @@ Execute the TDD micro-cycle for each pending item in `test-list.md`, transitioni
77
75
  ## Visual Review Guard
78
76
 
79
77
  - Review rendered output, screenshot evidence, or HTML output before closing any UI-affecting item.
80
- - Read the sidecar family first (selected direction, strategy, screen contracts) whenever implementation touches UI or critique-driven behavior.
81
- - Read order: option comparison (30_option_comparison.md) → selected anchor screen (31_selected_anchor_screen.md) → strategy (10_implementation_strategy.md) → taste interview (11_design_taste_interview.md) → trend scan (04_Sources.md) → 3-layer evaluation family (20/21/22/23 + optional 24) → screen contracts (40_screen_contracts.md) → review input bundle (50_review_input_bundle.md) → optional design tokens → optional fallback mock → mermaid flows.
78
+ - Read the sidecar family first (selected anchor, strategy, screen contracts) whenever implementation touches UI or critique-driven behavior.
79
+ - Read order: option comparison (30_option_comparison.md) → selected anchor screen (31_selected_anchor_screen.md) →
80
+ strategy (10_implementation_strategy.md) → taste interview (11_design_taste_interview.md) →
81
+ trend scan (04_Sources.md#Trend Scan) → 3-layer evaluation family (20/21/22/23 + optional 24) →
82
+ screen contracts (40_screen_contracts.md) → review input bundle (50_review_input_bundle.md) →
83
+ optional design tokens → optional fallback mock → mermaid flows.
82
84
  - If code intent and rendered output diverge, treat the rendered/HTML result as the blocking review input and reconcile before DONE.
83
85
 
84
86
  ## Non-goals
@@ -158,18 +160,21 @@ When transitioning to `exception`:
158
160
 
159
161
  ## Sub-agent Delegation (MANDATORY)
160
162
 
163
+ Follow `.qfai/assistant/instructions/shared-skill-delegation-baseline.md`.
164
+
161
165
  ### Orchestrator Protocol (MUST)
162
166
 
163
- - Orchestrator reads `test-list.md`, determines the next pending item, and delegates each TDD phase.
164
- - Orchestrator MUST NOT write test or production code directly.
165
- - Orchestrator updates `test-list.md` status after each phase completes.
167
+ - Orchestrator MUST NOT write test or production code directly; delegate every TDD phase to the routed implementation agents.
168
+ - Additional implement-specific overrides:
169
+ - read `test-list.md`, determine the next pending item, and delegate each TDD phase;
170
+ - update `test-list.md` status after each phase completes.
166
171
 
167
172
  ### Formal Sub-agent Roster
168
173
 
169
174
  This skill delegates through the centralized routing policy in `.qfai/assistant/steering/agent-routing.yml`.
170
175
 
171
176
  - `delivery-planner`
172
- - reads `test-list.md`, selects the next pending item, enforces Red-Green-Refactor ordering, and decides parallel safety
177
+ - reads `test-list.md`, selects the next pending item, enforces Red-Green-Refactor ordering, and is the sole authority for parallel dispatch decisions
173
178
  - `frontend-engineer` / `backend-engineer`
174
179
  - implement the selected item only, write the failing test first, write minimal passing code, and refactor without unrelated changes
175
180
  - `qa-gatekeeper`
@@ -194,28 +199,21 @@ All agent-to-agent transitions follow these contracts:
194
199
 
195
200
  ### Capability Probe (MUST)
196
201
 
197
- 1. Run one harmless Probe Task once at stage start.
198
- 2. If subagents are unavailable, explicitly ask for Simulation mode approval.
199
- 3. Without explicit approval, stop the stage.
202
+ - No additional overrides.
200
203
 
201
- ### Simulation mode (Opt-in only)
204
+ ### Delegation Failure (Hard Stop)
202
205
 
203
- - Allowed only when user explicitly states `Simulation mode allowed`.
204
- - Record both:
205
- - `Subagents: simulated (reason: <why unavailable>)`
206
- - `User approval: <quote or reference>`
206
+ - No additional overrides.
207
+ - Do not simulate roles. If the first required delegation fails, stop the stage and report remediation.
207
208
 
208
209
  ## Work Orders Summary
209
210
 
210
- Every major artifact in this stage MUST include this table schema:
211
-
212
- | Step | Role (sub-agent) | Task title | Input (refs) | Output (refs) | Status (PASS/REVISE) |
213
- | ---- | ---------------- | ---------- | ------------ | ------------- | -------------------- |
214
- | 1 | `role` | `task` | `refs` | `refs` | PASS/REVISE |
211
+ Use the shared schema (per-row `Status (PASS/REVISE)` column, reviewer response `Result: PASS | REVISE`).
215
212
 
216
213
  ### Reviewer Gate (MUST)
217
214
 
218
215
  - Delegate final completion gate to an independent Reviewer.
216
+ - Reviewer response must include `Result: PASS | REVISE` (matching shared-skill-delegation-baseline.md#reviewer-response-template).
219
217
  - Reviewer checks Drift Protocol compliance and alignment with `.qfai/assistant/steering/test-layers.md`.
220
218
  - Test volume floors/ratios are not gates; they are signals.
221
219
  - Do not declare DONE until Reviewer returns `PASS`; otherwise apply `REVISE`.
@@ -252,6 +250,8 @@ Every major artifact in this stage MUST include this table schema:
252
250
 
253
251
  ## Completion Contract (Shared)
254
252
 
253
+ Follow `.qfai/assistant/instructions/shared-skill-operating-baseline.md#completion-contract-shared`.
254
+
255
255
  ### Item completion checklist (10-point gate)
256
256
 
257
257
  An item in `test-list.md` may transition to `done` only when ALL of the following are satisfied:
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: qfai-prototyping
3
- title: QFAI Prototyping (All-spec runnable skeleton gate)
4
- description: "Implement a minimum runnable skeleton for ALL specs and block DONE until evidence + validate gate pass."
3
+ title: QFAI Prototyping (Full-Harness Only)
4
+ description: "Build a contract-aligned UI prototype and block completion until full-harness evidence and validate gate pass."
5
5
  argument-hint: "[--auto]"
6
6
  allowed-tools: [Read, Glob, Write, TodoWrite, Task, Bash]
7
7
  roles:
@@ -16,235 +16,225 @@ roles:
16
16
  product-surface-reviewer,
17
17
  qa-gatekeeper,
18
18
  ]
19
- routing-profile: ui-bearing
19
+ routing-profile: ui-surface-aware
20
20
  mode: execution-focused
21
21
  ---
22
22
 
23
- <!-- QFAI Skill Body (SSOT) -->
24
-
25
23
  ## /qfai-prototyping
26
24
 
27
25
  [DRIFT-PROTOCOL:MANDATORY]
28
26
 
29
- This skill is **static-first**. File-based checks and evidence are the default. Runtime-heavy verification is reserved for **explicit full-harness** runs only.
27
+ This skill is static-first for planning and file review, but the package execution contract is `full-harness` only.
28
+ Do not default or downgrade prototyping modes.
30
29
 
31
30
  ## CRITICAL CONSTRAINTS (Read First)
32
31
 
33
- - Scope is **ALL specs** from `.qfai/specs/spec-*`.
34
- - Evidence is mandatory in **markdown + json** under `.qfai/evidence/`.
35
- - `DONE is forbidden` until prototyping evidence, reviewer gate, and `qfai validate --fail-on error` pass.
36
- - `qfai prototyping run` is available as an auxiliary generate-side command, not the primary surface for this skill.
37
- - Defaulting to full-harness is prohibited.
38
- - If a required API endpoint still returns `404`, the run is incomplete.
39
- - `L1` and `L2` critique findings must be reflected in the evidence pack or justified as `REVISE`.
40
- - `uiFidelity` is the canonical UI evidence block for UI-bearing surfaces.
41
- - non-ui skip semantics must be preserved. UI-only placeholders are not required when the surface is non-ui.
42
- - Review rendered output, screenshot evidence, HTML snapshots, or preview artifacts before closing any UI-affecting run.
43
- - Read the canonical sidecar family first: option comparison / `30_option_comparison.md` -> selected anchor screen / `31_selected_anchor_screen.md` -> strategy / `10_implementation_strategy.md` -> taste interview / `11_design_taste_interview.md` -> trend scan / `04_Sources.md` -> 3-layer evaluation family (`20/21/22/23` + optional `24`) -> screen contracts / `40_screen_contracts.md` -> review input bundle / `50_review_input_bundle.md`.
32
+ - Scope is all specs from `.qfai/specs/spec-*`.
33
+ - Evidence is mandatory in markdown + json under `.qfai/evidence/`.
34
+ - DONE is forbidden until prototyping evidence, reviewer gate, and `qfai validate --fail-on error` pass.
35
+ - Supported prototyping surfaces are `web`, `mobile`, `desktop`, and `mixed`.
36
+ - `cli`, API-only, backend-only, and `ui_bearing: false` classifications are not prototyping execution targets.
37
+ - Canonical screen contracts in `discussion-*/uiux/40_screen_contracts.md` are mandatory.
38
+ - Browser QA, render evidence, runtimeGate, uiFidelity, specCoverage, and `fullHarness` are mandatory.
39
+ - `uiFidelity` is screen-level and must be built from real render/browser evidence.
40
+ - `mockPaths` is a negative-only issue ledger with `fail|finding` only.
41
+ - Calibration pack is the SSOT. Runtime and validator both resolve from `calibrationRef.packPath`.
42
+ - `--reviewer <id>` is mandatory and placeholder reviewer ids are rejected.
43
+ - L1 and L2 findings must be fixed or dispositioned before PASS.
44
44
 
45
45
  ## Goal
46
46
 
47
- Build the minimum runnable vertical slice for **ALL specs** and produce canonical prototyping evidence under `.qfai/evidence/`.
47
+ Build the minimum runnable slice for all specs and produce canonical `full-harness` evidence under `.qfai/evidence/`.
48
48
 
49
- ## Non-goals
49
+ ## Mode
50
50
 
51
- - Acceptance test automation (`/qfai-atdd`)
52
- - Contract redesign
53
- - Public CLI surface expansion
51
+ ### Full-harness
54
52
 
55
- ## Mode Selection Protocol
53
+ - Full-harness is the package default when prototyping execution is valid.
54
+ - Each `qfai prototyping run --mode full-harness --reviewer <id>` invocation records exactly one measured iteration.
55
+ - Multiple iterations are formed only by real code changes between runs.
56
+ - The runtime does not self-modify code and does not fabricate evidence.
56
57
 
57
- Mode selection precedence:
58
+ ## Obligation matrix
58
59
 
59
- 1. explicit request (`mode=low-cost|standard|full-harness`)
60
- 2. discussion recommendation from `prototyping.yaml`
61
- 3. default `standard`
60
+ | surface / mode | specs | runtimeGate | uiFidelity | render evidence | browser QA | fullHarness |
61
+ | ---------------------- | -------- | ----------- | ---------- | --------------- | ---------- | ----------- |
62
+ | web / full-harness | required | required | required | required | required | required |
63
+ | mobile / full-harness | required | required | required | required | required | required |
64
+ | desktop / full-harness | required | required | required | required | required | required |
65
+ | mixed / full-harness | required | required | required | required | required | required |
62
66
 
63
- Record in `prototyping.json`:
67
+ ## Required evidence
64
68
 
65
- - `mode.requested` (optional)
66
- - `mode.effective` (required)
67
- - `mode.source` (required)
68
- - `mode.rationale` (required)
69
- - `mode.discussionRecommendation` (optional)
69
+ ## Evidence (MANDATORY)
70
70
 
71
- ## Surface Semantics
71
+ - `.qfai/evidence/prototyping.md`
72
+ - `.qfai/evidence/prototyping.json`
73
+ - `.qfai/evidence/render.json`
74
+ - `.qfai/evidence/browser-qa.json`
75
+ - `.qfai/evidence/fullHarness.exit.json`
76
+ - `.qfai/evidence/fullHarness.handoff.json`
77
+ - `.qfai/evidence/fullHarness.fakeUiDetection.json`
72
78
 
73
- - `surface: non-ui` means UI-specific evidence is `n/a`.
74
- - For non-ui projects, `uiFidelity`, render evidence, browser QA, and `runtimeGate.ui` may be absent.
75
- - Absent is normal for non-ui. Do not force skipped placeholders unless the project intentionally emits them.
76
- - For UI-bearing projects, route/contract fidelity must be captured when `uiFidelity` is required by mode.
79
+ ## Truthfulness rules
77
80
 
78
- ## Prototyping Modes
81
+ - `mode.effective` must be `full-harness`.
82
+ - `runtimeGate` is observed-only. Synthetic status codes are invalid.
83
+ - `runtimeGate.evidenceRefs` must contain concrete render/browser QA/spec refs only.
84
+ - `specCoverage` must use concrete declared refs and concrete observed refs only.
85
+ - Browser QA evidence must be preserved per screen.
86
+ - `actionsWired` must reflect actionable control coverage, not finding counts.
87
+ - `reviewerSignoff.status` represents final decision, not mere completion.
88
+ - `reviewerLogs[].verdict` must align with decision/termination semantics.
79
89
 
80
- ### Low-cost
90
+ ## Review semantics
81
91
 
82
- - Static checks only.
83
- - Suitable for early skeleton work.
84
- - UI-bearing projects may include `uiFidelity` and render/browser artifacts, but they are optional.
85
- - `skeleton` mode is allowed for lightweight UI proof.
92
+ - `accepted` -> `approved`
93
+ - `rejected` -> `rejected`
94
+ - `abandoned` -> `abandoned`
95
+ - Plateau stop or max-iterations stop must not produce `approved`.
86
96
 
87
- ### Standard
97
+ ## Delegation Scope Table
88
98
 
89
- - Static checks plus optional light validation.
90
- - This is the default mode.
91
- - UI-bearing projects require `uiFidelity`.
92
- - Runtime gate, render bundle, and browser QA bundle are optional.
99
+ All sub-agent delegation in this skill MUST follow the category-to-role mapping below.
100
+ Assigning a task to a role not listed for the category is a violation and MUST be flagged.
93
101
 
94
- ### Full-harness
102
+ | Category | Allowed Role(s) |
103
+ | ------------------ | ------------------------------------------------------ |
104
+ | UI implementation | frontend-engineer, product-experience-architect |
105
+ | Screenshot capture | devops-ci-engineer |
106
+ | Evaluation L1-L2 | product-surface-reviewer, product-experience-architect |
107
+ | Build | devops-ci-engineer, backend-engineer |
95
108
 
96
- - Explicit opt-in only. Never auto-activate.
97
- - Adds runtime-heavy obligations and full-harness audit metadata.
98
- - UI-bearing projects require runtime gate, render bundle, browser QA bundle, and `fullHarness`.
99
- - Non-ui projects require `fullHarness`, but UI-specific bundles remain n/a.
109
+ Any delegation map entry that assigns a category to an undefined or unlisted role (e.g., `"generic-code-writer"`) MUST produce a violation finding naming the undefined role and the category.
100
110
 
101
- ## Obligation Matrix
111
+ ## Required process
102
112
 
103
- ### surface / mode
113
+ ### Step 0 — Execution Plan (executionPlan)
104
114
 
105
- | surface / mode | specs | runtimeGate | uiFidelity | render evidence | browser QA | fullHarness |
106
- | ------------------------- | -------- | ----------- | --------------------------------- | ------------------------------------ | ------------ | ------------ |
107
- | non-ui / low-cost | required | optional | n/a | n/a | n/a | absent |
108
- | non-ui / standard | required | optional | n/a | n/a | n/a | absent |
109
- | non-ui / full-harness | required | optional | n/a | n/a | n/a | required |
110
- | ui-bearing / low-cost | required | optional | optional (`skeleton` allowed) | optional (`captured/skipped/failed`) | optional | absent |
111
- | ui-bearing / standard | required | optional | **required** (`interactive` only) | optional (`captured/skipped/failed`) | optional | absent |
112
- | ui-bearing / full-harness | required | required | **required** (`interactive` only) | **required** | **required** | **required** |
115
+ Before any code is written, create an `executionPlan` record with the following fields:
113
116
 
114
- `uiFidelity.mode` policy:
117
+ - `targetIterations`: integer; minimum 2 for full-harness
118
+ - `evaluationAxesSource`: reference to the discussion pack evaluation-family files (20/21/22/23)
119
+ - `delegationMap`: category-to-role assignments per Delegation Scope Table above
120
+ - `plannedAt`: ISO-8601 timestamp
115
121
 
116
- - `low-cost`: `skeleton` or `interactive`
117
- - `standard`: `interactive` only — `skeleton` is rejected by the validator
118
- - `full-harness`: `interactive` only — `skeleton` is rejected; render evidence, Browser QA, runtimeGate, and fullHarness block are all required
119
- - `non-ui`: `uiFidelity` is not emitted
122
+ The executionPlan MUST be present in `prototyping.json` when `mode=full-harness`. A validator MUST reject any full-harness record without an executionPlan.
120
123
 
121
- Interpretation:
124
+ ### Iteration Gate
122
125
 
123
- - `required`: validator enforces presence and completeness
124
- - `optional`: if present, schema must be valid; if absent, no issue
125
- - `n/a`: absent is normal success
126
+ - full-harness convergence requires a minimum of 2 iterations.
127
+ - A single-iteration run that reports `converged=true` is invalid; the iteration gate MUST raise an error with message "minimum 2 iterations required before convergence".
128
+ - The phase transition from iteration N to N+1 is blocked until `terminationCondition` is met or the gate explicitly authorizes continuation.
126
129
 
127
- ## Required Evidence
130
+ ### 5-Step Iteration Cycle
128
131
 
129
- ### Evidence (MANDATORY)
132
+ Each full-harness iteration follows this fixed sequence:
130
133
 
131
- - `.qfai/evidence/prototyping.md`
132
- - `.qfai/evidence/prototyping.json`
133
- - `.qfai/evidence/render.json` when render evidence is emitted or required by mode
134
- - `.qfai/evidence/browser-qa.json` when browser QA evidence is emitted or required by mode
135
- - `Coverage Matrix` covering all specs
136
- - critique summary with `L1` / `L2` findings and disposition
134
+ 1. **Capture** — Run `packages/qfai/assets/scripts/capture-screenshots.js --url <url> --out <dir>` and record screenshot paths with timestamps under `scoringTrace[i].screenshotDir`.
135
+ 2. **Evaluate** — Launch L1 and L2 evaluator sub-agents with full context bundle: (a) screenshots from Step 1, (b) axisDefs from evaluation-family 20/21/22/23, (c) previousScore from prior iteration, (d) designSystemChecklist from `uiux/12_design_system.md`.
136
+ 3. **Identify** Aggregate L1 + L2 findings; flag immediate-fix items.
137
+ 4. **Fix** Apply fixes per finding disposition; do not close items without evidence.
138
+ 5. **Re-evaluate** Re-run Steps 1–4; compare new score to prior score to check plateau.
137
139
 
138
- ### low-cost obligations
140
+ The sequence MUST NOT be permuted. Parallel execution of Capture+Evaluate is prohibited.
139
141
 
140
- - always: `specs[]`, `meta.generatedAt`, `meta.toolVersion`, `meta.commands[]`, `mode.*`
141
- - ui-bearing: `uiFidelity` optional, render/browser optional
142
- - non-ui: UI-specific evidence is n/a
142
+ ### Evaluator Input 4 Required Elements
143
143
 
144
- ### standard obligations
144
+ When launching any L1 or L2 evaluator sub-agent, all 4 elements MUST be present in the input:
145
145
 
146
- - always: `specs[]`, `meta.*`, `mode.*`
147
- - ui-bearing: `uiFidelity` required
148
- - non-ui: UI-specific evidence is n/a
149
- - runtime gate and browser QA remain optional
146
+ (a) screenshots — paths produced by capture-screenshots.js for the current iteration
147
+ (b) axisDefs — scoring axes from discussion-pack evaluation-family (20/21/22/23)
148
+ (c) previousScore aggregate score from the prior iteration (null for iteration 1)
149
+ (d) designSystemChecklist the compliance checklist derived from `uiux/12_design_system.md`
150
150
 
151
- ### full-harness obligations
151
+ If any element is missing, a reviewer check MUST raise a finding naming the missing element.
152
+ Missing element (d) is a common error when `uiux/12_design_system.md` is absent; the reviewer MUST still flag it.
152
153
 
153
- - always: `specs[]`, `meta.*`, `mode.*`, `fullHarness`
154
- - ui-bearing: `runtimeGate`, `.qfai/evidence/render.json`, `.qfai/evidence/browser-qa.json`, `uiFidelity`
155
- - non-ui: UI-specific evidence remains n/a
154
+ ### Visual Quality Structural Checklist
156
155
 
157
- ## Full-harness minimum completeness
156
+ Each iteration evaluation MUST score all 6 visual categories:
158
157
 
159
- When `mode.effective = full-harness`, record:
158
+ 1. Color color palette adherence to design system tokens
159
+ 2. Typography — type scale, weight, line-height compliance
160
+ 3. Spacing — spacing scale and grid alignment
161
+ 4. Border radius — border-radius consistency across components
162
+ 5. Shadow — shadow elevation and opacity standards
163
+ 6. Do's&Don'ts — adherence to explicit do/don't rules from `uiux/12_design_system.md`
160
164
 
161
- - `fullHarness.enabled = true`
162
- - `fullHarness.available`
163
- - `fullHarness.runId`
164
- - `fullHarness.iterationCount >= 1`
165
- - `fullHarness.bestIteration >= 1`
166
- - `fullHarness.terminationReason`
167
- - `fullHarness.reviewerSignoff`
168
- - `fullHarness.scoringTrace`
165
+ ### Lighthouse Gate (MUST for web full-harness)
169
166
 
170
- ## Canonical Bundles
167
+ When `surface=web` and `mode=full-harness`, a Lighthouse performance/accessibility report MUST be captured and attached to the evidence. The reviewer gate MUST raise an error "Lighthouse Gate is MUST for full-harness + web surface" when the report is absent.
171
168
 
172
- - render bundle: `.qfai/evidence/render.json`
173
- - browser QA bundle: `.qfai/evidence/browser-qa.json`
169
+ ### Steps (continued)
174
170
 
175
- Render bundle uses `captured | skipped | failed`.
176
- Browser QA bundle uses `completed | skipped | failed`.
171
+ 1. Read the latest discussion pack and verify `prototyping.yaml`, `04_Sources.md`, `20/21/22/23`, and `40_screen_contracts.md`.
172
+ Read order: option comparison / `30_option_comparison.md` -> selected anchor screen / `31_selected_anchor_screen.md` -> strategy / `10_implementation_strategy.md` -> taste interview / `11_design_taste_interview.md` -> trend scan / `04_Sources.md` -> 3-layer evaluation family (`20/21/22/23`) -> screen contracts / `40_screen_contracts.md`.
173
+ 2. Verify the classification is UI-bearing and the surface is `web`, `mobile`, `desktop`, or `mixed`.
174
+ 3. Create the executionPlan (Step 0 above).
175
+ 4. Implement the minimum runnable slice for all specs.
176
+ 5. Run `qfai prototyping run --mode full-harness --reviewer <id>` — this executes the 5-Step Iteration Cycle per iteration.
177
+ 6. Review render evidence, HTML snapshots, Browser QA, runtimeGate, uiFidelity, and specCoverage for every declared screen.
178
+ 7. Fix findings and rerun until the evidence is coherent.
179
+ 8. Run `qfai validate --fail-on error`.
180
+ 9. Route an independent reviewer and do not declare completion until the result is `PASS`.
177
181
 
178
- ## Required Process
182
+ ## Reviewer gate
179
183
 
180
- 1. Read `.qfai/specs/spec-*` and determine the surface and requested mode.
181
- 2. Build the minimum runnable slice across **ALL specs**.
182
- 3. Produce `prototyping.md` and `prototyping.json` with a complete Coverage Matrix.
183
- 4. If UI-bearing, capture `uiFidelity`; if full-harness, capture runtime gate, render bundle, and browser QA bundle.
184
- 5. Review rendered output, screenshot evidence, HTML snapshots, or preview artifacts against the canonical sidecar family.
185
- 6. Record critique findings, classify each as `L1` or `L2`, and either fix or mark the result `REVISE`.
186
- 7. Use the read order `option comparison (30_option_comparison.md) -> selected anchor screen (31_selected_anchor_screen.md) -> strategy (10_implementation_strategy.md) -> taste interview (11_design_taste_interview.md) -> trend scan (04_Sources.md) -> 3-layer evaluation family (20/21/22/23 + optional 24) -> screen contracts (40_screen_contracts.md) -> review input bundle (50_review_input_bundle.md)` when the project is UI-bearing.
187
- 8. Run `qfai validate --fail-on error`.
188
- 9. Route reviewer gate and do not declare completion until the result is `PASS`.
184
+ ### Reviewer Gate (MUST)
185
+
186
+ - Reviewer must verify full-harness evidence completeness.
187
+ - Reviewer response must include `Result: PASS | REVISE` (matching shared-skill-delegation-baseline.md#reviewer-response-template).
188
+ - Reviewer must verify calibration pack usage via `calibrationRef`.
189
+ - Reviewer must reject self-reference, synthetic refs, and `mockPaths.status="pass"`.
190
+ - Reviewer must verify `reviewerSignoff`, `reviewerLogs`, `terminationReason`, and `finalDecision` are semantically aligned.
191
+ - Reviewer must verify Drift Protocol compliance and alignment with `test-layers.md`.
192
+ - Review volume guidance remains signals, not gates.
193
+ - Reviewer returns PASS or REVISE only.
189
194
 
190
195
  ## Sub-agent Delegation (MANDATORY)
191
196
 
197
+ Follow `.qfai/assistant/instructions/shared-skill-delegation-baseline.md`.
198
+
192
199
  ### Orchestrator Protocol (MUST)
193
200
 
194
- - Orchestrator may only create work orders, delegate tasks, integrate outputs, and present results.
195
- - Orchestrator MUST NOT self-approve.
196
- - Orchestrator MUST keep evidence paths canonical and ensure outputs stay under `.qfai/evidence/`.
201
+ - Additional prototyping-specific overrides:
202
+ - do not self-approve;
203
+ - keep evidence paths canonical and integrate delegated results only.
197
204
 
198
205
  ### Capability Probe (MUST)
199
206
 
200
- 1. Run one harmless Probe Task once at stage start.
201
- 2. If subagents are unavailable, explicitly ask for Simulation mode approval.
202
- 3. Without explicit approval, stop the stage.
207
+ - No additional overrides.
203
208
 
204
- ### Simulation mode (Opt-in only)
209
+ ### Delegation Failure (Hard Stop)
205
210
 
206
- - Simulation mode allowed only when user explicitly states `Simulation mode allowed`.
207
- - Record both:
208
- - `Subagents: simulated (reason: <why unavailable>)`
209
- - `User approval: <quote or reference>`
211
+ - No additional overrides.
212
+ - Do not simulate roles. If the first required delegation fails, stop the stage and report remediation.
210
213
 
211
214
  ## Work Orders Summary
212
215
 
213
- Every major artifact in this stage MUST include this table schema:
214
-
215
- | Step | Role (sub-agent) | Task title | Input (refs) | Output (refs) | Status (PASS/REVISE) |
216
- | ---- | ---------------- | ---------- | ------------ | ------------- | -------------------- |
217
- | 1 | `role` | `task` | `refs` | `refs` | PASS/REVISE |
218
-
219
- ### Reviewer Gate (MUST)
220
-
221
- - Delegate final completion gate to an independent Reviewer.
222
- - Reviewer checks Drift Protocol compliance and alignment with `.qfai/assistant/steering/test-layers.md`.
223
- - Test volume floors/ratios are not gates; they are signals.
224
- - Reviewer must verify evidence obligations for the chosen `surface / mode`.
225
- - Do not declare DONE until Reviewer returns `PASS`; otherwise apply `REVISE`.
216
+ Use the shared schema (per-row `Status (PASS/REVISE)` column, reviewer response `Result: PASS | REVISE`).
226
217
 
227
218
  ## Completion Contract (Shared)
228
219
 
229
- Before DONE:
220
+ Follow `.qfai/assistant/instructions/shared-skill-operating-baseline.md#completion-contract-shared`.
221
+
222
+ Prototyping-specific additions:
230
223
 
231
- - package assets and generated evidence must match the obligation matrix
232
- - `qfai validate --fail-on error` must pass
233
- - reviewer gate must return PASS
234
- - UI-bearing runs must reconcile `uiFidelity`, render evidence, and critique outputs
235
- - non-ui runs must preserve `n/a` semantics without fake placeholders
224
+ - all specs are covered;
225
+ - full-harness evidence is complete and truthful;
226
+ - `qfai validate --fail-on error` passes;
227
+ - reviewer returns `PASS`.
236
228
 
237
229
  ## FINAL CHECKLIST (Check Last)
238
230
 
239
231
  ### Completion Checklist (MUST)
240
232
 
241
233
  - All specs are covered in the Coverage Matrix.
242
- - `prototyping.md` and `prototyping.json` are both updated.
243
- - Required mode/surface evidence is present.
244
- - `404` findings are resolved or the run is not complete.
245
- - `L1` / `L2` critique findings are documented and dispositioned.
246
- - `uiFidelity` is present when required.
247
- - Reviewer returned `PASS`; otherwise status is `REVISE`.
234
+ - Required full-harness evidence is present.
235
+ - 404 findings are resolved or the run is not complete.
236
+ - uiFidelity is present when required.
237
+ - Reviewer returned PASS; otherwise status is REVISE.
248
238
 
249
239
  ## Completion Message & Next Actions (MUST)
250
240