qfai 1.7.8 → 1.7.13

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 (150) hide show
  1. package/README.md +34 -70
  2. package/assets/init/.qfai/README.md +11 -16
  3. package/assets/init/.qfai/assistant/agents/acceptance-test-engineer.md +51 -0
  4. package/assets/init/.qfai/assistant/agents/architecture-reviewer.md +57 -0
  5. package/assets/init/.qfai/assistant/agents/backend-engineer.md +40 -31
  6. package/assets/init/.qfai/assistant/agents/completion-reviewer.md +48 -0
  7. package/assets/init/.qfai/assistant/agents/delivery-planner.md +52 -0
  8. package/assets/init/.qfai/assistant/agents/devops-ci-engineer.md +31 -28
  9. package/assets/init/.qfai/assistant/agents/discovery-analyst.md +50 -0
  10. package/assets/init/.qfai/assistant/agents/doc-steward.md +30 -20
  11. package/assets/init/.qfai/assistant/agents/frontend-engineer.md +40 -31
  12. package/assets/init/.qfai/assistant/agents/implementation-reviewer.md +58 -0
  13. package/assets/init/.qfai/assistant/agents/orchestrator.md +19 -2
  14. package/assets/init/.qfai/assistant/agents/product-experience-architect.md +59 -0
  15. package/assets/init/.qfai/assistant/agents/product-surface-reviewer.md +60 -0
  16. package/assets/init/.qfai/assistant/agents/qa-gatekeeper.md +53 -48
  17. package/assets/init/.qfai/assistant/agents/qa-strategist.md +49 -0
  18. package/assets/init/.qfai/assistant/agents/requirements-analyst.md +32 -29
  19. package/assets/init/.qfai/assistant/agents/requirements-reviewer.md +48 -0
  20. package/assets/init/.qfai/assistant/agents/solution-architect.md +59 -0
  21. package/assets/init/.qfai/assistant/agents/test-design-analyst.md +64 -0
  22. package/assets/init/.qfai/assistant/instructions/agent-selection.md +64 -50
  23. package/assets/init/.qfai/assistant/instructions/communication.md +17 -0
  24. package/assets/init/.qfai/assistant/instructions/constitution.md +36 -1
  25. package/assets/init/.qfai/assistant/instructions/drift-protocol.md +1 -1
  26. package/assets/init/.qfai/assistant/instructions/requirements-decomposition.md +20 -13
  27. package/assets/init/.qfai/assistant/instructions/workflow.md +2 -1
  28. package/assets/init/.qfai/assistant/skills/qfai-atdd/SKILL.md +32 -31
  29. package/assets/init/.qfai/assistant/skills/qfai-atdd/references/test-case-depth-checklist.md +80 -0
  30. package/assets/init/.qfai/assistant/skills/qfai-configure/SKILL.md +21 -15
  31. package/assets/init/.qfai/assistant/skills/qfai-discussion/SKILL.md +95 -61
  32. package/assets/init/.qfai/assistant/skills/qfai-discussion/references/rcp_footer.md +17 -85
  33. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/01_Context.md +9 -1
  34. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/02_Inception-Deck.md +1 -1
  35. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/03_Story-Workshop.md +17 -60
  36. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/04_Sources.md +69 -2
  37. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/06_REQ.md +1 -1
  38. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/07_NFR.md +1 -1
  39. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/09_Constraints.md +1 -1
  40. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/10_Policy.md +1 -1
  41. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/11_OQ-Register.md +1 -1
  42. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/12_OQ-Resolution-Log.md +1 -1
  43. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/13_Deferred.md +1 -1
  44. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/14_Review-Request.md +25 -16
  45. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/99_delta.md +1 -1
  46. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/prototyping.yaml +9 -0
  47. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/review/Rxx_reviewer.md +8 -4
  48. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/review/review_request.md +11 -7
  49. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/review/summary.json +6 -44
  50. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/uiux/00_index.md +29 -14
  51. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/uiux/10_implementation_strategy.md +20 -0
  52. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/uiux/11_design_taste_interview.md +45 -0
  53. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/uiux/20_design_eval_invariant.md +68 -0
  54. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/uiux/21_design_eval_trend_derived.md +68 -0
  55. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/uiux/22_design_eval_product_specific.md +68 -0
  56. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/uiux/23_design_eval_aggregate.md +41 -0
  57. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/uiux/24_design_eval_dynamic_overrides.md +28 -0
  58. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/uiux/30_option_comparison.md +56 -0
  59. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/uiux/31_selected_anchor_screen.md +42 -0
  60. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/uiux/40_screen_contracts.md +44 -0
  61. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/uiux/50_review_input_bundle.md +36 -0
  62. package/assets/init/.qfai/assistant/skills/qfai-implement/SKILL.md +65 -67
  63. package/assets/init/.qfai/assistant/skills/qfai-prototyping/SKILL.md +188 -267
  64. package/assets/init/.qfai/assistant/skills/qfai-sdd/SKILL.md +91 -57
  65. package/assets/init/.qfai/assistant/skills/qfai-sdd/references/rcp_footer.md +21 -80
  66. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/evidence/import-lite.md +1 -1
  67. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/_policies/11_Slice-Policy.md +50 -0
  68. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/spec/06_Test-Cases.md +23 -3
  69. package/assets/init/.qfai/assistant/skills/qfai-verify/SKILL.md +25 -17
  70. package/assets/init/.qfai/assistant/steering/agent-catalog.yml +194 -0
  71. package/assets/init/.qfai/assistant/steering/agent-routing.yml +176 -0
  72. package/assets/init/.qfai/assistant/steering/cli-ux-guidelines.md +49 -0
  73. package/assets/init/.qfai/assistant/steering/manifest.md +44 -19
  74. package/assets/init/.qfai/assistant/steering/product.md +53 -11
  75. package/assets/init/.qfai/assistant/steering/research-first-protocol.md +58 -0
  76. package/assets/init/.qfai/assistant/steering/review-gate.rules.yml +17 -66
  77. package/assets/init/.qfai/assistant/steering/review-profiles.yml +30 -0
  78. package/assets/init/.qfai/assistant/steering/structure.md +30 -16
  79. package/assets/init/.qfai/assistant/steering/tech.md +37 -21
  80. package/assets/init/.qfai/assistant/steering/ui-definition-protocol.md +54 -0
  81. package/assets/init/.qfai/contracts/README.md +10 -4
  82. package/assets/init/.qfai/contracts/design/README.md +32 -0
  83. package/assets/init/.qfai/contracts/ui/README.md +5 -3
  84. package/assets/init/.qfai/discussion/README.md +52 -5
  85. package/assets/init/.qfai/evidence/README.md +143 -116
  86. package/assets/init/.qfai/report/README.md +1 -1
  87. package/assets/init/.qfai/review/README.md +24 -9
  88. package/assets/init/.qfai/specs/README.md +5 -2
  89. package/assets/init/root/qfai.config.yaml +13 -0
  90. package/assets/uix-rev/comparison-review.md +24 -7
  91. package/assets/uix-rev/contracts-review.md +17 -10
  92. package/assets/uix-rev/scoring-review.md +42 -6
  93. package/assets/uix-rev/strategy-review.md +13 -9
  94. package/dist/cli/index.cjs +15646 -11383
  95. package/dist/cli/index.cjs.map +1 -1
  96. package/dist/cli/index.mjs +10846 -6582
  97. package/dist/cli/index.mjs.map +1 -1
  98. package/dist/index.cjs +10885 -6287
  99. package/dist/index.cjs.map +1 -1
  100. package/dist/index.d.cts +766 -198
  101. package/dist/index.d.ts +766 -198
  102. package/dist/index.mjs +10858 -6263
  103. package/dist/index.mjs.map +1 -1
  104. package/package.json +11 -3
  105. package/assets/init/.qfai/assistant/agents/architect-reviewer.md +0 -65
  106. package/assets/init/.qfai/assistant/agents/architect.md +0 -49
  107. package/assets/init/.qfai/assistant/agents/atdd-api-implementer.md +0 -49
  108. package/assets/init/.qfai/assistant/agents/atdd-e2e-implementer.md +0 -48
  109. package/assets/init/.qfai/assistant/agents/atdd-integration-implementer.md +0 -48
  110. package/assets/init/.qfai/assistant/agents/backend-reviewer.md +0 -66
  111. package/assets/init/.qfai/assistant/agents/code-reviewer.md +0 -67
  112. package/assets/init/.qfai/assistant/agents/contract-designer.md +0 -49
  113. package/assets/init/.qfai/assistant/agents/coverage-planner.md +0 -49
  114. package/assets/init/.qfai/assistant/agents/design-owner.md +0 -48
  115. package/assets/init/.qfai/assistant/agents/design-review-lead.md +0 -68
  116. package/assets/init/.qfai/assistant/agents/facilitator.md +0 -48
  117. package/assets/init/.qfai/assistant/agents/frontend-reviewer.md +0 -66
  118. package/assets/init/.qfai/assistant/agents/interviewer.md +0 -45
  119. package/assets/init/.qfai/assistant/agents/option-explorer.md +0 -51
  120. package/assets/init/.qfai/assistant/agents/option-reviewer.md +0 -66
  121. package/assets/init/.qfai/assistant/agents/oq-harvester.md +0 -50
  122. package/assets/init/.qfai/assistant/agents/oq-reviewer.md +0 -70
  123. package/assets/init/.qfai/assistant/agents/planner.md +0 -48
  124. package/assets/init/.qfai/assistant/agents/project-lead.md +0 -47
  125. package/assets/init/.qfai/assistant/agents/prototyping-coverage-auditor.md +0 -46
  126. package/assets/init/.qfai/assistant/agents/qa-engineer.md +0 -47
  127. package/assets/init/.qfai/assistant/agents/qa-lead.md +0 -44
  128. package/assets/init/.qfai/assistant/agents/qa-reviewer.md +0 -66
  129. package/assets/init/.qfai/assistant/agents/researcher.md +0 -47
  130. package/assets/init/.qfai/assistant/agents/reviewer.md +0 -62
  131. package/assets/init/.qfai/assistant/agents/runtime-gatekeeper.md +0 -46
  132. package/assets/init/.qfai/assistant/agents/test-case-owner.md +0 -53
  133. package/assets/init/.qfai/assistant/agents/test-engineer.md +0 -50
  134. package/assets/init/.qfai/assistant/agents/test-volume-estimator.md +0 -48
  135. package/assets/init/.qfai/assistant/agents/ui-ux-reviewer.md +0 -71
  136. package/assets/init/.qfai/assistant/agents/unit-test-scope-enforcer.md +0 -46
  137. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/uiux/10_strategy.md +0 -28
  138. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/uiux/20_eval_axis_usability.md +0 -31
  139. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/uiux/21_eval_axis_consistency.md +0 -31
  140. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/uiux/22_eval_axis_accessibility.md +0 -31
  141. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/uiux/23_eval_axis_delight.md +0 -56
  142. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/uiux/30_comparison.md +0 -45
  143. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/uiux/31_anchor.md +0 -27
  144. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/uiux/40_contracts.md +0 -51
  145. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/uiux/50_review_bundle.md +0 -31
  146. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/uiux/60_critique_loop.md +0 -23
  147. package/assets/init/.qfai/assistant/steering/review-roster.yml +0 -128
  148. package/assets/init/.qfai/evidence/.gitignore +0 -3
  149. package/assets/init/.qfai/report/.gitignore +0 -3
  150. package/assets/init/.qfai/review/.gitignore +0 -5
@@ -6,329 +6,250 @@ argument-hint: "[--auto]"
6
6
  allowed-tools: [Read, Glob, Write, TodoWrite, Task, Bash]
7
7
  roles:
8
8
  [
9
- FullStackEngineer,
10
- BackendEngineer,
11
- FrontendEngineer,
12
- DBEngineer,
13
- DevOpsCIEngineer,
14
- QAEngineer,
15
- RuntimeGatekeeper,
16
- UIUXReviewer,
17
- CodeReviewer,
9
+ orchestrator,
10
+ delivery-planner,
11
+ product-experience-architect,
12
+ frontend-engineer,
13
+ backend-engineer,
14
+ devops-ci-engineer,
15
+ completion-reviewer,
16
+ product-surface-reviewer,
17
+ qa-gatekeeper,
18
18
  ]
19
+ routing-profile: ui-bearing
19
20
  mode: execution-focused
20
21
  ---
21
22
 
22
- <!--
23
- QFAI Skill Body (SSOT)
24
- - This file is intended to be referenced by tool-specific wrappers (e.g., GitHub/Claude/Codex skills).
25
- - Keep wrappers thin and route users to this skill body.
26
- -->
23
+ <!-- QFAI Skill Body (SSOT) -->
27
24
 
28
25
  ## /qfai-prototyping
29
26
 
30
27
  [DRIFT-PROTOCOL:MANDATORY]
31
28
 
32
- ## User Questions (AskUserQuestion Protocol)
33
-
34
- - When a question to the user is needed (e.g., implementation scope decisions, runtime environment confirmation),
35
- the agent MUST use AskUserQuestion if the tool is available.
36
- - When AskUserQuestion supports structured choices (radio/multi-select),
37
- the agent MUST prefer structured choices over free-text input.
38
- - If AskUserQuestion is technically unavailable, present the same question as a normal message
39
- with explicit numbered choices.
40
- The agent SHOULD preserve structured choice semantics (enumerated options, selection constraints).
41
- The reason for unavailability MUST be stated.
42
-
43
- Run prototyping as an **all-spec stage**. Scope is fixed to **ALL specs** resolved from `.qfai/specs/spec-*`.
44
-
45
- This stage is complete only when all specs pass the minimum runtime contract:
46
-
47
- - UI routes are reachable (no dead `#` links for primary flows).
48
- - API endpoints return non-404 statuses.
49
- - DB objects needed for runtime are present (real DB or documented in-memory substitute).
50
- - Evidence is captured and validate can enforce it.
51
-
52
- ## Visual Review Guard
53
-
54
- - Review rendered output, screenshot captures, or generated HTML for every UI-affecting slice; code-only inspection is insufficient.
55
- - Read the DDP (Design Direction Pack) first before comparing visuals or wiring critique outcomes into implementation.
56
- - Read order: DDP -> Design Token -> UI Contract -> HTML Mock -> Flow.
57
- - If rendered/HTML evidence disagrees with code intent, fix the rendered result before declaring completion.
58
-
59
- ## Definition of Done by fidelity level (Mandatory)
60
-
61
- - L1 (`skeleton`):
62
- - Route-level rendering exists for declared primary screens.
63
- - Surface shape is visible, but interactions may remain minimally wired.
64
- - L2 (`interactive`, default):
65
- - Declared primary interactions are wired with mockable behavior.
66
- - At least one declared mock path is executed and recorded per primary flow set.
67
- - `uiFidelity` is produced in `prototyping.json`.
68
- - Default target is L2 (`interactive`).
69
- - If L1 fallback is chosen, record explicit user approval and rationale in evidence.
70
- - Placeholder-only pages (single static string, lorem ipsum, or equivalent) are `REVISE`.
71
-
72
- ## FORMAT SSOT (Mandatory)
73
-
74
- - Before writing or editing any `.qfai/**` artifact, read and follow the relevant directory README template and sample:
75
- - `.qfai/require/README.md`
76
- - `.qfai/specs/README.md`
77
- - `.qfai/contracts/**/README.md`
78
- - `.qfai/evidence/README.md`
79
- - Do not copy templates/samples into this prompt or into other prompt markdown.
80
- - Generated artifacts must match README-defined structure (headings, ordering, table columns).
81
- - Completion requires a Format Self-Check in evidence.
82
-
83
- ## Inputs Priority (Preflight)
84
-
85
- When unsure, read inputs in this order:
86
-
87
- - P1: `.qfai/assistant/instructions/*`
88
- - P2: `.qfai/assistant/steering/*`
89
- - P3: `.qfai/specs/spec-*/01_Spec.md` (Primary SSOT / Consumer View)
90
- - P4: `.qfai/contracts/ui/**`, `.qfai/specs/_policies/05_Contracts.md`, and each `spec-*/11_Contracts.md`
91
- - P5: `.qfai/specs/spec-*/09_delta.md` (Decision Records)
92
- - P6: existing evidence
93
-
94
- ## Read Set Contract (Mandatory)
95
-
96
- - Default Mode:
97
- - `.qfai/specs/spec-*/01_Spec.md`
98
- - relevant `.qfai/contracts/ui/**`
99
- - Escalation Mode:
100
- - allowed only when `01_Spec.md` Escalation Hook signals ambiguity / conflict / missing constraint / trade-off
101
- - read only `.qfai/specs/_policies/01_Objective.md`, `.qfai/specs/_policies/07_Constraints.md`, `.qfai/specs/_policies/08_Decisions.md`
102
- - Do not read `_policies/**` by default.
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.
103
30
 
104
- ## Sub-agent Delegation (MANDATORY)
31
+ ## CRITICAL CONSTRAINTS (Read First)
105
32
 
106
- This section is mandatory and overrides conflicting fallback text.
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`.
107
44
 
108
- ### Orchestrator Protocol (MUST)
45
+ ## Goal
109
46
 
110
- - Orchestrator may only create work orders, delegate tasks, integrate outputs, and present results to the user.
111
- - Orchestrator MUST NOT generate the primary artifact first draft.
112
- - Orchestrator MUST NOT serve as Reviewer or skip delegation for convenience.
47
+ Build the minimum runnable vertical slice for **ALL specs** and produce canonical prototyping evidence under `.qfai/evidence/`.
113
48
 
114
- ### Capability Probe (MUST)
49
+ ## Non-goals
115
50
 
116
- 1. Run one harmless Probe Task (for example: "reply with ok") once at stage start.
117
- 2. If subagents are unavailable, explicitly ask the user for Simulation mode approval.
118
- 3. Without explicit approval, stop the stage.
51
+ - Acceptance test automation (`/qfai-atdd`)
52
+ - Contract redesign
53
+ - Public CLI surface expansion
119
54
 
120
- ### Simulation mode (Opt-in only)
55
+ ## Mode Selection Protocol
121
56
 
122
- - Allowed only when the user explicitly states `Simulation mode allowed`.
123
- - Record both in evidence:
124
- - `Subagents: simulated (reason: <why unavailable>)`
125
- - `User approval: <quote or reference>`
57
+ Mode selection precedence:
126
58
 
127
- ## Work Orders Summary
59
+ 1. explicit request (`mode=low-cost|standard|full-harness`)
60
+ 2. discussion recommendation from `prototyping.yaml`
61
+ 3. default `standard`
128
62
 
129
- Every major artifact in this stage MUST include this table:
63
+ Record in `prototyping.json`:
130
64
 
131
- | Step | Role (sub-agent) | Task title | Input (refs) | Output (refs) | Status (PASS/REVISE) |
132
- | ---- | ---------------- | ---------- | ------------ | ------------- | -------------------- |
133
- | 1 | <role> | <task> | <refs> | <refs> | PASS/REVISE |
65
+ - `mode.requested` (optional)
66
+ - `mode.effective` (required)
67
+ - `mode.source` (required)
68
+ - `mode.rationale` (required)
69
+ - `mode.discussionRecommendation` (optional)
134
70
 
135
- ### Reviewer Gate (MUST)
71
+ ## Surface Semantics
136
72
 
137
- - Final completion gate MUST be delegated to an independent Reviewer sub-agent.
138
- - Reviewer checks (minimum):
139
- - required roles were delegated (no orchestrator self-authoring),
140
- - evidence + validate gate is present,
141
- - Drift Protocol was enforced,
142
- - test-layer obligations match `test-layers.md` and plan,
143
- - floors and ratios are **signals, not gates**.
144
- - Reviewer returns only `PASS` or `REVISE`.
145
- - **All reviewers: alternative proposal obligation**:
146
- - Every reviewer MUST provide a concrete alternative or fix proposal when returning FAIL. Feedback without a concrete alternative is invalid and triggers re-judgment.
147
- - **devils-advocate gate**:
148
- - devils-advocate FAIL must include a concrete alternative proposal. Bare negation FAIL triggers re-judgment.
149
- - 3 consecutive FAILs trigger advisory demotion and allow progression to the next phase.
150
- - **pattern-doubler gate**:
151
- - Each pattern proposed by pattern-doubler must include rationale.
152
- - Artifacts with no ID-bearing items (US/AC/BR/EX/TC) are marked N/A.
153
-
154
- ### Work order template (copy/paste)
155
-
156
- ```text
157
- Task title: <short>
158
- Role: <sub-agent role>
159
- Goal: <what to decide/produce>
160
- Inputs (refs):
161
- - <file/section>
162
- Constraints:
163
- - must: enforce Drift Protocol
164
- - must: verify plan/test-layer adherence (`test-layers.md` + plan)
165
- - must: verify `qfai validate --fail-on error` evidence
166
- - must_not: accept floor/ratio as hard gate
167
- Output format:
168
- - <headings / bullet schema>
169
- Quality bar:
170
- - PASS if ...
171
- - REVISE if ...
172
- ```
173
-
174
- ### Reviewer response template
175
-
176
- ```text
177
- Result: PASS | REVISE
178
- Findings:
179
- - <issue>
180
- Required fixes:
181
- - <action>
182
- Evidence checked:
183
- - <refs>
184
- ```
185
-
186
- ## Stage 0 - Steering completion refresh (mandatory)
187
-
188
- Before implementation, refresh and verify:
189
-
190
- - `.qfai/assistant/steering/manifest.md`
191
- - `.qfai/assistant/steering/product.md`
192
- - `.qfai/assistant/steering/structure.md`
193
- - `.qfai/assistant/steering/tech.md`
194
-
195
- If facts are missing, record Open Questions and ask the user.
196
-
197
- ## Delta Rejected Guard (Mandatory)
198
-
199
- - Do not reintroduce options marked as rejected in 09_delta.md.
200
- - If reconsideration is needed, create a `[RE-OPEN]` Decision Record with explicit approval.
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.
201
77
 
202
- ## CRITICAL CONSTRAINTS (Read First)
78
+ ## Prototyping Modes
203
79
 
204
- - Scope is ALL specs from `.qfai/specs/spec-*`; do not shrink to one spec.
205
- - Contracts are strict inputs in this stage.
206
- - Do not create new files under `.qfai/contracts/**`.
207
- - If any spec has zero resolved contracts, STOP and route back to `/qfai-discussion`.
208
- - Do not add ATDD/TDD automation in this stage.
209
- - You MUST produce both prototyping evidence artifacts in `.qfai/evidence/`.
210
- - You MUST run runtime checks and capture evidence.
211
- - DONE is forbidden when Coverage Matrix is incomplete or API checks include status 404.
80
+ ### Low-cost
212
81
 
213
- ## Completion Contract (Shared)
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.
214
86
 
215
- Before declaring completion, you MUST:
87
+ ### Standard
216
88
 
217
- - resolve or explicitly defer ambiguous items,
218
- - verify every required artifact exists and is complete,
219
- - scan outputs for placeholders (TBD/TODO/OPEN QUESTION and equivalents),
220
- - run the smallest executable smoke proof and record outcomes.
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.
221
93
 
222
- ## Goal
94
+ ### Full-harness
223
95
 
224
- Build the minimum runnable vertical slice for **all specs** so `/qfai-atdd` can proceed without hidden scope gaps.
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.
225
100
 
226
- ## Non-goals
101
+ ## Obligation Matrix
227
102
 
228
- - Acceptance test automation (`/qfai-atdd`).
229
- - Unit/component tests (TDD phases).
230
- - Contract redesign during prototyping.
103
+ ### surface / mode
231
104
 
232
- ## Mandatory Outputs
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** |
233
113
 
234
- - Updated runnable skeleton implementation.
235
- - Coverage Matrix for all specs.
236
- - Runtime Gate v2 log for declared UI routes and API endpoints.
237
- - Prototyping evidence artifacts (markdown + json) under `.qfai/evidence/`.
238
- - `prototyping.json` includes `uiFidelity` for L2 reporting.
239
- - Reviewer result (`PASS` or actionable `REVISE`).
114
+ `uiFidelity.mode` policy:
240
115
 
241
- ## Scope SSOT (ALL contracts -> ALL specs)
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
242
120
 
243
- 1. Enumerate all specs from `.qfai/specs/spec-*`.
244
- 2. Resolve each spec's contracts via `_policies/05_Contracts.md` and/or `spec-*/11_Contracts.md`.
245
- 3. Do not declare completion while any spec lacks contract assignment.
121
+ Interpretation:
246
122
 
247
- ## Preflight (required)
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
248
126
 
249
- - Build spec list first and create Coverage Matrix rows for every spec.
250
- - Resolve declared counts per spec:
251
- - `uiRoutes`
252
- - `apiEndpoints`
253
- - `dbObjects`
254
- - Stop conditions:
255
- - any spec has zero contract assignment,
256
- - UI primary flow is undefined for a spec,
257
- - evidence schema cannot represent all specs.
127
+ ## Required Evidence
258
128
 
259
- ## Execution (required)
129
+ ### Evidence (MANDATORY)
260
130
 
261
- Process specs in dependency order (foundation first, then business modules):
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
262
137
 
263
- - UI: primary route renders (stub data is acceptable).
264
- - API: declared endpoints return non-404 status (stub handler is acceptable).
265
- - DB: minimum schema/store exists so runtime does not crash.
266
- - UI quality floor: avoid placeholder-only pages; this must be marked `REVISE`.
138
+ ### low-cost obligations
267
139
 
268
- ## Runtime Interaction Gate v2 (required)
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
269
143
 
270
- Check the **full declared list** from preflight and record all results:
144
+ ### standard obligations
271
145
 
272
- - UI routes: HTTP GET / route navigation checks.
273
- - API endpoints: runtime calls with status capture (`404` is forbidden).
274
- - DB objects: presence checks against schema or temporary store.
275
- - Mock paths: record at least one pass path for interactive flows when L2 is targeted.
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
276
150
 
277
- If any check fails, completion is blocked.
151
+ ### full-harness obligations
278
152
 
279
- ## Evidence (MANDATORY)
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
280
156
 
281
- Create/update both artifacts in `.qfai/evidence/`:
157
+ ## Full-harness minimum completeness
282
158
 
283
- 1. Markdown evidence with sections:
284
- - Coverage Matrix
285
- - Runtime Gate Log
286
- - Deviations / Exceptions
287
- - Work Orders Summary
288
- - Format Self-Check
289
- 2. JSON evidence with minimum fields:
290
- - `specs[]` with `specId`, `declared`, `checked`, `missing`
291
- - `runtimeGate.ui[]` and `runtimeGate.api[]`
292
- - `uiFidelity.version`, `uiFidelity.mode`, `uiFidelity.screens[]` for L2
293
- - `meta.generatedAt`, `meta.toolVersion`, `meta.commands[]`
159
+ When `mode.effective = full-harness`, record:
294
160
 
295
- `uiFidelity` is a stage DoD requirement in this skill.
296
- Validator compatibility remains backward-compatible: existing required fields stay unchanged.
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`
297
169
 
298
- ## DONE Declaration (Mandatory Output)
170
+ ## Canonical Bundles
299
171
 
300
- When declaring DONE, include:
172
+ - render bundle: `.qfai/evidence/render.json`
173
+ - browser QA bundle: `.qfai/evidence/browser-qa.json`
301
174
 
302
- - referenced instructions/steering/spec inputs,
303
- - DR-IDs checked and rejected-option result,
304
- - confirmation that evidence and validate gate both passed.
175
+ Render bundle uses `captured | skipped | failed`.
176
+ Browser QA bundle uses `completed | skipped | failed`.
305
177
 
306
- ## FINAL CHECKLIST (Check Last)
178
+ ## Required Process
179
+
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`.
189
+
190
+ ## Sub-agent Delegation (MANDATORY)
191
+
192
+ ### Orchestrator Protocol (MUST)
307
193
 
308
- - [ ] ALL specs from `.qfai/specs/spec-*` are covered in Coverage Matrix.
309
- - [ ] Every spec satisfies UI/API/DB minimum runtime conditions.
310
- - [ ] API runtime gate has zero 404 results.
311
- - [ ] Prototyping evidence artifacts are updated.
312
- - [ ] `prototyping.json` includes `uiFidelity` for L2 output.
313
- - [ ] Placeholder-only pages are not accepted (marked `REVISE` if present).
314
- - [ ] `qfai validate --fail-on error` passes.
315
- - [ ] Independent Reviewer returned PASS.
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/`.
197
+
198
+ ### Capability Probe (MUST)
199
+
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.
203
+
204
+ ### Simulation mode (Opt-in only)
205
+
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>`
210
+
211
+ ## Work Orders Summary
212
+
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`.
226
+
227
+ ## Completion Contract (Shared)
228
+
229
+ Before DONE:
230
+
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
236
+
237
+ ## FINAL CHECKLIST (Check Last)
316
238
 
317
- ## Completion Checklist (MUST)
239
+ ### Completion Checklist (MUST)
318
240
 
319
- - [ ] This skill's Definition of Done is satisfied.
320
- - [ ] Required artifacts were produced or updated.
321
- - [ ] Open questions were logged when needed.
322
- - [ ] Completion message was presented to the user.
323
- - [ ] Next actions were enumerated.
241
+ - 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`.
324
248
 
325
249
  ## Completion Message & Next Actions (MUST)
326
250
 
327
- When complete, provide a final user-facing completion message and list actions.
251
+ Action:
328
252
 
329
- - Proceed (recommended): `/qfai-atdd`.
330
- Action: implement acceptance tests against the all-spec prototype runtime behavior.
331
- - Quality gate run: `/qfai-verify`.
332
- Action: run full validation/report flow and publish gate evidence.
333
- - Rework prototyping: rerun `/qfai-prototyping`.
334
- Action: fix missing matrix rows, 404 findings, or unresolved contract mapping gaps.
253
+ - Proceed: `/qfai-atdd`
254
+ - Quality gate: `/qfai-verify`
255
+ - Rework prototyping: rerun `/qfai-prototyping` with corrected evidence