qfai 2.2.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (206) hide show
  1. package/README.md +60 -23
  2. package/assets/defaults/workflows/bump-dependency.yml +4 -1
  3. package/assets/defaults/workflows/decide-design.yml +5 -1
  4. package/assets/defaults/workflows/rename-concept.yml +30 -0
  5. package/assets/defaults/workflows/resolve-conflicts.yml +14 -0
  6. package/assets/defaults/workflows/retire-feature.yml +26 -0
  7. package/assets/defaults/workflows/run-release.yml +12 -0
  8. package/assets/init/.claude/settings.json +11 -11
  9. package/assets/init/.codex/hooks.json +9 -9
  10. package/assets/init/.qfai/assistant/agent/architecture-reviewer.md +2 -2
  11. package/assets/init/.qfai/assistant/agent/fullstack-engineer.md +101 -0
  12. package/assets/init/.qfai/assistant/agent/implementation-reviewer.md +78 -1
  13. package/assets/init/.qfai/assistant/agent/product-surface-reviewer.md +10 -5
  14. package/assets/init/.qfai/assistant/agent/requirements-reviewer.md +12 -2
  15. package/assets/init/.qfai/assistant/rule/agent-selection.md +22 -42
  16. package/assets/init/.qfai/assistant/rule/constitution.md +5 -3
  17. package/assets/init/.qfai/assistant/rule/drift-protocol.md +19 -1
  18. package/assets/init/.qfai/assistant/rule/references/asset-authoring.md +1 -1
  19. package/assets/init/.qfai/assistant/rule/references/codex-delegation.md +4 -4
  20. package/assets/init/.qfai/assistant/rule/references/gate-failure-autorepair.md +1 -1
  21. package/assets/init/.qfai/assistant/rule/references/reviewer-findings.md +1 -1
  22. package/assets/init/.qfai/assistant/rule/references/worker-edit-boundary.md +3 -3
  23. package/assets/init/.qfai/assistant/rule/research-first-protocol.md +7 -6
  24. package/assets/init/.qfai/assistant/rule/review-convergence.md +10 -4
  25. package/assets/init/.qfai/assistant/rule/shared-skill-delegation-baseline.md +81 -56
  26. package/assets/init/.qfai/assistant/rule/shared-skill-operating-baseline.md +8 -8
  27. package/assets/init/.qfai/assistant/rule/ui-definition-protocol.md +2 -1
  28. package/assets/init/.qfai/assistant/rule/workflow.md +4 -4
  29. package/assets/init/.qfai/assistant/skill/qfai-configure/SKILL.md +15 -46
  30. package/assets/init/.qfai/assistant/skill/qfai-discussion/SKILL.md +6 -15
  31. package/assets/init/.qfai/assistant/skill/qfai-discussion/references/discussion-completion-matrix.md +15 -2
  32. package/assets/init/.qfai/assistant/skill/qfai-discussion/references/ui-bearing-playbook.md +17 -0
  33. package/assets/init/.qfai/assistant/skill/qfai-discussion/references/ui_ux/trend_scan_playbook.md +3 -1
  34. package/assets/init/.qfai/assistant/skill/qfai-discussion/templates/01_Context.md +4 -1
  35. package/assets/init/.qfai/assistant/skill/qfai-discussion/templates/04_Sources.md +5 -1
  36. package/assets/init/.qfai/assistant/skill/qfai-discussion/templates/uiux/00_index.md +4 -1
  37. package/assets/init/.qfai/assistant/skill/qfai-grill/SKILL.md +8 -7
  38. package/assets/init/.qfai/assistant/skill/qfai-grilling/SKILL.md +15 -15
  39. package/assets/init/.qfai/assistant/skill/qfai-grilling/references/delegated-session.md +18 -18
  40. package/assets/init/.qfai/assistant/skill/qfai-grilling/references/session-record.md +3 -3
  41. package/assets/init/.qfai/assistant/skill/qfai-implement/SKILL.md +2 -16
  42. package/assets/init/.qfai/assistant/skill/qfai-implement/references/parallelization-policy.md +54 -12
  43. package/assets/init/.qfai/assistant/skill/qfai-implement/references/red-admissibility.md +35 -0
  44. package/assets/init/.qfai/assistant/skill/qfai-implement/references/test-runner-recipes.md +445 -0
  45. package/assets/init/.qfai/assistant/skill/qfai-implement/references/ui-affecting.md +2 -2
  46. package/assets/init/.qfai/assistant/skill/qfai-maintain/SKILL.md +0 -1
  47. package/assets/init/.qfai/assistant/skill/qfai-migration-v1-to-v2/SKILL.md +2 -13
  48. package/assets/init/.qfai/assistant/skill/qfai-migration-v1-to-v2/references/migration-guide.md +8 -11
  49. package/assets/init/.qfai/assistant/skill/qfai-migration-v1-to-v2/references/migration-placement.md +0 -7
  50. package/assets/init/.qfai/assistant/skill/qfai-prototyping/SKILL.md +11 -18
  51. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/generator-prompt.md +34 -3
  52. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/handoff.md +77 -2
  53. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/iteration-loop.md +14 -5
  54. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/review-payload-schema.md +7 -5
  55. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/reviewer-prompt.md +32 -6
  56. package/assets/init/.qfai/assistant/skill/qfai-run/SKILL.md +17 -18
  57. package/assets/init/.qfai/assistant/skill/qfai-run/references/extraction.md +194 -129
  58. package/assets/init/.qfai/assistant/skill/qfai-run/references/operator-screens.md +33 -18
  59. package/assets/init/.qfai/assistant/skill/qfai-run/references/plan.md +46 -22
  60. package/assets/init/.qfai/assistant/skill/qfai-run/references/reached-step-observations.md +2 -0
  61. package/assets/init/.qfai/assistant/skill/qfai-run/references/stage-points.md +7 -4
  62. package/assets/init/.qfai/assistant/skill/qfai-sdd/SKILL.md +0 -13
  63. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/concrete-abstract-cycle.md +3 -2
  64. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/contract-artifact-rules.md +13 -1
  65. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-execution-playbook.md +2 -2
  66. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-phase-checklists.md +1 -1
  67. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-pre-draft-grilling.md +2 -1
  68. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-quality-gate.md +1 -1
  69. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-triage.md +83 -6
  70. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/spec-traceability-rules.md +1 -1
  71. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/ui-contract-guide.md +23 -5
  72. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/change-request.md +1 -1
  73. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/spec/decisions/page-NNNN.md +6 -0
  74. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/spec/decisions.md +9 -0
  75. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/spec/open-questions.md +13 -0
  76. package/assets/init/.qfai/assistant/skill/qfai-triage/SKILL.md +0 -11
  77. package/assets/init/.qfai/assistant/skill/qfai-verify/SKILL.md +0 -9
  78. package/assets/init/.qfai/assistant/skill/qfai-verify/references/verify-output-contract.md +15 -9
  79. package/assets/init/.qfai/assistant/skill/web-research/SKILL.md +19 -19
  80. package/assets/init/.qfai/assistant/step/common-design-md/STEP.md +0 -2
  81. package/assets/init/.qfai/assistant/step/common-gate-run/STEP.md +11 -9
  82. package/assets/init/.qfai/assistant/step/common-grilling-record/STEP.md +15 -3
  83. package/assets/init/.qfai/assistant/step/common-policy-check/STEP.md +0 -1
  84. package/assets/init/.qfai/assistant/step/common-review-cycle/STEP.md +48 -12
  85. package/assets/init/.qfai/assistant/step/discussion-interview/STEP.md +11 -5
  86. package/assets/init/.qfai/assistant/step/discussion-oq/STEP.md +12 -2
  87. package/assets/init/.qfai/assistant/step/discussion-pack/STEP.md +18 -4
  88. package/assets/init/.qfai/assistant/step/discussion-research/STEP.md +0 -2
  89. package/assets/init/.qfai/assistant/step/discussion-uiux/STEP.md +4 -2
  90. package/assets/init/.qfai/assistant/step/implement-acceptance/STEP.md +3 -4
  91. package/assets/init/.qfai/assistant/step/implement-backport/STEP.md +0 -5
  92. package/assets/init/.qfai/assistant/step/implement-benchmark/STEP.md +0 -4
  93. package/assets/init/.qfai/assistant/step/implement-bisect/STEP.md +0 -5
  94. package/assets/init/.qfai/assistant/step/implement-credentials/STEP.md +4 -4
  95. package/assets/init/.qfai/assistant/step/implement-dep-bump/STEP.md +31 -12
  96. package/assets/init/.qfai/assistant/step/implement-diagnose/STEP.md +12 -9
  97. package/assets/init/.qfai/assistant/step/implement-minimize/STEP.md +0 -5
  98. package/assets/init/.qfai/assistant/step/implement-oracle-parity/STEP.md +0 -6
  99. package/assets/init/.qfai/assistant/step/implement-procedure/STEP.md +35 -8
  100. package/assets/init/.qfai/assistant/step/implement-quarantine/STEP.md +0 -4
  101. package/assets/init/.qfai/assistant/step/implement-refactor/STEP.md +25 -9
  102. package/assets/init/.qfai/assistant/step/implement-regression-fix/STEP.md +0 -4
  103. package/assets/init/.qfai/assistant/step/implement-retire/STEP.md +26 -6
  104. package/assets/init/.qfai/assistant/step/implement-revert/STEP.md +0 -4
  105. package/assets/init/.qfai/assistant/step/implement-scaffold/STEP.md +28 -7
  106. package/assets/init/.qfai/assistant/step/implement-seam/STEP.md +0 -4
  107. package/assets/init/.qfai/assistant/step/implement-stress-harness/STEP.md +0 -5
  108. package/assets/init/.qfai/assistant/step/implement-sweep/STEP.md +0 -5
  109. package/assets/init/.qfai/assistant/step/implement-tdd/STEP.md +23 -15
  110. package/assets/init/.qfai/assistant/step/implement-test-fix/STEP.md +0 -5
  111. package/assets/init/.qfai/assistant/step/implement-tooling/STEP.md +0 -3
  112. package/assets/init/.qfai/assistant/step/maintain-edit/STEP.md +71 -10
  113. package/assets/init/.qfai/assistant/step/prototyping-grill/STEP.md +39 -8
  114. package/assets/init/.qfai/assistant/step/prototyping-handoff/STEP.md +12 -5
  115. package/assets/init/.qfai/assistant/step/prototyping-loop/STEP.md +71 -23
  116. package/assets/init/.qfai/assistant/step/prototyping-preflight/STEP.md +5 -2
  117. package/assets/init/.qfai/assistant/step/sdd-contract/STEP.md +10 -4
  118. package/assets/init/.qfai/assistant/step/sdd-cycle/STEP.md +9 -6
  119. package/assets/init/.qfai/assistant/step/sdd-flow/STEP.md +0 -2
  120. package/assets/init/.qfai/assistant/step/sdd-gate/STEP.md +0 -1
  121. package/assets/init/.qfai/assistant/step/sdd-story/STEP.md +22 -3
  122. package/assets/init/.qfai/assistant/step/sdd-triage/STEP.md +54 -20
  123. package/assets/init/.qfai/assistant/step/triage-answer/STEP.md +0 -2
  124. package/assets/init/.qfai/assistant/step/triage-close/STEP.md +7 -4
  125. package/assets/init/.qfai/assistant/step/triage-cluster/STEP.md +0 -2
  126. package/assets/init/.qfai/assistant/step/triage-decompose/STEP.md +0 -2
  127. package/assets/init/.qfai/assistant/step/triage-dedupe/STEP.md +0 -2
  128. package/assets/init/.qfai/assistant/step/triage-handoff/STEP.md +6 -2
  129. package/assets/init/.qfai/assistant/step/triage-investigate/STEP.md +0 -2
  130. package/assets/init/.qfai/assistant/step/triage-operate/STEP.md +76 -5
  131. package/assets/init/.qfai/assistant/step/triage-owned-cleanup/STEP.md +0 -2
  132. package/assets/init/.qfai/assistant/step/triage-request-info/STEP.md +0 -2
  133. package/assets/init/.qfai/assistant/step/triage-security-intake/STEP.md +0 -2
  134. package/assets/init/.qfai/assistant/step/verify-advisory/STEP.md +0 -2
  135. package/assets/init/.qfai/assistant/step/verify-change-note/STEP.md +0 -2
  136. package/assets/init/.qfai/assistant/step/verify-commit/STEP.md +35 -12
  137. package/assets/init/.qfai/assistant/step/verify-context/STEP.md +7 -26
  138. package/assets/init/.qfai/assistant/step/verify-external/STEP.md +0 -2
  139. package/assets/init/.qfai/assistant/step/verify-manual/STEP.md +0 -2
  140. package/assets/init/.qfai/assistant/step/verify-qfai-gate/STEP.md +0 -2
  141. package/assets/init/.qfai/assistant/step/verify-release-notes/STEP.md +0 -2
  142. package/assets/init/.qfai/assistant/step/verify-repeat-run/STEP.md +0 -2
  143. package/assets/init/.qfai/assistant/step/verify-repo-gate/STEP.md +65 -9
  144. package/assets/init/root/.agents/rules/api-budget.md +8 -3
  145. package/assets/init/root/.agents/rules/graph-exploration.md +18 -4
  146. package/assets/init/root/.agents/rules/grilling.md +9 -9
  147. package/assets/init/root/.agents/rules/reminders.json +20 -28
  148. package/assets/init/root/.agents/rules/user-questions.md +21 -11
  149. package/assets/init/root/.gitattributes +2 -0
  150. package/assets/init/root/AGENTS.md +1 -1
  151. package/assets/mdschema/manifest.yml +3 -0
  152. package/assets/mdschema/story/03_contract/tech.mdschema.yml +1 -1
  153. package/assets/mdschema/story/decisions/page-NNNN.mdschema.yml +32 -0
  154. package/assets/mdschema/story/decisions.mdschema.yml +12 -0
  155. package/assets/schemas/workflow/extraction.schema.json +94 -2
  156. package/assets/schemas/workflow/plan.schema.json +34 -1
  157. package/assets/scripts/check-mdschema.mjs +434 -45
  158. package/dist/cli/index.cjs +4991 -3148
  159. package/dist/cli/index.cjs.map +1 -1
  160. package/dist/cli/index.mjs +4780 -2929
  161. package/dist/cli/index.mjs.map +1 -1
  162. package/dist/graph/cli.cjs +14 -2
  163. package/dist/graph/cli.cjs.map +1 -1
  164. package/dist/graph/cli.d.cts +1 -1
  165. package/dist/graph/cli.d.ts +1 -1
  166. package/dist/graph/cli.mjs +14 -2
  167. package/dist/graph/cli.mjs.map +1 -1
  168. package/dist/graph/hook.cjs.map +1 -1
  169. package/dist/graph/hook.mjs.map +1 -1
  170. package/dist/index.cjs +4359 -3843
  171. package/dist/index.cjs.map +1 -1
  172. package/dist/index.d.cts +60 -21
  173. package/dist/index.d.ts +60 -21
  174. package/dist/index.mjs +3594 -3080
  175. package/dist/index.mjs.map +1 -1
  176. package/dist/process-qqX2Owgq.d.cts +18 -0
  177. package/dist/process-qqX2Owgq.d.ts +18 -0
  178. package/package.json +1 -1
  179. package/assets/defaults/agent-routing/_contract.yml +0 -77
  180. package/assets/defaults/agent-routing/common.yml +0 -14
  181. package/assets/defaults/agent-routing/qfai-discussion.yml +0 -57
  182. package/assets/defaults/agent-routing/qfai-implement.yml +0 -236
  183. package/assets/defaults/agent-routing/qfai-maintain.yml +0 -12
  184. package/assets/defaults/agent-routing/qfai-prototyping.yml +0 -48
  185. package/assets/defaults/agent-routing/qfai-sdd.yml +0 -56
  186. package/assets/defaults/agent-routing/qfai-triage.yml +0 -108
  187. package/assets/defaults/agent-routing/qfai-verify.yml +0 -92
  188. package/assets/defaults/agent-routing/skills.yml +0 -59
  189. package/assets/defaults/review-profiles.yml +0 -25
  190. package/assets/init/.qfai/assistant/agent/acceptance-test-engineer.md +0 -81
  191. package/assets/init/.qfai/assistant/agent/backend-engineer.md +0 -90
  192. package/assets/init/.qfai/assistant/agent/completion-reviewer.md +0 -88
  193. package/assets/init/.qfai/assistant/agent/delivery-planner.md +0 -85
  194. package/assets/init/.qfai/assistant/agent/devops-ci-engineer.md +0 -78
  195. package/assets/init/.qfai/assistant/agent/discovery-analyst.md +0 -81
  196. package/assets/init/.qfai/assistant/agent/doc-steward.md +0 -78
  197. package/assets/init/.qfai/assistant/agent/frontend-engineer.md +0 -94
  198. package/assets/init/.qfai/assistant/agent/orchestrator.md +0 -92
  199. package/assets/init/.qfai/assistant/agent/product-experience-architect.md +0 -101
  200. package/assets/init/.qfai/assistant/agent/qa-gatekeeper.md +0 -153
  201. package/assets/init/.qfai/assistant/agent/qa-strategist.md +0 -82
  202. package/assets/init/.qfai/assistant/agent/requirements-analyst.md +0 -96
  203. package/assets/init/.qfai/assistant/agent/solution-architect.md +0 -89
  204. package/assets/init/.qfai/assistant/agent/test-design-analyst.md +0 -132
  205. package/dist/process-C21nTvkT.d.cts +0 -12
  206. package/dist/process-C21nTvkT.d.ts +0 -12
@@ -1,6 +1,6 @@
1
1
  # Generator Iteration Prompt
2
2
 
3
- Injected into the product-experience-architect sub-agent each iteration.
3
+ Read by the session agent, which generates, at the start of each iteration.
4
4
  Brand identity is locked by root `DESIGN.md`. Iterate on **information
5
5
  architecture**, **navigation flow**, and **usability** — not visual
6
6
  identity.
@@ -33,11 +33,15 @@ identity.
33
33
  makes it answerable and leave it open — treating it as a settled constraint
34
34
  decides on the user's behalf the one kind of question this loop exists to
35
35
  return to them.
36
- 5. From the second iteration on: the user's last answer,
36
+ 5. From the run's second iteration on: the user's last answer in this run,
37
37
  `iter-(NN-1)/review.json` (critique, scores,
38
38
  `layoutAntiPatternsDetected`, `designMdViolations`,
39
39
  `pivotDirective`), `iter-(NN-2)/review.json` when present, and
40
- `progress.md`.
40
+ `progress.md`. A review or confirmation from an earlier run is not one of
41
+ them: the run's first iteration is the first after `progress.md` records
42
+ its `runScope`, present or absent.
43
+ 6. In a scoped run, every iteration: `runScope` in `progress.md` and
44
+ `.qfai/prototype/final/index.html`.
41
45
 
42
46
  ## HTML envelope (mandatory on every iter)
43
47
 
@@ -271,6 +275,33 @@ match the routing shape to what the server in use does with an unknown
271
275
  path: a path route needs a server that falls back to `index.html`, and a
272
276
  hash route (`/#/settings`) works on any static server.
273
277
 
278
+ ### Restyle iterations
279
+
280
+ In a `restyle` iteration the project's app is the prototype. The HTML
281
+ envelope, the one self-contained file, the `<link rel="stylesheet">` ban and
282
+ "nothing else" above do not apply:
283
+
284
+ - Edit only the project's stylesheet and motion entry points, and record each
285
+ file edited for the handoff. Values that root `DESIGN.md` does not declare
286
+ are still findings.
287
+ - Write `iter-NN/index.html` as the list of live routes in scope: one link
288
+ per declared screen, each with its absolute URL and the setup it needs, such
289
+ as a login or seed data.
290
+ - The seed and pivot rules below do not apply as written. The first restyle
291
+ iteration restyles the screens as they are, and a restyle `pivot` rethinks
292
+ only the visual treatment: screens, fields and behaviour stay.
293
+
294
+ ### Scoped runs
295
+
296
+ When `progress.md` records a `runScope`, the run's first iteration starts from
297
+ a copy of `.qfai/prototype/final/index.html`, not from a seed, and each later
298
+ iteration builds on the previous one, whose out-of-scope parts are still
299
+ `final/`'s. Change only the in-scope screen routes and each in-scope shared
300
+ component wherever a screen route renders it, with the style only they use.
301
+ Leave everything else as `final/` has it, so the handoff can merge the
302
+ in-scope parts back. A `pivot` rethinks only what is inside the scope. A
303
+ change the scope needs outside those parts is reported, not made.
304
+
274
305
  ## The first iteration (seed)
275
306
 
276
307
  Produce one self-contained `iter-00/index.html` that satisfies the spec
@@ -1,10 +1,23 @@
1
1
  # Handoff (post-loop)
2
2
 
3
+ ## Contents
4
+
5
+ - Inputs
6
+ - Outputs
7
+ - Scoped handoff
8
+ - Restyle handoff
9
+ - Checking an implementation's tokens
10
+
3
11
  ## Inputs
4
12
 
5
13
  `.qfai/prototype/iter-<final>/index.html` — the iteration the user
6
14
  confirmed. It is one self-contained file with one client-side route per
7
15
  declared screen, written by the generator.
16
+ A `restyle` loop has no such file: its iterations restyled the live app
17
+ in place, and its handoff is the short form under Restyle handoff below.
18
+ A scoped run also reads the `final/index.html` and `final/handoff.json` an
19
+ earlier run confirmed, which the merge under Scoped handoff below keeps
20
+ outside the scope.
8
21
 
9
22
  Root `DESIGN.md` remains the brand SSOT through handoff.
10
23
 
@@ -12,8 +25,9 @@ Root `DESIGN.md` remains the brand SSOT through handoff.
12
25
 
13
26
  ### `.qfai/prototype/final/index.html`
14
27
 
15
- A copy (not a symlink) of the confirmed iteration. `/qfai-implement`
16
- reads this as a read-only artifact.
28
+ A copy (not a symlink) of the confirmed iteration, or in a scoped run the
29
+ merge under Scoped handoff below. `/qfai-implement` reads this as a
30
+ read-only artifact.
17
31
 
18
32
  ### `.qfai/prototype/final/handoff.json`
19
33
 
@@ -75,6 +89,67 @@ same checkout. `npx qfai validate --profile saas-package` requires it to be pres
75
89
  and to conform, and reports `QFAI-SAAS-002` naming the file
76
90
  otherwise; no other command reads it.
77
91
 
92
+ ## Scoped handoff
93
+
94
+ When `progress.md` records a `runScope`, the confirmed iteration changed
95
+ only the in-scope parts of a `final/index.html` an earlier run confirmed.
96
+ The unit of the merge is the screen route, one per declared screen, and each
97
+ place a route renders an in-scope shared component.
98
+
99
+ - In `final/index.html`, replace each in-scope screen's route, and each
100
+ in-scope component wherever a route renders it, together with the style
101
+ only they use, with the confirmed iteration's version. Keep every other
102
+ part as it was.
103
+ - A difference between the confirmed iteration and `final/` outside those
104
+ parts is a change the scope left out: keep `final/`'s version and name the
105
+ difference in the completion report.
106
+ - In `final/handoff.json`, replace the `procurement` rows of the in-scope
107
+ screens and components, keep every other row, so every declared screen
108
+ still appears, and record the scope the user confirmed as `runScope`.
109
+ Keep `finalArtifact`, `implementationNotes` and every other existing key,
110
+ extending `implementationNotes` with what this run decided rather than
111
+ rewriting it:
112
+
113
+ ```json
114
+ {
115
+ "runScope": {
116
+ "screens": ["<ui-contract-id>/<screen>"],
117
+ "components": ["<repository path or procurement item>"]
118
+ }
119
+ }
120
+ ```
121
+
122
+ The confirmed prototype is then the whole of `final/`: the in-scope parts
123
+ this run confirmed, and every other part as an earlier run confirmed it. A
124
+ run with no scope copies the whole iteration and writes no `runScope`.
125
+
126
+ ## Restyle handoff
127
+
128
+ When `.qfai/prototype/progress.md` records `iterationKind` `restyle`, every
129
+ screen is one the project already runs, so there is no prototype to copy and no region to
130
+ procure. No `final/index.html` is written, and
131
+ `final/handoff.json` takes this short form in place of `finalArtifact` and `procurement`:
132
+
133
+ ```json
134
+ {
135
+ "iterationKind": "restyle",
136
+ "liveRoutes": ["<route the confirmed iteration listed>"],
137
+ "entryPoints": {
138
+ "stylesheet": ["<repository-relative path>"],
139
+ "motion": ["<repository-relative path>"]
140
+ },
141
+ "implementationNotes": "Plain prose ..."
142
+ }
143
+ ```
144
+
145
+ - `liveRoutes` names every live route the confirmed iteration listed.
146
+ - `entryPoints` names the files the restyle changed: the stylesheet entry
147
+ points and the motion entry points, each list empty when the restyle
148
+ changed none.
149
+ - `implementationNotes` is as above.
150
+ - `npx qfai validate --profile saas-package` reports a `restyle` record
151
+ without a non-empty `liveRoutes` or without both `entryPoints` lists.
152
+
78
153
  ## Checking an implementation's tokens
79
154
 
80
155
  QFAI checks the prototype against the tokens in root `DESIGN.md`. It does
@@ -6,7 +6,7 @@
6
6
  [Build] iteration NN: generate iter-NN/index.html under DESIGN.md tokens
7
7
  [Review] iteration NN: the reviewer operates Playwright and returns the reviews
8
8
  [Ask] iteration NN: the user confirms the prototype, or answers with a change
9
- [Handoff] confirmed: final/index.html + final/handoff.json
9
+ [Handoff] confirmed: final/index.html + final/handoff.json (restyle: handoff.json only)
10
10
  ```
11
11
 
12
12
  ## Per-iteration files
@@ -17,15 +17,16 @@
17
17
  .qfai/prototype/iter-NN/UI-NNNN/<screen>.review.json
18
18
  ```
19
19
 
20
- The orchestrator writes the reviewer's payload for each `(UI contract, screen)` pair beside the
20
+ The session agent writes the reviewer's payload for each `(UI contract, screen)` pair beside the
21
21
  per-iteration `review.json` summary, from the first iteration on (the payload schema and the aggregation rule are
22
22
  in the reviewer references the loop step names). That holds for a single-contract run as much
23
- as for a multi-contract one.
23
+ as for a multi-contract one. A scoped run writes payloads only for the pairs it
24
+ reviews: its in-scope and render-check screens.
24
25
 
25
26
  The reviewer operates Playwright live. A screenshot or HTML snapshot is an
26
27
  additional input, taken only when someone needs it.
27
28
 
28
- `progress.md` is one file for the whole run. The orchestrator appends a
29
+ `progress.md` is one file for the whole run. The session agent appends a
29
30
  one-line summary at the end of each iteration.
30
31
 
31
32
  ## When the loop ends
@@ -41,6 +42,13 @@ The latest iteration is always the one put to the user. Temporary regressions
41
42
  are allowed; a leap backwards is a normal path to a breakthrough on the IA and
42
43
  flow axes.
43
44
 
45
+ ## Restyle iterations
46
+
47
+ A loop whose `progress.md` records `iterationKind` `restyle` restyles the
48
+ live app in place. Each `iter-NN/index.html` lists the live routes in scope,
49
+ the reviewer drives those routes in the running app, and the handoff is a
50
+ short form that names the routes and the stylesheet and motion entry points.
51
+
44
52
  ## Surface profile
45
53
 
46
54
  `surface` (web/mobile/desktop/mixed) only affects how the reviewer opens the
@@ -53,7 +61,8 @@ prototype. It is neutral with respect to AI behavior.
53
61
 
54
62
  ## Produced after the loop
55
63
 
56
- - `.qfai/prototype/final/index.html` and `.qfai/prototype/final/handoff.json`.
64
+ - `.qfai/prototype/final/index.html` and `.qfai/prototype/final/handoff.json`
65
+ (restyle: `handoff.json` only).
57
66
  The `prototyping-handoff` step defines its fields.
58
67
 
59
68
  ## Brand identity
@@ -1,11 +1,11 @@
1
1
  # Review Payload Schema (`<screen>.review.json`)
2
2
 
3
3
  SSOT for the per-UI-contract / per-screen review payload. The
4
- product-surface-reviewer sub-agent returns it, the orchestrator writes it,
4
+ product-surface-reviewer sub-agent returns it, the session agent writes it,
5
5
  and the user reads what it finds before confirming the prototype.
6
6
 
7
7
  The schema is **closed**: any key not listed below is rejected. The
8
- orchestrator checks each payload against it before writing it, and asks the
8
+ session agent checks each payload against it before writing it, and asks the
9
9
  reviewer again for one that does not conform before the prototype is put to
10
10
  the user. A near-miss (extra key, misspelled field) fails the
11
11
  whole file.
@@ -57,6 +57,8 @@ type ReviewerPayload = {
57
57
  menuReachabilityFeel: string;
58
58
  };
59
59
  layoutAntiPatternsDetected: string[]; // ids from the layout anti-pattern registry
60
+ // Only the violations specific to this screen; a screen-independent one is
61
+ // recorded once, in the per-iteration summary.
60
62
  designMdViolations: {
61
63
  // closed too: `kind` + `found` only, no extra key per element
62
64
  kind: "color" | "font" | "radius" | "shadow" | "contrast";
@@ -85,7 +87,7 @@ by overstating rather than by fixing.
85
87
  | `blockingFindings` | array of strings; each entry is shown to the user |
86
88
  | `impressions` | all 6 `*Feel` fields required, each a string of at most 200 words |
87
89
  | `layoutAntiPatternsDetected` | array of strings; each entry is shown to the user |
88
- | `designMdViolations` | array of `{kind, found}` (element closed: no other key); filled by the reviewer; each entry is shown to the user |
90
+ | `designMdViolations` | array of `{kind, found}` (element closed: no other key); filled by the reviewer; only the violations specific to this screen, since a screen-independent one is recorded once in the per-iteration summary and in no payload; each entry is shown to the user |
89
91
  | `wallTimeSec` | non-negative finite number; informational, no upper bound |
90
92
  | `softWarnings` | required, closed, single boolean key `timeBudget` |
91
93
  | `softWarnings.timeBudget` | derived, not free-standing: must equal `wallTimeSec > 300` (per-session cap 300 s = 5 min per `(UI contract, screen)` session, not per UI contract — a multi-screen contract gets one budget per screen because each pair is dispatched as its own session and writes its own payload). A payload where the two disagree is wrong, so an over-budget session is never written with the flag off |
@@ -118,12 +120,12 @@ exponential backoff (`base * 2^attemptIndex` ms, `base = 250`).
118
120
 
119
121
  Who records which status:
120
122
 
121
- - The orchestrator dispatches the reviewer for each pair and runs the
123
+ - The session agent dispatches the reviewer for each pair and runs the
122
124
  attempts. A session that completed is `ok`, including one that
123
125
  succeeded after earlier failed attempts: the reviewer returns
124
126
  `sessionStatus: "ok"` with the retries consumed in `retryCount`.
125
127
  - When the reviewer cannot be started, or every attempt fails, no
126
- reviewer payload exists. The orchestrator writes the pair's payload
128
+ reviewer payload exists. The session agent writes the pair's payload
127
129
  itself, with `sessionStatus` `launchFailed` or `retryExhausted`,
128
130
  `retryCount` the retries consumed, every impression and array empty,
129
131
  `wallTimeSec` the time spent, and `softWarnings.timeBudget` derived
@@ -37,11 +37,26 @@ transition-pass percentages as a substitute for the qualitative review.
37
37
  Open each route in your own Playwright session and exercise its declared
38
38
  primary tasks. Record `sessionStatus` and `retryCount` in the per-screen
39
39
  payload according to the closed per-screen payload schema.
40
+ In a `restyle` iteration, the iteration page lists the live routes in
41
+ scope: open each listed route in the running app and review it there.
42
+ The list page is not a screen, and the screens are the project's own.
43
+ Read the edited stylesheet and motion files as well when filling
44
+ `designMdViolations[]`.
45
+ When `progress.md` records a `runScope`, review its in-scope screens in
46
+ full. On each render-check screen, check only that the in-scope component
47
+ renders there: one that does not render, or that breaks the screen around
48
+ it, is a blocking finding, and the impressions speak of the component alone.
49
+ Return payloads for those pairs only, fold only them into the summary, and
50
+ open no other screen.
51
+ When the scope names components only, the render-check screens are the
52
+ whole review, and the summary's four scores rate the component as those
53
+ screens render it.
40
54
  - A screenshot or HTML snapshot, only when one was taken. Name any mandatory
41
55
  input you did not receive in a finding.
42
56
  - The layout anti-pattern registry the package ships.
43
57
  - Prior reviews: `iter-(NN-1)/review.json`, `iter-(NN-2)/review.json`
44
- (when present)
58
+ (when present), from this run only: the run's first iteration, the first
59
+ after `progress.md` records its `runScope`, has none.
45
60
  - Progress log: `.qfai/prototype/progress.md`
46
61
  - Root `DESIGN.md` (read-only context: `# Brand Philosophy`,
47
62
  `audience.emotion`, `audience.do_not_look_like`).
@@ -58,7 +73,7 @@ transition-pass percentages as a substitute for the qualitative review.
58
73
 
59
74
  ## Outputs — two files, two schemas
60
75
 
61
- You return two different results, and the orchestrator writes each to
76
+ You return two different results, and the session agent writes each to
62
77
  its file. They are not interchangeable. Both paths are given in full
63
78
  below and are relative to the project root.
64
79
 
@@ -75,7 +90,8 @@ below and are relative to the project root.
75
90
  the block below.
76
91
 
77
92
  The two share `blockingFindings`, `layoutAntiPatternsDetected` and
78
- `designMdViolations`. `proseCritique` / `pivotDirective` exist on
93
+ `designMdViolations`, except that a screen-independent `designMdViolations`
94
+ entry is recorded in the summary only. `proseCritique` / `pivotDirective` exist on
79
95
  the summary only — putting them in a
80
96
  `<screen>.review.json` fails the closed schema.
81
97
 
@@ -88,12 +104,21 @@ one screen alone. Fold every `(UI contract, screen)` pair of this iteration:
88
104
  prefixed with the screen it belongs to.
89
105
  - `layoutAntiPatternsDetected` — the **union** of the pairs' arrays,
90
106
  deduplicated by ID.
91
- - `designMdViolations` — the **union**, deduplicated on
107
+ - `designMdViolations` — every screen-independent violation, recorded here
108
+ and in no payload, plus the **union** of the pairs' arrays, deduplicated on
92
109
  `(kind, found)`.
93
110
  - `proseCritique`, four ordinal `scores`, and `pivotDirective` describe the
94
111
  iteration as a whole. The six bounded `impressions.*Feel` fields remain on each
95
112
  per-screen payload; do not add rating keys to that closed schema.
96
113
 
114
+ A violation is screen-independent when its source is shared by every screen of
115
+ the iteration: a shared stylesheet, the Tailwind configuration, the page layout,
116
+ or a component every screen renders. It reads the same on every screen, so
117
+ repeating it in each payload multiplies one fix into one entry per screen. A
118
+ pair's payload lists only the violations whose source is that screen. When the
119
+ iteration reviews one screen, nothing is screen-independent and its payload
120
+ keeps every violation.
121
+
97
122
  This keeps the summary findings aligned with the per-screen payloads. The
98
123
  user reads the summary before confirming the prototype, so a summary built
99
124
  from the best screen would hide another screen's blockers from them.
@@ -127,14 +152,15 @@ type Review = {
127
152
 
128
153
  Fill `designMdViolations` yourself: one entry per distinct value the
129
154
  prototype uses that root `DESIGN.md` does not declare, in the categories
130
- the generator prompt lists.
155
+ the generator prompt lists. The summary is the only place a
156
+ screen-independent violation is recorded.
131
157
 
132
158
  ## The four ordinal UX axes
133
159
 
134
160
  Score `informationArchitecture`, `navigationFlow`, `usability`, and
135
161
  `functionality` on the `weak` → `acceptable` → `strong` → `exceptional` scale.
136
162
  The four scores belong to the per-iteration summary and cover the live review of
137
- all declared screens. They do not replace the six bounded qualitative
163
+ all declared screens or, in a scoped run, of the pairs it reviews. They do not replace the six bounded qualitative
138
164
  `impressions.*Feel` fields or actionable `blockingFindings` on each closed
139
165
  per-screen payload. The user reads the scores and every finding before
140
166
  confirming the prototype, so do not inflate a score: a favorable score that
@@ -4,7 +4,6 @@ title: QFAI Run (Change request entry)
4
4
  description: "Use when the user asks for a change, a fix, an investigation of the codebase, a question about the project or an operation on finished work in plain words and names no stage skill. Plans every such request, the lightest included, with `npx qfai workflow plan` and runs the plan's steps in order to its end."
5
5
  argument-hint: "<the change, in your own words>"
6
6
  allowed-tools: [Read, Glob, Grep, Write, Edit, Bash, TodoWrite, Task, Agent]
7
- roles: [orchestrator]
8
7
  steps: []
9
8
  requires: [common-policy-check, common-review-cycle]
10
9
  mode: execution-focused
@@ -14,7 +13,7 @@ mode: execution-focused
14
13
 
15
14
  [DRIFT-PROTOCOL:REQUIRED]
16
15
 
17
- Follow the CLI plan's steps in order. Read no reference up front; each line says when.
16
+ In a git worktree, read and follow the worktree's own `.qfai/assistant/skill/qfai-run/SKILL.md`, whatever copy the host loaded. Follow the CLI plan's steps in order. Read no reference up front; each line says when.
18
17
 
19
18
  - `references/extraction.md`: for an extraction step 1 does not give.
20
19
  - `references/plan.md`: for a plan field this file does not name, or a refused plan.
@@ -48,8 +47,8 @@ values plan nothing.
48
47
 
49
48
  - For independent targets under one goal, read `references/operator-screens.md`
50
49
  before planning or switching during a wait.
51
- - Plan changes, questions, proposals to decide and reports to close.
52
- Questions plan answers without changes; nonrequests get no plan.
50
+ - Plan changes, questions, proposals to decide and reports to close. Questions plan answers without changes; nonrequests get no plan.
51
+ An automated notice (task, wake-up, CI) is no request; one that delivers a requested result resumes the waiting step.
53
52
  - Replies with a requested answer or result, including failure, resume the same step without
54
53
  a new invocation. An independent new request is planned; read `references/operator-screens.md`
55
54
  for replies.
@@ -59,13 +58,13 @@ values plan nothing.
59
58
  ## The work
60
59
 
61
60
  1. **Extract.** A question one read answers is `{ intent: question-why, qualifiers: [session-answerable] }`
62
- (or `question-how`, `question-help`); an operation on finished work that the session runs itself and
63
- that deletes nothing is `{ intent: order, artifacts: [] }`. Every other field is empty, with
64
- `confidence: high`; neither needs a reference. Read any other request as `references/extraction.md`
65
- sets out, and pass the extraction to `npx qfai workflow plan --in <file>`, or `--in -`.
61
+ (or `question-how`, `question-help`); an operation on finished work, or on a device or system the session reaches, that the session runs itself and
62
+ that deletes nothing is `{ intent: order, artifacts: [] }`. Every other field is empty, with `confidence: high`; neither needs a reference.
63
+ Read any other request as `references/extraction.md` sets out. Then run the launcher preflight above; after it passes, hand the extraction to `npx qfai workflow plan --in <file>`, or `--in -`.
64
+ The session-run operation that deletes nothing, read above as `{ intent: order, artifacts: [] }`, goes to `npx qfai workflow plan --order` instead, with no file; an order read through `references/extraction.md` keeps `--in`.
66
65
  2. **Candidates.** When `plan` returns `candidates`, put one single-select
67
66
  question, each option saying in the user's words what that route will do,
68
- then run `npx qfai workflow plan --route <route>` for the chosen one.
67
+ then run `npx qfai workflow plan --route <route>` with the same `--in` for the chosen one, keeping the candidate's `decisionPoints`.
69
68
  3. **Scope.** With two or more scopes, ask which to run as `references/operator-screens.md` says,
70
69
  and run only its stages. With one scope, no scopes, or a branch destination's plan, ask
71
70
  nothing and run every stage.
@@ -75,8 +74,8 @@ values plan nothing.
75
74
  closes, answers or asks, it reads and reports and writes nothing.
76
75
  5. **Run the stages.** Run each stage in plan order, and each of its steps in
77
76
  order, as `.qfai/assistant/rule/shared-skill-operating-baseline.md#running-steps-mandatory` says.
78
- When a step is short or passes without edits, read `references/operator-screens.md`.
79
- Write artifacts yourself or delegate independent parallel work or review.
77
+ Note each step's status for the final report; when a step is short or passes without edits, read `references/operator-screens.md`.
78
+ Do the work and write every artifact yourself. Start a sub-agent only for the two reasons the delegation baseline states: an independent judgement, or parallel units that pass the parallel-unit gate. A worker starts no finder, griller or reviewer: run each step that starts one yourself, as the delegation baseline's Session Agent Protocol says.
80
79
  At a step the plan marks with a point, follow `references/stage-points.md`:
81
80
  - **Release point.** Ask the user to approve the release before the step `releasePoint` names.
82
81
  - **Decision point.** Put each critical decision at a step `decisionPoints` names to the user.
@@ -85,14 +84,14 @@ values plan nothing.
85
84
  `implementation-reviewer`. Only a contract or screen change no earlier review read adds
86
85
  `architecture-reviewer` or `product-surface-reviewer`, as `common-review-cycle` lists; no one else
87
86
  joins. A review whose target's only edits resolve the conflicts of a merge or branch update between
88
- reviewed sides gets no reviewer.
87
+ reviewed sides, or a route code review of a small literal-only change, as `common-review-cycle` defines, gets no reviewer. A conflict resolution the plan's own edit stage made in the story tree, a contract or a register still gets one.
89
88
  No agent reviews its own work; no step adds a review. Each returns PASS or REVISE.
90
- Fix or answer each finding once, with no re-review. Stop a step that exceeds the request.
91
- 7. **Approvals.** Each approval of a specification change, a critical decision
92
- or a release is one `decisions.md` row: what was approved, who approved it,
93
- when, and the chosen option's label, in the `qfai-sdd` decisions template's form. A decision you took appends no row.
89
+ Fix or answer each finding once; a behaviour fix gets one re-review, as `common-review-cycle` says. Stop a step that exceeds the request.
90
+ 7. **Approvals.** Each approval of a specification change, a critical decision or a release is one `decisions.md` row: what was approved, who approved it, when, and the chosen option's label, in the `qfai-sdd` decisions template's form. A decision you took appends no row.
91
+ When the release change is produced outside this run (by a release workflow or bot), record its approval in the final report with the same four items and list the row as a pending follow-up;
92
+ the next change that touches `decisions.md` appends the row, and a `qfai-run` that writes `decisions.md` appends any pending approval row first.
94
93
  8. **A finding no stage serves.** Stop, and name the finding, its owner and the stage skill to invoke by name.
95
- 9. **Commit.** `verify-commit` runs last, after any release point; never pushes.
94
+ 9. **Commit.** `verify-commit` runs last, after any release point; never pushes. A push, pull request, merge or branch update the user asks for after the plan ends is planned next as `{ intent: order, artifacts: [] }` with `npx qfai workflow plan --order`, and its `triage-operate` delivers it.
96
95
  10. **Session feedback.** When the final report closes the user's last task and nothing waits on them, follow `.agents/rules/session-feedback.md` once.
97
96
 
98
97
  ## Under a no-question mode
@@ -147,4 +146,4 @@ retained; ordinary completion requires no unsolicited upload.
147
146
  project_memory:
148
147
 
149
148
  - The user names no stage after the first request.
150
- - The plan is fixed by its route; the session runs every step of the chosen scope.
149
+ - The plan is fixed by its route and the extraction's artifacts; the session runs every step of the chosen scope.