qfai 2.1.2 → 2.2.1

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 (162) hide show
  1. package/README.md +46 -6
  2. package/assets/defaults/agent-routing/qfai-implement.yml +9 -0
  3. package/assets/defaults/agent-routing/qfai-triage.yml +9 -0
  4. package/assets/defaults/workflows/answer-in-session.yml +8 -0
  5. package/assets/defaults/workflows/bump-dependency.yml +4 -1
  6. package/assets/defaults/workflows/decide-design.yml +5 -1
  7. package/assets/defaults/workflows/quarantine-flaky.yml +3 -0
  8. package/assets/defaults/workflows/rename-concept.yml +30 -0
  9. package/assets/defaults/workflows/repair-consistency.yml +1 -0
  10. package/assets/defaults/workflows/resolve-conflicts.yml +14 -0
  11. package/assets/defaults/workflows/retire-feature.yml +26 -0
  12. package/assets/defaults/workflows/run-operation.yml +11 -0
  13. package/assets/defaults/workflows/run-release.yml +12 -0
  14. package/assets/defaults/workflows/write-procedure.yml +18 -0
  15. package/assets/graph/codegraph-native.mjs +174 -0
  16. package/assets/graph/graphify-native.py +72 -0
  17. package/assets/init/.claude/settings.json +11 -29
  18. package/assets/init/.codex/hooks.json +9 -21
  19. package/assets/init/.qfai/assistant/agent/backend-engineer.md +1 -1
  20. package/assets/init/.qfai/assistant/agent/frontend-engineer.md +1 -1
  21. package/assets/init/.qfai/assistant/agent/implementation-reviewer.md +5 -0
  22. package/assets/init/.qfai/assistant/agent/product-surface-reviewer.md +8 -3
  23. package/assets/init/.qfai/assistant/rule/constitution.md +36 -18
  24. package/assets/init/.qfai/assistant/rule/drift-protocol.md +80 -1
  25. package/assets/init/.qfai/assistant/rule/references/codex-delegation.md +27 -0
  26. package/assets/init/.qfai/assistant/rule/references/gate-failure-autorepair.md +1 -1
  27. package/assets/init/.qfai/assistant/rule/references/griller-recommendations.md +21 -9
  28. package/assets/init/.qfai/assistant/rule/review-convergence.md +34 -15
  29. package/assets/init/.qfai/assistant/rule/shared-skill-delegation-baseline.md +12 -2
  30. package/assets/init/.qfai/assistant/rule/shared-skill-operating-baseline.md +14 -7
  31. package/assets/init/.qfai/assistant/rule/ui-definition-protocol.md +2 -1
  32. package/assets/init/.qfai/assistant/rule/workflow.md +2 -1
  33. package/assets/init/.qfai/assistant/skill/qfai-discussion/SKILL.md +11 -2
  34. package/assets/init/.qfai/assistant/skill/qfai-discussion/references/discussion-completion-matrix.md +32 -10
  35. package/assets/init/.qfai/assistant/skill/qfai-discussion/references/ui-bearing-playbook.md +17 -0
  36. package/assets/init/.qfai/assistant/skill/qfai-discussion/references/ui_ux/trend_scan_playbook.md +3 -1
  37. package/assets/init/.qfai/assistant/skill/qfai-discussion/templates/01_Context.md +4 -1
  38. package/assets/init/.qfai/assistant/skill/qfai-discussion/templates/04_Sources.md +5 -1
  39. package/assets/init/.qfai/assistant/skill/qfai-discussion/templates/uiux/00_index.md +4 -1
  40. package/assets/init/.qfai/assistant/skill/qfai-grilling/SKILL.md +30 -20
  41. package/assets/init/.qfai/assistant/skill/qfai-grilling/references/delegated-session.md +4 -3
  42. package/assets/init/.qfai/assistant/skill/qfai-grilling/references/session-record.md +8 -2
  43. package/assets/init/.qfai/assistant/skill/qfai-implement/SKILL.md +9 -2
  44. package/assets/init/.qfai/assistant/skill/qfai-implement/references/parallelization-policy.md +10 -0
  45. package/assets/init/.qfai/assistant/skill/qfai-implement/references/red-admissibility.md +35 -0
  46. package/assets/init/.qfai/assistant/skill/qfai-implement/references/test-runner-recipes.md +445 -0
  47. package/assets/init/.qfai/assistant/skill/qfai-implement/references/ui-affecting.md +3 -3
  48. package/assets/init/.qfai/assistant/skill/qfai-prototyping/SKILL.md +10 -9
  49. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/generator-prompt.md +33 -2
  50. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/handoff.md +77 -2
  51. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/iteration-loop.md +12 -3
  52. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/review-payload-schema.md +3 -1
  53. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/reviewer-prompt.md +31 -5
  54. package/assets/init/.qfai/assistant/skill/qfai-run/SKILL.md +48 -46
  55. package/assets/init/.qfai/assistant/skill/qfai-run/references/codex-cloud-install.md +80 -0
  56. package/assets/init/.qfai/assistant/skill/qfai-run/references/extraction.md +202 -126
  57. package/assets/init/.qfai/assistant/skill/qfai-run/references/operator-screens.md +38 -15
  58. package/assets/init/.qfai/assistant/skill/qfai-run/references/plan.md +48 -22
  59. package/assets/init/.qfai/assistant/skill/qfai-run/references/reached-step-observations.md +134 -0
  60. package/assets/init/.qfai/assistant/skill/qfai-run/references/stage-points.md +7 -4
  61. package/assets/init/.qfai/assistant/skill/qfai-run/scripts/codex-cloud-install.mjs +117 -0
  62. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/concrete-abstract-cycle.md +2 -1
  63. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/contract-artifact-rules.md +1 -1
  64. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/design-md-authoring.md +20 -7
  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 +2 -2
  67. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-pre-draft-grilling.md +5 -1
  68. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-quality-gate.md +2 -2
  69. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-triage.md +111 -7
  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 +58 -8
  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 +18 -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 +10 -7
  77. package/assets/init/.qfai/assistant/skill/qfai-verify/references/verify-output-contract.md +22 -16
  78. package/assets/init/.qfai/assistant/skill/web-research/SKILL.md +1 -1
  79. package/assets/init/.qfai/assistant/step/common-design-md/STEP.md +33 -16
  80. package/assets/init/.qfai/assistant/step/common-gate-run/STEP.md +37 -8
  81. package/assets/init/.qfai/assistant/step/common-grilling-record/STEP.md +25 -4
  82. package/assets/init/.qfai/assistant/step/common-policy-check/STEP.md +1 -0
  83. package/assets/init/.qfai/assistant/step/common-review-cycle/STEP.md +68 -15
  84. package/assets/init/.qfai/assistant/step/discussion-interview/STEP.md +25 -10
  85. package/assets/init/.qfai/assistant/step/discussion-oq/STEP.md +17 -1
  86. package/assets/init/.qfai/assistant/step/discussion-pack/STEP.md +23 -3
  87. package/assets/init/.qfai/assistant/step/discussion-uiux/STEP.md +9 -1
  88. package/assets/init/.qfai/assistant/step/implement-acceptance/STEP.md +3 -0
  89. package/assets/init/.qfai/assistant/step/implement-credentials/STEP.md +4 -0
  90. package/assets/init/.qfai/assistant/step/implement-dep-bump/STEP.md +33 -3
  91. package/assets/init/.qfai/assistant/step/implement-diagnose/STEP.md +12 -3
  92. package/assets/init/.qfai/assistant/step/implement-procedure/STEP.md +98 -0
  93. package/assets/init/.qfai/assistant/step/implement-quarantine/STEP.md +21 -4
  94. package/assets/init/.qfai/assistant/step/implement-refactor/STEP.md +25 -5
  95. package/assets/init/.qfai/assistant/step/implement-regression-fix/STEP.md +3 -3
  96. package/assets/init/.qfai/assistant/step/implement-retire/STEP.md +26 -0
  97. package/assets/init/.qfai/assistant/step/implement-scaffold/STEP.md +28 -5
  98. package/assets/init/.qfai/assistant/step/implement-stress-harness/STEP.md +33 -2
  99. package/assets/init/.qfai/assistant/step/implement-tdd/STEP.md +20 -5
  100. package/assets/init/.qfai/assistant/step/maintain-edit/STEP.md +70 -6
  101. package/assets/init/.qfai/assistant/step/prototyping-grill/STEP.md +39 -6
  102. package/assets/init/.qfai/assistant/step/prototyping-handoff/STEP.md +12 -3
  103. package/assets/init/.qfai/assistant/step/prototyping-loop/STEP.md +56 -6
  104. package/assets/init/.qfai/assistant/step/prototyping-preflight/STEP.md +13 -0
  105. package/assets/init/.qfai/assistant/step/sdd-contract/STEP.md +8 -0
  106. package/assets/init/.qfai/assistant/step/sdd-cycle/STEP.md +9 -4
  107. package/assets/init/.qfai/assistant/step/sdd-story/STEP.md +22 -1
  108. package/assets/init/.qfai/assistant/step/sdd-triage/STEP.md +52 -14
  109. package/assets/init/.qfai/assistant/step/triage-answer/STEP.md +2 -2
  110. package/assets/init/.qfai/assistant/step/triage-close/STEP.md +7 -2
  111. package/assets/init/.qfai/assistant/step/triage-handoff/STEP.md +6 -0
  112. package/assets/init/.qfai/assistant/step/triage-operate/STEP.md +123 -0
  113. package/assets/init/.qfai/assistant/step/verify-commit/STEP.md +35 -10
  114. package/assets/init/.qfai/assistant/step/verify-qfai-gate/STEP.md +8 -1
  115. package/assets/init/.qfai/assistant/step/verify-repeat-run/STEP.md +40 -0
  116. package/assets/init/.qfai/assistant/step/verify-repo-gate/STEP.md +77 -7
  117. package/assets/init/root/.agents/rules/api-budget.md +8 -3
  118. package/assets/init/root/.agents/rules/document-schema.md +17 -0
  119. package/assets/init/root/.agents/rules/documentation-clarity.md +1 -1
  120. package/assets/init/root/.agents/rules/graph-exploration.md +164 -0
  121. package/assets/init/root/.agents/rules/grilling.md +100 -43
  122. package/assets/init/root/.agents/rules/reminders.json +20 -32
  123. package/assets/init/root/.agents/rules/session-feedback.md +6 -11
  124. package/assets/init/root/.agents/rules/untrusted-content.md +2 -2
  125. package/assets/init/root/.agents/rules/user-questions.md +24 -14
  126. package/assets/init/root/.gitattributes +2 -0
  127. package/assets/init/root/.github/workflows/qfai-docs.yml +2 -2
  128. package/assets/init/root/.github/workflows/qfai-tests.yml +88 -35
  129. package/assets/init/root/.github/workflows/qfai-validate.yml +2 -2
  130. package/assets/init/root/AGENTS.md +1 -0
  131. package/assets/mdschema/manifest.yml +3 -0
  132. package/assets/mdschema/story/03_contract/tech.mdschema.yml +1 -1
  133. package/assets/mdschema/story/decisions/page-NNNN.mdschema.yml +32 -0
  134. package/assets/mdschema/story/decisions.mdschema.yml +12 -0
  135. package/assets/schemas/workflow/extraction.schema.json +98 -2
  136. package/assets/schemas/workflow/plan.schema.json +34 -1
  137. package/assets/scripts/check-mdschema.mjs +497 -39
  138. package/dist/cli/index.cjs +7667 -3515
  139. package/dist/cli/index.cjs.map +1 -1
  140. package/dist/cli/index.mjs +8872 -4702
  141. package/dist/cli/index.mjs.map +1 -1
  142. package/dist/graph/cli.cjs +1568 -0
  143. package/dist/graph/cli.cjs.map +1 -0
  144. package/dist/graph/cli.d.cts +9 -0
  145. package/dist/graph/cli.d.ts +9 -0
  146. package/dist/graph/cli.mjs +1541 -0
  147. package/dist/graph/cli.mjs.map +1 -0
  148. package/dist/graph/hook.cjs +817 -0
  149. package/dist/graph/hook.cjs.map +1 -0
  150. package/dist/graph/hook.d.cts +9 -0
  151. package/dist/graph/hook.d.ts +9 -0
  152. package/dist/graph/hook.mjs +792 -0
  153. package/dist/graph/hook.mjs.map +1 -0
  154. package/dist/index.cjs +6436 -3012
  155. package/dist/index.cjs.map +1 -1
  156. package/dist/index.d.cts +185 -1
  157. package/dist/index.d.ts +185 -1
  158. package/dist/index.mjs +6620 -3197
  159. package/dist/index.mjs.map +1 -1
  160. package/dist/process-C21nTvkT.d.cts +12 -0
  161. package/dist/process-C21nTvkT.d.ts +12 -0
  162. package/package.json +1 -1
@@ -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
@@ -20,7 +20,8 @@
20
20
  The orchestrator 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.
@@ -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
@@ -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 |
@@ -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`).
@@ -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
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: qfai-run
3
3
  title: QFAI Run (Change request entry)
4
- description: "Use when the user asks for a change, a fix, an investigation of the codebase or a question about the project in plain words and names no stage skill. A question that one command or one file read answers needs no plan. Plans the request with `npx qfai workflow plan` and runs the plan's steps in order to its end."
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
7
  roles: [orchestrator]
@@ -14,14 +14,15 @@ mode: execution-focused
14
14
 
15
15
  [DRIFT-PROTOCOL:REQUIRED]
16
16
 
17
- The CLI plans; this skill follows its steps in order.
17
+ 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
18
 
19
- - Read `references/extraction.md` to extract a request.
20
- - Plan command and format: `references/plan.md`.
21
- - Screens and questions: `references/operator-screens.md`.
22
- - Release, decision and branch points: `references/stage-points.md`.
19
+ - `references/extraction.md`: for an extraction step 1 does not give.
20
+ - `references/plan.md`: for a plan field this file does not name, or a refused plan.
21
+ - `references/operator-screens.md`: when a line below or a step names it, such as to ask or report.
22
+ - `references/stage-points.md`: at a step the plan marks with a point.
23
23
  - Run preflight before planning, as `.qfai/assistant/rule/shared-skill-operating-baseline.md#canonical-qfai-launcher-mandatory` says.
24
24
  If the launcher is missing or preflight fails, read `references/operator-screens.md` for recovery.
25
+ - Read `references/codex-cloud-install.md` before configuring an environment-owned Install script or Start skill, or preparing dependencies for a fresh checkout. Use the reviewed target's successful preparation and canonical proof before planning.
25
26
 
26
27
  ## What this skill never does
27
28
 
@@ -34,8 +35,8 @@ The CLI plans; this skill follows its steps in order.
34
35
 
35
36
  ## Mode
36
37
 
37
- Read `workflow.mode` in `qfai.config.yaml` first. No key means `active`; any
38
- value but the three below plans nothing.
38
+ Read `workflow.mode` in `qfai.config.yaml` first. No key means `active`; unlisted
39
+ values plan nothing.
39
40
 
40
41
  | Mode | What this skill does |
41
42
  | -------- | ------------------------------------------------------------------------------------ |
@@ -47,52 +48,52 @@ value but the three below plans nothing.
47
48
 
48
49
  - For independent targets under one goal, read `references/operator-screens.md`
49
50
  before planning or switching during a wait.
50
- - A change, a question, a proposal to decide or a report to close is planned.
51
- A question plans a route that answers it and changes nothing. Text that is
52
- not a request is not planned.
53
- - A reply with a requested answer or result resumes the same step without a new
54
- invocation, including failure. An independent new request is planned. Read
55
- `references/operator-screens.md` for replies.
51
+ - Plan changes, questions, proposals to decide and reports to close. Questions plan answers without changes; nonrequests get no plan.
52
+ An automated notice (task, wake-up, CI) is no request; one that delivers a requested result resumes the waiting step.
53
+ - Replies with a requested answer or result, including failure, resume the same step without
54
+ a new invocation. An independent new request is planned; read `references/operator-screens.md`
55
+ for replies.
56
56
  - `stop`: end the work at once and list every open decision as open.
57
57
  - A request naming a stage skill: invoke that skill by name.
58
58
 
59
59
  ## The work
60
60
 
61
- 1. **Extract.** Read the request into an extraction as
62
- `references/extraction.md` sets out, using its definition of acceptance.
63
- Pass the extraction to
64
- `npx qfai workflow plan --in <file>`, or `--in -` on standard input.
61
+ 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, or on a device or system the session reaches, that the session runs itself and
63
+ that deletes nothing is `{ intent: order, artifacts: [] }`. Every other field is empty, with `confidence: high`; neither needs a reference.
64
+ 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 -`.
65
+ The session-run operation that deletes nothing, read above as `{ intent: order, artifacts: [] }`, goes to `npx qfai workflow plan --order` instead, with no file; an order read through `references/extraction.md` keeps `--in`.
65
66
  2. **Candidates.** When `plan` returns `candidates`, put one single-select
66
67
  question, each option saying in the user's words what that route will do,
67
- then run `npx qfai workflow plan --route <route>` for the chosen one.
68
- 3. **Scope.** With two or more scopes, ask which to run as
69
- `references/operator-screens.md` says, and run only its stages.
70
- With one scope, no scopes, or a branch destination's plan, ask nothing and
71
- run every stage.
72
- 4. **Announce.** Before the first stage, give the goal, the chosen stages in
73
- order in plain words, and the files the work may change. Ask nothing. Then run
74
- `common-policy-check` once. On a route that changes no file, one that
68
+ then run `npx qfai workflow plan --route <route>` with the same `--in` for the chosen one, keeping the candidate's `decisionPoints`.
69
+ 3. **Scope.** With two or more scopes, ask which to run as `references/operator-screens.md` says,
70
+ and run only its stages. With one scope, no scopes, or a branch destination's plan, ask
71
+ nothing and run every stage.
72
+ 4. **Announce.** Before the first stage, give the goal, the chosen stages in order in plain words,
73
+ and the files the work may change. Ask nothing. Then run `common-policy-check` once, unless the
74
+ plan's one step is `triage-answer` or `triage-operate`. On a route that changes no file, one that
75
75
  closes, answers or asks, it reads and reports and writes nothing.
76
76
  5. **Run the stages.** Run each stage in plan order, and each of its steps in
77
77
  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.
80
- At each step, follow its plan's points in `references/stage-points.md`:
78
+ Note each step's status for the final report; 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. A worker starts no finder, griller or reviewer: run each step that starts one yourself, as the delegation baseline's Orchestrator Protocol says.
80
+ At a step the plan marks with a point, follow `references/stage-points.md`:
81
81
  - **Release point.** Ask the user to approve the release before the step `releasePoint` names.
82
82
  - **Decision point.** Put each critical decision at a step `decisionPoints` names to the user.
83
83
  - **Branch point.** Move to the destination a step `branchPoints` names, and plan it at once.
84
- 6. **Review.** After a stage whose `review` is `spec`, `requirements-reviewer`
85
- reviews, with `architecture-reviewer` when a contract changed; after one
86
- whose `review` is `code`, `implementation-reviewer`.
87
- `product-surface-reviewer` joins both where a UI contract with screens
88
- serves the flow. No agent reviews its own work, and no step adds a review.
89
- Each review returns PASS or REVISE, and each finding is fixed or answered
90
- once, with no re-review. A step that would go beyond the request stops.
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. A decision you took appends no row.
84
+ 6. **Review.** After a stage whose `review` is `spec`, `requirements-reviewer` reviews; for `code`,
85
+ `implementation-reviewer`. Only a contract or screen change no earlier review read adds
86
+ `architecture-reviewer` or `product-surface-reviewer`, as `common-review-cycle` lists; no one else
87
+ joins. A review whose target's only edits resolve the conflicts of a merge or branch update between
88
+ 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
+ No agent reviews its own work; no step adds a review. Each returns PASS or REVISE.
90
+ 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.
91
+ 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.
92
+ 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;
93
+ 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
94
  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.
95
+ 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
+ 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.
96
97
 
97
98
  ## Under a no-question mode
98
99
 
@@ -135,14 +136,15 @@ When parts ran in parallel, use the summary in `references/operator-screens.md`.
135
136
 
136
137
  ## Completion Contract (Shared)
137
138
 
138
- Follow `.qfai/assistant/rule/shared-skill-operating-baseline.md#completion-contract-shared`. **Smallest applicable smoke check** (this skill's override): the gates of the `verify-qfai-gate` and `verify-repo-gate` steps the chosen scope holds; a scope holding none runs no gate, and the report says so. A gate that cannot run is UNRUN, not a pass.
139
+ Follow `.qfai/assistant/rule/shared-skill-operating-baseline.md#completion-contract-shared`. **Smallest applicable smoke check**: the chosen scope's `verify-qfai-gate` and `verify-repo-gate` gates. With none, run no gate and report it. Unavailable gates are UNRUN, never PASS.
139
140
 
140
- When the request requires evidence handover before session archive, read
141
- `references/evidence-delivery.md` and complete its receiving proof first.
142
- Missing access keeps the handover pending and originals retained. Ordinary
143
- completion does not require an unsolicited upload.
141
+ At stage boundaries, follow `references/reached-step-observations.md` in the existing report.
142
+
143
+ If requested evidence handover must precede archive, read `references/evidence-delivery.md`
144
+ and complete receiving proof first. Missing access leaves handover pending and originals
145
+ retained; ordinary completion requires no unsolicited upload.
144
146
 
145
147
  project_memory:
146
148
 
147
149
  - The user names no stage after the first request.
148
- - The plan is fixed by its route; the session runs every step of the chosen scope.
150
+ - The plan is fixed by its route and the extraction's artifacts; the session runs every step of the chosen scope.
@@ -0,0 +1,80 @@
1
+ # Codex Cloud dependency preparation
2
+
3
+ Read before configuring an environment-owned Install script or Start skill, or
4
+ when a fresh checkout cannot pass the canonical launcher preflight. Init writes
5
+ the preparation entry and this guide; it performs no installation or host setup.
6
+
7
+ ## Before execution
8
+
9
+ Review the project-declared executable, separate argv and absolute checkout cwd.
10
+ Read the declared Install command from the project's Standard commands; translate
11
+ it into a reviewed native executable and arguments before configuration. The entry
12
+ does not parse Markdown, shell text or choose a package manager.
13
+
14
+ Covered authority for the command and its lifecycle scripts must already exist.
15
+ Preserve network, secret, trust and publication permissions. A generated file,
16
+ invocation or flag grants no authority. Missing authority blocks execution.
17
+ Review argument and output contents before retaining or sharing them.
18
+
19
+ ## Install script
20
+
21
+ Use the generated entry with the reviewed tuple:
22
+
23
+ ```text
24
+ node .qfai/assistant/skill/qfai-run/scripts/codex-cloud-install.mjs --cwd <absolute-checkout> -- <executable> [argument...]
25
+ ```
26
+
27
+ Replace the placeholders with the reviewed values and configure the host's
28
+ supported Install script. The executable and arguments are passed with no shell
29
+ parsing at the explicit cwd. Do not supply an entire shell command as one argument.
30
+ Do not use a parent, remote or cached command as a substitute.
31
+
32
+ Missing inputs, an unknown option, a relative cwd or an unreadable target directory
33
+ fail before installation. Unavailable tools, spawn errors, signals, nonzero exit
34
+ and observed timeout remain failed preparation. Retain the actual reason; there
35
+ is no automatic retry, extra timeout option or new deadline.
36
+
37
+ After successful installation the entry checks the same cwd for its local
38
+ `node_modules/.bin/qfai`, or a root `.pnp.cjs` / `.pnp.loader.mjs` marker with a
39
+ declared qfai dependency and native `yarn exec qfai --help` exiting 0. A failed
40
+ installation stays failed even if a launcher already exists. A Windows wrapper
41
+ that cannot start natively remains a tool failure; no shell fallback is added.
42
+
43
+ ## Start skill
44
+
45
+ Check successful preparation and the canonical proof at the same reviewed cwd
46
+ before dependent planning. Failure or missing covered authority blocks planning;
47
+ report the actual blocker and owner required to resume. The entry starts no plan.
48
+ Use the launcher that the existing canonical preflight established for that target.
49
+ Preparation is neither global validation nor formal workflow completion.
50
+
51
+ ## Environment setup
52
+
53
+ Confirm current environment support for the Install script and Start skill before
54
+ real configuration. The operator performs authorized setup and publication;
55
+ init and the generated entry do not register an account or configure the host.
56
+
57
+ Saving configuration, preparing and publishing a filesystem for new tasks are
58
+ distinct operations. A refresh does not rerun installation or startup. Existing
59
+ tasks retain their own state. Confirm the actual host behavior before claiming
60
+ that preparation or a Start skill ran for a task; changing a local file is not
61
+ evidence of a published environment or a new task using it.
62
+
63
+ ## Reminders and trust
64
+
65
+ Existing reminder-only exit-0 behavior stays unchanged. Project-edited hook groups
66
+ keep their existing merge behavior. Keep linked-path refusals, unreadable-file warnings and hook
67
+ review. Preparation does not grant hook trust. No universal SessionStart installer
68
+ is added, and reminder hooks do not perform this installation.
69
+
70
+ ## Evidence limits
71
+
72
+ Distinguish generated assets, controlled native CI and actual Cloud configuration,
73
+ publication or task execution. Retain reviewed command and argv, cwd, actual exit
74
+ or signal, and canonical result without exposing secrets. A failed or interrupted
75
+ run is not ready; missing outcomes remain unknown.
76
+
77
+ Controlled native fixtures cannot prove host lifecycle or startup execution.
78
+ Actual Cloud setup and execution remain unobserved without their own receipts.
79
+ Keep existing workflow gates, trust and independent review; preparation replaces
80
+ none of them.